1 /*******************************************************************************
2 * Copyright � Igor Barma, Alexandre Desoubeaux, Christian Martel, Eric Brun, Mathieu Amblard, Gwenael Gevet, Pierre Guillot, 2012
3 * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Alexandre Lefevre, Marc Salvat 2014-2016
4 * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Marc Salvat, Marc Suarez, Harifetra Ramamonjy 2017
6 * This file is part of the work and learning management system Pentila Nero.
8 * Pentila Nero is free software. You can redistribute it and/or modify since
9 * you respect the terms of either (at least one of the both license) :
10 * - under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
13 * - the CeCILL-C as published by CeCILL-C; either version 1 of the
14 * License, or any later version
15 * - the GNU Lesser General Public License as published by the
16 * Free Software Foundation, either version 3 of the license,
17 * or (at your option) any later version.
19 * There are special exceptions to the terms and conditions of the
20 * licenses as they are applied to this software. View the full text of
21 * the exception in file LICENSE-PROJECT.txt in the directory of this software
24 * Pentila Nero is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * Licenses for more details.
29 * You should have received a copy of the GNU Affero General Public License
30 * and the CeCILL-C and the GNU Lesser General Public License along with
31 * Pentila Nero. If not, see :
32 * <http://www.gnu.org/licenses/> and
33 * <http://www.cecill.info/licences.fr.html>.
34 ******************************************************************************/
35 package com.pentila.util;
37 import java.util.ArrayList;
38 import java.util.Collections;
39 import java.util.HashMap;
40 import java.util.List;
43 import javax.naming.directory.Attributes;
45 import com.liferay.portal.kernel.exception.SystemException;
46 import com.liferay.portal.kernel.json.JSONException;
47 import com.liferay.portal.kernel.json.JSONFactoryUtil;
48 import com.liferay.portal.kernel.json.JSONObject;
49 import com.liferay.portal.kernel.log.Log;
50 import com.liferay.portal.kernel.log.LogFactoryUtil;
51 import com.liferay.portal.kernel.repository.model.FileEntry;
52 import com.liferay.portal.kernel.repository.model.Folder;
53 import com.liferay.portal.kernel.search.Hits;
54 import com.liferay.portal.kernel.util.HttpUtil;
55 //import com.liferay.portal.util.PrefsPropsUtil;
56 import com.liferay.portal.kernel.util.PrefsPropsUtil;
57 import com.liferay.portal.kernel.util.PropsUtil;
58 import com.liferay.portal.kernel.util.StringPool;
59 import com.liferay.portal.model.Group;
60 import com.liferay.portal.model.Portlet;
61 import com.liferay.portal.model.User;
62 import com.liferay.portal.service.PortletLocalServiceUtil;
63 import com.liferay.portal.util.PortalUtil;
64 import com.liferay.portlet.blogs.model.BlogsEntry;
65 import com.liferay.portlet.documentlibrary.model.DLFileEntry;
66 import com.liferay.portlet.documentlibrary.model.DLFolder;
67 import com.liferay.portlet.messageboards.model.MBCategory;
68 import com.liferay.portlet.messageboards.model.MBMessage;
69 import com.pentila.entSavoie.agenda.model.EventAgenda;
70 import com.pentila.entSavoie.applicationManager.model.AMSingleUsers;
71 import com.pentila.entSavoie.applicationManager.service.AMSingleUsersLocalServiceUtil;
72 import com.pentila.entSavoie.cahierDeTexte.model.EventCDT;
73 import com.pentila.entSavoie.internalMessaging.model.InternalMessage;
74 import com.pentila.entSavoie.internalMessaging.model.Message;
75 import com.pentila.entSavoie.internalMessaging.model.RssItem;
76 import com.pentila.entSavoie.synchroLdap.impl.MembershipManager;
77 import com.pentila.entSavoie.synchroLdap.impl.SynchronizationManager;
78 import com.pentila.entSavoie.userPurge.UserPurgeImpl;
79 import com.pentila.entSavoie.utils.ENTMainUtilsLocalService;
80 import com.pentila.entSavoie.utils.ENTMainUtilsLocalServiceUtil;
82 public class ENTMainUtilsLocalServiceImpl implements ENTMainUtilsLocalService {
84 private static Log logger = LogFactoryUtil.getLog(ENTMainUtilsLocalServiceImpl.class);
86 // This map contains all pairs propertyKey / propertyValue, so that they are loaded only once
87 // and provided by the map when asked (in order to minimize IOs on portal-ext.properties file)
88 private static Map<String, String> propertiesMap = new HashMap<String, String>();
90 public static final String ENT_ORGROOT_NAME = "ent.orgRoot.name";
91 public static final String ENT_ORGROOT_MAIL = "ent.orgRoot.mail";
92 public static final String ENT_ORGROOT_PORTALMEMBERSNAME = "ent.orgRoot.portalMembersName";
93 public static final String ENT_ORGROOT_DEPARTMENT = "ent.orgRoot.department";
94 public static final String ENT_GOOGLEANALYTICS_CODE = "ent.google.analytics.code";
95 public static final String ENT_CHART = "ent.chart";
96 public static final String XMPP_HOST = "xmpp.host";
97 public static final String XMPP_ENABLE = "xmpp.enable";
98 public static final String XMPP_DOMAIN = "xmpp.domain";
99 public static final String VISIO_URL = "visio.url";
100 public static final String VISIO_RTMP_DOMAIN = "visio.rtmp.domain";
101 public static final String VISIO_RTMP_SERVICE = "visio.rtmp.service";
102 public static final String VISIO_SALT = "visio.salt";
103 public static final String MAIL_NOREPLY = "ent.mail.noreply";
104 public static final String MAIL_REPLY_SUBJECT = "ent.mail.reply.subject";
105 public static final String MAIL_REPLY_BODY = "ent.mail.reply.body";
106 public static final String VISIO_ADMIN_LOGIN = "visio.admin.login";
107 public static final String VISIO_ADMIN_PASSWORD = "visio.admin.password";
108 public static final String FILE_ERROR_SWF = "file.error.swf";
109 public static final String FILE_ERROR_FLV = "file.error.flv";
110 public static final String ENT_CONFIRMATION_SENDER_ID = "ent.confirmation.sender.id";
111 public static final String ENT_SCHOOL_IMPORT_TYPE = "ent.school.import.type";
112 public static final String ENT_GROUP_MANAGMENT = "ent.group.managment";
113 public static final String ENT_LDAP_SCHEMA_SUPANN = "ent.ldap.schema.supann";
114 public static final String FLASH_FILE_STATE_PROGRESS = "actualite.flash.file.state.progress";
115 public static final String FLASH_FILE_STATE_ERROR = "actualite.flash.file.state.error";
116 public static final String FLASH_FILE_STATE_CONVERT = "actualite.flash.file.state.convert";
117 public static final String XITI_ENABLE = "xiti.enable";
118 public static final String XITI_ID_PROJET = "xiti.id.projet";
119 public static final String XITI_ID_PLATEFORME = "xiti.id.plateforme";
120 public static final String XITI_ID_COLLECTIVITE = "xiti.id.collectivite";
121 public static final String XITI_LIST_ETAB_ID = "xiti.list.etab.id";
122 public static final String LDAP_IMPORT_MODIFY_DATE = "ldap.import.enable.modifyDate";
123 public static final String ENT_GROUP_INTRANET_ENABLE = "ent.group.intranet.enable";
124 public static final String ENT_LDAP_SYNCHRO_ROLE_DEFAULT = "ent.ldap.synchro.role.default";
125 public static final String ENT_LDAP_SYNCHRO_ETAB_NAME = "ent.ldap.synchro.etab.name";
126 public static final String ENT_LDAP_SYNCHRO_FORCE_LIST_INST = "ent.ldap.synchro.force.listinst";
127 public static final String ENT_AGENDA_ENABLE_FORCESUBSCRIBE = "ent.agenda.enable.forceSubscribe";
128 public static final String ENT_MOBILE_NOTIFICATION_ENABLE = "ent.mobile.notification.enable";
129 public static final String ENT_NOTIFICATIONS_ENABLE = "ent.notifications.enable";
130 public static final String ENT_MAILFORWARD_ENABLE = "ent.mailforward.enable";
131 public static final String PUBLIC_BLOG_URL = "ent.public.web.blog.url";
132 public static final String PUBLIC_FRONT_BLOG_URL = "ent.public.front.blog.url";
133 public static final String WORDPRESS_USERNAME = "wordpress.username";
134 public static final String WORDPRESS_PASSWORD = "wordpress.password";
135 public static final String WORDPRESS_URL = "wordpress.url";
136 public static final String WORDPRESS_ADMIN_SUFFIX_URL = "wordpress.admin.suffix.url";
137 public static final String WORDPRESS_SUFFIX_URL = "wodpress.suffix.url";
138 public static final String ENT_MAIL_ACADEMIC_SUFFIX = "ent.mail.academic.suffix";
139 public static final String WEBDAV_ENABLE = "webdav.enable";
140 public static final String ENT_GROUP_DEFAULT_VIEW = "ent.group.default.view";
141 public static final String SHIBBOLETH_AUTH_ENABLED = "shibboleth.auth.enable";
142 public static final String SHIBBOLETH_LOGOUT_URL = "shibboleth.logout.url";
143 public static final String ENT_MAILSENDER_USE_FORWARD = "ent.mailSender.use.forward";
144 public static final String PIWIK_ENABLE = "piwik.enable";
145 public static final String PIWIK_URL = "piwik.url";
146 public static final String PIWIK_API_URL = "piwik.api_url";
147 public static final String PIWIK_SITE_ID = "piwik.siteId";
148 public static final String PIWIK_TOKEN_AUTH = "piwik.token_auth";
149 public static final String LDAP_AUTH_MAIL_FILTER = "ldap.auth.mail.search.filter";
150 public static final String VIEW_AJAX_JSP_KEY = "portlet.key.view.ajax.jsp";
151 public static final String DEFAULT_PORLET_HEIGHT = "default.portlet.height";
152 public static final String SPECIAL_PORTLETS_THEME = "special.portlets.theme";
153 public static final String ENT_FULLSCREEN_ALLOWED = "ent.fullscreen.allowed";
154 public static final String ENT_FULLSCREEN_MAXIMIZE_KEY = "ent.fullscreen.maximize.key";
155 public static final String ENT_LIST_ROLES_ENABLED = "ent.list.roles.enabled";
156 public static final String ENT_LIST_ROLES_NATIONAUX_ENABLED = "ent.list.roles.nationaux.enabled";
157 public static final String ENT_IMPORT_UTILISATEURS_ENABLED = "ent.import.utilisateurs.enabled";
158 public static final String ENT_IMPORT_UTILISATEURS_PATH = "ent.import.utilisateurs.path";
159 public static final String ENT_KEY_LANGUAGE_SUFFIX = "ent.key.language.suffix";
160 public static final String ENT_SOCIAL_ACTIVITY_ENABLED = "ent.social.activity.enabled";
161 public static final String ENT_MENU_CATEGORIES = "ent.menu.categories";
162 public static final String ENT_MENU_LINK_ETAB_CATEGORY = "ent.menu.link.etab.category";
163 public static final String ENT_CAPTCHA_PUBLIC_KEY = "ent.captcha.public.key";
164 public static final String ENT_CAPTCHA_PRIVATE_KEY = "ent.captcha.private.key";
165 public static final String ENT_PLATEFORM_NAME = "ent.plateform.name";
166 public static final String ENT_RESET_PASSWORD_URL = "ent.reset.password.url";
167 public static final String ENT_VIE_SCOLAIRE_USER_ID = "ent.vie.scolaire.user.id";
168 public static final String MIME_TYPES = "mime.types";
169 public static final String ENT_POPULATION_MANAGER_ID = "ent.population.manager.id";
170 public static final String ENT_INCIDENTS_USERS_NOTIFICATION = "ent.incidents.users.notication";
171 public static final String LOGIN_DEFAULT_PAGE_LANDING = "login.default.page.landing";
172 public static final String LOGIN_DEFAULT_APPLICATION_LANDING = "login.default.application.landing";
173 public static final String ENT_LSO_ENABLED = "ent.lso.enabled";
174 public static final String ENT_LSO_GROUP_LANDING_PAGE = "ent.lso.group.landing.page";
175 public static final String JDBC_ENTLOG_URL = "jdbc.entlog.url";
176 public static final String JDBC_DEFAULT_USER = "jdbc.default.username";
177 public static final String JDBC_DEFAULT_PASSWD = "jdbc.default.password";
178 public static final String DL_HOOK_FILE_SYSTEM_ROOT_DIR = "dl.hook.file.system.root.dir";
179 public static final String USER_PURGE_OUTPUT_FILE = "user.purge.output.file";
180 public static final String SWFTOOLS_DIRECTORY = "swftools.directory";
181 public static final String DL_STORE_ISCO3 = "dl.store.isCO3";
182 public static final String MAIL_DEFAULT_ACCOUNTS = "mail.default.accounts";
183 public static final String HELP_MENU_LINK = "help.menu.link";
184 public static final String SUPPORT_LOCAL_ADMINS_ENABLE = "support.local.admins.enable";
185 public static final String SUPPORT_ADMIN_USURPATION_ENABLE = "support.admin.usurpation.enable";
186 public static final String SUPPORT_MAIL = "support.mail";
187 public static final String EDT_PRIVATE_KEY_PATH = "edt.private.key.path";
188 public static final String IMPORT_DEVMODE = "import.devmode";
189 public static final String SYNCHRO_FORCE_PARENT_MEMBERSHIP = "synchro.force.parent.membership";
190 public static final String EDT_IMPORTFILES_DIRECTORY = "edt.importfiles.directory";
191 public static final String MESSAGING_STUDENT_MAX_RECEIVERS = "messaging.student.max.receivers";
192 public static final String MESSAGING_PARENT_MAX_RECEIVERS = "messaging.parent.max.receivers";
193 public static final String MESSAGING_PERSONAL_MAX_RECEIVERS = "messaging.personal.max.receivers";
194 public static final String PRONOTE_STUDENT_LINK_LIST = "pronote.student.link.list";
195 public static final String PRONOTE_PARENT_LINK_LIST = "pronote.parent.link.list";
196 public static final String PRONOTE_TEACHER_LINK_LIST = "pronote.teacher.link.list";
197 public static final String ENT_MENU_PORTLET_HIDDEN = "ent.menu.portlet.hidden";
203 public static final String UPLOAD_SERVLET_REQUEST_MAX_SIZE = "com.liferay.portal.upload.UploadServletRequestImpl.max.size";
208 public static final String DL_FILE_MAX_SIZE = "dl.file.max.size";
213 public static final String ETHERPAD_URL = "etherpad.url";
214 public static final String ETHERPAD_API_KEY = "etherpad.api.key";
217 * Constant define in ext to parametized the URL of apps
219 public static final String PORTLET_URL_RACK = "portlet.url.rack";
220 public static final String PORTLET_URL_SCHOOLBAB = "portlet.url.schoolbag";
221 public static final String PORTLET_URL_NEWS = "portlet.url.news";
222 public static final String PORTLET_URL_FORUM = "portlet.url.forum";
223 public static final String PORTLET_URL_GROUP = "portlet.url.group";
224 public static final String PORTLET_URL_MESSAGING = "portlet.url.messaging";
225 public static final String PORTLET_URL_TEXTBOOK = "portlet.url.textbook";
226 public static final String PORTLET_URL_SEARCHENGINE = "portlet.url.searchengine";
227 public static final String PORTLET_URL_AGENDA = "portlet.url.agenda";
232 public static final String PLATFORM = "platform";
233 public static final String PLATFORM_HN_PROD = "HN_PROD";
234 public static final String PLATFORM_HN_PREPROD = "HN_PREPROD";
235 public static final String PLATFORM_CO3_PROD = "CO3_PROD";
236 public static final String PLATFORM_CO3_PREPROD = "CO3_PREPROD";
237 public static final String PLATFORM_CAIRNS_PROD = "CAIRNS_PROD";
238 public static final String PLATFORM_CAIRNS_PREPROD = "CAIRNS_PREPROD";
243 public static final String OAUTH_CLIENT_ID = "oauth.clientid";
244 public static final String OAUTH_SECRET_ID = "oauth.secretid";
249 public static final String SERVICE_GUIDE_PATH = "guide.";
254 public static final String EDX_BASEURL = "edx.baseurl";
255 public static final String EDX_ACCESS_TOKEN= "edx.accesstoken";
257 * Method to get the upload max size from portal-ext
258 * @param companyId the company id of the context
259 * @return the value of com.liferay.portal.upload.UploadServletRequestImpl.max.size value in portal ext
261 public boolean isImportDevMode(long companyId) {
262 if (propertiesMap.containsKey(IMPORT_DEVMODE)) {
263 return propertiesMap.get(IMPORT_DEVMODE).equals("true");
267 res = PrefsPropsUtil.getBoolean(companyId, IMPORT_DEVMODE);
268 } catch (SystemException e) {
271 propertiesMap.put(IMPORT_DEVMODE, res ? "true" : "false");
277 * Method to get the upload max size from portal-ext
278 * @param companyId the company id of the context
279 * @return the value of com.liferay.portal.upload.UploadServletRequestImpl.max.size value in portal ext
281 public long getUploadServletRequestMaxSize(long companyId){
282 if (propertiesMap.containsKey(UPLOAD_SERVLET_REQUEST_MAX_SIZE)) {
283 return Long.parseLong(propertiesMap.get(UPLOAD_SERVLET_REQUEST_MAX_SIZE));
287 res = PrefsPropsUtil.getLong(companyId, UPLOAD_SERVLET_REQUEST_MAX_SIZE);
288 } catch (SystemException e) {
291 propertiesMap.put(UPLOAD_SERVLET_REQUEST_MAX_SIZE, res + "");
296 * Method to get the dl file max size from portal-ext
297 * @param companyId the company id of the context
298 * @return the value of dl.file.max.size value in portal ext
300 public long getDLFileMaxSize(long companyId){
301 if (propertiesMap.containsKey(DL_FILE_MAX_SIZE)) {
302 return Long.parseLong(propertiesMap.get(DL_FILE_MAX_SIZE));
306 res = PrefsPropsUtil.getLong(companyId, DL_FILE_MAX_SIZE);
307 } catch (SystemException e) {
310 propertiesMap.put(DL_FILE_MAX_SIZE, res + "");
316 * Method to get the etherpad URL from portal-ext
317 * @param companyId the company id of the context
318 * @return the value of etherpad.url value in portal ext
320 public String getEtherpadUrl(long companyId){
321 if (propertiesMap.containsKey(ETHERPAD_URL)) {
322 return propertiesMap.get(ETHERPAD_URL);
326 res = PrefsPropsUtil.getString(companyId, ETHERPAD_URL);
327 } catch (SystemException e) {
330 propertiesMap.put(ETHERPAD_URL, res);
335 * Method to get the etherpad URL from portal-ext
336 * @param companyId the company id of the context
337 * @return the value of etherpad.api.key value in portal ext
339 public String getEtherpadApiKey(long companyId){
340 if (propertiesMap.containsKey(ETHERPAD_API_KEY)) {
341 return propertiesMap.get(ETHERPAD_API_KEY);
345 res = PrefsPropsUtil.getString(companyId, ETHERPAD_API_KEY);
346 } catch (SystemException e) {
349 propertiesMap.put(ETHERPAD_API_KEY, res);
354 * Method to get the help URL from portal-ext
355 * @param companyId the company id of the context
356 * @return the value of help.menu.link value in portal ext
358 public String getHelpMenuLink(long companyId){
359 if (propertiesMap.containsKey(HELP_MENU_LINK)) {
360 return propertiesMap.get(HELP_MENU_LINK);
364 res = PrefsPropsUtil.getString(companyId, HELP_MENU_LINK);
365 } catch (SystemException e) {
368 propertiesMap.put(HELP_MENU_LINK, res);
373 * Method to get the mail default account from portal-ext
374 * @param companyId the company id of the context
375 * @return the value of mail.default.accounts value in portal ext
377 public String getMailDefaultAccount(long companyId){
378 if (propertiesMap.containsKey(MAIL_DEFAULT_ACCOUNTS)) {
379 return propertiesMap.get(MAIL_DEFAULT_ACCOUNTS);
383 res = PrefsPropsUtil.getString(companyId, MAIL_DEFAULT_ACCOUNTS);
384 } catch (SystemException e) {
387 propertiesMap.put(MAIL_DEFAULT_ACCOUNTS, res);
392 * Method to get the rack URL from portal-ext
393 * @param companyId the company id of the context
394 * @return the value of portal.url.rack value in portal ext
396 public String getPortletUrlRack(long companyId){
397 if (propertiesMap.containsKey(PORTLET_URL_RACK)) {
398 return propertiesMap.get(PORTLET_URL_RACK);
402 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_RACK);
403 } catch (SystemException e) {
406 propertiesMap.put(PORTLET_URL_RACK, res);
411 * Method to get the schoolbag URL from portal-ext
412 * @param companyId the company id of the context
413 * @return the value of portal.url.schoolbag value in portal ext
415 public String getPortletUrlSchoolBag(long companyId){
416 if (propertiesMap.containsKey(PORTLET_URL_SCHOOLBAB)) {
417 return propertiesMap.get(PORTLET_URL_SCHOOLBAB);
421 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_SCHOOLBAB);
422 } catch (SystemException e) {
425 propertiesMap.put(PORTLET_URL_SCHOOLBAB, res);
429 * Method to get the news URL from portal-ext
430 * @param companyId the company id of the context
431 * @return the value of portal.url.news value in portal ext
433 public String getPortletUrlNews(long companyId){
434 if (propertiesMap.containsKey(PORTLET_URL_NEWS)) {
435 return propertiesMap.get(PORTLET_URL_NEWS);
439 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_NEWS);
440 } catch (SystemException e) {
443 propertiesMap.put(PORTLET_URL_NEWS, res);
447 * Method to get the forum URL from portal-ext
448 * @param companyId the company id of the context
449 * @return the value of portal.url.forum value in portal ext
451 public String getPortletUrlForum(long companyId){
452 if (propertiesMap.containsKey(PORTLET_URL_FORUM)) {
453 return propertiesMap.get(PORTLET_URL_FORUM);
457 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_FORUM);
458 } catch (SystemException e) {
461 propertiesMap.put(PORTLET_URL_FORUM, res);
465 * Method to get the group URL from portal-ext
466 * @param companyId the company id of the context
467 * @return the value of portal.url.group value in portal ext
469 public String getPortletUrlGroup(long companyId){
470 if (propertiesMap.containsKey(PORTLET_URL_GROUP)) {
471 return propertiesMap.get(PORTLET_URL_GROUP);
475 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_GROUP);
476 } catch (SystemException e) {
479 propertiesMap.put(PORTLET_URL_GROUP, res);
483 * Method to get the messaging URL from portal-ext
484 * @param companyId the company id of the context
485 * @return the value of portal.url.messaging value in portal ext
487 public String getPortletUrlMessaging(long companyId){
488 if (propertiesMap.containsKey(PORTLET_URL_MESSAGING)) {
489 return propertiesMap.get(PORTLET_URL_MESSAGING);
493 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_MESSAGING);
494 } catch (SystemException e) {
497 propertiesMap.put(PORTLET_URL_MESSAGING, res);
501 * Method to get the textbook URL from portal-ext
502 * @param companyId the company id of the context
503 * @return the value of portal.url.textbook value in portal ext
505 public String getPortletUrlTextbook(long companyId){
506 if (propertiesMap.containsKey(PORTLET_URL_TEXTBOOK)) {
507 return propertiesMap.get(PORTLET_URL_TEXTBOOK);
511 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_TEXTBOOK);
512 } catch (SystemException e) {
515 propertiesMap.put(PORTLET_URL_TEXTBOOK, res);
519 * Method to get the search engine URL from portal-ext
520 * @param companyId the company id of the context
521 * @return the value of portal.url.searchengine value in portal ext
523 public String getPortletUrlSearchengine(long companyId){
524 if (propertiesMap.containsKey(PORTLET_URL_SEARCHENGINE)) {
525 return propertiesMap.get(PORTLET_URL_SEARCHENGINE);
529 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_SEARCHENGINE);
530 } catch (SystemException e) {
533 propertiesMap.put(PORTLET_URL_SEARCHENGINE, res);
537 * Method to get the agenda URL from portal-ext
538 * @param companyId the company id of the context
539 * @return the value of portal.url.agenda value in portal ext
541 public String getPortletUrlAgenda(long companyId){
542 if (propertiesMap.containsKey(PORTLET_URL_AGENDA)) {
543 return propertiesMap.get(PORTLET_URL_AGENDA);
547 res = PrefsPropsUtil.getString(companyId, PORTLET_URL_AGENDA);
548 } catch (SystemException e) {
551 propertiesMap.put(PORTLET_URL_AGENDA, res);
556 public String getSwfToolsDirectory(long companyId) {
557 if (propertiesMap.containsKey(SWFTOOLS_DIRECTORY)) {
558 return propertiesMap.get(SWFTOOLS_DIRECTORY);
562 res = PrefsPropsUtil.getString(companyId, SWFTOOLS_DIRECTORY);
563 } catch (SystemException e) {
566 propertiesMap.put(SWFTOOLS_DIRECTORY, res);
570 public boolean isEntLsoEnabled(long companyId) {
571 if (propertiesMap.containsKey(ENT_LSO_ENABLED)) {
572 return propertiesMap.get(ENT_LSO_ENABLED).equals("true");
576 res = PrefsPropsUtil.getBoolean(companyId, ENT_LSO_ENABLED);
577 } catch (SystemException e) {
580 propertiesMap.put(ENT_LSO_ENABLED, res ? "true" : "false");
584 public String getLSOGroupLandingPage(long companyId) {
585 if (propertiesMap.containsKey(ENT_LSO_GROUP_LANDING_PAGE)) {
586 return propertiesMap.get(ENT_LSO_GROUP_LANDING_PAGE);
590 res = PrefsPropsUtil.getString(companyId, ENT_LSO_GROUP_LANDING_PAGE);
591 } catch (SystemException e) {
594 propertiesMap.put(ENT_LSO_GROUP_LANDING_PAGE, res);
599 public String getLoginDefaultPageLanding(long companyId) {
600 if (propertiesMap.containsKey(LOGIN_DEFAULT_PAGE_LANDING)) {
601 return propertiesMap.get(LOGIN_DEFAULT_PAGE_LANDING);
605 res = PrefsPropsUtil.getString(companyId, LOGIN_DEFAULT_PAGE_LANDING);
606 } catch (SystemException e) {
609 propertiesMap.put(LOGIN_DEFAULT_PAGE_LANDING, res);
615 * Get default application to load on login
617 public String getLoginDefaultApplicationLanding(long companyId) {
618 if (propertiesMap.containsKey(LOGIN_DEFAULT_APPLICATION_LANDING)) {
619 return propertiesMap.get(LOGIN_DEFAULT_APPLICATION_LANDING);
623 res = PrefsPropsUtil.getString(companyId, LOGIN_DEFAULT_APPLICATION_LANDING);
624 } catch (SystemException e) {
627 propertiesMap.put(LOGIN_DEFAULT_APPLICATION_LANDING, res);
633 public String getAuthMailFilter(long companyId) {
634 if (propertiesMap.containsKey(LDAP_AUTH_MAIL_FILTER)) {
635 return propertiesMap.get(LDAP_AUTH_MAIL_FILTER);
637 String res = "mail=@email_address@)";
639 res = PrefsPropsUtil.getString(companyId, LDAP_AUTH_MAIL_FILTER);
640 } catch (SystemException e) {
643 propertiesMap.put(LDAP_AUTH_MAIL_FILTER, res);
647 public long getEntConfirmationSenderId(long companyId) {
648 if (propertiesMap.containsKey(ENT_CONFIRMATION_SENDER_ID)) {
650 return Long.parseLong(propertiesMap.get(ENT_CONFIRMATION_SENDER_ID));
651 } catch (Exception e) {
655 Long res = new Long(0);
657 res = PrefsPropsUtil.getLong(companyId, ENT_CONFIRMATION_SENDER_ID);
658 } catch (SystemException e) {
661 propertiesMap.put(ENT_CONFIRMATION_SENDER_ID, ""+res);
665 public Boolean isGroupManagment(long companyId) {
666 if (propertiesMap.containsKey(ENT_GROUP_MANAGMENT)) {
667 return propertiesMap.get(ENT_GROUP_MANAGMENT).equals("true");
671 res = PrefsPropsUtil.getBoolean(companyId, ENT_GROUP_MANAGMENT);
672 } catch (SystemException e) {
675 propertiesMap.put(ENT_GROUP_MANAGMENT, res ? "true" : "false");
680 public Boolean isSchemaSupann(long companyId) {
681 if (propertiesMap.containsKey(ENT_LDAP_SCHEMA_SUPANN)) {
682 return propertiesMap.get(ENT_LDAP_SCHEMA_SUPANN).equals("true");
686 res = PrefsPropsUtil.getBoolean(companyId, ENT_LDAP_SCHEMA_SUPANN);
687 } catch (SystemException e) {
690 propertiesMap.put(ENT_LDAP_SCHEMA_SUPANN, res ? "true" : "false");
694 public boolean isENTMailSenderUseForward(long companyId) {
695 if (propertiesMap.containsKey(ENT_MAILSENDER_USE_FORWARD)) {
696 return propertiesMap.get(ENT_MAILSENDER_USE_FORWARD).equals("true");
700 res = PrefsPropsUtil.getBoolean(companyId, ENT_MAILSENDER_USE_FORWARD);
701 } catch (SystemException e) {
705 propertiesMap.put(ENT_MAILSENDER_USE_FORWARD, res ? "true" : "false");
711 public Boolean isGroupIntranetEnable(long companyId) {
712 if (propertiesMap.containsKey(ENT_GROUP_INTRANET_ENABLE)) {
713 return propertiesMap.get(ENT_GROUP_INTRANET_ENABLE).equals("true");
717 res = PrefsPropsUtil.getBoolean(companyId, ENT_GROUP_INTRANET_ENABLE);
718 } catch (SystemException e) {
721 propertiesMap.put(ENT_GROUP_INTRANET_ENABLE, res ? "true" : "false");
725 public String getEntGroupDefaultView(long companyId) {
726 if (propertiesMap.containsKey(ENT_GROUP_DEFAULT_VIEW)) {
727 return propertiesMap.get(ENT_GROUP_DEFAULT_VIEW);
729 String res = "actualites_WAR_actualitesportlet";
731 res = PrefsPropsUtil.getString(companyId, ENT_GROUP_DEFAULT_VIEW);
732 } catch (SystemException e) {
734 return "actualites_WAR_actualitesportlet";
736 propertiesMap.put(ENT_GROUP_DEFAULT_VIEW, res);
741 public Boolean getEntSchoolImportType(long companyId) {
742 if (propertiesMap.containsKey(ENT_SCHOOL_IMPORT_TYPE)) {
743 return propertiesMap.get(ENT_SCHOOL_IMPORT_TYPE).equals("true");
747 res = PrefsPropsUtil.getBoolean(companyId, ENT_SCHOOL_IMPORT_TYPE);
748 } catch (SystemException e) {
751 propertiesMap.put(ENT_SCHOOL_IMPORT_TYPE, res ? "true" : "false");
755 public String getXmppHost(long companyId) {
756 if (propertiesMap.containsKey(XMPP_HOST)) {
757 return propertiesMap.get(XMPP_HOST);
761 res = PrefsPropsUtil.getString(companyId, XMPP_HOST);
762 } catch (SystemException e) {
765 propertiesMap.put(XMPP_HOST, res);
770 public String getXmppDomain(long companyId) {
771 if (propertiesMap.containsKey(XMPP_DOMAIN)) {
772 return propertiesMap.get(XMPP_DOMAIN);
776 res = PrefsPropsUtil.getString(companyId, XMPP_DOMAIN);
777 } catch (SystemException e) {
780 propertiesMap.put(XMPP_DOMAIN, res);
785 public boolean isXmppEnable(long companyId) {
786 if (propertiesMap.containsKey(XMPP_ENABLE)) {
787 return propertiesMap.get(XMPP_ENABLE).equals("true");
791 res = PrefsPropsUtil.getBoolean(companyId, XMPP_ENABLE);
792 } catch (SystemException e) {
795 propertiesMap.put(XMPP_ENABLE, res ? "true" : "false");
799 public Boolean isLDAPImportModifyDate(long companyId){
800 if (propertiesMap.containsKey(LDAP_IMPORT_MODIFY_DATE)) {
801 return propertiesMap.get(LDAP_IMPORT_MODIFY_DATE).equals("true");
805 res = PrefsPropsUtil.getBoolean(companyId, LDAP_IMPORT_MODIFY_DATE);
806 } catch (SystemException e) {
809 propertiesMap.put(LDAP_IMPORT_MODIFY_DATE, res ? "true" : "false");
813 public String getVisioUrl(long companyId) {
814 if (propertiesMap.containsKey(VISIO_URL)) {
815 return propertiesMap.get(VISIO_URL);
819 res = PrefsPropsUtil.getString(companyId, VISIO_URL);
820 } catch (SystemException e) {
823 propertiesMap.put(VISIO_URL, res);
828 public String getVisioRtmpDomain(long companyId) {
829 if (propertiesMap.containsKey(VISIO_RTMP_DOMAIN)) {
830 return propertiesMap.get(VISIO_RTMP_DOMAIN);
834 res = PrefsPropsUtil.getString(companyId, VISIO_RTMP_DOMAIN);
835 } catch (SystemException e) {
838 propertiesMap.put(VISIO_RTMP_DOMAIN, res);
843 public String getVisioRtmpService(long companyId) {
844 if (propertiesMap.containsKey(VISIO_RTMP_SERVICE)) {
845 return propertiesMap.get(VISIO_RTMP_SERVICE);
849 res = PrefsPropsUtil.getString(companyId, VISIO_RTMP_SERVICE);
850 } catch (SystemException e) {
853 propertiesMap.put(VISIO_RTMP_SERVICE, res);
858 public String getVisioSalt(long companyId) {
859 if (propertiesMap.containsKey(VISIO_SALT)) {
860 return propertiesMap.get(VISIO_SALT);
864 res = PrefsPropsUtil.getString(companyId, VISIO_SALT);
865 } catch (SystemException e) {
868 propertiesMap.put(VISIO_SALT, res);
873 public String getVisioAdminLogin(long companyId) {
874 if (propertiesMap.containsKey(VISIO_ADMIN_LOGIN)) {
875 return propertiesMap.get(VISIO_ADMIN_LOGIN);
879 res = PrefsPropsUtil.getString(companyId, VISIO_ADMIN_LOGIN);
880 } catch (SystemException e) {
883 propertiesMap.put(VISIO_ADMIN_LOGIN, res);
888 public String getVisioAdminPassword(long companyId) {
889 if (propertiesMap.containsKey(VISIO_ADMIN_PASSWORD)) {
890 return propertiesMap.get(VISIO_ADMIN_PASSWORD);
894 res = PrefsPropsUtil.getString(companyId, VISIO_ADMIN_PASSWORD);
895 } catch (SystemException e) {
898 propertiesMap.put(VISIO_ADMIN_PASSWORD, res);
903 public String getENTGoogleAnalyticsCode(long companyId) {
904 if (propertiesMap.containsKey(ENT_GOOGLEANALYTICS_CODE)) {
905 return propertiesMap.get(ENT_GOOGLEANALYTICS_CODE);
909 res = PrefsPropsUtil.getString(companyId, ENT_GOOGLEANALYTICS_CODE);
910 } catch (SystemException e) {
913 propertiesMap.put(ENT_GOOGLEANALYTICS_CODE, res);
917 public String getENTOrgRootName(long companyId) {
918 if (propertiesMap.containsKey(ENT_ORGROOT_NAME)) {
919 return propertiesMap.get(ENT_ORGROOT_NAME);
923 res = PrefsPropsUtil.getString(companyId, ENT_ORGROOT_NAME);
924 } catch (SystemException e) {
927 propertiesMap.put(ENT_ORGROOT_NAME, res);
931 public String getENTOrgRootSuffixeMail(long companyId) {
932 if (propertiesMap.containsKey(ENT_ORGROOT_MAIL)) {
933 return propertiesMap.get(ENT_ORGROOT_MAIL);
937 res = PrefsPropsUtil.getString(companyId, ENT_ORGROOT_MAIL);
938 } catch (SystemException e) {
941 propertiesMap.put(ENT_ORGROOT_MAIL, res);
945 public String getENTOrgRootPortalMembersName(long companyId) {
946 if (propertiesMap.containsKey(ENT_ORGROOT_PORTALMEMBERSNAME)) {
947 return propertiesMap.get(ENT_ORGROOT_PORTALMEMBERSNAME);
951 res = PrefsPropsUtil.getString(companyId, ENT_ORGROOT_PORTALMEMBERSNAME);
952 } catch (SystemException e) {
955 propertiesMap.put(ENT_ORGROOT_PORTALMEMBERSNAME, res);
959 public String getENTOrgRootDepartment(long companyId) {
960 if (propertiesMap.containsKey(ENT_ORGROOT_DEPARTMENT)) {
961 return propertiesMap.get(ENT_ORGROOT_DEPARTMENT);
965 res = PrefsPropsUtil.getString(companyId, ENT_ORGROOT_DEPARTMENT);
966 } catch (SystemException e) {
969 propertiesMap.put(ENT_ORGROOT_DEPARTMENT, res);
973 public String getENTChart(long companyId) {
974 if (propertiesMap.containsKey(ENT_CHART)) {
975 return propertiesMap.get(ENT_CHART);
979 res = PrefsPropsUtil.getString(companyId, ENT_CHART);
980 } catch (SystemException e) {
983 propertiesMap.put(ENT_CHART, res);
987 public String getENTSynchroDefaultRole(long companyId) {
988 if (propertiesMap.containsKey(ENT_LDAP_SYNCHRO_ROLE_DEFAULT)) {
989 return propertiesMap.get(ENT_LDAP_SYNCHRO_ROLE_DEFAULT);
993 res = PrefsPropsUtil.getString(companyId, ENT_LDAP_SYNCHRO_ROLE_DEFAULT);
994 } catch (SystemException e) {
997 propertiesMap.put(ENT_LDAP_SYNCHRO_ROLE_DEFAULT, res);
1001 public String getENTSynchroEtabName(long companyId) {
1002 if (propertiesMap.containsKey(ENT_LDAP_SYNCHRO_ETAB_NAME)) {
1003 return propertiesMap.get(ENT_LDAP_SYNCHRO_ETAB_NAME);
1007 res = PrefsPropsUtil.getString(companyId, ENT_LDAP_SYNCHRO_ETAB_NAME);
1008 } catch (SystemException e) {
1011 propertiesMap.put(ENT_LDAP_SYNCHRO_ETAB_NAME, res);
1016 * Method to know if we force the list inst creation during synchro
1017 * @param companyId the company id of the context
1018 * @return the value of "ent.ldap.synchro.force.listinst" value in portal ext
1020 public boolean isENTSynchroForceListeInst(long companyId) {
1021 if (propertiesMap.containsKey(ENT_LDAP_SYNCHRO_FORCE_LIST_INST)) {
1022 return propertiesMap.get(ENT_LDAP_SYNCHRO_FORCE_LIST_INST).equals("true");
1024 boolean res = false;
1026 res = PrefsPropsUtil.getBoolean(companyId, ENT_LDAP_SYNCHRO_FORCE_LIST_INST);
1027 } catch (SystemException e) {
1030 propertiesMap.put(ENT_LDAP_SYNCHRO_FORCE_LIST_INST, res ? "true" : "false");
1034 public String getMailNoReply(long companyId) {
1035 if (propertiesMap.containsKey(MAIL_NOREPLY)) {
1036 return propertiesMap.get(MAIL_NOREPLY);
1040 res = PrefsPropsUtil.getString(companyId, MAIL_NOREPLY);
1041 } catch (SystemException e) {
1044 propertiesMap.put(MAIL_NOREPLY, res);
1048 public String getMailRedirectSubject(long companyId) {
1049 if (propertiesMap.containsKey(MAIL_REPLY_SUBJECT)) {
1050 return propertiesMap.get(MAIL_REPLY_SUBJECT);
1054 res = PrefsPropsUtil.getString(companyId, MAIL_REPLY_SUBJECT);
1055 } catch (SystemException e) {
1058 propertiesMap.put(MAIL_REPLY_SUBJECT, res);
1062 public String getMailRedirectBody(long companyId) {
1063 if (propertiesMap.containsKey(MAIL_REPLY_BODY)) {
1064 return propertiesMap.get(MAIL_REPLY_BODY);
1068 res = PrefsPropsUtil.getString(companyId, MAIL_REPLY_BODY);
1069 } catch (SystemException e) {
1072 propertiesMap.put(MAIL_REPLY_BODY, res);
1076 public String getFileErrorSwf(long companyId) {
1077 if (propertiesMap.containsKey(FILE_ERROR_SWF)) {
1078 return propertiesMap.get(FILE_ERROR_SWF);
1082 res = PrefsPropsUtil.getString(companyId, FILE_ERROR_SWF);
1083 } catch (SystemException e) {
1086 propertiesMap.put(FILE_ERROR_SWF, res);
1090 public String getFileErrorFlv(long companyId) {
1091 if (propertiesMap.containsKey(FILE_ERROR_FLV)) {
1092 return propertiesMap.get(FILE_ERROR_FLV);
1096 res = PrefsPropsUtil.getString(companyId, FILE_ERROR_FLV);
1097 } catch (SystemException e) {
1100 propertiesMap.put(FILE_ERROR_FLV, res);
1104 public String getFlashFileStateProgress(long companyId) {
1105 if (propertiesMap.containsKey(FLASH_FILE_STATE_PROGRESS)) {
1106 return propertiesMap.get(FLASH_FILE_STATE_PROGRESS);
1110 res = PrefsPropsUtil.getString(companyId, FLASH_FILE_STATE_PROGRESS);
1111 } catch (SystemException e) {
1114 propertiesMap.put(FLASH_FILE_STATE_PROGRESS, res);
1118 public String getFlashFileStateError(long companyId) {
1119 if (propertiesMap.containsKey(FLASH_FILE_STATE_ERROR)) {
1120 return propertiesMap.get(FLASH_FILE_STATE_ERROR);
1124 res = PrefsPropsUtil.getString(companyId, FLASH_FILE_STATE_ERROR);
1125 } catch (SystemException e) {
1128 propertiesMap.put(FLASH_FILE_STATE_ERROR, res);
1132 public String getFlashFileStateConvert(long companyId) {
1133 if (propertiesMap.containsKey(FLASH_FILE_STATE_CONVERT)) {
1134 return propertiesMap.get(FLASH_FILE_STATE_CONVERT);
1138 res = PrefsPropsUtil.getString(companyId, FLASH_FILE_STATE_CONVERT);
1139 } catch (SystemException e) {
1142 propertiesMap.put(FLASH_FILE_STATE_CONVERT, res);
1147 public boolean isForceSubscribeAgenda(long companyId) {
1148 if (propertiesMap.containsKey(ENT_AGENDA_ENABLE_FORCESUBSCRIBE)) {
1149 return propertiesMap.get(ENT_AGENDA_ENABLE_FORCESUBSCRIBE).equals("true");
1151 Boolean res = false;
1153 res = PrefsPropsUtil.getBoolean(companyId, ENT_AGENDA_ENABLE_FORCESUBSCRIBE);
1154 } catch (SystemException e) {
1157 propertiesMap.put(ENT_AGENDA_ENABLE_FORCESUBSCRIBE, res ? "true" : "false");
1161 public boolean isEnableMobileNtification(long companyId) {
1162 if (propertiesMap.containsKey(ENT_MOBILE_NOTIFICATION_ENABLE)) {
1163 return propertiesMap.get(ENT_MOBILE_NOTIFICATION_ENABLE).equals("true");
1165 Boolean res = false;
1167 res = PrefsPropsUtil.getBoolean(companyId, ENT_MOBILE_NOTIFICATION_ENABLE);
1168 } catch (SystemException e) {
1171 propertiesMap.put(ENT_MOBILE_NOTIFICATION_ENABLE, res ? "true" : "false");
1175 public boolean isEnableServicesNotifications(long companyId) {
1176 if (propertiesMap.containsKey(ENT_NOTIFICATIONS_ENABLE)) {
1177 return propertiesMap.get(ENT_NOTIFICATIONS_ENABLE).equals("true");
1179 Boolean res = false;
1181 res = PrefsPropsUtil.getBoolean(companyId, ENT_NOTIFICATIONS_ENABLE);
1182 } catch (SystemException e) {
1185 propertiesMap.put(ENT_NOTIFICATIONS_ENABLE, res ? "true" : "false");
1189 public boolean isEnableMailForward(long companyId) {
1190 if (propertiesMap.containsKey(ENT_MAILFORWARD_ENABLE)) {
1191 return propertiesMap.get(ENT_MAILFORWARD_ENABLE).equals("true");
1193 Boolean res = false;
1195 res = PrefsPropsUtil.getBoolean(companyId, ENT_MAILFORWARD_ENABLE);
1196 } catch (SystemException e) {
1199 propertiesMap.put(ENT_MAILFORWARD_ENABLE, res ? "true" : "false");
1203 public boolean getPiwikEnable(long companyId) {
1204 if (propertiesMap.containsKey(PIWIK_ENABLE)) {
1205 return propertiesMap.get(PIWIK_ENABLE).equals("true");
1207 Boolean res = false;
1209 res = PrefsPropsUtil.getBoolean(companyId, PIWIK_ENABLE);
1210 } catch (SystemException e) {
1213 propertiesMap.put(PIWIK_ENABLE, res ? "true" : "false");
1217 public String getPiwikUrl(long companyId) {
1218 if (propertiesMap.containsKey(PIWIK_URL)) {
1219 return propertiesMap.get(PIWIK_URL);
1223 res = PrefsPropsUtil.getString(companyId, PIWIK_URL);
1224 } catch (SystemException e) {
1227 propertiesMap.put(PIWIK_URL, res);
1231 public String getPiwikApiUrl(long companyId) {
1232 if (propertiesMap.containsKey(PIWIK_API_URL)) {
1233 return propertiesMap.get(PIWIK_API_URL);
1237 res = PrefsPropsUtil.getString(companyId, PIWIK_API_URL);
1238 } catch (SystemException e) {
1241 propertiesMap.put(PIWIK_API_URL, res);
1245 public String getPiwikSiteId(long companyId) {
1246 if (propertiesMap.containsKey(PIWIK_SITE_ID)) {
1247 return propertiesMap.get(PIWIK_SITE_ID);
1251 res = PrefsPropsUtil.getString(companyId, PIWIK_SITE_ID);
1252 } catch (SystemException e) {
1255 propertiesMap.put(PIWIK_SITE_ID, res);
1259 public String getPiwikTokenAuth(long companyId) {
1260 if (propertiesMap.containsKey(PIWIK_TOKEN_AUTH)) {
1261 return propertiesMap.get(PIWIK_TOKEN_AUTH);
1265 res = PrefsPropsUtil.getString(companyId, PIWIK_TOKEN_AUTH);
1266 } catch (SystemException e) {
1269 propertiesMap.put(PIWIK_TOKEN_AUTH, res);
1273 public boolean getXitiEnable(long companyId) {
1274 if (propertiesMap.containsKey(XITI_ENABLE)) {
1275 return propertiesMap.get(XITI_ENABLE).equals("true");
1277 Boolean res = false;
1279 res = PrefsPropsUtil.getBoolean(companyId, XITI_ENABLE);
1280 } catch (SystemException e) {
1283 propertiesMap.put(XITI_ENABLE, res ? "true" : "false");
1287 public int getXitiIdProjet(long companyId) {
1288 if (propertiesMap.containsKey(XITI_ID_PROJET)) {
1290 return Integer.parseInt(propertiesMap.get(XITI_ID_PROJET));
1291 } catch (Exception e) {
1295 Integer res = new Integer(-1);
1297 res = PrefsPropsUtil.getInteger(companyId, XITI_ID_PROJET);
1298 } catch (SystemException e) {
1301 propertiesMap.put(XITI_ID_PROJET, ""+res);
1305 public int getXitiIdPlateforme(long companyId) {
1306 if (propertiesMap.containsKey(XITI_ID_PLATEFORME)) {
1308 return Integer.parseInt(propertiesMap.get(XITI_ID_PLATEFORME));
1309 } catch (Exception e) {
1313 Integer res = new Integer(-1);
1315 res = PrefsPropsUtil.getInteger(companyId, XITI_ID_PLATEFORME);
1316 } catch (SystemException e) {
1319 propertiesMap.put(XITI_ID_PLATEFORME, ""+res);
1323 public int getXitiIdCollectivite(long companyId) {
1324 if (propertiesMap.containsKey(XITI_ID_COLLECTIVITE)) {
1326 return Integer.parseInt(propertiesMap.get(XITI_ID_COLLECTIVITE));
1327 } catch (Exception e) {
1331 Integer res = new Integer(-1);
1333 res = PrefsPropsUtil.getInteger(companyId, XITI_ID_COLLECTIVITE);
1334 } catch (SystemException e) {
1337 propertiesMap.put(XITI_ID_COLLECTIVITE, ""+res);
1341 public int getXitiEtabId(long companyId, long etabId) throws JSONException {
1342 if (propertiesMap.containsKey(XITI_LIST_ETAB_ID)) {
1344 return Integer.parseInt(propertiesMap.get(XITI_LIST_ETAB_ID));
1345 } catch (Exception e) {
1349 Integer res = new Integer(2);
1351 String listXitiEtabIdString = PrefsPropsUtil.getString(companyId, XITI_LIST_ETAB_ID);
1352 JSONObject listXitiEtabId = JSONFactoryUtil.createJSONObject(listXitiEtabIdString);
1353 int xitiEtabId = listXitiEtabId.getInt(String.valueOf(etabId));
1354 if(xitiEtabId != 0){
1357 } catch (SystemException e) {
1360 propertiesMap.put(XITI_LIST_ETAB_ID, ""+res);
1364 public String getPublicBlogUrl(long companyId) {
1365 if (propertiesMap.containsKey(PUBLIC_BLOG_URL)) {
1366 return propertiesMap.get(PUBLIC_BLOG_URL);
1370 res = PortalUtil.getPortalProperties().getProperty("absolute.url") + PrefsPropsUtil.getString(companyId, PUBLIC_BLOG_URL);
1371 } catch (SystemException e) {
1374 propertiesMap.put(PUBLIC_BLOG_URL, res);
1378 public String getPublicFrontBlogUrl(long companyId) {
1379 if (propertiesMap.containsKey(PUBLIC_FRONT_BLOG_URL)) {
1380 return propertiesMap.get(PUBLIC_FRONT_BLOG_URL);
1384 res = PrefsPropsUtil.getString(companyId, PUBLIC_FRONT_BLOG_URL);
1385 } catch (SystemException e) {
1388 propertiesMap.put(PUBLIC_FRONT_BLOG_URL, res);
1392 public String getWordpressUsername(long companyId) {
1393 if (propertiesMap.containsKey(WORDPRESS_USERNAME)) {
1394 return propertiesMap.get(WORDPRESS_USERNAME);
1398 res = PrefsPropsUtil.getString(companyId, WORDPRESS_USERNAME);
1399 } catch (SystemException e) {
1402 propertiesMap.put(WORDPRESS_USERNAME, res);
1406 public String getWordpressPassword(long companyId) {
1407 if (propertiesMap.containsKey(WORDPRESS_PASSWORD)) {
1408 return propertiesMap.get(WORDPRESS_PASSWORD);
1412 res = PrefsPropsUtil.getString(companyId, WORDPRESS_PASSWORD);
1413 } catch (SystemException e) {
1416 propertiesMap.put(WORDPRESS_PASSWORD, res);
1420 public String getWordpressUrl(long companyId) {
1421 if (propertiesMap.containsKey(WORDPRESS_URL)) {
1422 return propertiesMap.get(WORDPRESS_URL);
1426 res = PrefsPropsUtil.getString(companyId, WORDPRESS_URL);
1427 } catch (SystemException e) {
1430 propertiesMap.put(WORDPRESS_URL, res);
1434 public String getWordpressAdminSuffixUrl(long companyId) {
1435 if (propertiesMap.containsKey(WORDPRESS_ADMIN_SUFFIX_URL)) {
1436 return propertiesMap.get(WORDPRESS_ADMIN_SUFFIX_URL);
1440 res = PrefsPropsUtil.getString(companyId, WORDPRESS_ADMIN_SUFFIX_URL);
1441 } catch (SystemException e) {
1444 propertiesMap.put(WORDPRESS_ADMIN_SUFFIX_URL, res);
1448 public String getWordpressSuffixUrl(long companyId) {
1449 if (propertiesMap.containsKey(WORDPRESS_SUFFIX_URL)) {
1450 return propertiesMap.get(WORDPRESS_SUFFIX_URL);
1454 res = PrefsPropsUtil.getString(companyId, WORDPRESS_SUFFIX_URL);
1455 } catch (SystemException e) {
1458 propertiesMap.put(WORDPRESS_SUFFIX_URL, res);
1462 public boolean isShibbolethAuthEnable(long companyId) {
1463 if (propertiesMap.containsKey(SHIBBOLETH_AUTH_ENABLED)) {
1464 return propertiesMap.get(SHIBBOLETH_AUTH_ENABLED).equals("true");
1466 Boolean res = false;
1468 res = PrefsPropsUtil.getBoolean(companyId, SHIBBOLETH_AUTH_ENABLED);
1469 } catch (SystemException e) {
1472 propertiesMap.put(SHIBBOLETH_AUTH_ENABLED, res ? "true" : "false");
1476 public String getShibbolethLogoutUrl(long companyId) {
1477 if (propertiesMap.containsKey(SHIBBOLETH_LOGOUT_URL)) {
1478 return propertiesMap.get(SHIBBOLETH_LOGOUT_URL);
1482 res = PrefsPropsUtil.getString(companyId, SHIBBOLETH_LOGOUT_URL);
1483 } catch (SystemException e) {
1486 propertiesMap.put(SHIBBOLETH_LOGOUT_URL, res);
1490 public String getMailAcademicSuffix(long companyId) {
1491 if (propertiesMap.containsKey(ENT_MAIL_ACADEMIC_SUFFIX)) {
1492 return propertiesMap.get(ENT_MAIL_ACADEMIC_SUFFIX);
1496 res = PrefsPropsUtil.getString(companyId, ENT_MAIL_ACADEMIC_SUFFIX);
1497 } catch (SystemException e) {
1500 propertiesMap.put(ENT_MAIL_ACADEMIC_SUFFIX, res);
1504 public boolean isWebDAVEnable(long companyId) {
1505 if (propertiesMap.containsKey(WEBDAV_ENABLE)) {
1506 return propertiesMap.get(WEBDAV_ENABLE).equals("true");
1508 Boolean res = false;
1510 res = PrefsPropsUtil.getBoolean(companyId, WEBDAV_ENABLE);
1511 } catch (SystemException e) {
1514 propertiesMap.put(WEBDAV_ENABLE, res ? "true" : "false");
1518 public String getViewAjaxJSPKey() {
1519 if (propertiesMap.containsKey(VIEW_AJAX_JSP_KEY)) {
1520 return propertiesMap.get(VIEW_AJAX_JSP_KEY);
1522 String res = "view-ajax-jsp";
1524 res = PrefsPropsUtil.getString(VIEW_AJAX_JSP_KEY);
1525 } catch (SystemException e) {
1528 propertiesMap.put(VIEW_AJAX_JSP_KEY, res);
1532 public int getDefaultPortletHeight() {
1533 if (propertiesMap.containsKey(DEFAULT_PORLET_HEIGHT)) {
1535 return Integer.parseInt(propertiesMap.get(DEFAULT_PORLET_HEIGHT));
1536 } catch (Exception e) {
1540 Integer res = new Integer(800);
1542 res = PrefsPropsUtil.getInteger(DEFAULT_PORLET_HEIGHT);
1543 } catch (SystemException e) {
1546 propertiesMap.put(DEFAULT_PORLET_HEIGHT, res+"");
1550 public List<String> getSpecialPortletsTheme(long companyId) {
1551 List<String> portlets = new ArrayList<String>();
1553 if (propertiesMap.containsKey(SPECIAL_PORTLETS_THEME)) {
1554 res = propertiesMap.get(SPECIAL_PORTLETS_THEME);
1557 res = PrefsPropsUtil.getString(companyId, SPECIAL_PORTLETS_THEME);
1558 propertiesMap.put(SPECIAL_PORTLETS_THEME, res);
1559 } catch (SystemException e) {
1563 String[] portletsArray = res.split(",");
1564 for(int i=0; i<portletsArray.length; i++){
1565 portlets.add(portletsArray[i]);
1570 public boolean getEntFullScreenAllowed() {
1571 if (propertiesMap.containsKey(ENT_FULLSCREEN_ALLOWED)) {
1572 return propertiesMap.get(ENT_FULLSCREEN_ALLOWED).equals("true");
1574 Boolean res = false;
1576 res = PrefsPropsUtil.getBoolean(ENT_FULLSCREEN_ALLOWED);
1577 } catch (SystemException e) {
1580 propertiesMap.put(ENT_FULLSCREEN_ALLOWED, res ? "true" : "false");
1584 public String getEntFullScreenMaximizeKey() {
1585 if (propertiesMap.containsKey(ENT_FULLSCREEN_MAXIMIZE_KEY)) {
1586 return propertiesMap.get(ENT_FULLSCREEN_MAXIMIZE_KEY);
1590 res = PrefsPropsUtil.getString(ENT_FULLSCREEN_MAXIMIZE_KEY);
1591 } catch (SystemException e) {
1594 propertiesMap.put(ENT_FULLSCREEN_MAXIMIZE_KEY, res);
1598 public String[] getEntListRolesEnabled() {
1599 if (propertiesMap.containsKey(ENT_LIST_ROLES_ENABLED)) {
1600 String roles = propertiesMap.get(ENT_LIST_ROLES_ENABLED);
1601 if(!roles.isEmpty()){
1602 return roles.split(",");
1607 res = PrefsPropsUtil.getString(ENT_LIST_ROLES_ENABLED).trim();
1608 } catch (SystemException e) {
1611 propertiesMap.put(ENT_LIST_ROLES_ENABLED, res);
1613 return res.split(",");
1618 public String[] getEntListRolesNationauxEnabled() {
1619 if (propertiesMap.containsKey(ENT_LIST_ROLES_NATIONAUX_ENABLED)) {
1620 String roles = propertiesMap.get(ENT_LIST_ROLES_NATIONAUX_ENABLED);
1621 if(!roles.isEmpty()){
1622 return roles.split(",");
1627 res = PrefsPropsUtil.getString(ENT_LIST_ROLES_NATIONAUX_ENABLED).trim();
1628 } catch (SystemException e) {
1631 propertiesMap.put(ENT_LIST_ROLES_NATIONAUX_ENABLED, res);
1633 return res.split(",");
1638 public boolean getEntImportUtilisateursEnabled() {
1639 if (propertiesMap.containsKey(ENT_IMPORT_UTILISATEURS_ENABLED)) {
1640 return propertiesMap.get(ENT_IMPORT_UTILISATEURS_ENABLED).equals("true");
1642 Boolean res = false;
1644 res = PrefsPropsUtil.getBoolean(ENT_IMPORT_UTILISATEURS_ENABLED);
1645 } catch (SystemException e) {
1648 propertiesMap.put(ENT_IMPORT_UTILISATEURS_ENABLED, res ? "true" : "false");
1652 public String getEntImportUtilisateursPath() {
1653 if (propertiesMap.containsKey(ENT_IMPORT_UTILISATEURS_PATH)) {
1654 return propertiesMap.get(ENT_IMPORT_UTILISATEURS_PATH);
1658 res = PrefsPropsUtil.getString(ENT_IMPORT_UTILISATEURS_PATH);
1659 } catch (SystemException e) {
1662 propertiesMap.put(ENT_IMPORT_UTILISATEURS_PATH, res);
1666 public String getEntKeyLanguageSuffix() {
1667 if (propertiesMap.containsKey(ENT_KEY_LANGUAGE_SUFFIX)) {
1668 return propertiesMap.get(ENT_KEY_LANGUAGE_SUFFIX);
1672 res = PrefsPropsUtil.getString(ENT_KEY_LANGUAGE_SUFFIX);
1673 } catch (SystemException e) {
1676 propertiesMap.put(ENT_KEY_LANGUAGE_SUFFIX, res);
1680 public boolean getEntSocialActivityEnabled() {
1681 if (propertiesMap.containsKey(ENT_SOCIAL_ACTIVITY_ENABLED)) {
1682 return propertiesMap.get(ENT_SOCIAL_ACTIVITY_ENABLED).equals("true");
1684 Boolean res = false;
1686 res = PrefsPropsUtil.getBoolean(ENT_SOCIAL_ACTIVITY_ENABLED);
1687 } catch (SystemException e) {
1690 propertiesMap.put(ENT_SOCIAL_ACTIVITY_ENABLED, res ? "true" : "false");
1694 public String getEntCaptchaPublicKey() {
1695 if (propertiesMap.containsKey(ENT_CAPTCHA_PUBLIC_KEY)) {
1696 return propertiesMap.get(ENT_CAPTCHA_PUBLIC_KEY);
1700 res = PrefsPropsUtil.getString(ENT_CAPTCHA_PUBLIC_KEY);
1701 } catch (SystemException e) {
1704 propertiesMap.put(ENT_CAPTCHA_PUBLIC_KEY, res);
1708 public String getEntCaptchaPrivateKey() {
1709 if (propertiesMap.containsKey(ENT_CAPTCHA_PRIVATE_KEY)) {
1710 return propertiesMap.get(ENT_CAPTCHA_PRIVATE_KEY);
1714 res = PrefsPropsUtil.getString(ENT_CAPTCHA_PRIVATE_KEY);
1715 } catch (SystemException e) {
1718 propertiesMap.put(ENT_CAPTCHA_PRIVATE_KEY, res);
1722 public String getEntPlateformName() {
1723 if (propertiesMap.containsKey(ENT_PLATEFORM_NAME)) {
1724 return propertiesMap.get(ENT_PLATEFORM_NAME);
1728 res= PrefsPropsUtil.getString(ENT_PLATEFORM_NAME);
1729 } catch (SystemException e) {
1732 propertiesMap.put(ENT_PLATEFORM_NAME, res);
1736 public String getEntResetPasswordUrl() {
1737 if (propertiesMap.containsKey(ENT_RESET_PASSWORD_URL)) {
1738 return propertiesMap.get(ENT_RESET_PASSWORD_URL);
1742 res = PrefsPropsUtil.getString(ENT_RESET_PASSWORD_URL);
1743 } catch (SystemException e) {
1746 propertiesMap.put(ENT_RESET_PASSWORD_URL, res);
1750 // methodes pour pouvoir lancer les synchro depuis l'interface
1751 public void startLDAPSynchro(long companyId, boolean force) {
1753 SynchronizationManager.runSynchronization(force);
1754 } catch (Exception e) {
1755 logger.error("Error in runSynchronization", e);
1761 * Map entre les objets du model et les portlets ou ils sont principalement utilises
1763 private static final Map<String, String> MAP_MODEL_PORTLET;
1765 Map<String, String> aMap = new HashMap<String, String>();
1766 aMap.put(BlogsEntry.class.getName(), "actualites_WAR_actualitesportlet");
1767 aMap.put(DLFileEntry.class.getName(), "cartable_WAR_cartableportlet");
1768 aMap.put(FileEntry.class.getName(), "cartable_WAR_cartableportlet");
1769 aMap.put(DLFolder.class.getName(), "cartable_WAR_cartableportlet");
1770 aMap.put(Folder.class.getName(), "cartable_WAR_cartableportlet");
1771 aMap.put(EventCDT.class.getName(), "cahierDeTexte_WAR_cahierDeTexteportlet");
1772 aMap.put(EventAgenda.class.getName(), "agenda_WAR_agendaportlet");
1773 aMap.put(MBMessage.class.getName(), "forum_WAR_forumportlet");
1774 aMap.put(MBCategory.class.getName(), "forum_WAR_forumportlet");
1775 aMap.put(Message.class.getName(), "internalMessaging_WAR_internalMessagingportlet");
1776 aMap.put(InternalMessage.class.getName(), "internalMessaging_WAR_internalMessagingportlet");
1777 aMap.put(RssItem.class.getName(), "internalMessaging_WAR_internalMessagingportlet");
1778 aMap.put(Group.class.getName(), "accesAteliers_WAR_accesAteliersportlet");
1779 aMap.put(Hits.class.getName(), "moteurDeRecherche_WAR_moteurDeRechercheportlet");
1780 MAP_MODEL_PORTLET = Collections.unmodifiableMap(aMap);
1783 public String getPortletId(String className){
1784 if(MAP_MODEL_PORTLET.containsKey(className)){
1785 return MAP_MODEL_PORTLET.get(className);
1790 public String addUrlAjaxParameters(String url, String className, boolean displayInGroup){
1793 portlet = PortletLocalServiceUtil.getPortletById("menuPageGroupe_WAR_menuPageGroupeportlet");
1794 url = HttpUtil.removeParameter(url, "p_p_id");
1795 url = HttpUtil.removeParameter(url, "p_p_lifecycle");
1796 url = HttpUtil.removeParameter(url, "p_p_state");
1797 url = HttpUtil.removeParameter(url, "p_p_mode");
1798 url = HttpUtil.removeParameter(url, "p_p_col_id");
1799 url = HttpUtil.removeParameter(url, "p_p_col_count");
1801 portlet = PortletLocalServiceUtil.getPortletById(getPortletId(className));
1803 Map<String, String> map = portlet.getInitParams();
1804 String viewAjaxJSPKey = ENTMainUtilsLocalServiceUtil.getViewAjaxJSPKey();
1805 url = HttpUtil.addParameter(url, "p_p_id", portlet.getPortletId());
1806 url = HttpUtil.addParameter(url, "p_p_lifecycle", 0);
1807 url = HttpUtil.addParameter(url, "p_p_state", "exclusive");
1808 url = HttpUtil.addParameter(url, "p_p_mode", "view");
1809 url = HttpUtil.addParameter(url, "p_p_col_id", "column-1");
1810 url = HttpUtil.addParameter(url, "p_p_col_count", 1);
1811 url = HttpUtil.addParameter(url, "jspPage", map.get(viewAjaxJSPKey));
1813 url = HttpUtil.addParameter(url, "p_p_id_display", getPortletId(className));
1818 public String[] getEntCategories(){
1819 if (propertiesMap.containsKey(ENT_MENU_CATEGORIES)) {
1820 String categories = propertiesMap.get(ENT_MENU_CATEGORIES);
1821 if(!categories.isEmpty()){
1822 return categories.split(",");
1827 res = PrefsPropsUtil.getString(ENT_MENU_CATEGORIES, "").trim();
1828 } catch (SystemException e) {
1831 propertiesMap.put(ENT_MENU_CATEGORIES, res);
1833 return res.split(",");
1835 String[] defaultCategories = {"Menu"};
1836 return defaultCategories;
1839 public String getEntLinkEtabCategory(){
1840 if (propertiesMap.containsKey(ENT_MENU_LINK_ETAB_CATEGORY)) {
1841 return propertiesMap.get(ENT_MENU_LINK_ETAB_CATEGORY);
1843 String res = "Liens";
1845 res = PrefsPropsUtil.getString(ENT_MENU_LINK_ETAB_CATEGORY, "Liens").trim();
1846 } catch (SystemException e) {
1849 propertiesMap.put(ENT_MENU_LINK_ETAB_CATEGORY, res);
1853 public String[] getMimeTypes() {
1854 if (propertiesMap.containsKey(MIME_TYPES)) {
1855 String mimeTypes = propertiesMap.get(MIME_TYPES);
1856 if (!mimeTypes.isEmpty()) {
1857 return mimeTypes.split(",");
1861 String[] mimeTypes = PropsUtil.getArray(MIME_TYPES);
1862 if (mimeTypes != null) {
1863 for (int i = 0 ; i < mimeTypes.length ; i++) {
1864 String mimeType = mimeTypes[i];
1866 if (i != mimeTypes.length - 1) {
1871 propertiesMap.put(MIME_TYPES, res);
1875 public long getEntPopulationManagerId(){
1876 if (propertiesMap.containsKey(ENT_POPULATION_MANAGER_ID)) {
1878 return Integer.parseInt(propertiesMap.get(ENT_POPULATION_MANAGER_ID));
1879 } catch (Exception e) {
1883 Long res = new Long(1007835);
1885 res = PrefsPropsUtil.getLong(ENT_POPULATION_MANAGER_ID, 1007835);
1886 } catch (SystemException e) {
1889 propertiesMap.put(ENT_POPULATION_MANAGER_ID, res+"");
1893 public boolean isReferentNumerique(User user){
1895 List<AMSingleUsers> singleUsers = AMSingleUsersLocalServiceUtil.getUsersByPopulationId(getEntPopulationManagerId());
1897 for (AMSingleUsers su : singleUsers) {
1898 if(su.getUserId() == user.getUserId()){
1902 } catch(Exception e){
1903 // La population definie dans les properties n'existe pas
1909 public Long[] getEntIncidentsUsersNotification() {
1911 if (propertiesMap.containsKey(ENT_INCIDENTS_USERS_NOTIFICATION)) {
1912 users = propertiesMap.get(ENT_INCIDENTS_USERS_NOTIFICATION);
1916 users = PrefsPropsUtil.getString(ENT_INCIDENTS_USERS_NOTIFICATION).trim();
1917 } catch (SystemException e) {
1921 if(!users.isEmpty()){
1922 String[] arr = users.split(",");
1923 Long[] array = new Long[arr.length];
1924 for(int i=0; i<arr.length; i++){
1925 array[i] = Long.valueOf(arr[i]);
1927 propertiesMap.put(ENT_POPULATION_MANAGER_ID, users);
1933 public String getJdbcEntlogUrl() {
1934 if (propertiesMap.containsKey(JDBC_ENTLOG_URL)) {
1935 return propertiesMap.get(JDBC_ENTLOG_URL);
1939 res = PrefsPropsUtil.getString(JDBC_ENTLOG_URL);
1940 } catch (SystemException e) {
1943 propertiesMap.put(JDBC_ENTLOG_URL, res);
1947 public String getJdbcEntlogUser() {
1948 if (propertiesMap.containsKey(JDBC_DEFAULT_USER)) {
1949 return propertiesMap.get(JDBC_DEFAULT_USER);
1953 res = PrefsPropsUtil.getString(JDBC_DEFAULT_USER);
1954 } catch (SystemException e) {
1957 propertiesMap.put(JDBC_DEFAULT_USER, res);
1961 public String getJdbcEntlogPasswd() {
1962 if (propertiesMap.containsKey(JDBC_DEFAULT_PASSWD)) {
1963 return propertiesMap.get(JDBC_DEFAULT_PASSWD);
1967 res = PrefsPropsUtil.getString(JDBC_DEFAULT_PASSWD);
1968 } catch (SystemException e) {
1971 propertiesMap.put(JDBC_DEFAULT_PASSWD, res);
1976 * Purges all expired users in LDAP (ENTValidAccount = 2)
1977 * @return the list of purged userIds
1979 public List<Long> purgeExpiredUsers(long companyId) {
1981 return UserPurgeImpl.purgeExpiredUsers(companyId);
1982 } catch (Exception e) {
1989 * Purges a user in LDAP, given by its screenName
1990 * @return true if purge has succeeded
1992 public boolean purgeUserInLDAP(long companyId, String screenName) {
1994 return UserPurgeImpl.purgeUserInLDAP(companyId, screenName);
1995 } catch (Exception e) {
2002 * Purges a user in DB, given by its userId
2003 * @return true if purge has succeeded
2005 public boolean purgeUserInDB(long userId) {
2007 return UserPurgeImpl.purgeUserInDB(userId);
2008 } catch (Exception e) {
2015 public String getDlHookFileSystemRootDir() {
2016 if (propertiesMap.containsKey(DL_HOOK_FILE_SYSTEM_ROOT_DIR)) {
2017 return propertiesMap.get(DL_HOOK_FILE_SYSTEM_ROOT_DIR);
2021 res = PrefsPropsUtil.getString(DL_HOOK_FILE_SYSTEM_ROOT_DIR);
2022 } catch (SystemException e) {
2025 propertiesMap.put(DL_HOOK_FILE_SYSTEM_ROOT_DIR, res);
2030 public String getUserPurgeOutputFile() {
2031 if (propertiesMap.containsKey(USER_PURGE_OUTPUT_FILE)) {
2032 return propertiesMap.get(USER_PURGE_OUTPUT_FILE);
2036 res = PrefsPropsUtil.getString(USER_PURGE_OUTPUT_FILE);
2037 } catch (SystemException e) {
2040 propertiesMap.put(USER_PURGE_OUTPUT_FILE, res);
2044 public Boolean isDlStoreCO3(long companyId) {
2045 if (propertiesMap.containsKey(DL_STORE_ISCO3)) {
2046 return propertiesMap.get(DL_STORE_ISCO3).equals("true");
2048 Boolean res = false;
2050 res = PrefsPropsUtil.getBoolean(companyId, DL_STORE_ISCO3);
2051 } catch (SystemException e) {
2054 propertiesMap.put(DL_STORE_ISCO3, res ? "true" : "false");
2058 public Boolean sendSupportToLocalAdmins(long companyId) {
2059 if (propertiesMap.containsKey(SUPPORT_LOCAL_ADMINS_ENABLE)) {
2060 return propertiesMap.get(SUPPORT_LOCAL_ADMINS_ENABLE).equals("true");
2062 Boolean res = false;
2064 res = PrefsPropsUtil.getBoolean(companyId, SUPPORT_LOCAL_ADMINS_ENABLE);
2065 } catch (SystemException e) {
2068 propertiesMap.put(SUPPORT_LOCAL_ADMINS_ENABLE, res ? "true" : "false");
2072 public Boolean allowUsurpationForSupportAdmin(long companyId) {
2073 if (propertiesMap.containsKey(SUPPORT_ADMIN_USURPATION_ENABLE)) {
2074 return propertiesMap.get(SUPPORT_ADMIN_USURPATION_ENABLE).equals("true");
2076 Boolean res = false;
2078 res = PrefsPropsUtil.getBoolean(companyId, SUPPORT_ADMIN_USURPATION_ENABLE);
2079 } catch (SystemException e) {
2082 propertiesMap.put(SUPPORT_ADMIN_USURPATION_ENABLE, res ? "true" : "false");
2086 public String getPlatform() {
2087 if (propertiesMap.containsKey(PLATFORM)) {
2088 return propertiesMap.get(PLATFORM);
2090 String res = PLATFORM_CO3_PROD;
2092 res = PrefsPropsUtil.getString(PLATFORM);
2093 } catch (SystemException e) {
2096 if (!res.equals(PLATFORM_HN_PROD) && !res.equals(PLATFORM_HN_PREPROD)
2097 && !res.equals(PLATFORM_CO3_PROD) && !res.equals(PLATFORM_CO3_PREPROD)
2098 && !res.equals(PLATFORM_CAIRNS_PROD) && !res.equals(PLATFORM_CAIRNS_PREPROD)) {
2099 logger.error("The platform name should be either '"+PLATFORM_HN_PROD+"' or '"+PLATFORM_HN_PREPROD+"' or '"+PLATFORM_CO3_PROD+"' or '"+ PLATFORM_CO3_PREPROD+"' or '"+PLATFORM_CAIRNS_PROD+"' or '"+PLATFORM_CAIRNS_PREPROD+"'.");
2103 propertiesMap.put(PLATFORM, res);
2107 public String getSupportMail() {
2108 if (propertiesMap.containsKey(SUPPORT_MAIL)) {
2109 return propertiesMap.get(SUPPORT_MAIL);
2111 String res = "assistance@pentila.com";
2113 res = PrefsPropsUtil.getString(SUPPORT_MAIL);
2114 } catch (SystemException e) {
2117 propertiesMap.put(SUPPORT_MAIL, res);
2121 public String getEdtPrivateKeyPath() {
2122 if (propertiesMap.containsKey(EDT_PRIVATE_KEY_PATH)) {
2123 return propertiesMap.get(EDT_PRIVATE_KEY_PATH);
2125 String res = "/home/pentila/ssl/privkey.pem";
2127 res = PrefsPropsUtil.getString(EDT_PRIVATE_KEY_PATH);
2128 } catch (SystemException e) {
2131 propertiesMap.put(EDT_PRIVATE_KEY_PATH, res);
2135 public long getENTVieScolaireUserId() {
2136 if (propertiesMap.containsKey(ENT_VIE_SCOLAIRE_USER_ID)) {
2137 return Long.parseLong(propertiesMap.get(ENT_VIE_SCOLAIRE_USER_ID));
2142 userId = PrefsPropsUtil.getLong(ENT_VIE_SCOLAIRE_USER_ID);
2143 } catch (SystemException e) {
2147 propertiesMap.put(ENT_VIE_SCOLAIRE_USER_ID, String.valueOf(userId));
2151 public User synchronizeUser(long companyId, Attributes attributes) {
2154 user = SynchronizationManager.synchronizeUser(companyId, attributes, StringPool.BLANK, true);
2155 } catch (Exception e) {
2156 logger.error("Unable to run user synchronization", e);
2161 public boolean manageUserMembership(long companyId, Attributes attributes) {
2163 return MembershipManager.manageUserMembership(companyId, attributes);
2167 public boolean isForceParentMembership(long companyId) {
2168 if (propertiesMap.containsKey(SYNCHRO_FORCE_PARENT_MEMBERSHIP)) {
2169 return propertiesMap.get(SYNCHRO_FORCE_PARENT_MEMBERSHIP).equals("true");
2171 Boolean res = false;
2173 res = PrefsPropsUtil.getBoolean(companyId, SYNCHRO_FORCE_PARENT_MEMBERSHIP);
2174 } catch (SystemException e) {
2177 propertiesMap.put(SYNCHRO_FORCE_PARENT_MEMBERSHIP, res ? "true" : "false");
2181 public String getEdtImportFilesDirectory() {
2182 if (propertiesMap.containsKey(EDT_IMPORTFILES_DIRECTORY)) {
2183 return propertiesMap.get(EDT_IMPORTFILES_DIRECTORY);
2185 String res = "/home/pentila/edt_import";
2187 res = PrefsPropsUtil.getString(EDT_IMPORTFILES_DIRECTORY);
2188 } catch (SystemException e) {
2191 propertiesMap.put(EDT_IMPORTFILES_DIRECTORY, res);
2195 public String getOauthClientId() {
2196 if (propertiesMap.containsKey(OAUTH_CLIENT_ID)) {
2197 return propertiesMap.get(OAUTH_CLIENT_ID);
2201 res = PrefsPropsUtil.getString(OAUTH_CLIENT_ID);
2202 } catch (SystemException e) {
2205 propertiesMap.put(OAUTH_CLIENT_ID, res);
2209 public String getOauthSecretId() {
2210 if (propertiesMap.containsKey(OAUTH_SECRET_ID)) {
2211 return propertiesMap.get(OAUTH_SECRET_ID);
2215 res = PrefsPropsUtil.getString(OAUTH_SECRET_ID);
2216 } catch (SystemException e) {
2219 propertiesMap.put(OAUTH_SECRET_ID, res);
2223 public String getServiceGuidePath(String serviceName) {
2224 String propertyKey = SERVICE_GUIDE_PATH + serviceName;
2225 if (propertiesMap.containsKey(propertyKey)) {
2226 return propertiesMap.get(propertyKey);
2230 res = PrefsPropsUtil.getString(propertyKey);
2231 } catch (SystemException e) {
2234 propertiesMap.put(propertyKey, res);
2238 public int getMessagingStudentMaxReceivers(){
2239 if (propertiesMap.containsKey(MESSAGING_STUDENT_MAX_RECEIVERS)) {
2241 return Integer.parseInt(propertiesMap.get(MESSAGING_STUDENT_MAX_RECEIVERS));
2242 } catch (Exception e) {
2248 res = PrefsPropsUtil.getInteger(MESSAGING_STUDENT_MAX_RECEIVERS);
2249 } catch (SystemException e) {
2252 propertiesMap.put(MESSAGING_STUDENT_MAX_RECEIVERS, res+"");
2256 public int getMessagingParentMaxReceivers(){
2257 if (propertiesMap.containsKey(MESSAGING_PARENT_MAX_RECEIVERS)) {
2259 return Integer.parseInt(propertiesMap.get(MESSAGING_PARENT_MAX_RECEIVERS));
2260 } catch (Exception e) {
2266 res = PrefsPropsUtil.getInteger(MESSAGING_PARENT_MAX_RECEIVERS);
2267 } catch (SystemException e) {
2270 propertiesMap.put(MESSAGING_PARENT_MAX_RECEIVERS, res+"");
2274 public int getMessagingPersonalMaxReceivers(){
2275 if (propertiesMap.containsKey(MESSAGING_PERSONAL_MAX_RECEIVERS)) {
2277 return Integer.parseInt(propertiesMap.get(MESSAGING_PERSONAL_MAX_RECEIVERS));
2278 } catch (Exception e) {
2284 res = PrefsPropsUtil.getInteger(MESSAGING_PERSONAL_MAX_RECEIVERS);
2285 } catch (SystemException e) {
2288 propertiesMap.put(MESSAGING_PERSONAL_MAX_RECEIVERS, res+"");
2292 public String getPronoteStudentLinkList() {
2293 if (propertiesMap.containsKey(PRONOTE_STUDENT_LINK_LIST)) {
2294 return propertiesMap.get(PRONOTE_STUDENT_LINK_LIST);
2296 String res = "Travail à faire,Dernieres notes,Dernières évaluations";
2298 res = PrefsPropsUtil.getString(PRONOTE_STUDENT_LINK_LIST);
2299 } catch (SystemException e) {
2302 propertiesMap.put(PRONOTE_STUDENT_LINK_LIST, res);
2306 public String getPronoteParentLinkList() {
2307 if (propertiesMap.containsKey(PRONOTE_PARENT_LINK_LIST)) {
2308 return propertiesMap.get(PRONOTE_PARENT_LINK_LIST);
2310 String res = "Travail à faire,Dernieres notes,Dernières évaluations";
2312 res = PrefsPropsUtil.getString(PRONOTE_PARENT_LINK_LIST);
2313 } catch (SystemException e) {
2316 propertiesMap.put(PRONOTE_PARENT_LINK_LIST, res);
2320 public String getPronoteTeacherLinkList() {
2321 if (propertiesMap.containsKey(PRONOTE_TEACHER_LINK_LIST)) {
2322 return propertiesMap.get(PRONOTE_TEACHER_LINK_LIST);
2324 String res = "Appel et suivi,Saisie des notes,Saisie du cahier de textes";
2326 res = PrefsPropsUtil.getString(PRONOTE_TEACHER_LINK_LIST);
2327 } catch (SystemException e) {
2330 propertiesMap.put(PRONOTE_TEACHER_LINK_LIST, res);
2336 public String getEdxBaseUrl() {
2337 if (propertiesMap.containsKey(EDX_BASEURL)) {
2338 return propertiesMap.get(EDX_BASEURL);
2342 res = PrefsPropsUtil.getString(EDX_BASEURL);
2343 } catch (SystemException e) {
2346 propertiesMap.put(EDX_BASEURL, res);
2350 public String getEdxAccessToken() {
2351 if (propertiesMap.containsKey(EDX_ACCESS_TOKEN)) {
2352 return propertiesMap.get(EDX_ACCESS_TOKEN);
2356 res = PrefsPropsUtil.getString(EDX_ACCESS_TOKEN);
2357 } catch (SystemException e) {
2360 propertiesMap.put(EDX_ACCESS_TOKEN, res);
2364 public String getEntMenuPortletHidden() {
2365 if (propertiesMap.containsKey(ENT_MENU_PORTLET_HIDDEN)) {
2366 return propertiesMap.get(ENT_MENU_PORTLET_HIDDEN);
2370 res = PrefsPropsUtil.getString(ENT_MENU_PORTLET_HIDDEN);
2371 } catch (SystemException e) {
2374 propertiesMap.put(ENT_MENU_PORTLET_HIDDEN, res);