Package org.apache.chemistry.opencmis.client.api

Examples of org.apache.chemistry.opencmis.client.api.ObjectId


    public Document createDocument(Map<String, ?> properties, ContentStream contentStream,
            VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces,
            OperationContext context) {

        ObjectId newId = getSession().createDocument(properties, this, contentStream, versioningState, policies,
                addAces, removeAces);

        // if no context is provided the object will not be fetched
        if ((context == null) || (newId == null)) {
            return null;
View Full Code Here


    public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties,
            VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces,
            OperationContext context) {

        ObjectId newId = getSession().createDocumentFromSource(source, properties, this, versioningState, policies,
                addAces, removeAces);

        // if no context is provided the object will not be fetched
        if ((context == null) || (newId == null)) {
            return null;
View Full Code Here

    }

    public Folder createFolder(Map<String, ?> properties, List<Policy> policies, List<Ace> addAces,
            List<Ace> removeAces, OperationContext context) {

        ObjectId newId = getSession().createFolder(properties, this, policies, addAces, removeAces);

        // if no context is provided the object will not be fetched
        if ((context == null) || (newId == null)) {
            return null;
        }
View Full Code Here

    }

    public Policy createPolicy(Map<String, ?> properties, List<Policy> policies, List<Ace> addAces,
            List<Ace> removeAces, OperationContext context) {

        ObjectId newId = getSession().createPolicy(properties, this, policies, addAces, removeAces);

        // if no context is provided the object will not be fetched
        if ((context == null) || (newId == null)) {
            return null;
        }
View Full Code Here

    // operations

    public Document copy(ObjectId targetFolderId, Map<String, ?> properties, VersioningState versioningState,
            List<Policy> policies, List<Ace> addAces, List<Ace> removeAces, OperationContext context) {

        ObjectId newId = getSession().createDocumentFromSource(this, properties, targetFolderId, versioningState,
                policies, addAces, removeAces);

        // if no context is provided the object will not be fetched
        if (context == null || newId == null) {
            return null;
View Full Code Here

        return getSession().getObjectFactory().createContentStream(filename, length, contentStream.getMimeType(),
                contentStream.getStream());
    }

    public Document setContentStream(ContentStream contentStream, boolean overwrite) {
        ObjectId objectId = setContentStream(contentStream, overwrite, true);
        if (objectId == null) {
            return null;
        }

        if (!getObjectId().equals(objectId.getId())) {
            return (Document) getSession().getObject(objectId, getCreationContext());
        }

        return this;
    }
View Full Code Here

        return getSession().createObjectId(newObjectId);
    }

    public Document deleteContentStream() {
        ObjectId objectId = deleteContentStream(true);
        if (objectId == null) {
            return null;
        }

        if (!getObjectId().equals(objectId.getId())) {
            return (Document) getSession().getObject(objectId, getCreationContext());
        }

        return this;
    }
View Full Code Here

        properties.put(PropertyIds.NAME, name);
        properties.put(PropertyIds.OBJECT_TYPE_ID, objectTypeId);
        properties.put(PropertyIds.SOURCE_ID, source.getId());
        properties.put(PropertyIds.TARGET_ID, target.getId());

        ObjectId relId;
        Relationship result = null;

        try {
            relId = session.createRelationship(properties);
            result = (Relationship) session.getObject(relId, SELECT_ALL_NO_CACHE_OC);
View Full Code Here

            readUnlock();
        }
    }

    public CmisObject updateProperties(Map<String, ?> properties) {
        ObjectId objectId = updateProperties(properties, true);
        if (objectId == null) {
            return null;
        }

        if (!getObjectId().equals(objectId.getId())) {
            return getSession().getObject(objectId, getCreationContext());
        }

        return this;
    }
View Full Code Here

                doc.delete(true);
                return;
            }

            // check out
            ObjectId pwcId = doc.checkOut();
            Document pwc = (Document) session.getObject(pwcId, SELECT_ALL_NO_CACHE_OC);

            addResult(checkObject(session, pwc, getAllProperties(pwc), "PWC spec compliance - test 1"));

            checkCheckedOut(pwc);

            // cancel checkout
            pwc.cancelCheckOut();

            doc.refresh();
            checkCheckedIn(doc);

            // check out again
            pwcId = doc.checkOut();
            pwc = (Document) session.getObject(pwcId, SELECT_ALL_NO_CACHE_OC);

            addResult(checkObject(session, pwc, getAllProperties(pwc), "PWC spec compliance - test 2"));

            checkCheckedOut(pwc);

            // check in
            ObjectId newVersionId = pwc.checkIn(true, null, null, "Test Version 2");
            Document newVersion = (Document) session.getObject(newVersionId, SELECT_ALL_NO_CACHE_OC);

            addResult(checkObject(session, newVersion, getAllProperties(newVersion), "New version compliance"));

            checkCheckedIn(newVersion);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.client.api.ObjectId

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.