As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
I followed this tutorial (https://ohej.github.io/alfresco-tutorials/tutorial/aikau/tutorial.html#bringing-it-all-together) to create the custom ajaxWidget. everything went good using this url in the js file :
var url = Alfresco.constants.PROXY_URI + "slingshot/doclib/treenode/node/alfresco/company/home";
but when I tried another one from my own webscript that return a json response, I got no results ?<br><br>
I tried
var url = Alfresco.constants.PROXY_URI + "test/file.json" andurl = "alfresco/s/test/file.json"
"
It seems that, you have created custom webscript, can you please add the code for same.
Yes I did, and I am trying to use the url of the webscript instead of the one used in the tutorial, and the webscript works good, here is the code :
public class GetAll extends DeclarativeWebScript { protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { Map<String, Object> model = new HashMap<String, Object>();
model.put("firstname", "firstname",);model.put("lastname", "lastname",); model.put("username", "username"); return model; }
}
ftl file : {"test" : [
{ "username" : "${username}","firstname" : "${firstname}",
"lastname" : "${lastname}", } ]}
desc file :
<webscript> <shortname>Some shortname</shortname> <description>some desc</description> <url>/test/file.html</url> <url>/test/file.json</url> <authentication>user</authentication> <format default="json"></format></webscript>and I changed the name and description used in the tuto by username and firstname.Thanks.
It seems that you missed back end bean , which is used for creating webscript.Its for linking controller to ftl.You can look in to below link for more details on repository webscript.
http://www.krutikjayswal.com/2016/10/alfresco-webscript-spring-webscript.html
No I didn't miss the bean, the webscript is working correctly, and i get the results when I navigate to alfresco/s/test/file.json .Thanks.