As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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();
catch(Exception exception) { System.out.println("Error: " + exception.getMessage()); }
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(); }
session.getRootFolder().createDocument(properties, contentStream, VersioningState.MAJOR)