AnsweredAssumed Answered

Adding an aspect to Alfresco node comments?

Question asked by sepgs2004 on Sep 14, 2018
Latest reply on Sep 27, 2018 by sepgs2004


We are using node/alfresco comments feature.

What is the comment feature that I am referring to?

If we go to Share UI, and go to edit a document, we will see comments way below. There, we can add, edit or delete comments of a document.


For now, our application communicates with (or accesses documents in) Alfresco repository through CMIS and Rest API. We use CMIS API for all the regular document access.

Since CMIS API does not support the "alfresco comments feature", we use Rest API to access some existing web-scripts to access the document comments.



Our requirement is to attach our application's (native) user info on the document comments. This would tell us which of our application user added a comment on the document.



From recommendations by some experts here in this forum, I have created a custom aspect with the user and date property. This aspect is deployed and available to access (through code I believe).

Experts recommended me to write a special web-script that adds (or attaches) this aspect to a comment node. Then the plan is to access this web-script through Rest API.

While learning web scripts, I have practiced writing some simple "hello world" kind of web-scripts using Javascript.

Also, we have Alfresco 5.2 community.



It looks like we have Javascript or Java-backed web-scripts. Having a hard time figuring the choice.


Do you have (online) reference to any sample (web-script) code that adds an aspect to a node or to a comment node?


Any guidance is appreciated.