Reputation: 525
Recently I'm working on adding metadata to file in Alfresco repository. I'm using following code:
AlfrescoDocument alfDoc = (AlfrescoDocument) doc;
Map<String, Object> aspectProperties = new HashMap<String, Object>();
aspectProperties.put("cm:description", "test1");
alfDoc.removeAspect("P:cm:titled");
alfDoc.addAspect("P:cm:titled", aspectProperties);
System.out.println(alfDoc.getProperties());
I can't get this one to work. It's possible to clear title with this one, but I can't just set one - description is blank. What am I doing wrong?
My libraries:
I'm using scraps of this java class:
Upvotes: 0
Views: 476
Reputation: 433
You should be using the updateProperties method as shown here if using Alfresco OpenCMIS extension OR if using Apache OpenCMIS then this
Unitl you don't explicitly call the updateProperties method it will not commit those changes on the repository side.
Upvotes: 1