AnsweredAssumed Answered

Error Expected hash

Question asked by cperez on Apr 9, 2014
Latest reply on Apr 10, 2014 by kaynezhang
I am having an issue with accessing the file in ftl. I use a webscript to show the content of a specific file after search it.

This is the error when i search the file with http://localhost:8080/alfresco/service/showContent?name=doc3.pdf:
500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   Wrapped Exception (with status template): Error during processing of the template 'Expected hash. fichero evaluated instead to freemarker.template.SimpleSequence on line 9, column 15 in showContent.get.html.ftl.'. Please contact your system administrator.

I have the error in the next piece of code where I use "file" in the tithe within the head:

      File: ${}
         <#if fichero.isContainer>
            <td>><td><a href="${url.serviceContext}/folder<@encodepath node=fichero/>">${}</a>
            <td><td><a href="${url.serviceContext}/api/node/content/${fichero.nodeRef.storeRef.protocol}/${fichero.nodeRef.storeRef.identifier}/${}/${}">${}</a>
      <td><td><a href="${url.serviceContext}/api/node/content/${fichero.nodeRef.storeRef.protocol}/${fichero.nodeRef.storeRef.identifier}/${}/${}">${}</a>

I use the next script where I save "file" in "model.file". If I use " = "example"" this work fine.

var spath="'+PATH:\""+companyhome.displayPath +"//*\" + ";
var scontent="@\\{http\\://\\}content.mimetype:application/pdf + ";
var qname = "@cm\\:name:" +;
var strq=spath+scontent+qname;

var content=search.luceneSearch(strq); = "example";
model.fichero = content;

And this is the xml file of the script

   <shortname>Show Content</shortname>
   <description>Show user specific content identified by parameters </description>

can anyone hel my??

Thanks a lot in advance!!