Search in sources :

Example 1 with CMISPropertyAccessor

use of org.alfresco.opencmis.dictionary.CMISPropertyAccessor in project alfresco-repository by Alfresco.

the class CMISConnector method getAssocProperties.

public Properties getAssocProperties(CMISNodeInfo info, String filter) {
    PropertiesImpl result = new PropertiesImpl();
    Set<String> filterSet = splitFilter(filter);
    for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties()) {
        PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition();
        if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName()))) {
            // skip properties that are not in the filter
            continue;
        }
        CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor();
        Serializable value = cmisPropertyAccessor.getValue(info);
        PropertyType propType = propDef.getPropertyType();
        PropertyData<?> propertyData = getProperty(propType, propDefWrap, value);
        result.addProperty(propertyData);
    }
    return result;
}
Also used : Serializable(java.io.Serializable) PropertyDefinitionWrapper(org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper) PropertiesImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl) CMISPropertyAccessor(org.alfresco.opencmis.dictionary.CMISPropertyAccessor) PropertyString(org.apache.chemistry.opencmis.commons.data.PropertyString) PropertyType(org.apache.chemistry.opencmis.commons.enums.PropertyType)

Aggregations

Serializable (java.io.Serializable)1 CMISPropertyAccessor (org.alfresco.opencmis.dictionary.CMISPropertyAccessor)1 PropertyDefinitionWrapper (org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper)1 PropertyString (org.apache.chemistry.opencmis.commons.data.PropertyString)1 PropertyType (org.apache.chemistry.opencmis.commons.enums.PropertyType)1 PropertiesImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl)1