cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the existing comment web scripts to post?

nancygaillard
Champ on-the-rise
Champ on-the-rise
Hello,

I have a problem to understand how to use especially the POST Web script (because of the use of comment.lib.js)
I need to understand how it works to implement a Aikau service which allows users to add comments everithings from a dialog form.

I am inspired by https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Tutorial7.md

In comparison with the POST web script of groups :
1 - github) url : /api/rootgroups/{shortName}
1 - me) url : /api/node/{store_type}/{store_id}/{id}/comments (I have not seen an other comment webscript to POST a comment)

2 - github) in the model we can see
displayName = json.get("displayName")
and
model.group = groups.createRootGroup(shortName, displayName);

2 - me) the model send us to comment.lib.js , so I gone on C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\repository\comments\comment.lib.ftl, but I seen nothing about adding or updating comments!!!

3 - github) in the custom service we have to write something like :
<blockcode>
this.serviceXhr({
    url: AlfConstants.PROXY_URI + "api/rootgroups/" + payload.shortName,
    method: "POST",
    data: {
      displayName: payload.displayName
    }
  });
</blockcode>
3 - me) i am not here ><

Thank you for future help!
1 REPLY 1

nancygaillard
Champ on-the-rise
Champ on-the-rise
I find it is worry to do that but, I can see any other way, so I am writing my own web script.