Examples of TypeDefinition


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

    /**
     * Returns if the test repository supports relationships.
     */
    protected boolean supportsRelationships() {
        TypeDefinition relType = null;

        try {
            relType = getBinding().getRepositoryService().getTypeDefinition(getTestRepositoryId(), "cmis:relationship",
                    null);
        } catch (CmisObjectNotFoundException e) {
View Full Code Here

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

    /**
     * Returns if the test repository supports policies.
     */
    protected boolean supportsPolicies() {
        TypeDefinition relType = null;

        try {
            relType = getBinding().getRepositoryService().getTypeDefinition(getTestRepositoryId(), "cmis:policy", null);
        } catch (CmisObjectNotFoundException e) {
            return false;
View Full Code Here

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

    /**
     * Returns a type definition.
     */
    protected TypeDefinition getTypeDefinition(String typeName) {
        TypeDefinition typeDef = getBinding().getRepositoryService().getTypeDefinition(getTestRepositoryId(), typeName,
                null);

        assertNotNull(typeDef);
        assertNotNull(typeDef.getId());

        return typeDef;
    }
View Full Code Here

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

    /**
     * Returns if the type is versionable.
     */
    protected boolean isVersionable(String typeName) {
        TypeDefinition type = getTypeDefinition(typeName);

        assertTrue(type instanceof DocumentTypeDefinition);

        Boolean isVersionable = ((DocumentTypeDefinition) type).isVersionable();
        assertNotNull(isVersionable);
View Full Code Here

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

            if (typeId == null) {
                throw new CmisInvalidArgumentException(PropertyIds.OBJECT_TYPE_ID + " not set!");
            }
        }

        TypeDefinition typeDef = typeCache.getTypeDefinition(typeId);
        if (typeDef == null) {
            throw new CmisInvalidArgumentException("Invalid type: " + typeId);
        }

        PropertiesImpl result = new PropertiesImpl();

        int i = 0;
        for (String propertyId : propertyIds) {
            PropertyDefinition<?> propDef = typeDef.getPropertyDefinitions().get(propertyId);
            if (propDef == null) {
                throw new CmisInvalidArgumentException(propertyId + " is unknown!");
            }

            PropertyData<?> propertyData = null;
View Full Code Here

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

        if (entry.getId() == null) {
            throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
        }

        lockTypeLinks();
        TypeDefinition result = null;
        try {
            // clean up cache
            removeTypeLinks(repositoryId, entry.getId());

            // walk through the entry
View Full Code Here

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

            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // get parameters
        String typeId = getStringParameter(request, Constants.PARAM_TYPE_ID);

        // execute
        TypeDefinition type = service.getTypeDefinition(repositoryId, typeId, null);
        JSONObject jsonType = JSONConverter.convert(type);

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(jsonType, request, response);
    }
View Full Code Here

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

    public void run(Session session) {
        CmisTestResult failure;

        // document
        try {
            TypeDefinition documentType = session.getTypeDefinition(BaseTypeId.CMIS_DOCUMENT.value());
            addResult(checkTypeDefinition(session, documentType, "Document type spec compliance."));

            failure = createResult(FAILURE, "Document type has the wrong base type: " + documentType.getBaseTypeId());
            addResult(assertEquals(BaseTypeId.CMIS_DOCUMENT, documentType.getBaseTypeId(), null, failure));
        } catch (CmisObjectNotFoundException e) {
            addResult(createResult(FAILURE, "Document type not available!", e, false));
        }

        // folder
        try {
            TypeDefinition folderType = session.getTypeDefinition(BaseTypeId.CMIS_FOLDER.value());

            addResult(checkTypeDefinition(session, folderType, "Folder type spec compliance."));

            failure = createResult(FAILURE, "Folder type has the wrong base type: " + folderType.getBaseTypeId());
            addResult(assertEquals(BaseTypeId.CMIS_FOLDER, folderType.getBaseTypeId(), null, failure));
        } catch (CmisObjectNotFoundException e) {
            addResult(createResult(FAILURE, "Folder type not available!", e, false));
        }

        // relationship
        try {
            TypeDefinition relationshipType = session.getTypeDefinition(BaseTypeId.CMIS_RELATIONSHIP.value());
            addResult(checkTypeDefinition(session, relationshipType, "Relationship type spec compliance."));

            failure = createResult(FAILURE,
                    "Relationship type has the wrong base type: " + relationshipType.getBaseTypeId());
            addResult(assertEquals(BaseTypeId.CMIS_RELATIONSHIP, relationshipType.getBaseTypeId(), null, failure));
        } catch (CmisObjectNotFoundException e) {
            addResult(createResult(WARNING, "Relationship type not available!", e, false));
        }

        // policy
        try {
            TypeDefinition policyType = session.getTypeDefinition(BaseTypeId.CMIS_POLICY.value());
            addResult(checkTypeDefinition(session, policyType, "Policy type spec compliance."));

            failure = createResult(FAILURE, "Policy type has the wrong base type: " + policyType.getBaseTypeId());
            addResult(assertEquals(BaseTypeId.CMIS_POLICY, policyType.getBaseTypeId(), null, failure));
        } catch (CmisObjectNotFoundException e) {
            addResult(createResult(WARNING, "Policy type not available!", e, false));
        }

        int numOfTypes = runTypeChecks(session, session.getTypeDescendants(null, -1, true));
View Full Code Here

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

                // clear the cache to ensure that the type definition is
                // reloaded from the repository
                session.clear();

                try {
                    TypeDefinition reloadedType = session.getTypeDefinition(tree.getItem().getId());

                    addResult(checkTypeDefinition(session, reloadedType, "Type spec compliance: "
                            + (reloadedType == null ? "?" : reloadedType.getId())));

                    failure = createResult(FAILURE,
                            "Type fetched via getTypeDescendants() is does not macth type fetched via getTypeDefinition(): "
                                    + tree.getItem().getId());
                    addResult(assertEquals(tree.getItem(), reloadedType, null, failure));
View Full Code Here

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

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, name);
        properties.put(PropertyIds.OBJECT_TYPE_ID, objectTypeId);

        TypeDefinition type = session.getTypeDefinition(objectTypeId);
        if (!(type instanceof DocumentTypeDefinition)) {
            addResult(createResult(FAILURE, "Type is not a document type! Type: " + objectTypeId, true));
            return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.