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

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


            i++;
        }

        // create properties
        PropertiesImpl result = new PropertiesImpl();

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

            PropertyData<?> propertyData = null;

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

            result.addProperty(propertyData);

            i++;
        }

        return result;
View Full Code Here


                }
            }
        }

        // create properties
        PropertiesImpl result = new PropertiesImpl();

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

            PropertyData<?> propertyData = null;

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

            result.addProperty(propertyData);

            i++;
        }

        return result;
View Full Code Here

        // file name
        String name = source.getName();

        // get properties
        PropertiesImpl sourceProperties = new PropertiesImpl();
        readCustomProperties(source, sourceProperties, null, new ObjectInfoImpl());

        // get the type id
        String typeId = getIdProperty(sourceProperties, PropertyIds.OBJECT_TYPE_ID);
        if (typeId == null) {
            typeId = TypeManager.DOCUMENT_TYPE_ID;
        }

        // copy properties
        PropertiesImpl newProperties = new PropertiesImpl();
        for (PropertyData<?> prop : sourceProperties.getProperties().values()) {
            if ((prop.getId().equals(PropertyIds.OBJECT_TYPE_ID)) || (prop.getId().equals(PropertyIds.CREATED_BY))
                    || (prop.getId().equals(PropertyIds.CREATION_DATE))
                    || (prop.getId().equals(PropertyIds.LAST_MODIFIED_BY))) {
                continue;
            }

            newProperties.addProperty(prop);
        }

        // replace properties
        if (properties != null) {
            // find new name
            String newName = getStringProperty(properties, PropertyIds.NAME);
            if (newName != null) {
                if (!isValidName(newName)) {
                    throw new CmisNameConstraintViolationException("Name is not valid!");
                }
                name = newName;
            }

            // get the property definitions
            TypeDefinition type = types.getType(typeId);
            if (type == null) {
                throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
            }

            // replace with new values
            for (PropertyData<?> prop : properties.getProperties().values()) {
                PropertyDefinition<?> propType = type.getPropertyDefinitions().get(prop.getId());

                // do we know that property?
                if (propType == null) {
                    throw new CmisConstraintException("Property '" + prop.getId() + "' is unknown!");
                }

                // can it be set?
                if ((propType.getUpdatability() != Updatability.READWRITE)) {
                    throw new CmisConstraintException("Property '" + prop.getId() + "' cannot be updated!");
                }

                // empty properties are invalid
                if (isEmptyProperty(prop)) {
                    throw new CmisConstraintException("Property '" + prop.getId() + "' must not be empty!");
                }

                newProperties.addProperty(prop);
            }
        }

        addPropertyId(newProperties, typeId, null, PropertyIds.OBJECT_TYPE_ID, typeId);
        addPropertyString(newProperties, typeId, null, PropertyIds.CREATED_BY, context.getUsername());
View Full Code Here

        if (isRename && !isValidName(newName)) {
            throw new CmisNameConstraintViolationException("Name is not valid!");
        }

        // get old properties
        PropertiesImpl oldProperties = new PropertiesImpl();
        readCustomProperties(file, oldProperties, null, new ObjectInfoImpl());

        // get the type id
        String typeId = getIdProperty(oldProperties, PropertyIds.OBJECT_TYPE_ID);
        if (typeId == null) {
View Full Code Here

            objectInfo.setWorkingCopyOriginalId(null);
        }

        // let's do it
        try {
            PropertiesImpl result = new PropertiesImpl();

            // id
            String id = fileToId(file);
            addPropertyId(result, typeId, filter, PropertyIds.OBJECT_ID, id);
            objectInfo.setId(id);
View Full Code Here

    /**
     * Checks and compiles a property set that can be written to disc.
     */
    private Properties compileProperties(String typeId, String creator, GregorianCalendar creationDate,
            String modifier, Properties properties) {
        PropertiesImpl result = new PropertiesImpl();
        Set<String> addedProps = new HashSet<String>();

        if ((properties == null) || (properties.getProperties() == null)) {
            throw new CmisConstraintException("No properties!");
        }

        // get the property definitions
        TypeDefinition type = types.getType(typeId);
        if (type == null) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
        }

        // check if all required properties are there
        for (PropertyData<?> prop : properties.getProperties().values()) {
            PropertyDefinition<?> propType = type.getPropertyDefinitions().get(prop.getId());

            // do we know that property?
            if (propType == null) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' is unknown!");
            }

            // can it be set?
            if ((propType.getUpdatability() == Updatability.READONLY)) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' is readonly!");
            }

            // empty properties are invalid
            if (isEmptyProperty(prop)) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' must not be empty!");
            }

            // add it
            result.addProperty(prop);
            addedProps.add(prop.getId());
        }

        // check if required properties are missing
        for (PropertyDefinition<?> propDef : type.getPropertyDefinitions().values()) {
View Full Code Here

    /**
     * Checks and updates a property set that can be written to disc.
     */
    private Properties updateProperties(String typeId, String creator, GregorianCalendar creationDate, String modifier,
            Properties oldProperties, Properties properties) {
        PropertiesImpl result = new PropertiesImpl();

        if (properties == null) {
            throw new CmisConstraintException("No properties!");
        }

        // get the property definitions
        TypeDefinition type = types.getType(typeId);
        if (type == null) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
        }

        // copy old properties
        for (PropertyData<?> prop : oldProperties.getProperties().values()) {
            PropertyDefinition<?> propType = type.getPropertyDefinitions().get(prop.getId());

            // do we know that property?
            if (propType == null) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' is unknown!");
            }

            // only add read/write properties
            if ((propType.getUpdatability() != Updatability.READWRITE)) {
                continue;
            }

            result.addProperty(prop);
        }

        // update properties
        for (PropertyData<?> prop : properties.getProperties().values()) {
            PropertyDefinition<?> propType = type.getPropertyDefinitions().get(prop.getId());

            // do we know that property?
            if (propType == null) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' is unknown!");
            }

            // can it be set?
            if ((propType.getUpdatability() == Updatability.READONLY)) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' is readonly!");
            }

            if ((propType.getUpdatability() == Updatability.ONCREATE)) {
                throw new CmisConstraintException("Property '" + prop.getId() + "' can only be set on create!");
            }

            // default or value
            if (isEmptyProperty(prop)) {
                addPropertyDefault(result, propType);
            } else {
                result.addProperty(prop);
            }
        }

        addPropertyId(result, typeId, null, PropertyIds.OBJECT_TYPE_ID, typeId);
        addPropertyString(result, typeId, null, PropertyIds.CREATED_BY, creator);
