public void cancelCheckOut(CmisObject document, String documentId) { validateObjectOrId(document, documentId); validateRedundantIdentifier(document, documentId); CmisObject target = getCmisObject(document, documentId); if (target != null && target instanceof Document) { ((Document) target).cancelCheckOut(); } }
private void createDocumentAndAttachSecondaryType(Session session, Folder testFolder, ObjectType secondaryTestType) { Document doc = createDocument(session, testFolder, "createandattach.txt", "Secondary Type Test"); Document workDoc = doc; try { // test if check out is required boolean checkedout = false; if (needsCheckOut(doc)) { workDoc = (Document) session.getObject(doc.checkOut(), SELECT_ALL_NO_CACHE_OC); checkedout = true; } // attach secondary type ObjectId newId = workDoc.updateProperties(null, Collections.singletonList(secondaryTestType.getId()), null); Document newDoc = (Document) session.getObject(newId, SELECT_ALL_NO_CACHE_OC); // check if the secondary type is there boolean found = checkSecondaryType(newDoc, secondaryTestType); // -- detach secondary type if (found) { detachSecondaryType(session, newDoc, secondaryTestType); } // cancel a possible check out if (checkedout) { workDoc.cancelCheckOut(); } } finally { deleteObject(doc); } }
return (Document) session.getObject(newObjectId); } catch (CmisBaseException e) { pwc.cancelCheckOut(); throw new RuntimeException("Cannot store document in CMIS reposiory", e);
pwc.cancelCheckOut(); pwc = null; } finally { if (pwc != null) { pwc.cancelCheckOut();
pwc.cancelCheckOut(); pwcId = doc.checkOut(); pwc = (Document) session.getObject(pwcId, SELECT_ALL_NO_CACHE_OC); pwc.cancelCheckOut();
addResult(assertEquals(1, versions.size(), null, f)); docCheckedOut.cancelCheckOut(); } catch (CmisConstraintException ce) { addResult(createResult(WARNING, "Creating a checked out version failed! "
addResult(createResult(SKIPPED, "The test PWC does not accept a new content stream. Test skipped!")); workDoc.cancelCheckOut(); doc.delete(true); return; workDoc.cancelCheckOut();