View Javadoc
1   /*
2    * Copyright (c) 2002-2021, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.newsletter.util;
35  
36  import fr.paris.lutece.portal.service.util.AppPropertiesService;
37  
38  /**
39   * Shared constants
40   */
41  public final class NewsLetterConstants
42  {
43      public static final String CONSTANT_EMPTY_STRING = "";
44      public static final String CONSTANT_SLASH = "/";
45      public static final String CONSTANT_PDF_FILE_TYPE = "pdf";
46      public static final String PLUGIN_NAME = "newsletter";
47  
48      ///////////////////////////////////////////////////////////////////////
49      // BOOKMARKS
50      public static final String MARK_ROWS = "rows";
51      public static final String MARK_TEMPLATE_ID = "template_id";
52      public static final String MARK_TEMPLATE_TYPE = "template_type";
53      public static final String MARK_TEMPLATE_DESCRIPTION = "template_description";
54      public static final String MARK_TEMPLATE_FILE_NAME = "template_file_name";
55      public static final String MARK_TEMPLATE_PICTURE = "template_picture";
56      public static final String MARK_TEMPLATE_SOURCE = "template_source";
57      public static final String MARK_SUBSCRIBER_EMAIL = "subscriber_email";
58      public static final String MARK_SUBSCRIBER_EMAIL_EACH = "@email@"; // TODO remove the @
59      public static final String MARK_SUBSCRIBER_DATE = "subscriber_date";
60      public static final String MARK_SUBSCRIBER_ID = "subscriber_id";
61      public static final String MARK_PREVIOUS_NEXT = "previous_next";
62      public static final String MARK_BASE_URL = "base_url"; // FIXME
63      public static final String PROPERTY_UNSUBSCRIBE_TRUE = "TRUE"; // FIXME
64      public static final String PROPERTY_UNSUBSCRIBE_FALSE = "FALSE"; // FIXME
65      public static final String PROPERTY_ABSOLUTE_URL_TRUE = "TRUE"; // FIXME
66  
67      public static final String MARK_SENDING = "sending";
68      public static final String WEBAPP_PATH_FOR_LINKSERVICE = "@webapp_path_for_linkservice@";
69  
70      ///////////////////////////////////////////////////////////////////////
71      // bookmark to use for mail template
72      public static final String MARK_CONFIRM_URL = "confirm_url";
73      public static final String PROPERTY_CONFIRM_MAIL_SENDER_NAME = AppPropertiesService.getProperty( "newsletter.confirm.senderName", "CONFIRMATION" );
74      public static final String PROPERTY_CONFIRM_MAIL_SENDER_ADDRESS = AppPropertiesService.getProperty( "newsletter.confirm.sender", "noreply@paris.fr" );
75  
76      ///////////////////////////////////////////////////////////////////////
77      // properties
78      public static final String PROPERTY_PATH_FILE_NEWSLETTER_TEMPLATE = "newsletter.path.file.newsletter.template";
79      public static final String PROPERTY_BASE_URL = "lutece.prod.url";
80      public static final String PROPERTY_PORTAL_JSP_PATH = "lutece.portal.path";
81      public static final String PROPERTY_MAIL_MULTIPART = "newsletter.mail.multipart";
82      public static final String ALL_GROUPS = "all"; // FIXME
83      public static final String PROPERTY_LABEL_ALL_GROUPS = "portal.workgroup.labelAllGroups"; // FIXME
84      public static final String PROPERTY_CHECKBOX_ON = "on";
85  
86      /////////////////////////////////////////////////////////////////
87      // parameters
88      public static final String PARAMETER_EMAIL = "email";
89      public static final String PARAMETER_SUBSCRIBER_SEARCH = "subscriber_search";
90      public static final String PARAMETER_SENDING_ID = "sending_id";
91      public static final String PARAMETER_ACTION = "action";
92      public static final String PARAMETER_NEWSLETTER_ID = "newsletter_id";
93      public static final String PARAMETER_PAGE = "page";
94      public static final String PARAMETER_KEY = "key";
95      public static final String PARAMETER_USER_ID = "user_id";
96  
97      // newsletter templates //////////////////////////////////////////
98      public static final String PARAMETER_NEWSLETTER_TEMPLATE_NAME = "newsletter_template_name";
99      public static final String PARAMETER_NEWSLETTER_TEMPLATE_FILE = "newsletter_template_file";
100     public static final String PARAMETER_NEWSLETTER_TEMPLATE_PICTURE = "newsletter_template_picture";
101     public static final String PARAMETER_NEWSLETTER_TEMPLATE_WORKGROUP = "newsletter_template_workgroup";
102     public static final String PARAMETER_NEWSLETTER_TEMPLATE_NEW_FILE = "newsletter_template_new_file";
103     public static final String PARAMETER_NEWSLETTER_TEMPLATE_NEW_PICTURE = "newsletter_template_new_picture";
104     public static final String PARAMETER_NEWSLETTER_TEMPLATE_TYPE = "newsletter_template_type";
105     public static final String PARAMETER_NEWSLETTER_TEMPLATE_ID = "newsletter_template_id";
106     public static final String PARAMETER_NEWSLETTER_TEMPLATE_SOURCE = "newsletter_template_source";
107     public static final String PARAMETER_NEWSLETTER_IMPORT_PATH = "newsletter_import_path";
108     public static final String MARK_TEMPLATE = "template";
109 
110     // I18n properties
111     public static final String PROPERTY_SUBSCRIPTION_OK_TITLE_MESSAGE = "newsletter.siteMessage.subscription_ok.title";
112     public static final String PROPERTY_SUBSCRIPTION_OK_ALERT_MESSAGE = "newsletter.siteMessage.subscription_ok.message";
113     public static final String PROPERTY_SUBSCRIPTION_OK_ALERT_MESSAGE_CONFIRM = "newsletter.siteMessage.subscription_ok.messageConfirm";
114     public static final String PROPERTY_SUBSCRIPTION_CONFIRM_TITLE_MESSAGE = "newsletter.siteMessage.subscription_confirm.title";
115     public static final String PROPERTY_SUBSCRIPTION_CONFIRM_ALERT_MESSAGE = "newsletter.siteMessage.subscription_confirm.message";
116     public static final String PROPERTY_UNSUBSCRIPTION_OK_TITLE_MESSAGE = "newsletter.siteMessage.unsubscription_ok.title";
117     public static final String PROPERTY_UNSUBSCRIPTION_OK_ALERT_MESSAGE = "newsletter.siteMessage.unsubscription_ok.message";
118     public static final String PROPERTY_NO_NEWSLETTER_CHOSEN_TITLE_MESSAGE = "newsletter.siteMessage.no_newsletter_chosen.title";
119     public static final String PROPERTY_NO_NEWSLETTER_CHOSEN_ERROR_MESSAGE = "newsletter.siteMessage.no_newsletter_chosen.message";
120     public static final String PROPERTY_INVALID_MAIL_TITLE_MESSAGE = "newsletter.siteMessage.invalid_mail.title";
121     public static final String PROPERTY_INVALID_MAIL_ERROR_MESSAGE = "newsletter.siteMessage.invalid_mail.message";
122     public static final String PROPERTY_CONFIRM_UNSUBSCRIPTION_ALERT_MESSAGE = "newsletter.siteMessage.unsubscription.message";
123     public static final String PROPERTY_CONFIRM_UNSUBSCRIPTION_TITLE_MESSAGE = "newsletter.siteMessage.unsubscription.title";
124     public static final String PROPERTY_MSG_REGISTRATION_OK = "newsletter.message.alert.newsletter.registration_ok.text";
125     public static final String PROPERTY_ACTION_ERROR = "newsletter.message.error.action";
126     public static final String PROPERTY_NO_JCAPTCHA_TITLE_MESSAGE = "newsletter.siteMessage.jcaptcha.title";
127     public static final String PROPERTY_NO_JCAPTCHA_MESSAGE = "newsletter.siteMessage.jcaptcha.message";
128     public static final String PROPERTY_NO_TOS_TITLE_MESSAGE = "newsletter.siteMessage.tos.title";
129     public static final String PROPERTY_NO_TOS_MESSAGE = "newsletter.siteMessage.tos.message";
130     public static final String PROPERTY_SUBSCRIPTION_INVALID_USER_TITLE_MESSAGE = "newsletter.siteMessage.invalid_user.title";
131     public static final String PROPERTY_SUBSCRIPTION_INVALID_USER_ERROR_MESSAGE = "newsletter.siteMessage.invalid_user.message";
132     public static final String PROPERTY_SUBSCRIPTION_INVALID_KEY_TITLE_MESSAGE = "newsletter.siteMessage.invalid_key.title";
133     public static final String PROPERTY_SUBSCRIPTION_INVALID_KEY_ERROR_MESSAGE = "newsletter.siteMessage.invalid_key.message";
134 
135     // Newsletter archive
136     public static final String PROPERTY_PAGE_NEWSLETTER_ARCHIVE_TITLE = "newsletter.page_newsletter_archive.pageTitle";
137     public static final String PROPERTY_PAGE_NEWSLETTER_ARCHIVE_LABEL = "newsletter.page_newsletter_archive.pageLabel";
138 
139     // Actions
140     public static final String ACTION_REGISTER = "register";
141     public static final String ACTION_UNSUBSCRIBE = "unsubscribe";
142     public static final String ACTION_CONFIRM_UNSUBSCRIBE = "confirm_unsubscribe";
143     public static final String ACTION_CONFIRM_SUBSCRIBE = "confirm_subscribe";
144     public static final String ACTION_SHOW_ARCHIVE = "show_archive";
145 
146     // Jsp
147     public static final String JSP_URL_PORTAL = "../../Portal.jsp";
148     public static final String JSP_URL_DO_UNSUBSCRIBE = "/jsp/site/plugins/newsletter/DoUnsubscribeNewsLetter.jsp";
149     public static final String MARK_CONTENT = "content";
150     public static final String MARK_CONTENT_SECTION = "content_";
151     public static final String MARK_UNSUBSCRIBE_KEY = "unsubscribe_key";
152     public static final String MARK_UNSUBSCRIBE_KEY_EACH = "@unsubscribe_key@";
153     public static final String TEMPLATE_NEWSLETTER_SUBSCRIPTION_LIST = "admin/plugins/newsletter/newsletter_subscription_list.html";
154     public static final String TEMPLATE_NEWSLETTER_ARCHIVE_LIST = "admin/plugins/newsletter/newsletter_sending_list.html";
155     /**
156      * Private constructor
157      */
158     private NewsLetterConstants( )
159     {
160     }
161     public static final String MARK_SITE_NAME = "site_name";
162     public static final String MARK_NEWSLETTER_LIST = "newsletter_list";
163 }