use of org.alfresco.opencmis.CMISNodeInfoImpl in project alfresco-remote-api by Alfresco.
the class RepoService method getProperties.
/*
* Get (CMIS) node properties
*/
private Properties getProperties(NodeRef nodeRef) {
CMISNodeInfoImpl nodeInfo = cmisConnector.createNodeInfo(nodeRef);
final Properties properties = cmisConnector.getNodeProperties(nodeInfo, null);
// fake the title property, which CMIS doesn't give us
String title = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
final PropertyStringImpl titleProp = new PropertyStringImpl(ContentModel.PROP_TITLE.toString(), title);
Properties wrapProperties = new Properties() {
@Override
public List<CmisExtensionElement> getExtensions() {
return properties.getExtensions();
}
@Override
public void setExtensions(List<CmisExtensionElement> extensions) {
properties.setExtensions(extensions);
}
@Override
public Map<String, PropertyData<?>> getProperties() {
Map<String, PropertyData<?>> updatedProperties = new HashMap<String, PropertyData<?>>(properties.getProperties());
updatedProperties.put(titleProp.getId(), titleProp);
return updatedProperties;
}
@Override
public List<PropertyData<?>> getPropertyList() {
List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>(properties.getPropertyList());
propertyList.add(titleProp);
return propertyList;
}
};
return wrapProperties;
}
Aggregations