View Javadoc
1   /*
2    * Copyright (c) 2002-2016, Mairie de 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.mydashboard.modules.identity.util;
35  
36  import fr.paris.lutece.portal.service.util.AppPropertiesService;
37  
38  
39  /**
40   * This class provides constants for identity services
41   *
42   */
43  public final class Constants
44  {
45      
46      public static final String TRUE = "1";
47      public static final String FALSE = "0";
48  
49      // properties
50   
51      
52      public static final String PROPERTY_APPLICATION_CODE = "mydashboard.identity.application.code";
53      public static final String PROPERTY_KEY_LOGIN = AppPropertiesService.getProperty( 
54              "mydashboard.identity.attribute.user.login" );
55      public static final String PROPERTY_KEY_GENDER = AppPropertiesService.getProperty( 
56              "mydashboard.identity.attribute.user.gender" );
57      public static final String PROPERTY_KEY_BIRTHDATE = AppPropertiesService.getProperty( 
58              "mydashboard.identity.attribute.user.bdate" );
59      public static final String PROPERTY_KEY_BIRTHPLACE = AppPropertiesService.getProperty( 
60              "mydashboard.identity.attribute.user.bplace" );
61      public static final String PROPERTY_KEY_NAME = AppPropertiesService.getProperty( 
62              "mydashboard.identity.attribute.user.name.family" );
63      public static final String PROPERTY_KEY_PREFERREDUSERNAME = AppPropertiesService.getProperty( 
64              "mydashboard.identity.attribute.user.name.preferred-username" );
65      public static final String PROPERTY_KEY_FIRSTNAME = AppPropertiesService.getProperty( 
66              "mydashboard.identity.attribute.user.name.given" );
67      public static final String PROPERTY_KEY_BIRTHCOUNTRY = AppPropertiesService.getProperty( 
68              "mydashboard.identity.attribute.user.bcountry" );
69      public static final String PROPERTY_KEY_ADDRESS = AppPropertiesService.getProperty( 
70              "mydashboard.identity.attribute.home-info.postal.address" );
71      public static final String PROPERTY_KEY_ADDRESSDETAIL = AppPropertiesService.getProperty( 
72              "mydashboard.identity.attribute.home-info.postal.addressdetail" );
73      public static final String PROPERTY_KEY_ADDRESS_POSTAL_CODE = AppPropertiesService.getProperty( 
74              "mydashboard.identity.attribute.home-info.postal.postalcode" );
75      public static final String PROPERTY_KEY_ADDRESS_CITY = AppPropertiesService.getProperty( 
76              "mydashboard.identity.attribute.home-info.postal.city" );
77      public static final String PROPERTY_KEY_EMAIL = AppPropertiesService.getProperty( 
78              "mydashboard.identity.attribute.user.home-info.online.email" );
79      public static final String PROPERTY_KEY_MOBILE_PHONE = AppPropertiesService.getProperty( 
80              "mydashboard.identity.attribute.user.home-info.telecom.mobile.number" );
81      public static final String PROPERTY_KEY_PHONE = AppPropertiesService.getProperty( 
82              "mydashboard.identity.attribute.user.home-info.telecom.telephone.number" );
83      public static final String PROPERTY_KEY_GENDER_LIST = AppPropertiesService.getProperty( 
84              "mydashboard.identity.application.listref.gender" );
85      public static final String PROPERTY_KEY_CONTACT_MODE_LIST = AppPropertiesService.getProperty( 
86              "mydashboard.identity.application.listref.contact-mode" );
87      public static final String PROPERTY_KEY_BIRTHPLACE_CODE = AppPropertiesService.getProperty( 
88              "mydashboard.identity.attribute.user.bplaceCode" );
89      public static final String PROPERTY_KEY_BIRTHCOUNTRY_CODE = AppPropertiesService.getProperty( 
90              "mydashboard.identity.attribute.user.bcountryCode" );
91      
92      //Fields validation messages
93      public static final String MESSAGE_ERROR_UPDATE_IDENTITY = "module.mydashboard.identity.message.error.identity.update";
94      public static final String MESSAGE_INFO_IDENTITY_UPDATED = "module.mydashboard.identity.message.info.identity.updated";
95      public static final String MESSAGE_ERROR_VALIDATION_LASTNAME = "module.mydashboard.identity.message.error.identity.check.format.lastname";
96      public static final String MESSAGE_ERROR_VALIDATION_PREFFEREDUSERNAME = "module.mydashboard.identity.message.error.identity.check.format.preferredusername";
97      public static final String MESSAGE_ERROR_VALIDATION_FIRSTNAME = "module.mydashboard.identity.message.error.identity.check.format.firstname";
98      public static final String MESSAGE_ERROR_VALIDATION_BIRTHDATE = "module.mydashboard.identity.message.error.identity.check.format.birthdate";
99      public static final String MESSAGE_ERROR_VALIDATION_BIRTHPLACE = "module.mydashboard.identity.message.error.identity.check.format.birthplace";
100     public static final String MESSAGE_ERROR_VALIDATION_BIRTHCOUNTRY = "module.mydashboard.identity.message.error.identity.check.format.birthcountry";
101     public static final String MESSAGE_ERROR_VALIDATION_BIRTHCITY = "module.mydashboard.identity.message.error.identity.check.format.birthcity";
102     public static final String MESSAGE_ERROR_VALIDATION_ADDRESS = "module.mydashboard.identity.message.error.identity.check.format.address";
103     public static final String MESSAGE_ERROR_VALIDATION_ADDRESS_DETAIL = "module.mydashboard.identity.message.error.identity.check.format.address-detail";
104     public static final String MESSAGE_ERROR_VALIDATION_ADDRESS_POSTALCODE = "module.mydashboard.identity.message.error.identity.check.format.address-postalcode";
105     public static final String MESSAGE_ERROR_VALIDATION_ADDRESS_CITY = "module.mydashboard.identity.message.error.identity.check.format.address-city";
106     public static final String MESSAGE_ERROR_VALIDATION_PHONE = "module.mydashboard.identity.message.error.identity.check.format.phone";
107     public static final String MESSAGE_ERROR_VALIDATION_MOBILEPHONE = "module.mydashboard.identity.message.error.identity.check.format.mobilephone";
108     public static final String MESSAGE_ERROR_VALIDATION_EMAIL = "module.mydashboard.identity.message.error.identity.check.format.email";
109     public static final String MESSAGE_ERROR_EMAIL_EMPTY = "module.mydashboard.identity.message.error.identity.check.empty.email";
110     public static final String MESSAGE_ERROR_TELEPHONE_EMPTY = "module.mydashboard.identity.message.error.identity.check.empty.phone";
111     public static final String MESSAGE_ERROR_EMPTY_ERROR_PREFIX = "module.mydashboard.identity.message.error.identity.check.empty.";
112     public static final String MESSAGE_ERROR_VALIDATION_BIRTHPLACE_CODE = "module.mydashboard.identity.message.error.identity.check.format.birthplaceCode";
113     public static final String MESSAGE_ERROR_VALIDATION_BIRTHCOUNTRY_CODE = "module.mydashboard.identity.message.error.identity.check.format.birthcountryCode";
114     public static final String MESSAGE_ERROR_TOKEN = "Invalid Security Token";
115     
116     // FIELDS VALIDATION REGEXP
117     public static final String PROPERTY_KEY_VALIDATION_REGEXP_LAST_NAME = AppPropertiesService.getProperty( 
118             "mydashboard.identity.application.validation.regex.lastname" );
119     public static final String PROPERTY_KEY_VALIDATION_REGEXP_PREFERREDUSERNAME = AppPropertiesService.getProperty( 
120             "mydashboard.identity.application.validation.regex.preferredusername" );
121     public static final String PROPERTY_KEY_VALIDATION_REGEXP_FIRSTNAME = AppPropertiesService.getProperty( 
122             "mydashboard.identity.application.validation.regex.firstname" );
123     public static final String PROPERTY_KEY_VALIDATION_REGEXP_BIRTHPLACE = AppPropertiesService.getProperty( 
124             "mydashboard.identity.application.validation.regex.birthplace" );
125     public static final String PROPERTY_KEY_VALIDATION_REGEXP_BIRTHCOUNTRY = AppPropertiesService.getProperty( 
126             "mydashboard.identity.application.validation.regex.birthcountry" );
127     public static final String PROPERTY_KEY_VALIDATION_REGEXP_BIRTHDATE = AppPropertiesService.getProperty( 
128             "mydashboard.identity.application.validation.regex.birthdate" );
129     public static final String PROPERTY_KEY_VALIDATION_REGEXP_PHONE = AppPropertiesService.getProperty( 
130             "mydashboard.identity.application.validation.regex.phone" );
131     public static final String PROPERTY_KEY_VALIDATION_REGEXP_MOBILEPHONE = AppPropertiesService.getProperty( 
132             "mydashboard.identity.application.validation.regex.mobilephone" );
133     public static final String PROPERTY_KEY_VALIDATION_REGEXP_ADDRESS = AppPropertiesService.getProperty( 
134             "mydashboard.identity.application.validation.regex.address" );
135     public static final String PROPERTY_KEY_VALIDATION_REGEXP_ADDRESS_DETAIL = AppPropertiesService.getProperty( 
136             "mydashboard.identity.application.validation.regex.address-detail" );
137     public static final String PROPERTY_KEY_VALIDATION_REGEXP_ADDRESS_POSTALCODE = AppPropertiesService.getProperty( 
138             "mydashboard.identity.application.validation.regex.address-postalcode" );
139     public static final String PROPERTY_KEY_VALIDATION_REGEXP_ADDRESS_CITY = AppPropertiesService.getProperty( 
140             "mydashboard.identity.application.validation.regex.address-city" );   
141     public static final String PROPERTY_KEY_VALIDATION_REGEXP_BIRTHPLACE_CODE = AppPropertiesService.getProperty( 
142             "mydashboard.identity.application.validation.regex.birthplaceCode" );
143     public static final String PROPERTY_KEY_VALIDATION_REGEXP_BIRTHCOUNTRY_CODE = AppPropertiesService.getProperty( 
144             "mydashboard.identity.application.validation.regex.birthcountryCode" );    
145     
146     
147     //Fields for dashboard Identity
148     public static final String ATTRIBUTE_DB_IDENTITY_CONNECTION_ID = "connectionId";
149     public static final String ATTRIBUTE_DB_IDENTITY_CUSTOMER_ID = "customerId";
150     public static final String ATTRIBUTE_DB_IDENTITY_LAST_NAME = "lastName";
151     public static final String ATTRIBUTE_DB_IDENTITY_PREFERRED_USER_NAME = "preferredUsername";
152     public static final String ATTRIBUTE_DB_IDENTITY_FIRSTNAME = "firstname";
153     public static final String ATTRIBUTE_DB_IDENTITY_GENDER = "gender";
154     public static final String ATTRIBUTE_DB_IDENTITY_BIRTHDATE = "birthdate";
155     public static final String ATTRIBUTE_DB_IDENTITY_BIRTHPLACE = "birthplace";
156     public static final String ATTRIBUTE_DB_IDENTITY_BIRTHCOUNTRY = "birthcountry";
157     public static final String ATTRIBUTE_DB_IDENTITY_ADDRESS = "address";
158     public static final String ATTRIBUTE_DB_IDENTITY_ADDRESS_DETAIL = "address_detail";
159     public static final String ATTRIBUTE_DB_IDENTITY_ADDRESS_POSTAL_CODE = "address_postalcode";
160     public static final String ATTRIBUTE_DB_IDENTITY_ADDRESS_CITY = "address_city";
161     public static final String ATTRIBUTE_DB_IDENTITY_BILLING_ADDRESS = "billing_address";
162     public static final String ATTRIBUTE_DB_IDENTITY_BILLING_ADDRESS_DETAIL = "billing_address_detail";
163     public static final String ATTRIBUTE_DB_IDENTITY_BILLING_ADDRESS_POSTAL_CODE = "billing_address_postal_code";
164     public static final String ATTRIBUTE_DB_IDENTITY_BILLING_ADDRESS_CITY = "billing_address_city";
165     public static final String ATTRIBUTE_DB_IDENTITY_EMAIL = "email";
166     public static final String ATTRIBUTE_DB_IDENTITY_PHONE = "phone";
167     public static final String ATTRIBUTE_DB_IDENTITY_LOGIN = "login";
168     public static final String ATTRIBUTE_DB_IDENTITY_MOBILE_PHONE = "mobile_phone";
169     public static final String ATTRIBUTE_DB_IDENTITY_FRANCE_CONNECT_CERTIFIED = "franceconnect_certified";
170     public static final String ATTRIBUTE_DB_IDENTITY_BIRTHPLACE_CODE = "birthplace_code";
171     public static final String ATTRIBUTE_DB_IDENTITY_BIRTHCOUNTRY_CODE = "birthcountry_code";
172     
173     //PROPERTY_CERTIFICATION_PROCESS_NOT_CERTIFIABLE
174     public static final String PROPERTY_CERTIFICATION_PROCESS_NOT_CERTIFIABLE = AppPropertiesService.getProperty(
175             "mydashboard.identity.application.certification.process.not_certifiable", "DEC");
176     
177     public static final int PROPERTY_CERTIFICATION_PROCESS_NOT_CERTIFIABLE_LEVEL = AppPropertiesService.getPropertyInt(
178             "mydashboard.identity.application.certification.process.not_certifiable.level", 100);
179     
180     
181     //ORIGIN ACTION COMPLETION
182     public static final int ORIGIN_ACTION_CREATE_ACCOUNT = 1;
183     public static final int ORIGIN_ACTION_MODIFY_ACCOUNT = 2;
184     public static final int ORIGIN_ACTION_COMPLETION_ACCOUNT = 3;
185     
186     public static final String PROPERTY_SUSPICIOUS_LIST_RULE_STRIC       = AppPropertiesService.getProperty( "mydashboard.identity.suspicious.identity.list_code_rule.strict", "RG_GEN_StrictDoublon_01" );
187     public static final String PROPERTY_SUSPICIOUS_LIST_RULE_NOT_STRIC   = AppPropertiesService.getProperty( "mydashboard.identity.suspicious.identity.list_code_rule.not_strict",
188             "RG_GEN_SuspectDoublon_09" );
189     
190     public static final boolean PROPERTY_SUSPICIOUS_IDENTITY_ACTIVATION_INDICATEUR = AppPropertiesService.getPropertyBoolean( "mydashboard.identity.suspicious.activation_indicator", false );
191     
192     /**
193      * Default constructor
194      */
195     private Constants(  )
196     {
197     }
198 }