08-06-2012 04:20 AM
CmisObject testCmisObject = ….;
if (testCmisObject.getAllowableActions().getAllowableActions().contains(org.apache.chemistry.opencmis.commons.enums.Action.CAN_CHECK_OUT)) {
testCmisObject.refresh();
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");
}
ObjectId idOfCheckedOutDocument = documentToBeCheckedout.checkOut();
and does not print the message after that. 08-06-2012 11:49 AM
08-06-2012 12:25 PM
catch(Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
08-06-2012 01:30 PM
08-06-2012 02:22 PM
testCmisObject.getAllowableActions().getAllowableActions().contains(org.apache.chemistry.opencmis.commons.enums.Action.CAN_CHECK_OUT)
String testName = documentToBeCheckedout.getContentStream().getFileName();
SessionFactory factory = SessionFactoryImpl.newInstance();
IdentityHashMap<String, String> parameter = new IdentityHashMap<String, String>();
parameter.put(SessionParameter.USER, "ROLE_TICKET");
parameter.put(SessionParameter.PASSWORD, ticket);
parameter.put(SessionParameter.ATOMPUB_URL, url + "/s/cmis");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
List<Repository> repositories = factory.getRepositories(parameter);
Session session = repositories.get(0).createSession();
Folder rootFolder = session.getRootFolder();
ItemIterable<CmisObject> rootFolderChildren = rootFolder.getChildren();
Iterator<CmisObject> childrenItems = rootFolderChildren.iterator();
while(childrenItems.hasNext()) {
CmisObject testCmisObject = childrenItems.next();
}
08-06-2012 02:54 PM
08-06-2012 05:03 PM
session.getRootFolder().createDocument(properties, contentStream, VersioningState.MAJOR)
catch(Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
08-06-2012 05:50 PM
08-07-2012 07:51 AM
08-07-2012 12:58 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.