AnsweredAssumed Answered

webscript working in Alfresco but not workin in Share

Question asked by on Oct 19, 2009
Latest reply on Oct 19, 2009 by mikeh
Hi there,
i am new to the forum and to Alfresco Webscripts. I am workin on an Alfresco share as a support tool for my current project.

My first approach to webscripts is the typical helloworld:

The result is that the sample webscript is Working in Alfresco, but Failing in Share, I need some help regarding this:

    Caused by: freemarker.core.InvalidReferenceException: Expression person is undefined on line 4, column 42 in hello-world
            at freemarker.core.TemplateObject.assertNonNull(
            at freemarker.core.TemplateObject.invalidTypeException(
            at freemarker.core.Dot._getAsTemplateModel(
            at freemarker.core.Expression.getAsTemplateModel(
            at freemarker.core.Dot._getAsTemplateModel(
            at freemarker.core.Expression.getAsTemplateModel(
            at freemarker.core.Expression.getStringValue(
            at freemarker.core.DollarVariable.accept(
            at freemarker.core.Environment.visit(
            at freemarker.core.MixedContent.accept(
            at freemarker.core.Environment.visit(
            at freemarker.core.Environment.process(
            at freemarker.template.Template.process(
            at org.alfresco.web.scripts.PresentationTemplateProcessor.process(
            … 109 more

This is the webscript:
       <shortname>Hello World</shortname>
       <description>Hello World Dashlet</description>

    <div class="dashlet">
    <div class="title">Hello World Title</div>
    <div class="body">
    <span>Hello World Body for : username: ${}</span>

To deploy it:
1. Deploy In Alfresco: upload it to Company Home > Data Dictionary > Web Scripts > jal And activate it with the 'refresh web scripts' button in http://alfrescosrvr:8080/alfresco/service/index
2. Deploy In Share: copy it to c:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\hello-world\ (default installation path of alfresco community on windows xp) And activate it with the 'refresh web scripts' button in http://alfrescosrvr:8080/share/service/index

If I delete the reference to the '${}' it works correctly in Share. To be sure I am correctly authenticated into share, I paste the webscript URL in the browser after logging in Share.

Thank you very much for your help.