Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException


        }

        // get the node
        JcrNode jcrNode = getJcrNode(session, objectId);
        if (!jcrNode.isVersionable()) {
            throw new CmisUpdateConflictException("Not a version: " + jcrNode);
        }

        // cancelCheckout
        jcrNode.asVersion().cancelCheckout();
    }
View Full Code Here


        JcrNode jcrNode;
        try {
            jcrNode = getJcrNode(session, objectId.getValue());
        }
        catch (CmisObjectNotFoundException e) {
            throw new CmisUpdateConflictException(e.getCause().getMessage(), e.getCause());
        }
       
        if (!jcrNode.isVersionable()) {
            throw new CmisUpdateConflictException("Not a version: " + jcrNode);
        }

        // checkin
        JcrVersion checkedIn = jcrNode.asVersion().checkin(properties, contentStream, checkinComment);
        objectId.setValue(checkedIn.getId());
View Full Code Here

                    "Object is of a versionable type but not instance of VersionedDocument or DocumentVersion.");
    }

    protected void checkHasUser(String user) {
        if (null == user || user.length() == 0)
            throw new CmisUpdateConflictException("Object can't be checked-in, no user is given.");
    }
View Full Code Here

            throw new CmisUpdateConflictException("Object can't be checked-in, no user is given.");
    }

    protected void testCheckedOutByCurrentUser(String user, VersionedDocument verDoc) {
        if (!user.equals(verDoc.getCheckedOutBy()))
            throw new CmisUpdateConflictException("Object can't be checked-in, user " + verDoc.getCheckedOutBy()
                    + " has checked out the document.");
    }
View Full Code Here

                    + " has checked out the document.");
    }

    protected void testIsCheckedOut(VersionedDocument verDoc) {
        if (!verDoc.isCheckedOut())
            throw new CmisUpdateConflictException("Canot check-in: Document " + verDoc.getId() + " is not checked out.");
    }
View Full Code Here

        // check properties for validity
        TypeValidator.validateProperties(typeDef, properties, false);

        if (changeToken != null && changeToken.getValue() != null
                && Long.valueOf(so.getChangeToken()) > Long.valueOf(changeToken.getValue()))
            throw new CmisUpdateConflictException(" updateProperties failed: outdated changeToken");

        // update properties
        boolean hasUpdatedName = false;
        boolean hasUpdatedOtherProps = false;
View Full Code Here

            throw new CmisPermissionDeniedException("Object can't be checked-in, no user is given.");
    }

    protected void testCheckedOutByCurrentUser(String user, VersionedDocument verDoc) {
        if (!user.equals(verDoc.getCheckedOutBy()))
            throw new CmisUpdateConflictException("Object can't be checked-in, user " + verDoc.getCheckedOutBy()
                    + " has checked out the document.");
    }
View Full Code Here

                    + " has checked out the document.");
    }

    protected void testIsCheckedOut(VersionedDocument verDoc) {
        if (!verDoc.isCheckedOut())
            throw new CmisUpdateConflictException("Canot check-in: Document " + verDoc.getId() + " is not checked out.");
    }
View Full Code Here

        } else {
            content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
        }

        if (verDoc.isCheckedOut())
            throw new CmisUpdateConflictException("Document " + objectId.getValue() + " is already checked out.");

        String user = context.getUsername();
        checkHasUser(user);

        DocumentVersion pwc = verDoc.checkOut(content, user);
View Full Code Here

        boolean rename = newName != null && !getName().equals(newName);
        if (rename && !JcrConverter.isValidJcrName(newName)) {
            throw new CmisNameConstraintViolationException("Name is not valid: " + newName);
        }
        if (rename && isRoot()) {
            throw new CmisUpdateConflictException("Cannot rename root node");
        }

        try {
            // rename file or folder if necessary
            Session session = getNode().getSession();
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.