AnsweredAssumed Answered

webscript error

Question asked by joshna on Sep 1, 2008
Latest reply on Sep 16, 2008 by joshna
Hi I hav some problem with webscripts,
My error
500 Description: An error inside the HTTP server which prevented it from fulfilling the request. 
  
Message: Error during processing of the template 'Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator. 
  
Exception: freemarker.core.InvalidReferenceException - Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl. 
   
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) 
freemarker.core.IteratorBlock.accept(IteratorBlock.java:93) 
freemarker.core.Environment.visit(Environment.java:196) 
freemarker.core.MixedContent.accept(MixedContent.java:92) 
freemarker.core.Environment.visit(Environment.java:196) 
freemarker.core.Environment.process(Environment.java:176) 
freemarker.template.Template.process(Template.java:232) 
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201) 
org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:262) 
org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:249) 
org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:155) 
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:263) 
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:230) 
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:227) 
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:130) 
org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:108) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) 
java.lang.Thread.run(Thread.java:595) 
   
Exception: org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator. 
   
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205) 
   
Server: Alfresco Community Network v2.9.0 (B 683) schema 116 
Time: Sep 1, 2008 4:45:07 PM 
  
Diagnostics: Inspect Web Script (retrieve.get) 


these are my files
desc.xml
<webscript>
<shortname>Get all Text files</shortname>
<description>Returns a list of data with extesion text</description>
<url>/retrieve/whitepapers</url>
<authentication>admin</authentication>
<transaction>none</transaction>
</webscript>
html.ftl
#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz">
<html>
<body>
<h3>Data</h3>
<table>
<#list whitepapers as child>
<tr>
<td><b>Title</b></td><td>${child.whitepaper.properties.title}</td>
</tr>
<tr>
<td><b>Author</b></td><td>${child.whitepaper.properties.author}</td>
</tr>
<tr>
<td><b>Size</b></td><td>${child.whitepaper.properties.size}</td>
</tr>
</#list>
</table>
</body>
</html>

.js file



var whitepapers = search.luceneSearch("PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}Sample\+TYPE:\'{http://www.alfresco.org/model/content/1.0}whitepaper\"");
if(whitepapers==null)
{
status.code=404;
}

model.resultset=whitepapers;

Outcomes