I have a scenario where I am publishing lots of items using Tridion Core Service. I want to publish ten items and wait till these items get published and then publish the next items. Is there a way to determine if there are pending items to be published in the queue. IsPublished works only for individual items and beside this it will only give true for published item and will not pass any information for the itmes which have failed.
1 Answer
You need to get list of publish transactions:
var filter = new PublishTransactionsFilterData();
var publishTransactions = Client.GetSystemWideListXml(filter);
You can set filter.PublishTransactionState
to filter on a certain publish transaction state as well as ForRepository
to narrow it down to a certain publication. Consider also setting PublicationTarget
and PublishedBy
. If you will configure this filter properly you will get only your publish transactions. You can then further analyse it if there are failed transactions and if all of them are complete.
I'm not sure bout 2011 GA, but on 2011 SP1 you should be able to use GetSystemWideList
method that will return you objects instead of XML. You will then be able to Linq it instead of fiddling with XML :)