10-03-2011 05:28 AM
.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
10-04-2011 03:53 AM
10-04-2011 06:08 AM
public class SimpleWebScript extends DeclarativeWebScript {
public SimpleWebScript() {
}
protected Map<String, Object> executeImpl(WebScriptRequest req,
Status status) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("hello", "Hello World");
return model;
}
}
<webscript>
<shortname>The World's Simplest Webscript</shortname>
<description>Hands back a little bit of JSON</description>
<url>/demo/simple</url>
<authentication>none</authentication>
<format default="">argument</format>
</webscript>
<html>
<head>
<title>Hello World</title>
</head>
<body>
${hello}
</body>
</html>
10-04-2011 06:21 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN 2.0//EN' 'http://www.springframework.org/dtd/spring-beans-2.0.dtd'>
<beans>
<bean id="webscript.org.alfresco.demo.simple.get" class="org.alfresco.module.demoscripts.SimpleWebScript" parent="webscript" />
</beans>
10-04-2011 12:25 PM
10-05-2011 03:05 AM
10-05-2011 08:31 AM
10-05-2011 09:16 AM
10-05-2011 10:11 AM
10-05-2011 10:30 AM
<?xml version="1.0"?>
<project name="Sample Module" default="package-amp" basedir=".">
<property name="project.dir" value="." />
<property file="${project.dir}/build.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/SimpleWebScript.jar" />
<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}/src/org/alfresco/module/demoscripts" destdir="${build.dir}/classes" target="1.5" encoding="UTF-8" />
<copy todir="${build.dir}/classes">
<fileset dir="${project.dir}/src/org/alfresco/module/demoscripts" defaultexcludes="false">
<exclude name="**/*.java" />
<exclude name="**/.svn/**" />
<exclude name="**/CVS/**" />
</fileset>
<fileset dir="${project.dir}/src/org/alfresco/module/demoscripts" 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>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.