cancel
Showing results for 
Search instead for 
Did you mean: 

java Backed web script help

faisal
Champ in-the-making
Champ in-the-making
Hi everyone…. I was just trying to run a sample java backed web script…. When I copy pasted the SimpleWebScript Example from alfresco wiki to eclipse where My SDk is set up… It Fails to find the class org.alfresco.web.scripts.AbstractWebScript… as a result shows an error message in import org.alfresco.web.scripts.AbstractWebScript line… Is there any other jar files i need to add… I have already added all the jars in alfresco embedded and alfresco remote.. and all the other examples ran fine.. I just failed to create the class file of the simplewebscrpt…. Can any body tell me what to do… I need to figure this out quickly… Any help pleaseee….

Thanking Everyone Faisal
4 REPLIES 4

t_broyer
Champ in-the-making
Champ in-the-making
In Alfresco versions prior to 3.0, this class lives in the alfresco-web-client.jar.
In Alfresco 3.0 onwards, you'll find it in alfresco-webscript-framework.jar.

faisal
Champ in-the-making
Champ in-the-making
Hi thanx a lot for u r reply the other day. Now i ran into another problem. I was trying to add users into alfresco using web scripts. To do that I need to get hold of the peopleService bean. As a result I was trying to get hold of the webApplicationContext of alfresco from the webscripts.

To do that I was trying to use

WebApplicationContext configurationApplicationContext= WebApplicationContextUtils.getWebApplicationContext(this.getWebScriptRegistry().getContext());

But it was not telling me getWebScriptRegistry() does not exist even though it is there in the api at

http://dev.alfresco.com/resource/docs/java/web-client/org/alfresco/web/scripts/AbstractWebScript.htm...

Can you anyone plz tell me how to get around it. Is this funtion no longer there in version 3.0 ? If it is not then how do I get hold of the webapplicationContext from a web script.

Thanking You
Faisal

mrogers
Star Contributor
Star Contributor
The usual way of obtaining services in Java Backed scripts is to inject references via Spring.

faisal
Champ in-the-making
Champ in-the-making
Thanx a lot… I got my webscripts working using your r suggestions