cancel
Showing results for 
Search instead for 
Did you mean: 

envoi de mail de notification sur Alfresco Share

vaquero13010
Champ in-the-making
Champ in-the-making
bonjour,

sur Alfresco Share j'ai créé un site dans lequel j'ai mis plusieurs fichiers accessibles par les membres invités sur ce site.
je voudrais générer un mail à tout les membres du groupe à la mise à jour d'un fichier.

j'ai créé un fichier de notification dans Email Notify Template:
  Le folio '${document.name}' a été mis à jour par ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}</#if> 


vous pouvez visualiser ce fichier via ce lien:

<#assign ref=space.nodeRef>
<#assign displayPaths=document.displayPath?split("/")>
<#assign site=displayPaths[3]>
<#assign workspace=ref[0..ref?index_of("://")-1]>
<#assign storenode=ref[ref?index_of("://")+3..]>
http://${url.serverPath}/share/page/site/${site}/document-details?${workspace}/${storenode}
Cordialement
Administrateur

l'envoi de mail est déjà configuré et fonctionne sous alfresco explorer et aussi pour l'envoi d'invitation des utilisateurs du site

mais sur le log s'affiche des erreurs d'envoi de mail et aussi que je chemin Node du fichier est inexistant:

15:28:06,515 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] Failed to send email to selfakir
org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/3532537a-aac6-44ac-95d3-10bcd5df4c87
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:368)
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)
   at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:439)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)
   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.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:65)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy253.execute(Unknown Source)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:726)
   at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:66)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:726)
   at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:658)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:526)
   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:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:43)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:279)
   at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:228)
   at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:195)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:140)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy39.executeAction(Unknown Source)
   at org.alfresco.repo.rule.RuleServiceImpl.executeRule(RuleServiceImpl.java:1118)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:1086)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:1057)
   at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:1030)
   at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:57)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:738)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:718)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:674)
   at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:927)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:737)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:394)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:472)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:343)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:417)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:434)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:298)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:319)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:177)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
   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.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.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/3532537a-aac6-44ac-95d3-10bcd5df4c87
   at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:143)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.getPrimaryParent(DbNodeServiceImpl.java:1832)
   at sun.reflect.GeneratedMethodAccessor321.invoke(Unknown Source)
   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:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:104)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy10.getPrimaryParent(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor321.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:215)
   at $Proxy11.getPrimaryParent(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor321.invoke(Unknown Source)
   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:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:303)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:303)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy10.getPrimaryParent(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor321.invoke(Unknown Source)
   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:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:43)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:279)
   at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:163)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:140)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:43)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:279)
   at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:163)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:140)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy10.getPrimaryParent(Unknown Source)
   at org.alfresco.repo.action.executer.MailActionExecuter.createEmailTemplateModel(MailActionExecuter.java:504)
   at org.alfresco.repo.action.executer.MailActionExecuter.access$600(MailActionExecuter.java:64)
   at org.alfresco.repo.action.executer.MailActionExecuter$1.prepare(MailActionExecuter.java:394)
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:353)
   … 71 more

j'ai remarqué aussi que l'  UUID sur le log ne correspond pas à celui du fichier.

si vous avez déjà résolu cette problématique, votre aide sera la bienvenue.
24 REPLIES 24

bertrandf
Champ on-the-rise
Champ on-the-rise
Vos explications ne sont vraiment pas très claires.

Dernière fois que je demande et après j'abandonne, serait-il possible de voir des bouts de code de votre règle (notamment quand vous envoyez le mail) ?
Nous ne sommes pas devin, on va pas deviner les traitements que vous faites …

Quand vous modifiez votre fichier, est-ce que vous faites bien un document.save() ?

Je me répète mais est-ce que votre règle est exécutée en fond ou pas ?

Au passage je pense que votre template de mail ne récupère pas correctement le site mais ce n'est pas la cause du problème.
Je pense qu'il faut faire displayPaths[2]
Je pense que displayPath retourne qqch de la forme : /Company Home/Sites/nom-du-site

vaquero13010
Champ in-the-making
Champ in-the-making
Je n'ai pas mis de code pour la régle.
j'ai passé par la l'inteface Manage Rule ou je spécifie rien que le destinataire du mail et le mail envoyé.
lorsque je parle de télécharger un fichier je veux dire uploader une nouvelle version.
effectivement, les mails que j'ai reçu, provenaient  d'une régle faite sur alfresco explorer.
maintenant je ne reçois plus de mail.
j'ai rajouté seulement ce mail sur le dossier notify Email Templates

merci pour vos réponses

bertrandf
Champ on-the-rise
Champ on-the-rise
Désolé j'avais mal compris votre problème.

Avez-vous modifié les permissions sur l'espace 'Data Dictionary' ?
C'est peut être un problème d'accès au template de mail, vérifiez que EVERYONE y ait accès en lecture.

vaquero13010
Champ in-the-making
Champ in-the-making
EVERYONE est bien en mode lecture
lorsque j'ai rajouté un mail contenant que du texte sans lien sur le dossier notify Email Templates
et en spécifiant une autre règle sur les fichiers entrants le mail est envoyé.

je conclus que le mail est accessible par le propriétaire du site  sous alfresco share.
je pense que le souci viens seulement de la syntaxe du lien.
juste une question:
lorsque je visualise le fichier il y a sur le coté droit en bas de page
il y a 4 lien
Adresse de téléchargement
http://localhost:8080/share/proxy/alfresco-feed/api/node/content/workspace/SpacesStore/d80d53eb-f732...
Adresse du document
http://localhost:8080/share/proxy/alfresco-feed/api/node/content/workspace/SpacesStore/d80d53eb-f732...
WEBDAV
http://localhost:8080/alfresco/webdav/Sites/ibidok/documentLibrary/79.Distribution%2024%20VDC%20cont...
adresse de la page
http://localhost:8080/share/page/site/ibidok/document-details?nodeRef=workspace://SpacesStore/d80d53...

Le link que j'ai mis sur le mail est celui de la page de visualisation de Share. mais je crois qu'il vaut mieux mettre le link du document!!
qu' en pensez-vous?

vaquero13010
Champ in-the-making
Champ in-the-making
l'envoi de mail est résolu
et je laisse la syntaxe si elle intéresse quelqu'un:

Le nom du document : '${document.name}'
la personne qui a fait les modifications: ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}</#if>

le lien vers le fichier sur share:
<#assign displayPaths=document.displayPath?split("/")>
<#assign site=displayPaths[3]>
${url.serverPath}/share/page/site/${site}/document-details?nodeRef=${document.nodeRef}

merci a Rodel et BertrandF pour leurs réponses même si j'étais pas assez clair!!