View Full Code Here

    public static Properties convertProperties(final Map<String, Object> json, final Map<String, Object> extJson) {
        if (json == null) {
            return null;
        }

        PropertiesImpl result = new PropertiesImpl();

        for (Object jsonProperty : json.values()) {
            Map<String, Object> jsonPropertyMap = getMap(jsonProperty);
            if (jsonPropertyMap != null) {
                AbstractPropertyData<?> property = null;

                String id = getString(jsonPropertyMap, JSON_PROPERTY_ID);
                if (id == null) {
                    throw new CmisRuntimeException("Invalid property!");
                }

                PropertyType propertyType = null;
                try {
                    propertyType = PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
                } catch (Exception e) {
                    throw new CmisRuntimeException("Invalid property: " + id);
                }

                Object value = jsonPropertyMap.get(JSON_PROPERTY_VALUE);
                List<Object> values = null;
                if (value instanceof List) {
                    values = (List<Object>) value;
                } else if (value != null) {
                    values = Collections.singletonList(value);
                }

                switch (propertyType) {
                case STRING:
                    property = new PropertyStringImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyStringImpl) property).setValues(propertyValues);
                    }
                    break;
                case ID:
                    property = new PropertyIdImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyIdImpl) property).setValues(propertyValues);
                    }
                    break;
                case BOOLEAN:
                    property = new PropertyBooleanImpl();
                    {
                        List<Boolean> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<Boolean>();
                            for (Object obj : values) {
                                if (obj instanceof Boolean) {
                                    propertyValues.add((Boolean) obj);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyBooleanImpl) property).setValues(propertyValues);
                    }
                    break;
                case INTEGER:
                    property = new PropertyIntegerImpl();
                    {
                        List<BigInteger> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<BigInteger>();
                            for (Object obj : values) {
                                if (obj instanceof BigInteger) {
                                    propertyValues.add((BigInteger) obj);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyIntegerImpl) property).setValues(propertyValues);
                    }
                    break;
                case DECIMAL:
                    property = new PropertyDecimalImpl();
                    {
                        List<BigDecimal> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<BigDecimal>();
                            for (Object obj : values) {
                                if (obj instanceof BigDecimal) {
                                    propertyValues.add((BigDecimal) obj);
                                } else if (obj instanceof BigInteger) {
                                    propertyValues.add(new BigDecimal((BigInteger) obj));
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyDecimalImpl) property).setValues(propertyValues);
                    }
                    break;
                case DATETIME:
                    property = new PropertyDateTimeImpl();
                    {
                        List<GregorianCalendar> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<GregorianCalendar>();
                            for (Object obj : values) {
                                if (obj instanceof Number) {
                                    GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
                                    cal.setTimeInMillis(((Number) obj).longValue());
                                    propertyValues.add(cal);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyDateTimeImpl) property).setValues(propertyValues);
                    }
                    break;
                case HTML:
                    property = new PropertyHtmlImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyHtmlImpl) property).setValues(propertyValues);
                    }
                    break;
                case URI:
                    property = new PropertyUriImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyUriImpl) property).setValues(propertyValues);
                    }
                    break;
                }

                property.setId(id);
                property.setDisplayName(getString(jsonPropertyMap, JSON_PROPERTY_DISPLAYNAME));
                property.setQueryName(getString(jsonPropertyMap, JSON_PROPERTY_QUERYNAME));
                property.setLocalName(getString(jsonPropertyMap, JSON_PROPERTY_LOCALNAME));

                convertExtension(jsonPropertyMap, property, PROPERTY_KEYS);

                result.addProperty(property);
            }
        }

        if (extJson != null) {
            convertExtension(extJson, result, Collections.<String> emptySet());
View Full Code Here

        TypeDefinition typeDef = null;
        if (json.get(PropertyIds.OBJECT_TYPE_ID) instanceof String) {
            typeDef = typeCache.getTypeDefinition((String) json.get(PropertyIds.OBJECT_TYPE_ID));
        }

        PropertiesImpl result = new PropertiesImpl();

        for (Map.Entry<String, Object> entry : json.entrySet()) {
            String id = entry.getKey();
            PropertyDefinition<?> propDef = (typeDef == null ? null : typeDef.getPropertyDefinitions().get(id));

            List<Object> values = null;
            if (entry.getValue() instanceof List) {
                values = (List<Object>) entry.getValue();
            } else if (entry.getValue() != null) {
                values = Collections.singletonList(entry.getValue());
            }

            AbstractPropertyData<?> property = null;

            if (propDef != null) {
                switch (propDef.getPropertyType()) {
                case STRING:
                    property = new PropertyStringImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyStringImpl) property).setValues(propertyValues);
                    }
                    break;
                case ID:
                    property = new PropertyIdImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyIdImpl) property).setValues(propertyValues);
                    }
                    break;
                case BOOLEAN:
                    property = new PropertyBooleanImpl();
                    {
                        List<Boolean> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<Boolean>();
                            for (Object obj : values) {
                                if (obj instanceof Boolean) {
                                    propertyValues.add((Boolean) obj);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyBooleanImpl) property).setValues(propertyValues);
                    }
                    break;
                case INTEGER:
                    property = new PropertyIntegerImpl();
                    {
                        List<BigInteger> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<BigInteger>();
                            for (Object obj : values) {
                                if (obj instanceof BigInteger) {
                                    propertyValues.add((BigInteger) obj);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyIntegerImpl) property).setValues(propertyValues);
                    }
                    break;
                case DECIMAL:
                    property = new PropertyDecimalImpl();
                    {
                        List<BigDecimal> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<BigDecimal>();
                            for (Object obj : values) {
                                if (obj instanceof BigDecimal) {
                                    propertyValues.add((BigDecimal) obj);
                                } else if (obj instanceof BigInteger) {
                                    propertyValues.add(new BigDecimal((BigInteger) obj));
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyDecimalImpl) property).setValues(propertyValues);
                    }
                    break;
                case DATETIME:
                    property = new PropertyDateTimeImpl();
                    {
                        List<GregorianCalendar> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<GregorianCalendar>();
                            for (Object obj : values) {
                                if (obj instanceof Number) {
                                    GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
                                    cal.setTimeInMillis(((Number) obj).longValue());
                                    propertyValues.add(cal);
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyDateTimeImpl) property).setValues(propertyValues);
                    }
                    break;
                case HTML:
                    property = new PropertyHtmlImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyHtmlImpl) property).setValues(propertyValues);
                    }
                    break;
                case URI:
                    property = new PropertyUriImpl();
                    {
                        List<String> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<String>();
                            for (Object obj : values) {
                                if (obj instanceof String) {
                                    propertyValues.add(obj.toString());
                                } else {
                                    throw new CmisRuntimeException("Invalid property value: " + obj);
                                }
                            }
                        }
                        ((PropertyUriImpl) property).setValues(propertyValues);
                    }
                    break;
                }

                property.setId(id);
                property.setDisplayName(propDef.getDisplayName());
                property.setQueryName(propDef.getQueryName());
                property.setLocalName(propDef.getLocalName());
            } else {
                // this else block should only be reached in rare circumstances
                // it may return incorrect types

                if (values == null) {
                    property = new PropertyStringImpl();
                    ((PropertyStringImpl) property).setValues(null);
                } else {
                    Object firstValue = values.get(0);
                    if (firstValue instanceof Boolean) {
                        property = new PropertyBooleanImpl();
                        List<Boolean> propertyValues = new ArrayList<Boolean>();
                        for (Object obj : values) {
                            if (obj instanceof Boolean) {
                                propertyValues.add((Boolean) obj);
                            } else {
                                throw new CmisRuntimeException("Invalid property value: " + obj);
                            }
                        }
                        ((PropertyBooleanImpl) property).setValues(propertyValues);
                    } else if (firstValue instanceof BigInteger) {
                        property = new PropertyIntegerImpl();
                        List<BigInteger> propertyValues = new ArrayList<BigInteger>();
                        for (Object obj : values) {
                            if (obj instanceof BigInteger) {
                                propertyValues.add((BigInteger) obj);
                            } else {
                                throw new CmisRuntimeException("Invalid property value: " + obj);
                            }
                        }
                        ((PropertyIntegerImpl) property).setValues(propertyValues);
                    } else if (firstValue instanceof BigDecimal) {
                        property = new PropertyDecimalImpl();
                        List<BigDecimal> propertyValues = new ArrayList<BigDecimal>();
                        for (Object obj : values) {
                            if (obj instanceof BigDecimal) {
                                propertyValues.add((BigDecimal) obj);
                            } else if (obj instanceof BigInteger) {
                                propertyValues.add(new BigDecimal((BigInteger) obj));
                            } else {
                                throw new CmisRuntimeException("Invalid property value: " + obj);
                            }
                        }
                        ((PropertyDecimalImpl) property).setValues(propertyValues);
                    } else {
                        property = new PropertyStringImpl();
                        List<String> propertyValues = new ArrayList<String>();
                        for (Object obj : values) {
                            if (obj instanceof String) {
                                propertyValues.add((String) obj);
                            } else {
                                throw new CmisRuntimeException("Invalid property value: " + obj);
                            }
                        }
                        ((PropertyStringImpl) property).setValues(propertyValues);
                    }
                }

                property.setId(id);
                property.setDisplayName(id);
                property.setQueryName(null);
                property.setLocalName(null);
            }

            result.addProperty(property);
        }

        if (extJson != null) {
            convertExtension(extJson, result, Collections.<String> emptySet());
        }
