Esempio n. 1
0
        public void ApproveContent(Guid siteGuid, Guid approvalUserGuid)
        {
            // get latest workflow record waiting for approval
            ContentWorkflow submittedContent = ContentWorkflow.GetWorkInProgress(this.moduleGuid, ContentWorkflowStatus.AwaitingApproval.ToString());

            if (submittedContent == null)
            {
                return;
            }

            // create a new content history record of the existing live content
            ContentHistory history = new ContentHistory();

            history.ContentGuid = ModuleGuid;
            history.ContentText = Body;
            history.SiteGuid    = siteGuid;
            history.UserGuid    = LastModUserGuid;
            history.CreatedUtc  = LastModUtc;
            history.Save();

            //update the html with the approved content
            this.body            = submittedContent.ContentText;
            this.lastModUserGuid = submittedContent.LastModUserGuid;
            this.lastModUtc      = DateTime.UtcNow;
            this.Save();

            //update content workflow to show record is now approved
            submittedContent.Status          = ContentWorkflowStatus.Approved;
            submittedContent.LastModUserGuid = approvalUserGuid;
            submittedContent.LastModUtc      = DateTime.UtcNow;
            submittedContent.Save();
        }
Esempio n. 2
0
        public void CreateHistory(Guid siteGuid)
        {
            if (this.itemGuid == Guid.Empty)
            {
                return;
            }

            HtmlContent currentVersion = new HtmlContent(moduleID);

            if (currentVersion.Body == this.Body)
            {
                return;
            }

            ContentHistory history = new ContentHistory();

            history.ContentGuid = currentVersion.ModuleGuid;
            history.ContentText = currentVersion.Body;
            history.SiteGuid    = siteGuid;
            history.UserGuid    = currentVersion.LastModUserGuid;
            history.CreatedUtc  = currentVersion.LastModUtc;
            history.Save();
        }
Esempio n. 3
0
        public void CreateHistory(Guid siteGuid)
        {
            if (this.blogGuid == Guid.Empty)
            {
                return;
            }

            Blog currentVersion = new Blog(this.itemID);

            if (currentVersion.Description == this.Description)
            {
                return;
            }

            ContentHistory history = new ContentHistory();

            history.ContentGuid = currentVersion.BlogGuid;
            history.Title       = currentVersion.Title;
            history.ContentText = currentVersion.Description;
            history.SiteGuid    = siteGuid;
            history.UserGuid    = currentVersion.LastModUserGuid;
            history.CreatedUtc  = currentVersion.LastModUtc;
            history.Save();
        }