cancel
Showing results for 
Search instead for 
Did you mean: 

How to update document property added from aspect

mateuszk
Champ in-the-making
Champ in-the-making

Generally I want to upload new document with custom property. I have found solution how to do this. Firstly I need to create aspect with property and create rule that assigns aspect to new document. Next step is to set aspect property value to uploaded file. It's very simple when we do it with CMIS in JAVA but I wan't to use JAVA. I want to do it with one HTTP request. 

How can I do it with REST?

Nowhere I can find tips how to do this.

1 ACCEPTED ANSWER

marktielemans
Confirmed Champ
Confirmed Champ

See the reference for updateNode: Alfresco Content Services REST API Explorer . I'm assuming this'll work with custom properties, though I haven't actually tried it out.

View answer in original post

3 REPLIES 3

marktielemans
Confirmed Champ
Confirmed Champ

See the reference for updateNode: Alfresco Content Services REST API Explorer . I'm assuming this'll work with custom properties, though I haven't actually tried it out.

Yes it works! Thank you.


I have found another solution with cmis that not require setting rules. It allows to add aspect and set value simultaneously.

      <alf:setAspects>
               <alf:aspectsToAdd>P:testowy:test</alf:aspectsToAdd>
               <alfSmiley Tongueroperties>
                  <cmisSmiley TongueropertyString propertyDefinitionId="property:name"><cmis:value>Property value</cmis:value></cmisSmiley TongueropertyString>
               </alfSmiley Tongueroperties>
            </alf:setAspects>
@edit
Your answer gives it too. I wasted a lot of time.

Glad to hear it works!

Free tip: when working with CMIS, it's usually more convenient to use a Java CMIS client library and let that take care of all the XML messaging for you.

Java Clients | Alfresco Documentation