Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Cannot push News document type from staging to production - lost create task - what to do View modes: 
User avatar
Member
Member
jhoppe - 4/27/2011 11:02:28 AM
   
Cannot push News document type from staging to production - lost create task - what to do
I'm trying to publish some news documents from our staging environment to our production environment. The synchronizations are failing with the following message:
"Synchronization server error: Document node not found, please synchronize the document node first."

It seems as though we lost the 'create' task for these documents, so they will not publish from staging to production. I look in the content staging queue and they aren't there.

Is there anything we can do to move these?

Please help!!!

Thanks,
Joe

User avatar
Member
Member
kentico_alleng - 4/27/2011 2:14:48 PM
   
RE:Cannot push News document type from staging to production - lost create task - what to do
Hello Joe,

If you look over the Developer's Guide section on synchronizing content, you'll see the following tasks listed:

• Run complete synchronization - performs complete synchronization of all documents in the content tree
• Synchronize current document - synchronizes the currently selected document
• Synchronize current sub-tree - synchronizes all documents in the selected sub-tree

Try running whichever of these applies to your situation, and the documents should be created successfully on the target site.


Regards,
Allen Greenhaw

User avatar
Member
Member
Chanan - 4/27/2011 3:40:07 PM
   
RE:Cannot push News document type from staging to production - lost create task - what to do
Hi Allen,

I think we might have run into a bug in Kentico. We thought that we messed up those nodes somehow, so we deleted them and re-entered them. We are using the API to create those news items. When we looked in the content staging, again they were not in there with CREATEDOC only PUBLISHDOC

Here is the code we are using:

for (int i = 0; i < 18; ++i) {
//parent = provider.SelectSingleNode(Convert.ToInt32(s[i, 0]));
parent = provider.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName, s[i, 0], "en-us");

// create a new tree node
node = new CMS.TreeEngine.TreeNode("cms.news", provider);
if (parent != null) {
// set document properties
node.NodeName = s[i, 1];
node.NodeAlias = s[i, 1];
node.DocumentPageTemplateID = 157; // 164;
node.SetValue("DocumentCulture", "en-us");
node.SetValue("NewsTitle", s[i, 1]);
node.SetValue("NewsText", s[i, 3] + "<br /><br /><a target=\"_blank\" href=\"" + s[i, 2] + "\">" + CustomFunctions.BreakLongUrl(s[i, 2], 72) + "</a>");
node.SetValue("NewsReleaseDate", DateTime.Now);
node.SetValue("SubmittedByUserGUID", "0DA32CEF-FF55-4096-919F-ED60E0F98D8B"); //"27315A57-D79B-4190-AAC2-77B931CA151E");
// create New document
node.Insert(parent.NodeID);
}


User avatar
Member
Member
kentico_alleng - 4/28/2011 1:45:50 PM
   
RE:Cannot push News document type from staging to production - lost create task - what to do
The following documentation details best practices for using the API to create documents:
Synchronization using API
A complete example (of managing workflow documents with the API)

In particular, note in the second example that the DocumentHelper class is used to create the document. When a document is created in this way, checks are performed to make sure all needed tasks are created. In your example, it looks like the synchronization task was missed.

Regards,

Allen Greenhaw

User avatar
Member
Member
Chanan - 4/29/2011 6:04:31 AM
   
RE:Cannot push News document type from staging to production - lost create task - what to do
Thanks, we will be sure to follow that code pattern and use the DocumentHelper class from now on. You may suggest to the people that write the dev guide that they update the section in the guide that shows how to create documents since that is the section we followed.