cancel
Showing results for 
Search instead for 
Did you mean: 

Java Backed Web Scripts

yvinodh
Champ in-the-making
Champ in-the-making
Hi all,

i am trying to execute the example in Java Backed Webscripts which is given in the below link..

http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#RandomSelectWebScript.java

In this example they have extended the AbstractRepositoryWebScript class. where is this class be available ? Do i want to include any jars files to execute this script..?

When i am trying to compile this java file.. i am getting the errors like this..

RandomSelectWebScript.java:23: cannot find symbol
symbol: class AbstractRepositoryWebScript
public class RandomSelectWebScript extends AbstractRepositoryWebScript
                                           ^
RandomSelectWebScript.java:42: cannot find symbol
symbol  : variable services
location: class org.alfresco.demoscripts.RandomSelectWebScript
        List<FileInfo> files = this.services.getFileFolderService().listFiles(rootNodeRef);
                               ^
RandomSelectWebScript.java:88: cannot find symbol
symbol  : variable repository
location: class org.alfresco.demoscripts.RandomSelectWebScript
                NodeRef companyHomeRef = this.repository.getCompanyHome();
                                         ^
RandomSelectWebScript.java:89: cannot find symbol
symbol  : method getFileFolderService()
location: class org.alfresco.demoscripts.RandomSelectWebScript
                nodeRef = getFileFolderService().resolveNamePath(companyHomeRef, pathElements).getNodeRef();
                          ^
RandomSelectWebScript.java:105: cannot find symbol
symbol  : variable services
location: class org.alfresco.demoscripts.RandomSelectWebScript
        ContentReader reader = this.services.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT);
                               ^
5 errors

What should i wanna do to execute this java file and run this script successfully…?


Thanks in Advance,
Vinodh
13 REPLIES 13

jego
Star Contributor
Star Contributor
Hello,

you can download the complete example under http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#Download_Scripts.
Jens

yvinodh
Champ in-the-making
Champ in-the-making
Hello..

Even i refered to that example from the site which you specified..
While executing that script, i got some errors which i specified above..
can u clarify my doubt.


Thanks in Advance,
Vinodh

risenhoover
Champ in-the-making
Champ in-the-making
Try replacing "AbstractRepositoryWebScript" with simply "AbstractWebScript".

denzil_fillis
Champ in-the-making
Champ in-the-making
Hi,

I am trying to implement the samples as indicated in http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples however I cannot find the AbstractRepositoryWebScript class. I have downloaded the Alfresco 3.2 SDK as well as 3.2r2 SDK. I would really appreciate any help as to where I can find the jar where these classes reside.

Any assistance is highly appreciated.

Best Regards
Denzil Fillis

mitpatoliya
Star Collaborator
Star Collaborator
There are two ways you can try.

1) Extend Declerativewebscript class instead of AbstractWebScript.
2) The other possiblity is you may have not added alfresco jar files to your class path.
    If you are compiling this class using build file then you need to add dependancy of alfresco sdk and add all the Jar files of Alfresco to your class path.

Hope this may solve your problem.

pingowingo
Champ in-the-making
Champ in-the-making
Hello,

I have the same problem:

I'm trying out the "Java-Backed Web Scripts tutorial http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples" example, SimpleWebScript.java, and I cannot locate the jar file(s) containing the following packages:

org.springframework.extensions.webscripts.AbstractWebScript;
org.springframework.extensions.webscripts.WebScriptException;
org.springframework.extensions.webscripts.WebScriptRequest;
org.springframework.extensions.webscripts.WebScriptResponse;

I've checked /tomcat/webapps/ROOT/WEB-INF/lib/, but it's not there.

Am I missing something? 
Thank you for any help provided.

mrogers
Star Contributor
Star Contributor
What version are you using? if >= 3.3 then you should have a spring-webscripts JAR somewhere.

flopez
Champ in-the-making
Champ in-the-making
Hi, I'm facing the same problem, the only available jar files are the following:

spring-webscripts-1.0.0.CI-SNAPSHOT-sources (3rd-party\src)
spring-webscripts-1.0.0.CI-SNAPSHOT-test-sources (3rd-party\src)
spring-webscripts-api-1.0.0.CI-SNAPSHOT-sources (3rd-party\src)

spring-webscripts-1.0.0.CI-SNAPSHOT-tests (3rd-party\lib\spring-surf)
spring-webscripts-1.0.0.CI-SNAPSHOT (3rd-party\lib\spring-surf)
spring-webscripts-api-1.0.0.CI-SNAPSHOT (3rd-party\lib\spring-surf)

spring-webscripts-1.0.0.CI-SNAPSHOT (\slingshot\build\assemble\WEB-INF\lib)
spring-webscripts-api-1.0.0.CI-SNAPSHOT (\slingshot\build\assemble\WEB-INF\lib)

spring-webscripts-1.0.0.CI-SNAPSHOT (\web-client\build\assemble\WEB-INF\lib)
spring-webscripts-api-1.0.0.CI-SNAPSHOT (\web-client\build\assemble\WEB-INF\lib)


But none of the above seem to do the trick when added to the build path… still no success on how to import correctly:

org.alfresco.web.scripts.WebScriptException;
org.alfresco.web.scripts.WebScriptRequest;
org.alfresco.web.scripts.WebScriptResponse;


And how to extend from:

AbstractRepositoryWebScript

No success on finding out what's the >3.3 equivalent to this classes and jar files on the current revision

Has anyone been able to succeed on making this examples work? any help would be appreciated

thanks

mrogers
Star Contributor
Star Contributor