4

I am trying to get the publish state of a page/component. But not able to find a method which will tell me if an item is UNPUBLISHED from a particular target. I am using CoreService.

client.GetListPublishInfo(pageUri) does not give me the information if the page/component is unpublished. Or I am looking at a wrong method?

0

2 Answers 2

11

You can use following if your requirement is just to check the status

public bool IsPublished(string itemId, string publicationTargetId, 
bool isPublishedInContext)
6

To check if an item is published to a known PublicationTarget use the method as described by @Raj

public bool IsPublished(string itemId, string publicationTargetId, bool isPublishedInContext)

To see which PublicationTargets a known item is published to use

public PublishInfoData[] GetListPublishInfo(string itemId);

You can then see information about the items publish status like

foreach(PublishInfoData info in PublishInfoDataArray)
{
    Console.WriteLine(string.Format("Target: {0} Time: {1}", info.PublicationTarget.Title, info.PublishedAt.ToString()));
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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