I’m writing a custom itemfilter to fix a publishing issue. The itemfilter needs to look at past revisions for the last revision that was ever in a certain workflow state, and if so use that revision. I am trying to figure out a way to get a list of workflow state ids that the item was in during the lifetime of the revision.
For that to work I need all the records for an item in the contentstatushistory table. However, the way I’m getting revisions for an item is only showing me the first contentstatushistory record for a revision. Any ideas for another way to get the entire content status history?
Here’s a summary/part of the code:
IPSContentWs contentWebService = PSContentWsLocator.getContentWebservice();
List<PSRevisions> revisionsList = contentWebService.findRevisions(guidList);
if (revisionsList != null && revisionsList.size() > 0) {
PSRevisions revisions = revisionsList.get(0);
List<PSContentStatusHistory> contentStatusHistoryList = revisions.getRevisions();
for (PSContentStatusHistory contentStatusHistory : contentStatusHistoryList) {
log.debug("Previous Revision Id: " + contentStatusHistory.getRevision());
log.debug("Previous Revision State: " + contentStatusHistory.getStateName());
log.debug("Workflow STate id: " + contentStatusHistory.getStateId());
}
}
The debug shows that there’s only one PSContentStatusHistory item for each revision, which holds the values of the first (oldest) contentstatushistory record in the DB for that revision.
Anyone have any ideas for a different way to get the full content status history?
Thanks,
Brian