throw new CmisUpdateConflictException("Update conflict: " + cmisAffecting.getMessage(), e);
/** * See CMIS 1.0 section 2.2.7.2 cancelCheckout */ public void cancelCheckout(String objectId) { if(log.isTraceEnabled()) { log.trace("<<<<<<<< cancelCheckout for object id " + objectId); } //TODO check what is the object id. Whether it is the id of orig copy or pwc. // check id if (objectId == null) { throw new CmisInvalidArgumentException("Object Id must be set."); } // get the node RegistryObject gregNode = getGregNode(objectId); if (!gregNode.isVersionable()) { throw new CmisUpdateConflictException("Not a version: " + gregNode); } // cancelCheckout gregNode.asVersion().cancelCheckout(); }
throw new CmisUpdateConflictException("Update conflict: " + cmisAffecting.getMessage(), e);
/** * See CMIS 1.0 section 2.2.7.3 checkedIn */ public void checkIn(Holder<String> objectId, Boolean major, Properties properties, ContentStream contentStream, String checkinComment) { if(log.isTraceEnabled()) { log.trace("<<<<<<< checkin for object id " + objectId.getValue()); } // check id if (objectId == null || objectId.getValue() == null) { throw new CmisInvalidArgumentException("Object Id must be set."); } // get the node RegistryObject gregNode; try { gregNode = getGregNode(objectId.getValue()); } catch (CmisObjectNotFoundException e) { throw new CmisUpdateConflictException(e.getCause().getMessage(), e.getCause()); } if (!gregNode.isVersionable()) { throw new CmisUpdateConflictException("Not a version: " + gregNode); } // checkin RegistryVersion checkedIn = gregNode.asVersion().checkin(properties, contentStream, checkinComment); objectId.setValue(checkedIn.getId()); }
return new CmisStreamNotSupportedException(msg, code, errorContent, additionalData); case UPDATE_CONFLICT: return new CmisUpdateConflictException(msg, code, errorContent, additionalData); case VERSIONING: return new CmisVersioningException(msg, code, errorContent, additionalData);
return new CmisStreamNotSupportedException(message, errorContent, additionalData, t); } else if (CmisUpdateConflictException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) { return new CmisUpdateConflictException(message, errorContent, additionalData, t); } else if (CmisVersioningException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) { return new CmisVersioningException(message, errorContent, additionalData, t);
return new CmisStreamNotSupportedException(message, errorContent, additionalData, t); } else if (CmisUpdateConflictException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) { return new CmisUpdateConflictException(message, errorContent, additionalData, t); } else if (CmisVersioningException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) { return new CmisVersioningException(message, errorContent, additionalData, t);
/** * See CMIS 1.0 section 2.2.7.1 checkOut */ public void checkOut(Holder<String> objectId, Holder<Boolean> contentCopied) { if(log.isTraceEnabled()) { log.trace("<<<<<<<<< checkout for object id " + objectId.getValue()); } // check id if (objectId == null || objectId.getValue() == null) { throw new CmisInvalidArgumentException("Object Id must be set."); } // get the node RegistryObject gregNode = getGregNode(objectId.getValue()); if (!gregNode.isVersionable()) { throw new CmisUpdateConflictException("Not a version: " + gregNode); } // checkout RegistryPrivateWorkingCopy pwc = gregNode.asVersion().checkout(); objectId.setValue(pwc.getId()); if (contentCopied != null) { contentCopied.setValue(true); } }
return new CmisVersioningException(message, errorContent, t); } else if (CmisUpdateConflictException.EXCEPTION_NAME.equals(exception)) { return new CmisUpdateConflictException(message, errorContent, t); } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equals(exception)) { return new CmisNameConstraintViolationException(message, errorContent, t);
return new CmisVersioningException(message, errorContent, additionalData, t); } else if (CmisUpdateConflictException.EXCEPTION_NAME.equals(exception)) { return new CmisUpdateConflictException(message, errorContent, additionalData, t); } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equals(exception)) { return new CmisNameConstraintViolationException(message, errorContent, additionalData, t);
throw new CmisUpdateConflictException("Cannot rename root node");