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

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


        }
    }

    @Test
    public void readTypeChildrenDocumentSkip() {
        ObjectType otd = this.session.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
        Assert.assertNotNull(otd);
        this.session.getDefaultContext().setMaxItemsPerPage(2);
        ItemIterable<ObjectType> pc = this.session.getTypeChildren(otd.getId(), true);
        Assert.assertNotNull(pc);

        ItemIterable<ObjectType> pcc = pc.skipTo(2).getPage(2);
        for (ObjectType ot1 : pcc) {
            ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
            Assert.assertEquals(ot1.getId(), ot2.getId());
        }
    }
View Full Code Here


        }
    }

    @Test
    public void readTypeChildrenFolder() {
        ObjectType otd = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
        Assert.assertNotNull(otd);
        this.session.getDefaultContext().setMaxItemsPerPage(2);
        ItemIterable<ObjectType> pc = this.session.getTypeChildren(otd.getId(), true);
        Assert.assertNotNull(pc);

        for (ObjectType ot1 : pc) {
            ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
            Assert.assertEquals(ot1.getId(), ot2.getId());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void readTypeChildrenFolderSkip() {
        ObjectType otd = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
        Assert.assertNotNull(otd);
        this.session.getDefaultContext().setMaxItemsPerPage(2);
        ItemIterable<ObjectType> pc = this.session.getTypeChildren(otd.getId(), true);
        Assert.assertNotNull(pc);

        ItemIterable<ObjectType> pcc = pc.skipTo(0).getPage(2);
        for (ObjectType ot1 : pcc) {
            ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
            Assert.assertEquals(ot1.getId(), ot2.getId());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void readTypeDescandantsDocument() {
        ObjectType otd = this.session.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
        Assert.assertNotNull(otd);
        List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd.getId(), 1, true);
        Assert.assertNotNull(desc);
        Assert.assertFalse(desc.isEmpty());
    }
View Full Code Here

        Assert.assertFalse(desc.isEmpty());
    }

    @Test
    public void readTypeDescandantsFolder() {
        ObjectType otd = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
        Assert.assertNotNull(otd);
        List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd.getId(), 1, true);
        Assert.assertNotNull(desc);
        desc.isEmpty();
    }
View Full Code Here

        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) {
            assertNotNull(r);
            assertEquals(id, r.getId());
View Full Code Here

    public void testTypes() {
        String documentBaseId = "cmis:document";
        String folderBaseId = "cmis:folder";

        // check document type definition
        ObjectType documentType = getSession().getTypeDefinition(documentBaseId);
        checkBaseType(documentBaseId, BaseTypeId.CMIS_DOCUMENT, documentType);

        // check folder type definition
        ObjectType folderType = getSession().getTypeDefinition(folderBaseId);
        checkBaseType(folderBaseId, BaseTypeId.CMIS_FOLDER, folderType);

        // get base types via getTypesChildren
        ItemIterable<ObjectType> baseTypes = getSession().getTypeChildren(null, true);
        assertNotNull(baseTypes);
View Full Code Here

        // Types
        System.out.println("\nTypes...");
        System.out.println("--------");
        // Look at the type definition
        System.out.println("Getting type definition for doc");
        ObjectType objectType = session.getTypeDefinition(doc.getType().getId());
        System.out.println("doc is of type " + objectType.getDisplayName());
        System.out.println("isBaseType() returns " + (objectType.isBaseType() ? "true" : "false"));
        ObjectType baseType = objectType.getBaseType();
        if (baseType == null) {
            System.out.println("getBaseType() returns null");
        } else {
            System.out.println("getBaseType() returns " + baseType.getDisplayName());
        }
        ObjectType parentType = objectType.getParentType();
        if (parentType == null) {
            System.out.println("getParentType() returns null");
        } else {
            System.out.println("getParentType() returns " + parentType.getDisplayName());
        }
        System.out.println("Listing child types of " + objectType.getDisplayName());
        for (ObjectType o : objectType.getChildren()) {
            System.out.println("\t" + o.getDisplayName());
        }
View Full Code Here

     */
    private List<Tree<ObjectType>> convertTypeDescendants(List<TypeDefinitionContainer> descendantsList) {
        List<Tree<ObjectType>> result = new ArrayList<Tree<ObjectType>>();

        for (TypeDefinitionContainer container : descendantsList) {
            ObjectType objectType = objectFactory.convertTypeDefinition(container.getTypeDefinition());
            List<Tree<ObjectType>> children = convertTypeDescendants(container.getChildren());

            result.add(new TreeImpl<ObjectType>(objectType, children));
        }

View Full Code Here

        if ((source == null) || (source.getId() == null)) {
            throw new IllegalArgumentException("Source must be set!");
        }

        // get the type of the source document
        ObjectType type = null;
        if (source instanceof CmisObject) {
            type = ((CmisObject) source).getType();
        } else {
            CmisObject sourceObj = getObject(source);
            type = sourceObj.getType();
        }

        if (type.getBaseTypeId() != BaseTypeId.CMIS_DOCUMENT) {
            throw new IllegalArgumentException("Source object must be a document!");
        }

        String newId = getBinding().getObjectService().createDocumentFromSource(getRepositoryId(), source.getId(),
                objectFactory.convertProperties(properties, type, CREATE_UPDATABILITY),
View Full Code Here

TOP

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

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.