示例#1
0
        protected void PublishNextDocument(object sender, EventArgs e)
        {
            WBLogging.Debug("Attempting to publishg the next document " + process.CurrentItemID);

            process = manager.PublishDocument(process);

            WBLogging.Debug("Published the document");

            DocumentPublishingProgress.WBxUpdateTask(process.LastTaskFeedback);

            PublishingProcessJSON.Text = WBUtils.SerializeToCompressedJSONForURI(process);

            WBLogging.Debug("Serialized to: " + PublishingProcessJSON.Text);

            if (process.HasMoreDocumentsToPublish && process.PublishMode == WBPublishingProcess.PUBLISH_MODE__ALL_TOGETHER)
            {
                Image image = (Image)DocumentPublishingProgress.WBxFindNestedControlByID(DocumentPublishingProgress.WBxMakeControlID(process.CurrentItemID, "image"));
                image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif";

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TriggerNextStepFunction", "WorkBoxFramework_triggerPublishNextDocument();", true);
            }
            else
            {
                if (process.HasMoreDocumentsToPublish)
                {
                    WBLogging.Debug("Trying to set button text to Publish next doc");
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Publish Next Document');", true);
                }
                else
                {
                    WBLogging.Debug("Trying to set button text to done");
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Done');", true);
                }
            }
        }