There is a PSLocator constructor which only takes the content id.
public PSLocator(int id)
Convenience constructor {#link PSLocator(int, int)} with an undefined revision. The revision of the constructed object is default to -1 and it is also default to persisted.
What revision does it uses? Does it defaults to the most recent revision or something else?
I am trying to find the owners for a content item. I am building the guid id for the content item using both the content id, and the revision id.
To the findOwners() method I am passing the load operation flag as false, and the Relationship filter as NULL.
However, the result that is returned contains a list of owners which are both current as well as past ones. This is causing problems for us, as we do not want old parents to show up in the list.
Is there anyway to limit the result set to only have the current owners?
When I pass the RelationshipFilter, I am getting Null pointer exception.
This is my method:
private List<PSItemSummary> getOwners(IPSGuid guid) throws PSErrorException {
PSRelationshipFilter filter = new PSRelationshipFilter();
filter.setName(“findCurrentParents”);
filter.limitToEditOrCurrentOwnerRevision(true);
filter.setCategory(“rs_activeassembly”);
System.out.println(“finding the owners”);
List<PSItemSummary> result = cws.findOwners(guid, filter, false);
return result;
}
The Null Pointer Exception is coming as:
The call-stack was:
java.lang.NullPointerException
at com.percussion.webservices.content.impl.PSContentWs.setFilterByAaCategorysIfNeeded(Unknown Source)
at com.percussion.webservices.content.impl.PSContentWs.findOwners(Unknown Source)
The Name that you pass to setName() must be the name of a valid relationship type that is configured in your system. Almost certainly, you do NOT need this parameter at all.