Package org.apache.chemistry.opencmis.commons.definitions

Examples of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition


            MultiFiling multiParentObj = (MultiFiling) sop;
            List<Folder> parents = multiParentObj.getParents(user);
            if (null != parents) {
                for (Folder parent : parents) {
                    ObjectParentDataImpl parentData = new ObjectParentDataImpl();
                    TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, parent.getTypeId()).getTypeDefinition();
                    ObjectData objData = PropertyCreationHelper.getObjectData(typeDef, parent, filter, user, includeAllowableActions,
                            includeRelationships, "", false, true, null);

                    parentData.setObject(objData);
                    parentData.setRelativePathSegment(multiParentObj.getPathSegment());
View Full Code Here


        return parent;
    }

    void copyFilteredProperties(String repositoryId, StoredObject so, String filter, ObjectDataImpl objData) {
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
        TypeDefinition td = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
        Properties props = PropertyCreationHelper.getPropertiesFromObject(so, td, requestedIds, true);
        objData.setProperties(props);
    }
View Full Code Here

        }
        List<ObjectData> objDataList = new ArrayList<ObjectData>();
        Map<String, String> props = queryObj.getRequestedProperties();
        Map<String, String> funcs = queryObj.getRequestedFuncs();
        for (StoredObject so : matches) {
            TypeDefinition td = tm.getTypeById(so.getTypeId()).getTypeDefinition();
            ObjectData od = PropertyCreationHelper.getObjectDataQueryResult(td, so, user, props, funcs,
                    includeAllowableActions, includeRelationships, renditionFilter);

            objDataList.add(od);
        }
View Full Code Here

                BaseTypeId.CMIS_DOCUMENT.value(), BigInteger.valueOf(depth), Boolean.TRUE, null);
        assertNotNull(types);
        log.info("Found in repository " + repositoryId + " " + types.size() + " type(s) with depth " + depth + ".");

        for (TypeDefinitionContainer type : types) {
            TypeDefinition typeDef = type.getTypeDefinition();
            log.info("Found type: " + typeDef.getId() + ", display name is: " + typeDef.getDisplayName());
            log.info("  Base type is: " + typeDef.getBaseTypeId());
            log.info("  Number of children types is: " + type.getChildren().size());
            containsAllBasePropertyDefinitions(typeDef);
        }

        int totalSize = getRecursiveSize(types);
        assertEquals(5, totalSize); // all RepositoryTestTypeSystemCreator types
        // minus one in level two plus cmis.docment
        assertFalse(containsTypeByIdRecursive(BaseTypeId.CMIS_DOCUMENT.value(), types));
        assertFalse(containsTypeByIdRecursive(BaseTypeId.CMIS_FOLDER.value(), types));

        assertTrue(containsTypeByIdRecursive("MyDocType1", types));
        assertTrue(containsTypeByIdRecursive("MyDocType2", types));

        assertFalse(containsTypeByIdRecursive(UnitTestTypeSystemCreator.LEVEL2_TYPE, types));

        for (TypeDefinitionContainer type : types) {
            assertNotNull(type);
            TypeDefinition typeDef = type.getTypeDefinition();
            assertNotNull(typeDef);
            assertNotNull(typeDef.getId());
            assertNotNull(typeDef.getBaseTypeId());
        }

        log.info("... testGetAllTypesLimitedDepth() finished.");
    }
View Full Code Here

        while (typeId != null) {
            if (typeId.equals(td.getId())) {
                return true;
            }
            // check parent type
            TypeDefinition parentTD = queryObj.getParentType(typeId);
            typeId = parentTD == null ? null : parentTD.getId();
        }
        return false;
    }
View Full Code Here

                                                                           // support
                                                                           // JOINS
                                                                           // take
                                                                           // first
                                                                           // type
        TypeDefinition td = queryObj.getTypeDefinitionFromQueryName(queryName);
        boolean skip = so instanceof VersionedDocument; // we are only
                                                        // interested in
                                                        // versions not in the
                                                        // series
        boolean typeMatches = typeMatches(td, so);
