cancel
Showing results for 
Search instead for 
Did you mean: 

Including form.get.head.ftl in dashlet in web-extension dir

matjazmuhic
Champ on-the-rise
Champ on-the-rise
I have a problem including form.get.head.ftl into my dashlets in web-extension directory (tomcat/shared/classes/alfresco/web-extension/site-webscripts/……).

If I include it like this:

<#include "../form/form.get.head.ftl">

in my dashlet  head file suddenly share stops working and I get an error page.

How do I include this file in my dashlet in web-extension directory?
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
There will be an error - please post it.

I suspect the relative path might be different.

Thanks,
Mike

matjazmuhic
Champ on-the-rise
Champ on-the-rise
Yes, the path is wrong. But how do I include this then?

This is the stack trace:


08:42:27,194 http-8080-110 ERROR [freemarker.runtime] Error reading included file si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl

Error reading included file si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl
The problematic instruction:
———-
==> include "../form/form.get.head.ftl" [on line 1, column 1 in si/agenda/components/dashlets/myAssignmentTasks/mytasks.get.head.ftl]
———-

Java backtrace for programmers:
———-
freemarker.template.TemplateException: Error reading included file si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl
   at freemarker.core.Include.accept(Include.java:167)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:166)
   at org.springframework.extensions.webscripts.WebScriptProcessor.executeHeader(WebScriptProcessor.java:174)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:66)
   at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:264)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:581)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.header(TemplateInstanceRenderer.java:94)
   at org.springframework.extensions.surf.render.RenderService.renderTemplateHeaderAsString(RenderService.java:792)
   at org.springframework.extensions.webscripts.ProcessorModelHelper.populateTemplateModel(ProcessorModelHelper.java:494)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:300)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:378)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:123)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:85)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: Template si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl not found.
   at freemarker.template.Configuration.getTemplate(Configuration.java:489)
   at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
   at freemarker.core.Include.accept(Include.java:157)
   … 50 more
08:42:27,197 http-8080-110 ERROR [surf.render.RenderService] Unable to process template: dashboard-2-columns-wide-right
08:42:27,197 http-8080-110 ERROR [surf.render.RenderService] An exception occurred while rendering: site/frontoffice/dashboard
org.springframework.extensions.surf.exception.RendererExecutionException: WebTemplateProcessor failed to process template uri: org/alfresco/dashboard
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:377)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:378)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:123)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:85)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.extensions.webscripts.WebScriptException: 05300006 Failed to process template si/agenda/components/dashlets/myAssignmentTasks/mytasks.get.head.ftl
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:170)
   at org.springframework.extensions.webscripts.WebScriptProcessor.executeHeader(WebScriptProcessor.java:174)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:66)
   at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:264)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:581)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.header(TemplateInstanceRenderer.java:94)
   at org.springframework.extensions.surf.render.RenderService.renderTemplateHeaderAsString(RenderService.java:792)
   at org.springframework.extensions.webscripts.ProcessorModelHelper.populateTemplateModel(ProcessorModelHelper.java:494)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:300)
   … 36 more
Caused by: freemarker.template.TemplateException: Error reading included file si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl
   at freemarker.core.Include.accept(Include.java:167)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:166)
   … 44 more
Caused by: java.io.FileNotFoundException: Template si/agenda/components/dashlets/myAssignmentTasks/../form/form.get.head.ftl not found.
   at freemarker.template.Configuration.getTemplate(Configuration.java:489)
   at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
   at freemarker.core.Include.accept(Include.java:157)
   … 50 more

matjazmuhic
Champ on-the-rise
Champ on-the-rise
I solved the problem. I had to adjust the relative path.

You have to go back up in the directories ( with "../") until you get to "tomcat/shared/classes/alfresco/web-extension/site-webscripts" then add this to end of the path: "org/alfresco/components/form/form.get.head.ftl".

Sample:

<#include "../../../../../org/alfresco/components/form/form.get.head.ftl">

If you have your dashlet in this directory: "tomcat/shared/classes/alfresco/web-extension/site-webscripts/com/mycompany/components/dashlets/myTestDashlet"