8

I'm trying to get a list of all published publications from Content Delivery.

I've tried so far using:

PublicationCriteria pubCriteria = new PublicationCriteria(0);
Query q = new Query(pubCriteria);
string[] pubIds = q.ExecuteQuery();

And also tried

ItemTypeCriteria pubCriteria = new ItemTypeCriteria(1);
Query q = new Query(pubCriteria);
string[] pubIds = q.ExecuteQuery();

Both cases return 0 results. Am I missing something obvious here?

To be clear, I don't really care about the publications themselves, but rather for the pages in them, and wanted to do some queries "per publication".

Something like this would return all pages but that would be around 100,000 in total and I wanted to break down my script to do one publication at a time.

ItemTypeCriteria pageCriteria = new ItemTypeCriteria(16);
Query q = new Query(pageCriteria );
string[] pageIds = q.ExecuteQuery();
  • Does new PublicationMetaFactory().GetAllMeta() do what you want? – Albert Romkes Mar 14 '17 at 13:53
  • This does work Albert! Put it up as an answer. – Nuno Linhares Mar 14 '17 at 14:16
8

You can use new PublicationMetaFactory().GetAllMeta() to retrieve a list of all published publications.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.