Do you know if there is any way to get list of all published pages for specific publication by using Content Delivery API?
Something similar to next API, but for pages:
new PublicationMetaFactory().getAllMeta();
Here is the working code example for getting the published pages items:
int publicationId = 8; //change this value to your publicationId on your environment
PublicationCriteria publicationCiteria = new PublicationCriteria(publicationId);
ItemTypeCriteria itemCriteria = new ItemTypeCriteria(64);
Query query = new Query(CriteriaFactory.And(new Criteria[] { publicationCiteria, itemCriteria }));
SortParameter sortParameter = new SortParameter(SortParameter.ItemLastPublishedDate, SortParameter.Descending);
query.AddSorting(sortParameter);
string[] itemIds = query.ExecuteQuery();
I hope it helps.
Haven't tested this, but I would probably use a Query
object with its Criteria
property set accordingly.
Meaning:
PublicationCriteria
to select the desired publicationItemTypeCriteria
to select only pages.Make sure to "And"
these two criteria together. Once you have the criteria, you would simply call ExecuteQuery
on the Query
object and it will return the list of Tcm
-s. Since this is the CD we're talking about, you will only get the Items present there, in other words, only the published ones.