[xwiki-users] Translating from velocity to Groovy
Hello People, I am trying to translate the script below from velocity to groovy, but I am not getting success in the "map" variable translation, when I try to define more than 1 value in variable I get error. I will need it because I am passing information to a template email. Velocity #set($map= {'document':"$xwiki.getDocument()", 'url':"xwiki.getDocument().getExternalURL()"}) #set($discard = $xwiki.mailsender.sendMessageFromTemplate($defaultMail, "$recipients", $xwiki.null, $xwiki.null, "pt_BR", "PublicationWorkflow.MailTemplate : Refus de publication", $map)) My groovy def map = xwiki.null def result = xwiki.mailsender.sendMessageFromTemplate("${sender}", "[email protected]", emailcc, emailbcc, "pt_BR", "MailTemplate : Aviso de Publicacao Topico", map) It will be part of a script to advice the wiki users that a topic was created in their forum. Anyone can help? Thank you! Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DETI e-mail: [email protected] | tel: (32) 3429-6342 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately.
Hi, On 7 Feb 2014 at 13:41:08, Danilo Amaral de Oliveira ([email protected](mailto:[email protected])) wrote:
Hello People,
I am trying to translate the script below from velocity to groovy, but I am not getting success in the "map" variable translation, when I try to define more than 1 value in variable I get error. I will need it because I am passing information to a template email. Velocity #set($map= {'document':"$xwiki.getDocument()", 'url':"xwiki.getDocument().getExternalURL()"}) #set($discard = $xwiki.mailsender.sendMessageFromTemplate($defaultMail, "$recipients", $xwiki.null, $xwiki.null, "pt_BR", "PublicationWorkflow.MailTemplate : Refus de publication", $map))
My groovy def map = xwiki.null
Here’s how to define a map in Groovy: http://groovy.codehaus.org/JN1035-Maps Thanks -Vincent
def result = xwiki.mailsender.sendMessageFromTemplate("${sender}", "[email protected]", emailcc, emailbcc, "pt_BR", "MailTemplate : Aviso de Publicacao Topico", map)
It will be part of a script to advice the wiki users that a topic was created in their forum.
Anyone can help?
Thank you!
participants (2)
-
Danilo Amaral de Oliveira -
vincent@massol.net