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      public static final String PROPERTY_FileProviderStore = "newsletter.FileProviderStore";
48  
49      ///////////////////////////////////////////////////////////////////////
50      // BOOKMARKS
51      public static final String MARK_ROWS = "rows";
52      public static final String MARK_TEMPLATE_ID = "template_id";
53      public static final String MARK_TEMPLATE_TYPE = "template_type";
54      public static final String MARK_TEMPLATE_DESCRIPTION = "template_description";
55      public static final String MARK_TEMPLATE_FILE_NAME = "template_file_name";
56      public static final String MARK_TEMPLATE_PICTURE = "template_picture";
57      public static final String MARK_TEMPLATE_SOURCE = "template_source";
58      public static final String MARK_SUBSCRIBER_EMAIL = "subscriber_email";
59      public static final String MARK_SUBSCRIBER_EMAIL_EACH = "@email@"; // TODO remove the @
60      public static final String MARK_SUBSCRIBER_DATE = "subscriber_date";
61      public static final String MARK_SUBSCRIBER_ID = "subscriber_id";
62      public static final String MARK_PREVIOUS_NEXT = "previous_next";
63      public static final String MARK_BASE_URL = "base_url"; // FIXME
64      public static final String PROPERTY_UNSUBSCRIBE_TRUE = "TRUE"; // FIXME
65      public static final String PROPERTY_UNSUBSCRIBE_FALSE = "FALSE"; // FIXME
66      public static final String PROPERTY_ABSOLUTE_URL_TRUE = "TRUE"; // FIXME
67      public static final String MARK_TEMPLATE_FILE = "template_file";
68      public static final String MARK_TEMPLATE_IMAGE = "template_image";
69      public static final String MARK_TEMPLATE_IMAGE_NAME = "template_image_name";
70      public static final String MARK_TEMPLATE_IMAGE_LIST = "template_image_list";
71      public static final String MARK_SENDING = "sending";
72      public static final String WEBAPP_PATH_FOR_LINKSERVICE = "@webapp_path_for_linkservice@";
73  
74      ///////////////////////////////////////////////////////////////////////
75      // bookmark to use for mail template
76      public static final String MARK_CONFIRM_URL = "confirm_url";
77      public static final String PROPERTY_CONFIRM_MAIL_SENDER_NAME = AppPropertiesService.getProperty( "newsletter.confirm.senderName", "CONFIRMATION" );
78      public static final String PROPERTY_CONFIRM_MAIL_SENDER_ADDRESS = AppPropertiesService.getProperty( "newsletter.confirm.sender", "noreply@paris.fr" );
79  
80      ///////////////////////////////////////////////////////////////////////
81      // properties
82      public static final String PROPERTY_PATH_FILE_NEWSLETTER_TEMPLATE = "newsletter.path.file.newsletter.template";
83      public static final String PROPERTY_BASE_URL = "lutece.prod.url";
84      public static final String PROPERTY_PORTAL_JSP_PATH = "lutece.portal.path";
85      public static final String PROPERTY_MAIL_MULTIPART = "newsletter.mail.multipart";
86      public static final String ALL_GROUPS = "all"; // FIXME
87      public static final String PROPERTY_LABEL_ALL_GROUPS = "portal.workgroup.labelAllGroups"; // FIXME
88      public static final String PROPERTY_CHECKBOX_ON = "on";
89  
90      /////////////////////////////////////////////////////////////////
91      // parameters
92      public static final String PARAMETER_EMAIL = "email";
93      public static final String PARAMETER_SUBSCRIBER_SEARCH = "subscriber_search";
94      public static final String PARAMETER_SENDING_ID = "sending_id";
95      public static final String PARAMETER_ACTION = "action";
96      public static final String PARAMETER_NEWSLETTER_ID = "newsletter_id";
97      public static final String PARAMETER_PAGE = "page";
98      public static final String PARAMETER_KEY = "key";
99      public static final String PARAMETER_USER_ID = "user_id";
100 
101     // newsletter templates //////////////////////////////////////////
102     public static final String PARAMETER_NEWSLETTER_TEMPLATE_NAME = "newsletter_template_name";
103     public static final String PARAMETER_NEWSLETTER_TEMPLATE_FILE = "newsletter_template_file";
104     public static final String PARAMETER_NEWSLETTER_TEMPLATE_PICTURE = "newsletter_template_picture";
105     public static final String PARAMETER_NEWSLETTER_TEMPLATE_WORKGROUP = "newsletter_template_workgroup";
106     public static final String PARAMETER_NEWSLETTER_TEMPLATE_NEW_FILE = "newsletter_template_new_file";
107     public static final String PARAMETER_NEWSLETTER_TEMPLATE_NEW_PICTURE = "newsletter_template_new_picture";
108     public static final String PARAMETER_NEWSLETTER_TEMPLATE_TYPE = "newsletter_template_type";
109     public static final String PARAMETER_NEWSLETTER_TEMPLATE_ID = "newsletter_template_id";
110     public static final String PARAMETER_NEWSLETTER_TEMPLATE_SOURCE = "newsletter_template_source";
111     public static final String PARAMETER_NEWSLETTER_IMPORT_PATH = "newsletter_import_path";
112     public static final String MARK_TEMPLATE = "template";
113 
114     // I18n properties
115     public static final String PROPERTY_SUBSCRIPTION_OK_TITLE_MESSAGE = "newsletter.siteMessage.subscription_ok.title";
116     public static final String PROPERTY_SUBSCRIPTION_OK_ALERT_MESSAGE = "newsletter.siteMessage.subscription_ok.message";
117     public static final String PROPERTY_SUBSCRIPTION_OK_ALERT_MESSAGE_CONFIRM = "newsletter.siteMessage.subscription_ok.messageConfirm";
118     public static final String PROPERTY_SUBSCRIPTION_CONFIRM_TITLE_MESSAGE = "newsletter.siteMessage.subscription_confirm.title";
119     public static final String PROPERTY_SUBSCRIPTION_CONFIRM_ALERT_MESSAGE = "newsletter.siteMessage.subscription_confirm.message";
120     public static final String PROPERTY_UNSUBSCRIPTION_OK_TITLE_MESSAGE = "newsletter.siteMessage.unsubscription_ok.title";
121     public static final String PROPERTY_UNSUBSCRIPTION_OK_ALERT_MESSAGE = "newsletter.siteMessage.unsubscription_ok.message";
122     public static final String PROPERTY_NO_NEWSLETTER_CHOSEN_TITLE_MESSAGE = "newsletter.siteMessage.no_newsletter_chosen.title";
123     public static final String PROPERTY_NO_NEWSLETTER_CHOSEN_ERROR_MESSAGE = "newsletter.siteMessage.no_newsletter_chosen.message";
124     public static final String PROPERTY_INVALID_MAIL_TITLE_MESSAGE = "newsletter.siteMessage.invalid_mail.title";
125     public static final String PROPERTY_INVALID_MAIL_ERROR_MESSAGE = "newsletter.siteMessage.invalid_mail.message";
126     public static final String PROPERTY_CONFIRM_UNSUBSCRIPTION_ALERT_MESSAGE = "newsletter.siteMessage.unsubscription.message";
127     public static final String PROPERTY_CONFIRM_UNSUBSCRIPTION_TITLE_MESSAGE = "newsletter.siteMessage.unsubscription.title";
128     public static final String PROPERTY_MSG_REGISTRATION_OK = "newsletter.message.alert.newsletter.registration_ok.text";
129     public static final String PROPERTY_ACTION_ERROR = "newsletter.message.error.action";
130     public static final String PROPERTY_NO_JCAPTCHA_TITLE_MESSAGE = "newsletter.siteMessage.jcaptcha.title";
131     public static final String PROPERTY_NO_JCAPTCHA_MESSAGE = "newsletter.siteMessage.jcaptcha.message";
132     public static final String PROPERTY_NO_TOS_TITLE_MESSAGE = "newsletter.siteMessage.tos.title";
133     public static final String PROPERTY_NO_TOS_MESSAGE = "newsletter.siteMessage.tos.message";
134     public static final String PROPERTY_SUBSCRIPTION_INVALID_USER_TITLE_MESSAGE = "newsletter.siteMessage.invalid_user.title";
135     public static final String PROPERTY_SUBSCRIPTION_INVALID_USER_ERROR_MESSAGE = "newsletter.siteMessage.invalid_user.message";
136     public static final String PROPERTY_SUBSCRIPTION_INVALID_KEY_TITLE_MESSAGE = "newsletter.siteMessage.invalid_key.title";
137     public static final String PROPERTY_SUBSCRIPTION_INVALID_KEY_ERROR_MESSAGE = "newsletter.siteMessage.invalid_key.message";
138 
139     // Newsletter archive
140     public static final String PROPERTY_PAGE_NEWSLETTER_ARCHIVE_TITLE = "newsletter.page_newsletter_archive.pageTitle";
141     public static final String PROPERTY_PAGE_NEWSLETTER_ARCHIVE_LABEL = "newsletter.page_newsletter_archive.pageLabel";
142 
143     // Actions
144     public static final String ACTION_REGISTER = "register";
145     public static final String ACTION_UNSUBSCRIBE = "unsubscribe";
146     public static final String ACTION_CONFIRM_UNSUBSCRIBE = "confirm_unsubscribe";
147     public static final String ACTION_CONFIRM_SUBSCRIBE = "confirm_subscribe";
148     public static final String ACTION_SHOW_ARCHIVE = "show_archive";
149 
150     // Jsp
151     public static final String JSP_URL_PORTAL = "../../Portal.jsp";
152     public static final String JSP_URL_DO_UNSUBSCRIBE = "/jsp/site/plugins/newsletter/DoUnsubscribeNewsLetter.jsp";
153     public static final String MARK_CONTENT = "content";
154     public static final String MARK_CONTENT_SECTION = "content_";
155     public static final String MARK_UNSUBSCRIBE_KEY = "unsubscribe_key";
156     public static final String MARK_UNSUBSCRIBE_KEY_EACH = "@unsubscribe_key@";
157     public static final String TEMPLATE_NEWSLETTER_SUBSCRIPTION_LIST = "admin/plugins/newsletter/newsletter_subscription_list.html";
158     public static final String TEMPLATE_NEWSLETTER_ARCHIVE_LIST = "admin/plugins/newsletter/newsletter_sending_list.html";
159     /**
160      * Private constructor
161      */
162     private NewsLetterConstants( )
163     {
164     }
165     public static final String MARK_SITE_NAME = "site_name";
166     public static final String MARK_NEWSLETTER_LIST = "newsletter_list";
167     public static final String MARK_CONFIRM_CSS = "css";
168 }