07-17-2014 01:11 PM
private static void changeProperties(String id, String propertyName, String propertyValue)
{
AlfrescoDocument alfDoc = (AlfrescoDocument) session.getObject(id);
PropertiesImpl properties = new PropertiesImpl();
List<CmisExtensionElement> extensions = new ArrayList<CmisExtensionElement>();
CmisExtensionElement valueElem = new CmisExtensionElementImpl(
ALFRESCO_EXTENSION_NAMESPACE, VALUE, null, propertyValue);
List<CmisExtensionElement> valueElems = new ArrayList<CmisExtensionElement>();
valueElems.add(valueElem);
List<CmisExtensionElement> children = new ArrayList<CmisExtensionElement>();
Map<String, String> attributes = new HashMap<String, String>();
attributes.put(PROPERTY_DEFINITION_ID, propertyName);
children.add(new CmisExtensionElementImpl(ALFRESCO_EXTENSION_NAMESPACE,
PROPERTY_STRING, attributes, valueElems));
List<CmisExtensionElement> propertyValuesExtension = new ArrayList<CmisExtensionElement>();
propertyValuesExtension.add(new CmisExtensionElementImpl(
ALFRESCO_EXTENSION_NAMESPACE, PROPERTIES, null, children));
CmisExtensionElement setAspectsExtension = new CmisExtensionElementImpl(
ALFRESCO_EXTENSION_NAMESPACE, SET_ASPECTS, null,
propertyValuesExtension);
extensions.add(setAspectsExtension);
properties.setExtensions(extensions);
String repId = session.getRepositoryInfo().getId();
Holder<String> objectIdHolder = new Holder<String>(alfDoc.getId());
session.getBinding().getObjectService().updateProperties(repId, objectIdHolder, null, properties, null);
log.debug((alfDoc.getPropertyValue(propertyName)).toString());
}
07-18-2014 11:38 AM
07-23-2014 08:43 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.