1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.mail.internal.factory.template

File MailTemplateManager.java

 

Code metrics

0
0
0
1
66
13
0
-
-
0
-

Classes

Class Line # Actions
MailTemplateManager 36 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.mail.internal.factory.template;
21   
22    import java.util.Map;
23   
24    import javax.mail.MessagingException;
25   
26    import org.xwiki.component.annotation.Role;
27    import org.xwiki.model.reference.DocumentReference;
28   
29    /**
30    * Provides helper component for sending mail from template.
31    *
32    * @version $Id: 2e53e9459ee2429f8d2c795bd8985acb9ca5c117 $
33    * @since 6.1RC1
34    */
35    @Role
 
36    public interface MailTemplateManager
37    {
38    /**
39    * Evaluate a xproperty from a template document containing one or several XWiki.Mail xobjects (one per
40    * supported language). The xobject used is matched according to the passed language parameter value.
41    *
42    * @param templateReference the reference to the template document containing the XWiki.Mail xobject
43    * @param property the name of xproperty
44    * @param velocityVariables the list of velocity variables to set in the Velocity Context when evaluating
45    * @param localeValue the language value used to find a matching XWiki.Mail xobject (there can be one xobject per
46    * language). Can be either a Locale or a String.
47    * @return the evaluated property
48    * @throws MessagingException when an error occurs
49    * @since 6.1
50    */
51    String evaluate(DocumentReference templateReference, String property, Map<String, Object> velocityVariables,
52    Object localeValue) throws MessagingException;
53   
54    /**
55    * Evaluate a xproperty from a template document containing one or several XWiki.Mail xobjects (one per
56    * supported language). The xobject used is matched according to the default language defined in the wiki.
57    *
58    * @param templateReference the reference to the template document containing the XWiki.Mail xobject
59    * @param property the name of xproperty
60    * @param velocityVariables the list of velocity variables to set in the Velocity Context when evaluating
61    * @return the evaluated property
62    * @throws MessagingException when an error occurs
63    */
64    String evaluate(DocumentReference templateReference, String property, Map<String, Object> velocityVariables)
65    throws MessagingException;
66    }