04-03-2019 05:19 PM
I am writing a web script to get a list of all the checkout documents and user who has them checked out.
I can use this api to get a Boolean answer of whether a document is checked out or not;
var docNode = search.findNode("workspace://SpacesStore/"+alfid);
model.foo = docNode.hasAspect("cm:workingcopy");
Now, I need to find the lock owner for this docNode, I tried this api but it doesn't return anything:
model.boo = docNode.properties["cm:lockOwner"]
Any suggestions?
04-04-2019 12:13 AM
Hi,
You can use alternate solution with java backed webscript.
if (nodeService.hasAspect(nodeRefOriginal,ContentModel.ASPECT_WORKING_COPY)) {
String docName=(String)nodeService.getProperty(nodeRefOriginal, ContentModel.PROP_NAME);
String workingCopyOwner= (String)nodeService.getProperty(nodeRefOriginal,ContentModel.PROP_WORKING_COPY_OWNER);
}
Thanks,
Sanjay
04-04-2019 12:13 AM
Hi,
You can use alternate solution with java backed webscript.
if (nodeService.hasAspect(nodeRefOriginal,ContentModel.ASPECT_WORKING_COPY)) {
String docName=(String)nodeService.getProperty(nodeRefOriginal, ContentModel.PROP_NAME);
String workingCopyOwner= (String)nodeService.getProperty(nodeRefOriginal,ContentModel.PROP_WORKING_COPY_OWNER);
}
Thanks,
Sanjay
04-04-2019 02:18 AM
Thanks.
Also, I got the correct property from Node Browser:
model.boo = docNode.properties["cm:workingCopyOwner"]
Explore our Alfresco products with the links below. Use labels to filter content by product module.