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

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


       TypeValidator.validateAcl(typeDef, addACEs, removeACEs);

       // validate the allowed types of the relationship
       ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);

       TypeDefinition sourceTypeDef = fStoreManager.getTypeById(repositoryId, objStore.getObjectById(sourceId).getTypeId()).getTypeDefinition();
       TypeDefinition targetTypeDef = fStoreManager.getTypeById(repositoryId, objStore.getObjectById(targetId).getTypeId()).getTypeDefinition();
       TypeValidator.validateAllowedRelationshipTypes(typeDef,  sourceTypeDef, targetTypeDef);

        StoredObject storedObject = objStore.createRelationship( relationObjects[0], relationObjects[1],
                propMap, user, addACEs,  removeACEs);
        return storedObject;
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

            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // get parameters
        String typeId = getStringParameter(request, 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

                    + " could not be found, no types will be created.");
            return;
        }

        try {
            TypeDefinition typeDef = null;
            Unmarshaller u = InMemoryJaxbHelper.createUnmarshaller();
            JAXBElement<TypeDefinitions> types = (JAXBElement<TypeDefinitions>) u.unmarshal(is);
            for (CmisTypeDefinitionType td : types.getValue().getTypeDefinitions()) {
                LOG.debug("Found type in file: " + td.getLocalName());
                typeDef = Converter.convert(td);
                if (typeDef.getPropertyDefinitions() == null) {
                    ((AbstractTypeDefinition) typeDef)
                            .setPropertyDefinitions(new LinkedHashMap<String, PropertyDefinition<?>>());
                }
                tmc.addTypeDefinition(typeDef);
            }
View Full Code Here

        result.setList(new ArrayList<TypeDefinition>(feed.getEntries().size()));

        // get the children
        if (!feed.getEntries().isEmpty()) {
            for (AtomEntry entry : feed.getEntries()) {
                TypeDefinition child = null;

                lockTypeLinks();
                try {
                    // walk through the entry
                    for (AtomElement element : entry.getElements()) {
View Full Code Here

        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

                if (null == mapper)
                    throw new MapperException("Unknown mime type (no configuration): " + mimeType);
                String typeId = mapper.getMappedTypeId();
                if (null == typeId)
                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
                TypeDefinition td = session.getTypeDefinition(typeId);
                if (null == td)
                    throw new MapperException("CMIS type " + typeId + " does not exist on server.");

                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
                parser.extractMetadata(f, td);
                properties = parser.getCmisProperties();
            }
                       
            // check if there is an overridden content type configured
View Full Code Here

                String typeId = mapper.getMappedTypeId();
                if (null == typeId)
                    throw new MapperException("No CMIS type configured for mime type" + mimeType);
               
                // Session available? if yes do conversion
                TypeDefinition td = null;
                if (null!= session) {
                    session.getTypeDefinition(typeId);
                    if (null == td)
                        throw new MapperException("CMIS type " + typeId + " does not exist on server.");
                }
                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id: " + td.getId());
               
                parser.extractMetadata(f, td);
                Map<String, Object> properties = parser.getCmisProperties();
                for (String key : properties.keySet()) {
                    LOG.info("Found metadata tag " + key + "mapped to " + properties.get(key));
View Full Code Here

        }
        List<ObjectData> objDataList = new ArrayList<ObjectData>();
        Map<String, String> props = queryObj.getRequestedPropertiesByAlias();
        Map<String, String> funcs = queryObj.getRequestedFuncsByAlias();
        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

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.