cancel
Showing results for 
Search instead for 
Did you mean: 

How to invoke/call java backed code from web scripts in alfresco

naveenv449
Confirmed Champ
Confirmed Champ
Hi everyone,
             I am new to Alfresco and learning it now. I just wanted to know how to call a java backed code from a webscript. I have a java code. I want to invoke it from the web script written in *.js file. Like, I will create a new rule and execute a .js file, then that java backed code should be called. How to do this?  Thanks in advance.
5 REPLIES 5

lementree
Champ on-the-rise
Champ on-the-rise
Hi,

You can extend the Alfresco Javascript to call you custom java code.

follow tha link http://wiki.alfresco.com/wiki/4.0_JavaScript_API#Native_Java_API_Access

romschn
Star Collaborator
Star Collaborator
Hi Naveen,

You are trying to do two different things over here. At one place you are mentioning about writing a webscript and secondly you are mentioning about executing a js from the business rule. Both are two different things.
What is exactly you are trying to do? Looking at your post, it appears that you are more interested to execute the javascript (which will execute java code) from the business rule configured.
In order to execute java code from the business rule - there are two approaches you can take -
1. Write a custom action in alfresco and invoke it from business rule.
2. Execute java code from javascript and execute the javascript from business rule. In order to do that - you will have to write custom java script extension. Here are the steps in brief to help you with that. https://forums.alfresco.com/comment/146025#comment-146025

Hope this helps.

Thank you soo much Sagar and Ramesh. Got some understanding and working on it.

naveenv449
Confirmed Champ
Confirmed Champ
Thank you soo much Sagar and Ramesh. Got some understanding and working on it.

mbee
Champ in-the-making
Champ in-the-making