Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andrew shearer 512 posts 661 karma points
    Feb 24, 2014 @ 23:54
    andrew shearer
    0

    using ContentService API for bulk SaveAndPublish

    Is this possible? Are there any working examples out there? thanks

  • Ado 3 posts 23 karma points
    Feb 25, 2014 @ 01:46
    Ado
    0

    I am looking for similiar.  This thread suggests its not. 

  • Comment author was deleted

    Feb 25, 2014 @ 02:47

    I don't think there is a way.  The save/publish is a very iterative process and hits the DB quite a bit.  This would be a nice feature to have if 'batches' of content could be published at once :) 

    Best you can do is use a loop I suppose.  That's what we've done historically.

  • Ado 3 posts 23 karma points
    Feb 25, 2014 @ 14:23
    Ado
    0

    From my testing the Bulk publish with sub pages only publishes changed content i.e. content with a newer version not yet published. For example In the structure below all content items are published and Article 1 & 3 have newer versions not yet published.

    Content

    -----Parent Node

    ---------Cateogory Node

    --------------Article 1*

    --------------Article  2

    --------------Article  3*

    If I right click Parent Node and select Publish and then check Publish Parent node and all its Sub pages. The ContentService.Publishing event fires twice, once for Article 1 and once for Article 3. The ContentService.Published Fires once with PublishEventArgs.PublishedEntities containing the two Article 1 & 3. 

    The Other nodes are not republished because they have no new versions. Which kind of makes sence but its different behaviour from 4.9 which we recently upgrade from to 6.1.6. Now in V6  we recently copied alot of content from one node to another and are seeing a lot of Oops: this document is published but is not in the cache (internal error) . 

    The only way to fix this is to click on the individual node and hit save and publish. When you have 600 nodes its tiresome. In V4.9 I could have just bulk published from the parent node. 

    I think the only way around it is to add a new Context Menu item Force Published all sub pages and write our own.

    Hope this helps

    Ado

     

  • Gijs 38 posts 133 karma points
    Nov 27, 2015 @ 11:33
    Gijs
    0

    I have the exact same findings as Ado. Bulk publish only publishes changed content.

    I ran into this problem when I did some changes to the content directly in the database, and only save & publish made these changes appear. With bulk publish they did not.

    Apparently bulk publish doesn't publish the nodes in table cmsDocument that for which newest = 1 AND published = 1.

    I found two possible fixes, and ended up using the latter.

    Fix 1:

    Update [dbo].[cmsDocument]
    SET published = 0
    WHERE newest = 1 
    AND nodeId = [xxx]
    
    Update top(1) [dbo].[cmsDocument]
    SET published = 1
    WHERE newest = 0 
    AND nodeId = [xxx]
    

    After this, bulk update worked as expected. (I think the second update isn't really needed, but I didn't investigate any further)

    Fix 2: Using the package Bulkmanager I unpublished all the necessary nodes and then published them. That worked perfectly, so I ended up using fix 2.

Please Sign in or register to post replies

Write your reply to:

Draft