jpotts / alfresco-developer-series

Source code from the ecmarchitect.com Alfresco Developer Series tutorials
Apache License 2.0
199 stars 231 forks source link

Webscript Tutorial with ACS 6.2 #40

Closed akreienbring closed 4 years ago

akreienbring commented 4 years ago

Digging my way through the tutorial I found a few things that I'd like to report here... Basically all minor things, but just to let you and maybe others know.

In the files rating.get.js and rating.delete.js the search wasn't working for me. So I changed var curNode = search.findNode("workspace://SpacesStore/" + args.id); to

var referenceType = "node"; 
var reference = ["workspace", "SpacesStore", args.id];   
var curNode = search.findNode(referenceType, reference);

As there is a webscript-context file I put the Java-backed controller <bean id="webscript.com.somco.ratings.rating.post" class="com.somco.scripts.PostRating" parent="webscript"> into it to separate the controller from the "normal" beans.

In the descriptor file rating.delete.desc.xml I changed

<url>/someco/rating/delete?id={id}</url>
<url>/someco/rating/delete.html?id={id}</url>

to

<url>/someco/rating?id={id}</url>
<url>/someco/rating?id={id}</url>

because this matches with the rest of the rating webscripts.

In rating.delete.html.ftl there is a quotation mark missing. So I changed <a href="${url.serviceContext}/binformed/rating2.html?id=${args.id}>Back to Ratings</a> to <a href="${url.serviceContext}/binformed/rating2.html?id=${args.id}">Back to Ratings</a>

No I'm looking forward to the workflow part :-) Which, as I saw, you have just updated!

jpotts commented 4 years ago

search.findNode with a string as the node reference works fine, so that is an unnecessary, but equivalent, change.

Moving the bean to a webscript-context.xml file is fine, but not necessary.

I agree that the delete URL is not consistent with the other URLs as written.

Good catch on the missing quote, I've just checked in a fix for that.

Thanks for reading the tutorials and for the feedback!