<?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 Re: Create Java back webscript in share extesion project in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303739#M256869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might want to have a look at &amp;lt;a href="&lt;/SPAN&gt;&lt;A href="http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html" rel="nofollow noopener noreferrer"&gt;http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;this tutorial&amp;lt;/a&amp;gt;. It describes how to write a Java-backed web script and the config you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tutorial covers repo tier web scripts but it should be the same for Share tier web scripts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jul 2016 15:04:28 GMT</pubDate>
    <dc:creator>jpotts</dc:creator>
    <dc:date>2016-07-18T15:04:28Z</dc:date>
    <item>
      <title>Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303738#M256868</link>
      <description>Hi All,I am new with alfresco. I have created a share extension where I want to create a Java backed webscript.I used https://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples to create Java backed webscript.Add the following bean in custom-slingshot-application-context.xml&amp;lt;bean id="webframe</description>
      <pubDate>Fri, 08 Jul 2016 20:55:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303738#M256868</guid>
      <dc:creator>djaweid_</dc:creator>
      <dc:date>2016-07-08T20:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303739#M256869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might want to have a look at &amp;lt;a href="&lt;/SPAN&gt;&lt;A href="http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html" rel="nofollow noopener noreferrer"&gt;http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;this tutorial&amp;lt;/a&amp;gt;. It describes how to write a Java-backed web script and the config you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tutorial covers repo tier web scripts but it should be the same for Share tier web scripts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 15:04:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303739#M256869</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-07-18T15:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303740#M256870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;Jeff Potts&lt;/B&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed the principle and structure of your tutorial and that of the official Alfresco document tutorial, but still get the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;2016-10-05 16:34:25,500&amp;nbsp; ERROR [freemarker.runtime] [http-apr-8080-exec-2] Error executing FreeMarker template&lt;/P&gt;&lt;P&gt; FreeMarker template error:&lt;/P&gt;&lt;P&gt;The following has evaluated to null or missing:&lt;/P&gt;&lt;P&gt;==&amp;gt; data&amp;nbsp; [in template "sudo/sudorename.get.html.ftl" at line 6, column 22]&lt;/P&gt;&lt;P&gt;Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use &amp;lt;#if myOptionalVar??&amp;gt;when-present&amp;lt;#else&amp;gt;when-missing&amp;lt;/#if&amp;gt;. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??&lt;/P&gt;&lt;P&gt;The failing instruction (FTL stack trace):&lt;/P&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;==&amp;gt; ${data}&amp;nbsp; [in template "sudo/sudorename.get.html.ftl" at line 6, column 20]&lt;/P&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;&amp;lt;/blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The webscript is fully registered and only when I invoke it do I get that error message. The Java class is a simple class to return a text (business logic to be done later).&lt;/P&gt;&lt;P&gt;My files:&lt;/P&gt;&lt;P&gt;tomcat\webapps\alfresco\WEB-INF\classes\za\gov\parliament\sudowebscripts\SudoChildNode.class&lt;/P&gt;&lt;P&gt;&amp;lt;blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;public Map&amp;lt;String, Object&amp;gt; executeImpl(WebScriptRequest req, Status status, Cache cache)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; model = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp; model.put("data", "Data retrieved");&lt;/P&gt;&lt;P&gt;&amp;nbsp; logger.debug("Sudo webscript execution complete");&lt;/P&gt;&lt;P&gt;&amp;nbsp; return model;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;lt;/blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tomcat\shared\classes\alfresco\extension\templates\webscripts\sudo\sudorename.get.desc.xml&lt;/P&gt;&lt;P&gt;tomcat\shared\classes\alfresco\extension\templates\webscripts\sudo\sudorename.get.html.xml&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/9970_pastedImage_5.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tomcat\shared\classes\alfresco\extension\sudorename-context.xml&lt;/P&gt;&lt;P&gt;&amp;lt;blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN 2.0//EN' '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.springframework.org/dtd/spring-beans-2.0.dtd" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.springframework.org/dtd/spring-beans-2.0.dtd&lt;/A&gt;&lt;SPAN&gt;'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;beans&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;bean id="webscript.sudo" class="za.gov.parliament.sudowebscripts.SudoChildNode" parent="webscript" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/beans&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/blockcode&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In all the above is there something that I am missing?&lt;/P&gt;&lt;P&gt;Using Alfresco 5.2 201609 Nightly build&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much thanks.&lt;/P&gt;&lt;P&gt;~Vusani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2016 15:01:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303740#M256870</guid>
      <dc:creator>darkredd</dc:creator>
      <dc:date>2016-10-05T15:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303741#M256871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide the full class signature of your Java class so I can see what it extends/implements?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2016 21:01:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303741#M256871</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-10-05T21:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303742#M256872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And you'd better check if a variable exists in&amp;nbsp; FreeMarker template before using it,like this&lt;/P&gt;&lt;P&gt;&amp;lt;#if data??&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ${data}&lt;/P&gt;&lt;P&gt;&amp;lt;/#if&amp;gt;&lt;/P&gt;&lt;P&gt;Or&amp;nbsp; display a default text when the variable is null ,like this&lt;/P&gt;&lt;P&gt;${(data)!"default text"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 02:50:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303742#M256872</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-10-06T02:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303743#M256873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @Jeff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the full class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1475750569176662 jive_text_macro" data-hasrefreshed="true" data-renderedposition="108_8_1332_416" jivemacro_uid="_1475750569176662"&gt;&lt;P&gt;package za.gov.parliament.sudowebscripts;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import java.util.HashMap;&lt;/P&gt;&lt;P&gt;import java.util.Map;&lt;/P&gt;&lt;P&gt;import org.apache.commons.logging.Log;&lt;/P&gt;&lt;P&gt;import org.apache.commons.logging.LogFactory;&lt;/P&gt;&lt;P&gt;import org.springframework.extensions.webscripts.Cache;&lt;/P&gt;&lt;P&gt;import org.springframework.extensions.webscripts.DeclarativeWebScript;&lt;/P&gt;&lt;P&gt;import org.springframework.extensions.webscripts.Status;&lt;/P&gt;&lt;P&gt;import org.springframework.extensions.webscripts.WebScriptRequest;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class SudoChildNode extends DeclarativeWebScript&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; private Log logger = LogFactory.getLog(SudoChildNode.class);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; public Map&amp;lt;String, Object&amp;gt; executeImpl(WebScriptRequest req, Status status, Cache cache)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; model = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp; model.put("data", "Data retrieved");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; logger.debug("Sudo webscript execution complete");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return model;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much Thanks&lt;/P&gt;&lt;P&gt;~Vusani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 07:15:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303743#M256873</guid>
      <dc:creator>darkredd</dc:creator>
      <dc:date>2016-10-06T07:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303744#M256874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your class looks fine, so it must be the Spring context file that is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect it is your bean ID. As it says in my tutorial, the syntax for the bean ID is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;webscript.package.service-id.method&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But yours is "webscript.sudo". Alfresco has no way of knowing which web script you intend to use that class with unless that ID follows the convention. You need to change it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;webscript.sudo.sudorename.get&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be sure to restart Alfresco after that change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 13:46:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303744#M256874</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-10-06T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303745#M256875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your issue is due to reasons given by Jeff and and kyne. Error is because you are trying print value of "data" which is null and you do not have any null check in your ftl.&lt;/P&gt;&lt;P&gt;Reason your data is null is because your java class is not getting called.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 13:58:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303745#M256875</guid>
      <dc:creator>mitpatoliya</dc:creator>
      <dc:date>2016-10-06T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303746#M256876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;mit patoliya&lt;/B&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes that I understand and have since put a freemarker check on the ftl. No the issue is getting the java class called. What could be the cause of the class not to be called?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:16:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303746#M256876</guid>
      <dc:creator>darkredd</dc:creator>
      <dc:date>2016-10-06T14:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303747#M256877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed it was the bean ID, made the change and worked. It was an oversight while I was working through the tutorial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Vusani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:29:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303747#M256877</guid>
      <dc:creator>darkredd</dc:creator>
      <dc:date>2016-10-06T14:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create Java back webscript in share extesion project</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303748#M256878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, glad you got it working!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:42:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/create-java-back-webscript-in-share-extesion-project/m-p/303748#M256878</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-10-06T14:42:41Z</dc:date>
    </item>
  </channel>
</rss>

