示例#1
0
 internal IList<CmsContent> GetAllContent(Data.Guid siteGuid)
 {
     CmsContentDao dao = new CmsContentDao();
     return dao.FindAllContent(siteGuid);
 }
示例#2
0
 public IList<CmsContent> GetUnapprovedContent(Data.Guid siteGuid)
 {
     CmsContentDao dao = new CmsContentDao();
     return dao.FindUnapprovedContent(siteGuid);
 }
示例#3
0
        public void Save(CmsContent item)
        {
            CmsContentDao dao = new CmsContentDao();
            using (Transaction tx = new Transaction())
            {
                dao.Save<CmsContent>(item);
                tx.Commit();
            }

            SitePageCacheRefreshInvoker.InvokeRefresh(item.SubscriptionId, SitePageRefreshRequest.PageRefreshType.All);
        }
示例#4
0
 public CmsContent GetFile(Data.Guid siteGuid, string filename)
 {
     CmsContentDao dao = new CmsContentDao();
     return dao.FindByFilename(siteGuid, filename);
 }
示例#5
0
 public IList<CmsContent> GetFileContent(Data.Guid siteGuid)
 {
     CmsContentDao dao = new CmsContentDao();
     return dao.FindFilesBySite(siteGuid);
 }
示例#6
0
        public IList<CmsContent> GetExistingContent(Data.Guid siteGuid, CmsContentType filter)
        {
            CmsContentDao dao = new CmsContentDao();
            IList<CmsContent> results;
            if (filter == null)
            {
                results = dao.FindAllContent(siteGuid);
            }
            else
            {
                results = dao.FindContentByType(siteGuid,filter);
            }

            return results;
        }
示例#7
0
 public CmsContent GetContent(Data.Guid siteGuid, Data.Guid contentGuid)
 {
     CmsContentDao dao = new CmsContentDao();
     return dao.FindByGuid(siteGuid,contentGuid);
 }
示例#8
0
 public void Delete(CmsContent content)
 {
     if (content != null)
     {
         CmsContentDao dao = new CmsContentDao();
         using (Transaction tx = new Transaction())
         {
             dao.Delete<CmsContent>(content);
             tx.Commit();
         }
     }
 }
示例#9
0
        public CmsContent CreateContent(CmsContent content, System.Web.UI.WebControls.Table dynamicControls)
        {
            if (content.SubscriptionId == null)
                throw new ApplicationException("The subscription id must not be null. This is a programming error.");

            IList<CmsContentField> fields = new List<CmsContentField>();
            PopulateFields(content.SubscriptionId,dynamicControls, content, null);

            CmsContentDao dao = new CmsContentDao();
            using (Transaction tx = new Transaction())
            {
                dao.Save<CmsContent>(content);
                tx.Commit();
            }

            return content;
        }
        private void loadContentFromQuerystring(String contentType)
        {
            String guid = WebRequestContext.Instance.Request[contentType];

            //If the guid is null, check if they used the default identifier instead of a content type identifier
            if (guid == null)
                guid = WebRequestContext.Instance.Request.QueryString["cid"];

            if (guid != null)
            {
                CmsContentDao dao = new CmsContentDao();
                loadedContent = dao.FindByGuid(CurrentSite.Guid, guid);
                loadedContentType = contentType;
            }
        }