cancel
Showing results for 
Search instead for 
Did you mean: 

Ajax call

dlloret
Champ in-the-making
Champ in-the-making
I'm using Alfresco Community - v3.4.0 and and when uploading a file I want to notify an external website, I'm trying to through an action in the folder and run a script, but I dont know how to make an ajax call, or something similar, within that script. The variables document, status and window are not defined (Error: Failed to execute script 'workspace://SpacesStore/6a3c9990-6fc2-4cf9-bdd5-3c56fd064c95': 07211345 ReferenceError: "status" is not defined (workspace. // SpacesStore / …), and I wonder if this is the best way…

Any help?

Thank you
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
Alfresco use Rhino JavaScript Engine for Java to implement javascript api ,by default Rhino dose not have ajax capability.
So I recommend you to use other options ,for example implment a java action,in your action use apache common http client to make a http request.

dlloret
Champ in-the-making
Champ in-the-making
Hi kaynezhang, thanks for the help.

Finally I extended of Rhino functionality, I found this page:
http://www.unorganizedmachines.com/site/software-and-technology/34-software-development/97-calling-w...

I followed the steps and it works.