cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a custom web script using a custom action

sankatha
Champ in-the-making
Champ in-the-making
Hi All. I am new to Alfresco and I am trying to execute a webscript from a custom action. Don't have much of an idea of how to do this. Therefore any kind of lead or help will be highly appreciated. Oh !!! by the way I am using alfresco 3.3.3  Smiley Very Happy . Thanks
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
Alfresco doesn't provide you any method to execute a webscript from a custom action.
You can execute an action from a WebScript:
http://wiki.alfresco.com/wiki/3.4_JavaScript_API#Actions_API

Or you can execute a script from a custom action (ScriptAction):
http://wiki.alfresco.com/wiki/3.4_JavaScript_API#ScriptAction_API

Probably you are confused because the same Javascript API of Alfresco is used for WebScripts and for Action Scripts.

More info about the JavaScript API:
http://wiki.alfresco.com/wiki/JavaScript_API

A WebScript is a REST-based action so this means that you can call this using directly the HTTP protocol.
An action can be triggered from a WebScript call, from a Rule call or programmatically using the Javascript API, the Foundation API or  the SOAP API of Alfresco.

If you need to execute a WebScript from an action, you need to implement by yourself the HTTP call, for example using HttpClient in Java. But I suggest you to study all the Alfresco architecture before starting to do this type of integrations.
Usually you don't need to call a WebScript from an action, this means that you are loosing all the good choices that you can follow with Alfresco.

Hope this helps.