AnsweredAssumed Answered

ftl et companyhome

Question asked by kevin-56 on Jun 11, 2008
Latest reply on Jul 17, 2009 by share
Bonjour,

j'ai un petit souci, voila mon script :

<#assign folderName="/Biblio-Veto/Articles"/>

<#if companyhome.childByNamePath[folderName]?exists>
   <#assign folderObj=companyhome.childByNamePath[folderName]>
</#if>

Et il m'indique l'erreur "Expression companyhome is undefined"

Cela viendrait-il pas du fait que j'ai modifié le nom du companyhome qui était "Alfresco" ? normalement non
Est-il suffisant de placer  e flt depuis le web client dans le dictionnaire de données ou faut-il le mettre manuellement dans le répertoire "…/templates
/email" dans tomcat pour que le companyhome soit pris en compte ?

voila le log correspondant :

14:51:04,410 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] Failed to send email to [user]
org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is org.alfresco.service.cmr.repository.TemplateException: Une er
Caused by: org.alfresco.service.cmr.repository.TemplateException: Une erreur est survenue lors de la g�n�ration du mod�le 'Expression companyhome is undefin
        at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205)
        at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:181)
        at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:200)
        at org.alfresco.repo.action.executer.MailActionExecuter$1.prepare(MailActionExecuter.java:310)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:347)  
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:339)
        at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:336)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:537)
        at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:72)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:537)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:472)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:399)
        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:241)
        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 $Proxy18.executeAction(Unknown Source)
        at org.alfresco.repo.rule.RuleServiceImpl.executeRule(RuleServiceImpl.java:922)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:890)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:861)
at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:834)
        at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:69)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:638)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:620)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:592)
        at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:821)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:637)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:624)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:307)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:420)
        at org.alfresco.web.bean.clipboard.WorkspaceClipboardItem.paste(WorkspaceClipboardItem.java:311)
        at org.alfresco.web.bean.clipboard.ClipboardBean.performClipboardOperation(ClipboardBean.java:229)
        at org.alfresco.web.bean.clipboard.ClipboardBean.performPasteItems(ClipboardBean.java:158)
        at org.alfresco.web.bean.clipboard.ClipboardBean.pasteAll(ClipboardBean.java:121)
        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.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
at javax.faces.component.UICommand.broadcast(UICommand.java:89)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        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: freemarker.core.InvalidReferenceException: Expression companyhome is undefined on line 20, column 23 in workspace://SpacesStore/322df418-3795-11d
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
        at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:74)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Assignment.accept(Assignment.java:90)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.Environment.process(Environment.java:176)
        at freemarker.template.Template.process(Template.java:232)
        at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)

Outcomes