As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Input form <html> <head> <title>***** ex_listDocsSpace.html *****</title> </head> <body> <form method="POST" action="http://vaio-sugai:8080/alfresco/command/script/execute" accept-charset="UTF-8" > <br>JavaScript call from HTML form<br> <br> <input type="text" name="scriptPath" size="100" value="/Company Home/User Homes/ex_listDocsSpace.js"> <br><br> <input type="text" name="spacePath" size="100" value="User Homes"> <br><br> <input type="text" name="templatePath" size="100" value="User Homes/ex_listDocsSpace.ftl"> <br><br> <input type="submit"> </form> </body> </html> [JavaScript code] var arg = new Array(); arg = args; var script = arg["scriptPath"]; var spacePath = arg["spacePath"]; var templatePath = arg["templatePath"]; var result = "args check !" + "<br>"; result += "arg[script] : " + script + "<br>"; result += "arg[spacePath] : " + spacePath + "<br>"; result += "arg[templatePath] : " + templatePath + "<br><br>"; // 10 space = userhome; var spaceNode = space.childByNamePath(spacePath); if ( spaceNode == null) { result += "spaceNode not found !" + "<br>"; } else { result += "spaceNode.name = " + spaceNode.name + "<br>"; } // Get templateNode var templateNode = space.childByNamePath(templatePath); result += "templateNodeName = " + templateNode.name + "<br>"; // set spaceNode to current space space = spaceNode; // Execute processTemplate var outString = new String(""); outString += space.processTemplate(templateNode); result += outString + "<br>"; result; [Template] <#– Renders list of all the documents in the Space –> <table> <#list space.children as child> <#if child.isDocument> <tr><td>${child.properties.name}</td></tr> </#if> </#list> </table>
can you execute the template by itself i.e. in the client
can you execute the template by itself i.e. via URL?
java.lang.IllegalArgumentException: Unable to resolve item Path: /Company Home/Data Dictionary/Presentation Templates/ex_listDocSpace.ftl 詳細をé
java.lang.IllegalArgumentException: Unable to resolve item Path: /Company Home/Data Dictionary/Presentation Templates/ex_listDocSpace.ftl
var result = new String(""); var space = companyhome; var document = space.childByNamePath("doc_info.ftl"); var template = space.childByNamePath("doc_info.ftl"); result += document.processTemplate(template); result;
http://crs-sugai:8080/alfresco/command/script/execute?scriptPath=/Company%20Home/test_processTemplate.js
org.alfresco.error.AlfrescoRuntimeException: Error during command servlet processing: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) caused by: org.alfresco.service.cmr.repository.ScriptException: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) caused by: org.alfresco.service.cmr.repository.ScriptException: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) caused by: org.alfresco.error.AlfrescoRuntimeException: Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) caused by: org.mozilla.javascript.WrappedException: Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) caused by: org.alfresco.service.cmr.repository.TemplateException caused by: java.lang.NullPointerException Show Details org.alfresco.error.AlfrescoRuntimeException: Error during command servlet processing: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) at org.alfresco.web.app.servlet.CommandServlet.service(CommandServlet.java:194) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:619) Caused by: org.alfresco.service.cmr.repository.ScriptException: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:171) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154) at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:256) at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:191) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210) at $Proxy48.executeScript(Unknown Source) at org.alfresco.web.app.servlet.command.ExecuteScriptCommand.execute(ExecuteScriptCommand.java:103) at org.alfresco.web.app.servlet.command.ScriptCommandProcessor.process(ScriptCommandProcessor.java:146) at org.alfresco.web.app.servlet.CommandServlet.service(CommandServlet.java:159) … 15 more Caused by: org.alfresco.service.cmr.repository.ScriptException: Failed to execute script 'workspace://SpacesStore/e70c1871-5aa7-11dc-88c4-6b68314a45f1': Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:146) at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:167) … 37 more Caused by: org.alfresco.error.AlfrescoRuntimeException: Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:518) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:142) … 38 more Caused by: org.mozilla.javascript.WrappedException: Wrapped org.alfresco.service.cmr.repository.TemplateException (AlfrescoScript#11) at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1705) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:157) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201) at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:64) at org.mozilla.javascript.gen.c2._c0(AlfrescoScript:11) at org.mozilla.javascript.gen.c2.call(AlfrescoScript) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755) at org.mozilla.javascript.gen.c2.call(AlfrescoScript) at org.mozilla.javascript.gen.c2.exec(AlfrescoScript) at org.mozilla.javascript.Context.evaluateString(Context.java:1144) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:510) … 39 more Caused by: org.alfresco.service.cmr.repository.TemplateException at org.alfresco.repo.processor.TemplateServiceImpl.processTemplateString(TemplateServiceImpl.java:218) at org.alfresco.repo.processor.TemplateServiceImpl.processTemplateString(TemplateServiceImpl.java:229) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154) at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:238) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210) at $Proxy94.processTemplateString(Unknown Source) at org.alfresco.repo.jscript.ScriptNode.processTemplate(ScriptNode.java:1882) at org.alfresco.repo.jscript.ScriptNode.processTemplate(ScriptNode.java:1785) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142) … 49 more Caused by: java.lang.NullPointerException at org.alfresco.repo.processor.TemplateServiceImpl.processTemplateString(TemplateServiceImpl.java:210) … 75 more アプリケーションã
— TemplateServiceImpl.java (revision 6672) +++ TemplateServiceImpl.java (revision 6673) @@ -78,7 +78,11 @@ * @see org.alfresco.service.cmr.repository.TemplateService#getTemplateProcessor(java.lang.String) */ public TemplateProcessor getTemplateProcessor(String engine) - { + { + if (engine == null) + { + engine = this.defaultTemplateEngine; + } return this.processors.get(engine); }