AnsweredAssumed Answered

Issue with checkOut() using Apache Chemistry

Question asked by mandarj on Aug 6, 2012
Latest reply on Aug 7, 2012 by jpotts
I am connecting to Alfresco 3.4.1 Enterprise using Apache Chemistry and trying to checkout a file from repository. I could get the ContentStream of object which I want to checkout but somehow it does not checkout document and create pwc.

Can anyone help me to figure out what could be the issue?

Piece of code I am trying with :

CmisObject testCmisObject = ….;
if (testCmisObject.getAllowableActions().getAllowableActions().contains(org.apache.chemistry.opencmis.commons.enums.Action.CAN_CHECK_OUT)) {
   System.out.println("Object Refreshed");
   org.apache.chemistry.opencmis.client.api.Document documentToBeCheckedout = (org.apache.chemistry.opencmis.client.api.Document) testCmisObject;
   System.out.println("Creating a pwc document");
   String testName = documentToBeCheckedout.getContentStream().getFileName();
   System.out.println("File Name=" + testName);
   ObjectId idOfCheckedOutDocument = documentToBeCheckedout.checkOut();
   System.out.println("Got Object Id=" + idOfCheckedOutDocument.getId());
   org.apache.chemistry.opencmis.client.api.Document pwcOfDocumentCheckedOut = (org.apache.chemistry.opencmis.client.api.Document) session.getObject(idOfCheckedOutDocument);
   System.out.println("Object checked-out");

In this, I think, it gets stuck at
ObjectId idOfCheckedOutDocument = documentToBeCheckedout.checkOut();
and does not print the message after that.