I am trying to figure out if there is a way with code to tell if a CI or SF has ever been published, a few things I've thought about....
- Look at each CI and check the publishing status, this is unreliable for a few reasons:
- As soon as a CI/SF has a channel associated to it, it goes to an unpublished state. So if we looked for CI's/SF's without any publishing status, theses items would be overlooked.
- If you are a CI that is "brought along for the ride" when another item is published, the publishing status of that CI/SF goes to unknown and stays in that state. A CI/SF in an unknow state WOULD signify that the item has been published, but these items typically do not have channel/site associations, which is needed to get the publishing status (i.e.
ps = site.getDeploymentStatus(ci.getContentManagementId().getObjectId()); ) So we would not be able to access the "published" state of an item in the "unknown" state. (Maybe if I tried to see what the publishing state was checking against each site individually, but I don't think we'd want to do that with 10 or so sites...)
- Use the ManagedObjectDBQuery to only bring back items never published.... for the same reasons in #1 there is no good way to query this.
- The best option I have at this point is to grab all the CI's/SF's and look for a reference of them in a custom audit table we have.
If would be nice if I could do this with code and not have to make database calls in the code, has anyone done this or does anyone have an idea how to do this with code? Thanks in advance for any help!