Alfresco Share - Develop a webscript in JAVA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2011 05:28 AM
I would try to create a new webscript in JAVA not in Javascript only in Alfreso Share.
I try to refer to the link below :
http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples
and especially about the locations files in Share :
.jar file in <tomcat>/webapps/share/WEB-INF/lib or .class files in <Alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/<class folder structure>
web-scripts-application-context.xml - <tomcat>/webapps/share/WEB-INF/classes/org/springframework/extensions/webscripts
simple.get.desc.xml - <tomcat>/webapps/share/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/demo
I realize that when I connect to the URL http://localhost:8080/share/service/index , I can't find again a new webscript in the list.
Could someone give me more informations ?
Thanks so much for your help.
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2011 12:20 PM
this is mine:
<?xml version="1.0"?><project name="Sample Module" default="package-amp" basedir="."> <property name="project.dir" value="." /> <property file="${project.dir}/build.properties" /> <property file="${project.dir}/module.properties" /> <property name="build.dir" value="${project.dir}/build" /> <property name="config.dir" value="${project.dir}/config" /> <property name="jar.file" value="${build.dir}/lib/${module.id}.jar" /> <property name="amp.file" value="${build.dir}/dist/${module.id}.amp" /> <target name="mkdirs"> <mkdir dir="${build.dir}/dist" /> <mkdir dir="${build.dir}/lib" /> <mkdir dir="${build.dir}/classes" /> </target> <path id="class.path"> <dirset dir="${build.dir}" /> <fileset dir="${project.dir}/lib" includes="**/*.jar" /> </path> <target name="clean"> <delete dir="${build.dir}" /> </target><target name="compile" depends="mkdirs"> <javac classpathref="class.path" debug="${debug}" srcdir="${project.dir}/source" destdir="${build.dir}/classes" target="1.6" encoding="UTF-8" includeantruntime="false" /> <copy todir="${build.dir}/classes"> <fileset dir="${project.dir}/source" defaultexcludes="false"> <exclude name="**/*.java" /> <exclude name="**/.svn/**" /> <exclude name="**/CVS/**" /> </fileset> </copy></target><target name="package-jar" depends="compile"> <jar destfile="${jar.file}" encoding="UTF-8"> <fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" defaultexcludes="false" /> </jar></target><target name="package-amp" depends="package-jar" description="Package the Module"></target></project>
there is a way to create a generic structure of the eclipse for webscript written in Java instead of JavaScript? I found this link http://code.google.com/p/share-extras/wiki/SampleProject but does not speak of java becked webscripts.
Thanks…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 03:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 03:40 AM
no don't work for me webscript in java. Can you give me the your project? I try with your java sample project.
The ideal thing would be to find a sort of skeleton for the eclipse, which could represent a generic structure for java becked webscript can apply for any customization.
Then you should be able to build a generic build.xml file that generates the jar to be included in tomcat/shared/lib.
You have the documentation to do this for Alfresco Share 3.4+? I have found out only documents dated and confusing.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 05:11 AM
Look at my first posts at the beginning.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 05:33 AM
thanks, you do not have a jar file? you have only java class?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 08:27 AM
now I have no errors but if I go into page share webscript and I refresh do not load the new webscripts. what wrong?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 08:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 06:09 AM
you have resolved your ptoblem?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2011 11:10 AM
Have you resolved the problem with the webscript in Alfresco Share?
I have the same problem in version 4.0.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2011 04:52 AM
I just wanted to check that you've seen the documentation at: http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples ? The bean name starting with "webscript." is important and the following package structure needs to match the package structure of the other files associated with the WebScript, you also need to ensure that it ends in the appropriate REST method (e.g. ".get" or ".post").
For example a bean with the id "webscript.org.springframework.extensions.webscripts.index.get" will map to the WebScript "<store-home>/org/springframework/extensions/webscripts/index.get.desc.xml" (where <store-home> it the location at which the WebScript is found).
Hopefully this answers your question,
Regards,
Dave
