IPSPublisherServer.executeDemandPublish - what order is used for publishing?

We’re using IPSPublisherServer.executeDemandPublish in order to run our on-demand preview publishing editions.

This method takes four parameters:
(quoting from Java doc):

ids - an array of content ids to publish. These may be references to folders, content items or a mix. Never null or empty.
parentFolderId - the parent folder id, used for reference in creating the content list for items, not important when folders are selected, never null or empty.
edition - the edition id as a string, never null or empty
wait - if true then this method will not return until publishing is complete

My question is about the first parameter - “ids”. I’ve noticed that the order in which it publishes the content items does not always match the order of the items in the array that is passed. Can someone fill me in on what order is used to publish the items? In order to have the items published in a predictable order, I have ended up putting the IDs into an iterator, and then running a separate publish for each of them (this is for database publishing, where relationships/data integrity needs to be maintained). This seems like it would have a performance cost, because it means multiple method calls, rather than a single one.

Thanks,
Kathleen

Kim,

Although the IDs in the call the publisher service are an “Array” (and thus strictly ordered) the items in the content list generator are a Sorted “Set” in 6.5.x. I don’t know of any easy way to guarantee ordering.

Rhythmyx 6.6 will be different in this regard: there’s a queue of items to by published, and I believe the queue is processed in order.

Why exactly do you need to enforce ordering? Is there some way to group the items so that they can be published in batches that don’t require ordering within the same batch?

Dave

Dave,

As I said in my original message, I changed the JSP so that one call is made to the executeDemandPublish for each ID in the array, to ensure that the publishing order matches the order in the array. So, it’s publishing in order now, but it would be nice to avoid incurring the overhead of a separate call to executeDemandPublish for each ID.

The reason we need them published in a certain order is that there is a mixture of different content types in the array - the first one is an item and the remaining elements in the array are related items to that first one. The publish edition in question is a database publish, and we have a trigger on the destination table for the parent item (the first one), and we want that trigger to run before the children are published to their table. (Hope that explanation made sense - let me know if it didn’t). If you have some suggestions for other ways to do this, let me know.

Thanks,
Kathleen (not Kim :wink:

Kathleen (sorry about that)

I would recommend a separate content list for each content type in this case, rather than doing individual items. This may require you to do more processing in the JSP (as you have to collect the items by content type)

Dave