03-30-2009 12:00 PM
08-21-2009 04:11 PM
07210001 Web Script org/alfresco/java/simple.get already associated with the 'Presentation' container (classpath:alfresco/webscripts/org/alfresco/java/simple.get.desc.xml)
08-21-2009 04:39 PM
08-21-2009 05:34 PM
09-15-2009 09:03 PM
<bean id="webscript.test.simple.get" class="com.test.webscript.SimpleWebscript" parent="webscript" />
BTW, do I need some kind of <property> for the bean entry?
{
"status" : "${status}",
"x" : "${x}",
"y" : "${y}"
}
<webscript>
<shortname>Simple Webscript</shortname>
<description>Returns JSON results</description>
<url>/test/simple</url>
<format default="json">extension</format>
<authentication>none</authentication>
</webscript>
import java.util.HashMap;
import java.util.Map;
import org.alfresco.web.scripts.DeclarativeWebScript;
import org.alfresco.web.scripts.Status;
import org.alfresco.web.scripts.WebScriptRequest;
public class SimpleWebscript extends DeclarativeWebScript {
@Override
protected Map<String, Object> executeImpl(WebScriptRequest request, Status status) {
String responseStatus = "200";
String x = "xxx";
String y = "yyy";
Map<String, Object> model = new HashMap<String, Object>();
model.put("status", responseStatus);
model.put("x", x);
model.put("y", y);
return model;
}
}
{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message" : "Wrapped Exception (with status template): Error during processing of the template 'Expression x is undefined on line 3, column 20 in test\/simple.get.json.ftl.'. Please contact your system administrator.",
"exception" : "org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): Error during processing of the template 'Expression username is undefined on line 3, column 20 in test\/simple.get.json.ftl.'. Please contact your system administrator.",
….
09-15-2009 10:23 PM
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.