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

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


        // create a folder to move into
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, "newfolder");
        properties.put(PropertyIds.OBJECT_TYPE_ID,
                FixtureData.FOLDER_TYPE_ID.value());
        ObjectId folderId = session.createFolder(properties, testRoot);
        assertNotNull(folderId);

        // get the document
        String pathd = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
                + FixtureData.DOCUMENT1_NAME;
View Full Code Here


                // the repository sent an object without a valid object id...
                throw new CmisRuntimeException("Repository sent invalid data! No object id!");
            }

            // fetch the object and make sure it is a folder
            ObjectId parentId = getSession().createObjectId((String) idProperty.getFirstValue());
            CmisObject parentFolder = getSession().getObject(parentId);
            if (!(parentFolder instanceof Folder)) {
                // the repository sent an object that is not a folder...
                throw new CmisRuntimeException("Repository sent invalid data! Object is not a folder!");
            }
View Full Code Here

    }

    public CmisObject getSource(OperationContext context) {
        readLock();
        try {
            ObjectId sourceId = getSourceId();
            if (sourceId == null) {
                return null;
            }

            return getSession().getObject(sourceId, context);
View Full Code Here

    }

    public CmisObject getTarget(OperationContext context) {
        readLock();
        try {
            ObjectId targetId = getTargetId();
            if (targetId == null) {
                return null;
            }

            return getSession().getObject(targetId, context);
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

    @Test
    public void createFileApplyAclAndGetAclFromNewSession() {
        this.session.getDefaultContext().setIncludeAcls(true);
        this.session2.getDefaultContext().setIncludeAcls(true);     
       
        ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
        String folderName = UUID.randomUUID().toString();
        String typeId = FixtureData.DOCUMENT_TYPE_ID.value();

        // properties
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, folderName);
        properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);

        // permissions
        List<Ace> aces = new ArrayList<Ace>();
        ArrayList<String> permissions = new ArrayList<String>();
        permissions.add("cmis:read");
        aces.add(this.session.getObjectFactory().createAce("everyone", permissions));

        // create document
        ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE);
        assertNotNull(id);

        // get document for id
        Document doc = (Document) this.session.getObject(id);
        assertNotNull(doc);
View Full Code Here

        .contains(Action.CAN_MOVE_OBJECT);
  }

  @Override
  public void doAction() throws Exception {
    ObjectId targetFolderId = new ObjectIdImpl(targetFolderField.getText());
    ((FileableCmisObject) getObject()).move(getClientModel()
        .getCurrentFolder(), targetFolderId);
  }
View Full Code Here

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.OBJECT_TYPE_ID, ObjectType.RELATIONSHIP_BASETYPE_ID);
        properties.put(PropertyIds.SOURCE_ID, document1.getId());
        properties.put(PropertyIds.TARGET_ID, document2.getId());

        ObjectId id = this.session.createRelationship(properties);

        ObjectType ot = document1.getType();
        ItemIterable<Relationship> relations = session.getRelationships(document1, true, RelationshipDirection.EITHER,
                ot, this.session.getDefaultContext());
        for (Relationship r : relations) {
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.