These examples (at least the first one) do not seem compatible with the new Surf framework. The Web Script engine returns an error:
07210001 Web Script org/alfresco/java/simple.get already associated with the 'Presentation' container
(classpath:alfresco/webscripts/org/alfresco/java/simple.get.desc.xml)
Great resource. I just wish the wiki authors would be a little more specific about filenames and file locations. It would make it a lot easier for developers just getting their feet wet in Alfresco development.
I had a problem with the RandomSelectWebScript example on Alfresco 4.0.2. This chunk of code failed:
if (!(req instanceof WebScriptServletRequest)) {
throw new WebScriptException( 'Content retrieval must be executed in HTTP Servlet environment');
}
The request wasn't an instance of WebScriptServletRequest. I got around the problem by pulling the parameter directly from the WebScriptRequest like this:
String path = req.getParameter('path');