Package org.apache.chemistry.opencmis.commons.impl.dataobjects

Examples of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl


    public static Properties convert(CmisPropertiesType properties) {
        if (properties == null) {
            return null;
        }

        PropertiesImpl result = new PropertiesImpl();

        for (CmisProperty property : properties.getProperty()) {
            result.addProperty(convert(property));
        }

        // handle extensions
        convertExtension(properties, result);
View Full Code Here


        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;

            if (singleValuePropertyMap.containsKey(i)) {
                propertyData = createPropertyData(propDef, singleValuePropertyMap.get(i));
            } else if (multiValuePropertyMap.containsKey(i)) {
                propertyData = createPropertyData(propDef, controlParser.getValues(CONTROL_PROP_VALUE, i));
            } else {
                propertyData = createPropertyData(propDef, null);
            }

            result.addProperty(propertyData);

            i++;
        }

        return result;
View Full Code Here

        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;

            if (singleValuePropertyMap.containsKey(i)) {
                propertyData = createPropertyData(propDef, singleValuePropertyMap.get(i));
            } else if (multiValuePropertyMap.containsKey(i)) {
                propertyData = createPropertyData(propDef, controlParser.getValues(CONTROL_PROP_VALUE, i));
            } else {
                propertyData = createPropertyData(propDef, null);
            }

            result.addProperty(propertyData);

            i++;
        }

        return result;
View Full Code Here

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter("*");

        Properties existingProps = PropertyCreationHelper.getPropertiesFromObject(so, td, requestedIds, true);

        PropertiesImpl newPD = new PropertiesImpl();
        // copy all existing properties
        for (PropertyData<?> prop : existingProps.getProperties().values()) {
            newPD.addProperty(prop);
        }

        if (null != properties)
            // overwrite all new properties
            for (PropertyData<?> prop : properties.getProperties().values()) {
                newPD.addProperty(prop);
            }

        String res = createDocument(context, repositoryId, newPD, folderId, content, versioningState, policies,
                addAces, removeAces, null);
        LOG.debug("stop createDocumentFromSource()");
View Full Code Here

        TypeValidator.validateVersionStateForCreate((DocumentTypeDefinition) typeDef, versioningState);

        // set properties that are not set but have a default:
        Map<String, PropertyData<?>> propMapNew = setDefaultProperties(typeDef, propMap);
        if (propMapNew != propMap) {
            properties = new PropertiesImpl(propMapNew.values());
            propMap = propMapNew;
        }

        TypeValidator.validateProperties(typeDef, properties, true);
View Full Code Here

        }

        Map<String, PropertyData<?>> propMap = properties.getProperties();
        Map<String, PropertyData<?>> propMapNew = setDefaultProperties(typeDef, propMap);
        if (propMapNew != propMap) {
            properties = new PropertiesImpl(propMapNew.values());
        }

        TypeValidator.validateProperties(typeDef, properties, true);

        // validate ACL
View Full Code Here

       // set default properties
       Map<String, PropertyData<?>> propMap = properties.getProperties();
       Map<String, PropertyData<?>> propMapNew = setDefaultProperties(typeDef, propMap);
       if (propMapNew != propMap) {
           properties = new PropertiesImpl(propMapNew.values());
       }

       TypeValidator.validateProperties(typeDef, properties, true);

       // validate ACL
View Full Code Here

            PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100));
            // fixed dummy value
            mappedProperties.put(funcEntry.getValue(), pi);
        }

        Properties props = new PropertiesImpl(mappedProperties.values());
        return props;
    }
View Full Code Here

        // build properties collection
        List<String> requestedIds = FilterParser.getRequestedIdsFromFilter("*");

        Properties existingProps = PropertyCreationHelper.getPropertiesFromObject(so, td, requestedIds, true);

        PropertiesImpl newPD = new PropertiesImpl();
        // copy all existing properties
        for (PropertyData<?> prop : existingProps.getProperties().values()) {
            newPD.addProperty(prop);
        }

        if (null != properties)
            // overwrite all new properties
            for (PropertyData<?> prop : properties.getProperties().values()) {
                newPD.addProperty(prop);
            }

        String res = createDocument(context, repositoryId, newPD, folderId, content, versioningState, policies,
                addAces, removeAces, null);
        LOG.debug("stop createDocumentFromSource()");
View Full Code Here

        TypeValidator.validateVersionStateForCreate((DocumentTypeDefinition) typeDef, versioningState);

        // set properties that are not set but have a default:
        Map<String, PropertyData<?>> propMapNew = setDefaultProperties(typeDef, propMap);
        if (propMapNew != propMap) {
            properties = new PropertiesImpl(propMapNew.values());
            propMap = propMapNew;
        }

        TypeValidator.validateProperties(typeDef, properties, true);
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl

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.