Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

publish and unpublish event and icons

Vote:
 

Hi Guys,

Currently have a function on one of our sites where a page and its child items can be published and unpublished programmatically (through a gui plugin).

I have a couple of questions on things I'm trying to do:

1. The publish code works in that the items are published, but the interface doesnt reflect this change for a period of time (due to the cache i assume), is there a way to jump start this so to speak?  We publish but creating a clone of the page and then using the datafactory instance to the publish the clone.

2.  When pages are created and unpublished they have the thumbs down icon.  I would like to do a reversal of the above process where I unpublish the page and the thumbs down icon reappears.  Is it best to unpublish by again using the datafactory instance to this time SaveAction.Save a clone and populate its StopPublish flag (again cms interface doesnt seem to reflect these changes). With the code i have I have unpublished items listed in the main content window, but the items in the tree dont reflect this and no thumbs down icon is present.

Code i use for publishing:

DataFactory.Instance.Save(stockContainer.CreateWritableClone(), SaveAction.Publish);

 

Code for unpublishing:

PageData cStockContainer = stockContainer.CreateWritableClone();
cStockContainer.StopPublish = DateTime.Now.AddDays(-1);

DataFactory.Instance.Save(cStockContainer, SaveAction.Save);

 

any help much appreciated.

#39368
May 13, 2010 11:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.