AnsweredAssumed Answered

Freemarker error in share webscript

Question asked by vince20151 on Nov 25, 2013
Latest reply on Nov 25, 2013 by parzgnat
I have a very simple JS webscript on the Alfresco side (mytest.get.js)

function main() {
  model.someDesc= "Some description text");
}
main();


I can use this on an Alfresco webscript freemarker template and it works fine on the Alfresco side. Example

<div class="dashlet">
  <div class="title">Return Info WebScript</div>
  <div class="body">
    <br>Value is ${someDesc}</br>
  </div>
</div>


Now I want to access this data from the Share side in a webscript .Example sharetest.get.js
function main() {
  var data;
  var connector = remote.connect("alfresco");
  var result = connector.call("/mytest");

  if (result.status == status.STATUS_OK)
  {
    data = eval('(' + result + ')');
  }
  model.desc1= data.someDesc;
}
main();


And use desc1 in a freemarker template on the Share side

<div class="dashlet">
  <div class="title">Test getting value from Alfresco side</div>
  <div class="body">
    <br>Description is ${desc1}
  </div>
</div>


I keep getting error : Error on line 4, column 26 in sharetest.get.html.ftl Expecting a string, date or number here, Expression desc1 is instead a freemarker.template.SimpleHash

What did I do wrong and how to correct it.
Thanks a bunch!



Outcomes