cancel
Showing results for 
Search instead for 
Did you mean: 

Call a repo webscript from a js file through scheduled action

kavilash23
Champ on-the-rise
Champ on-the-rise
Hi Guys,

I have written a javascript file which calls a webscript and have configured a scheduled action to run that script.

I have enable the 'remote' object for alfresco (its enabled only for share OOTB)and my script runs fine when run from the javascript console in Share but fails when run through the schedule action complaining that 'remote' is not defined.


var url = "http://localhost:8080/alfresco/service/api/audit/query/AuditExampleLogin
var theUrl = "/api/audit/query/AuditExampleLogin2?verbose=true";
var json = remote.call(theUrl);
//var connector = remote.connect("http");
//var json = connector.call(url);
logger.log(json);

Can someone please advice?

Kind Regards,

Kavi
2 REPLIES 2

romschn
Star Collaborator
Star Collaborator
Is there any specific reason for invoking webscript from js and then calling js from schedule action? If not then you can directly make a call to the webscript from your scheduled action implementation.

Hope this helps.

Hi Ramesh,

The reason for using the js is that the json obtained from the calling the webscript needs some processing to be presented as a report.

Kind Regards,

Kavi