View Full Code Here

        assertTrue(containsTypeByIdRecursive("MyDocType1.2", types));
        assertTrue(containsTypeByIdRecursive("MyDocType1.1.1", types));
        assertTrue(containsTypeByIdRecursive("MyDocType1.1.2", types));
        for (TypeDefinitionContainer type : types) {
            assertNotNull(type);
            TypeDefinition typeDef = type.getTypeDefinition();
            assertNotNull(typeDef);
            assertNotNull(typeDef.getId());
            assertNotNull(typeDef.getBaseTypeId());
            log.info("Found type: " + typeDef.getId() + ", display name is: " + typeDef.getDisplayName());
            log.info("  Base type is: " + typeDef.getBaseTypeId());
            log.info("  Number of children types is: " + type.getChildren().size());
            containsAllBasePropertyDefinitions(typeDef);
        }

        log.info("... testGetSpecificTypeLimitedDepth() finished.");
View Full Code Here

        } catch (CmisInvalidArgumentException e) {
            log.info("getTypeDescendants() with unknown type raised expected exception: " + e);
        }

        try {
            TypeDefinition type = fRepSvc.getTypeDefinition(wrongRepositoryId, "CMISDocument", null);
            log.debug("getTypeDefinition(): " + type);
            fail("getTypeDefinition() with unknown repository id should throw exception.");
        } catch (CmisInvalidArgumentException e) {
            log.info("getTypeDefinition() with unknown repository id raised expected exception: " + e);
        }

        try {
            TypeDefinition type = fRepSvc.getTypeDefinition(repositoryId, wrongTypeId, null);
            log.debug("getTypeDefinition(): " + type);
            fail("getTypeDefinition() with unknown type should throw exception.");
        } catch (CmisObjectNotFoundException e) {
            log.info("getTypeDefinition() with unknown type raised expected exception: " + e);
        }
View Full Code Here

        log.info("starting testInheritedProperties()...");
        String repositoryId = getRepositoryId();
        String typeId = UnitTestTypeSystemCreator.TOPLEVEL_TYPE;

        // get top level type
        TypeDefinition typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
        assertNotNull(typeContainer);
        Map<String, PropertyDefinition<?>> propDefMap = typeContainer.getPropertyDefinitions();
        assertTrue(propDefMap.containsKey("StringPropTopLevel"));
        assertFalse(propDefMap.get("StringPropTopLevel").isInherited());
        assertFalse(propDefMap.containsKey("StringPropLevel1"));
        assertFalse(propDefMap.containsKey("StringPropLevel2"));
        containsAllBasePropertyDefinitions(typeContainer);

        // get level 1 type
        typeId = UnitTestTypeSystemCreator.LEVEL1_TYPE;
        typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
        assertNotNull(typeContainer);
        propDefMap = typeContainer.getPropertyDefinitions();
        assertTrue(propDefMap.containsKey("StringPropTopLevel"));
        assertTrue(propDefMap.get("StringPropTopLevel").isInherited());
        assertTrue(propDefMap.containsKey("StringPropLevel1"));
        assertFalse(propDefMap.get("StringPropLevel1").isInherited());
        assertFalse(propDefMap.containsKey("StringPropLevel2"));
        containsAllBasePropertyDefinitions(typeContainer);

        // get level 2 type
        typeId = UnitTestTypeSystemCreator.LEVEL2_TYPE;
        typeContainer = fRepSvc.getTypeDefinition(repositoryId, typeId, null);
        assertNotNull(typeContainer);
        propDefMap = typeContainer.getPropertyDefinitions();
        assertTrue(propDefMap.containsKey("StringPropTopLevel"));
        assertTrue(propDefMap.get("StringPropTopLevel").isInherited());
        assertTrue(propDefMap.containsKey("StringPropLevel1"));
        assertTrue(propDefMap.get("StringPropLevel1").isInherited());
        assertTrue(propDefMap.containsKey("StringPropLevel2"));
View Full Code Here

    private static List<TypeDefinition> createCmisDefaultTypes() {
        List<TypeDefinition> typesList = new LinkedList<TypeDefinition>();

        // create root types:
        TypeDefinition cmisType = InMemoryDocumentTypeDefinition.getRootDocumentType();
        typesList.add(cmisType);

        cmisType = InMemoryFolderTypeDefinition.getRootFolderType();
        typesList.add(cmisType);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.definitions.TypeDefinition

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.