I'm trying to print "hello admin" in the dashlet, that retrieve from alfresco repository. I'm using alfresco 4.2.f.What I see in my dashlet is a message like this:
Hello
org.mozilla.javascript.Undefined@6c251a4c
also I have attached the figure with this message, if you want to see.I want to know where's my mistake.I'll paste first the alfresco repository code:1-hellouser.get.desc.xml
<webscript>
<shortname>Hello User</shortname>
<description>Personalized greeting</description>
<url>/hellouser</url>
<authentication>user</authentication>
<negotiate accept="text/html">html</negotiate>
<negotiate accept="application/json">json</negotiate>
</webscript>
2-hellouser.get.json.ftl
{greeting: "hello", user: "${person.properties.userName}"}
3-hellouser.get.html.ftl
Hello ${person.properties.userName}
and the share code is as following:1-hellouser.get.html.ftl
<div class="dashlet">
<div class="title">Hello </div>
<div class="body scrollableList">
${hellouser} <#– user’s value will be taken from .js file –>
</div>
</div>
2-hellouser.get.js
function main()
{
var connector = remote.connect("alfresco");
var data = connector.get("/hellouser.json");
// create json object from data
var result = eval('(' + data + ')');
model.hellouser = result["hellouser"];
}
main();
hellouser.get.desc.xml
<webscript>
<shortname>Hello World</shortname>
<description>Hello World Dashlet</description>
<family>dashlet</family>
<url>/components/dashlets/hellouser</url>
</webscript>