Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Publishing a Document View modes: 
User avatar
Member
Member
enelson-drhorton - 8/1/2012 9:58:36 AM
   
Publishing a Document
I am using version 5.5

I am using the following code to publish a document.....straight from the examples


        public static void PublishDocument( TreeProvider tree, TreeNode node )
{
try
{
WorkflowManager wm = new WorkflowManager( tree );
WorkflowInfo wi = wm.GetNodeWorkflow( node );

if ( wi != null )
{
WorkflowStepInfo si = wm.GetStepInfo( node );
if ( si != null )
{
// Use the workflow step information to approve the document until it is published
while ( si.StepName.ToLower() != "published" )
{
si = wm.MoveToNextStep( node, "" );
if ( si == null )
{
break;
}
}
}
}
}
catch (Exception ex )
{ }
}


If I enter a future DocumentPublishFrom date in a node then save and publish, the DocumentPublishedVersionHistoryID remains null, and hence the document never publishes.

Since the Kentico code controls this area, are there any ideas?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/2/2012 3:07:49 AM
   
RE:Publishing a Document
Hi,

You need to understand the difference between workflow publish and content scheduling publish as described in this KB article.

I hope it will make more sense.

Best regards,
Juraj Ondrus

User avatar
Member
Member
enelson-drhorton - 8/2/2012 9:49:41 AM
   
RE:Publishing a Document
The article is useful, but does not really address my question.

Let me rephrase.

Should the DocumentPublishedVersionHistoryID ever be null on any document that I have published, without regard to the document dates in the DocumentPublishFrom/To fields? Under what conditions could this field be null?

Thanks.

User avatar
Member
Member
enelson-drhorton - 8/2/2012 10:40:11 AM
   
RE:Publishing a Document
Here is an example from the database.

User image

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/3/2012 1:56:20 AM
   
RE:Publishing a Document
Hi,

You mentioned that you are setting the Document publish from value into the future. So, the document is in the workflow step pulished (approval publish) but it is still not published from the scheduling point of view = the published version history is null. It is filled once the document is published also according to its schedule.

Best regards,
Juraj Ondrus

User avatar
Member
Member
enelson-drhorton - 8/3/2012 10:14:43 AM
   
RE:Publishing a Document
" It is filled once the document is published also according to its schedule."

Are you saying that the DocumentPublishedVersionHistoryID value automatically fills (and the document starts to show) when the DocumentPublishFrom date is reached? By what mechanism does this happen?

You can see from my example that StepName=published and that the DocumentPublishedVersionHistoryID=null. Is this normal?

By my observation, the DocumentPublishedVersionHistoryID never fills when the DocumentPublishFrom date is reached. It needs to be filled.


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/5/2012 8:41:06 AM
   
RE:Publishing a Document
Hi,

1. It is mentioned in one of the links in the KB article I linked - there is a scheduled task which is checking the content scheduling dates and publishes the document

2. Yes, in this case it is normal and again, it is explained in the KB article - the published step in this case is the approval process publish, but the document is still waiting for the content schedule publishing.

3. What is the exact version of the CMS you are using so I can check whether there were any bugs - I am not aware of any bugs and it is working fine on my end.

Also, could you please check whether the "content publishing" scheduled task is running? Moreover, the scheduler runs only if there are some requests on the web site application (unless you have configured the scheduler using the web.config key).

Best regards,
Juraj Ondrus