<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java-backed web script in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305367#M258497</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been working now with java-backed web script because I need some data manipulation I can't achieve with JavaScript. I followed these instructions &lt;/SPAN&gt;&lt;A href="https://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#SimpleWebScript.java" rel="nofollow noopener noreferrer"&gt;https://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#SimpleWebScript.java&lt;/A&gt;&lt;SPAN&gt;. So I've tried to implement SimpleWebScript with Java. I implemented the -context file to load the bean, the JAR file and description file and deployed them all to the server in the locations described in the guide. The webscript is loaded and recognized but when I call the url I got error message template file is missing. The webscript is not actually using any template. It should just write some simple JSON and that's all. I think my webscript is not running the execute method I've defined in my Java class. I'm quite sure about that. I've been trying to understand how the web script is actually supposed to call the method and I can't figure that out. How Alfresco knows what method inside which class it is supposed to call?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make things easier for you here is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SimpleWebscript.class&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;public class SimpleWebScript extends AbstractWebScript&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void execute(WebScriptRequest req, WebScriptResponse res)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throws IOException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;…&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;web-scripts-application-context.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;bean id="webscript.org.alfresco.demo.simple.get" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class="org.alfresco.module.demoscripts.SimpleWebScript"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parent="webscript"&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;simple.get.desc.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;webscript&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;shortname&amp;gt;The World's Simplest Webscript&amp;lt;/shortname&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;description&amp;gt;Hands back a little bit of JSON&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;url&amp;gt;/demo/simple&amp;lt;/url&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;authentication&amp;gt;none&amp;lt;/authentication&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;format default=""&amp;gt;argument&amp;lt;/format&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;family&amp;gt;Alfresco Java-Backed WebScripts Demo&amp;lt;/family&amp;gt;&lt;BR /&gt;&amp;lt;/webscript&amp;gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is the error message I get when calling the webscript:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockquote&amp;gt;Cannot locate template processor for template org/alfresco/demo/simple.get.html&amp;lt;/blockquote&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2015 06:57:00 GMT</pubDate>
    <dc:creator>sihnu</dc:creator>
    <dc:date>2015-03-30T06:57:00Z</dc:date>
    <item>
      <title>Java-backed web script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305367#M258497</link>
      <description>Hey,I've been working now with java-backed web script because I need some data manipulation I can't achieve with JavaScript. I followed these instructions https://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#SimpleWebScript.java. So I've tried to implement SimpleWebScript with Java. I impl</description>
      <pubDate>Mon, 30 Mar 2015 06:57:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305367#M258497</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-03-30T06:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java-backed web script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305368#M258498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The description in my starting post refers to when files are deployed according to Alfresco Share Standalone. Now I'm not sure if my Alfresco is really Share Standalone but it is version 4.2f so it's newer than 3.3 (in the documents it says 3.3 or greater). However, I've tried to deploy the files according to the other instruction also. But when I start my server I get this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockquote&amp;gt;SEVERE: Allocate exception for servlet apiServlet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'webscripts.authenticator.basic' is defined&amp;lt;/quote&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like Alfresco is reading my context file but something is going wrong. I think Alfresco can't load my bean and then stops loading all the other beans as well and throws that error because can't find the bean used for authentication. Just a guess it might be like this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 07:14:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305368#M258498</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-03-30T07:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Java-backed web script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305369#M258499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe it does need the template to render any GET response…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try the newer tutorial - I've used it on 4.2f, and works good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://docs.alfresco.com/4.2/tasks/ws-folderListing-Java-scripting.html" rel="nofollow noopener noreferrer"&gt;http://docs.alfresco.com/4.2/tasks/ws-folderListing-Java-scripting.html&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 10:05:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305369#M258499</guid>
      <dc:creator>pkie</dc:creator>
      <dc:date>2015-03-30T10:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Java-backed web script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305370#M258500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, it doesn't need a template but still it asking for one. I think it's because it's not running the execute method of the Java Class. Alfresco finds new web script from description file but not the execute method and that's why it's asking for the template. Anyway, I'm now trying out the tutorial you linked. I'll tell here how it goes. Thanks for the reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 10:31:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305370#M258500</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-03-30T10:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Java-backed web script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305371#M258501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for the tutorial. I got it working right away. I will use this as an example for my own web script. Thanks a lot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 11:16:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-web-script/m-p/305371#M258501</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-03-30T11:16:49Z</dc:date>
    </item>
  </channel>
</rss>

