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

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


            ObjectInFolderDataImpl oifd = new ObjectInFolderDataImpl();
            if (includePathSegments != null && includePathSegments) {
                oifd.setPathSegment(spo.getName());
            }

            TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, spo.getTypeId()).getTypeDefinition();
            ObjectData objectData = PropertyCreationHelper.getObjectData(typeDef, spo, filter, user, includeAllowableActions,
                    includeRelationships, renditionFilter, false, true, null);

            oifd.setObject(objectData);
            folderList.add(oifd);
View Full Code Here


            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

    public void checkOut(CallContext context, String repositoryId, Holder<String> objectId,
            ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHandler objectInfos) {

        StoredObject so = validator.checkOut(context, repositoryId, objectId, extension, contentCopied);

        TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
        if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)) {
            throw new CmisNotSupportedException("Only documents can be checked-out.");
        } else if (!((DocumentTypeDefinition) typeDef).isVersionable()) {
            throw new CmisNotSupportedException("Object can't be checked-out, type is not versionable.");
        }
View Full Code Here

            throw new CmisInvalidArgumentException("Object is not instance of a document (version series)");
        }

        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);

        TypeDefinition td = fStoreManager.getTypeById(repositoryId, latestVersionObject.getTypeId()).getTypeDefinition();
        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, td,
                requestedIds, true);

        return props;
    }
View Full Code Here

    /**
     * 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

    /**
     * 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

    /**
     * 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

    /**
     * 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

            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

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.