View Full Code Here

    public static Properties convertProperties(final Map<String, Object> json, final Map<String, Object> extJson) {
        if (json == null) {
            return null;
        }

        PropertiesImpl result = new PropertiesImpl();

        for (Object jsonProperty : json.values()) {
            Map<String, Object> jsonPropertyMap = getMap(jsonProperty);
            if (jsonPropertyMap != null) {
                AbstractPropertyData<?> property = null;

                String id = getString(jsonPropertyMap, JSON_PROPERTY_ID);
                String queryName = getString(jsonPropertyMap, JSON_PROPERTY_QUERYNAME);
                if (id == null && queryName == null) {
                    throw new CmisRuntimeException("Invalid property!");
                }

                PropertyType propertyType = null;
                try {
                    propertyType = PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
                } catch (Exception e) {
                    throw new CmisRuntimeException("Invalid property: " + id, e);
                }

                Object value = jsonPropertyMap.get(JSON_PROPERTY_VALUE);
                List<Object> values = null;
                if (value instanceof List) {
                    values = (List<Object>) value;
                } else if (value != null) {
                    values = Collections.singletonList(value);
                }

                switch (propertyType) {
                case STRING:
                    property = new PropertyStringImpl();
                    ((PropertyStringImpl) property).setValues(copyStringValues(values));
                    break;
                case ID:
                    property = new PropertyIdImpl();
                    ((PropertyIdImpl) property).setValues(copyStringValues(values));
                    break;
                case BOOLEAN:
                    property = new PropertyBooleanImpl();
                    ((PropertyBooleanImpl) property).setValues(copyBooleanValues(values));
                    break;
                case INTEGER:
                    property = new PropertyIntegerImpl();
                    ((PropertyIntegerImpl) property).setValues(copyIntegerValues(values));
                    break;
                case DECIMAL:
                    property = new PropertyDecimalImpl();
                    ((PropertyDecimalImpl) property).setValues(copyDecimalValues(values));
                    break;
                case DATETIME:
                    property = new PropertyDateTimeImpl();
                    ((PropertyDateTimeImpl) property).setValues(copyDateTimeValues(values));
                    break;
                case HTML:
                    property = new PropertyHtmlImpl();
                    ((PropertyHtmlImpl) property).setValues(copyStringValues(values));
                    break;
                case URI:
                    property = new PropertyUriImpl();
                    ((PropertyUriImpl) property).setValues(copyStringValues(values));
                    break;
                default:
                    throw new CmisRuntimeException("Unknown property type!");
                }

                property.setId(id);
                property.setDisplayName(getString(jsonPropertyMap, JSON_PROPERTY_DISPLAYNAME));
                property.setQueryName(queryName);
                property.setLocalName(getString(jsonPropertyMap, JSON_PROPERTY_LOCALNAME));

                convertExtension(jsonPropertyMap, property, PROPERTY_KEYS);

                result.addProperty(property);
            }
        }

        if (extJson != null) {
            convertExtension(extJson, result, Collections.<String> emptySet());
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.