Search in sources :

Example 1 with CmisPropertyHtmlDefinitionImpl

use of com.pogeyan.cmis.api.data.common.CmisPropertyHtmlDefinitionImpl in project copper-cms by PogeyanOSS.

the class MTypeObject method getPropertyDefinitions.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Map<String, PropertyDefinition<?>> getPropertyDefinitions() {
    Map<String, PropertyDefinition<?>> map = new LinkedHashMap<String, PropertyDefinition<?>>();
    if (propertyDefinition != null) {
        Set<Entry<String, MongoPropertyDefinition<?>>> data = propertyDefinition.entrySet();
        for (Map.Entry<String, MongoPropertyDefinition<?>> propertiesValues : data) {
            String id = propertiesValues.getKey();
            PropertyDefinitionImpl<?> valueName = propertiesValues.getValue();
            String propertyType = valueName.getPropertyType().toString();
            if (propertyType.equalsIgnoreCase("string")) {
                CmisPropertyStringDefinitionImpl propertyValue = new CmisPropertyStringDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("boolean")) {
                CmisPropertyBooleanDefinitionImpl propertyValue = new CmisPropertyBooleanDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("id")) {
                CmisPropertyIdDefinitionImpl propertyValue = new CmisPropertyIdDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("datetime")) {
                CmisPropertyDateTimeDefinitionImpl propertyValue = new CmisPropertyDateTimeDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("decimal")) {
                CmisPropertyDecimalDefinitionImpl propertyValue = new CmisPropertyDecimalDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("html")) {
                CmisPropertyHtmlDefinitionImpl propertyValue = new CmisPropertyHtmlDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("uri")) {
                CmisPropertyUriDefinitionImpl propertyValue = new CmisPropertyUriDefinitionImpl(valueName);
                map.put(id, propertyValue);
            } else if (propertyType.equalsIgnoreCase("integer")) {
                CmisPropertyIntegerDefinitionImpl propertyValue = new CmisPropertyIntegerDefinitionImpl(valueName);
                map.put(id, propertyValue);
            }
        }
    }
    return map;
}
Also used : CmisPropertyIdDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyIdDefinitionImpl) CmisPropertyIntegerDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyIntegerDefinitionImpl) CmisPropertyDateTimeDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyDateTimeDefinitionImpl) PropertyDefinition(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition) CmisPropertyBooleanDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyBooleanDefinitionImpl) LinkedHashMap(java.util.LinkedHashMap) Entry(java.util.Map.Entry) CmisPropertyUriDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyUriDefinitionImpl) CmisPropertyHtmlDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyHtmlDefinitionImpl) CmisPropertyStringDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyStringDefinitionImpl) CmisPropertyDecimalDefinitionImpl(com.pogeyan.cmis.api.data.common.CmisPropertyDecimalDefinitionImpl) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

CmisPropertyBooleanDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyBooleanDefinitionImpl)1 CmisPropertyDateTimeDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyDateTimeDefinitionImpl)1 CmisPropertyDecimalDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyDecimalDefinitionImpl)1 CmisPropertyHtmlDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyHtmlDefinitionImpl)1 CmisPropertyIdDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyIdDefinitionImpl)1 CmisPropertyIntegerDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyIntegerDefinitionImpl)1 CmisPropertyStringDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyStringDefinitionImpl)1 CmisPropertyUriDefinitionImpl (com.pogeyan.cmis.api.data.common.CmisPropertyUriDefinitionImpl)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 PropertyDefinition (org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition)1