Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 1934 discussions
r123 - in trunk: faxtomail-persistence/src/main/xmi faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 02 Jun '14
by echatellier@users.forge.codelutin.com 02 Jun '14
02 Jun '14
Author: echatellier
Date: 2014-06-02 22:10:28 +0200 (Mon, 02 Jun 2014)
New Revision: 123
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/123
Log:
Ajout des droits d'?\195?\169criture et des charg?\195?\169s de clientelle
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 18:45:22 UTC (rev 122)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 20:10:28 UTC (rev 123)
@@ -181,15 +181,15 @@
<table class="table table-bordered">
<thead>
<tr>
- <th>Adresse email</th>
+ <th>Utilisateur</th>
<th>Action</th>
</tr>
</thead>
<tbody>
- <tr ng-repeat="customerResponsible in selectedMailFolder.customerResponsibles track by $index">
+ <tr ng-repeat="customerResponsible in selectedMailFolder.customerResponsibles">
<td>
<span class="glyphicon glyphicon-user"></span>
- {{customerResponsible}}</td>
+ {{customerResponsible.firstName}} {{customerResponsible.lastName}}</td>
<td>
<a class="pull-right btn btn-danger btn-xs" ng-click="removeCustomerResponsible($index)">
<span class="glyphicon glyphicon-remove"></span>
@@ -199,7 +199,7 @@
</tbody>
</table>
- Nouveau : <input type="email" ng-model="newCustomerResponsible" placeholder="nom.prenom(a)franciaflex.fr" />
+ Nouveau : <select ng-model="newCustomerResponsible" ng-options="user as user.firstName + ' ' + user.lastName for user in users"></select>
<a class="btn btn-success btn-xs" ng-click="addCustomerResponsible()" ng-disabled="!newCustomerResponsible">
<span class="glyphicon glyphicon-ok"></span>
</a>
@@ -283,16 +283,30 @@
<tr>
<th>Utilisateur ou groupe</th>
<th>Type</th>
+ <th>Action</th>
</tr>
</thead>
<tbody>
-
+ <tr ng-repeat="user in selectedMailFolder.writeRightUsers">
+ <td>
+ {{user.firstName}} {{user.lastName}}
+ </td>
+ <td>
+ Ecriture
+ </td>
+ <td>
+ <a class="pull-right btn btn-danger btn-xs" ng-click="removeWriteRightUser($index)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ </td>
+ </tr>
</tbody>
</table>
<div class="form-group">
- Nouveau utilisateur : <input type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
- <a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
+ Nouveau utilisateur :
+ <select ng-model="newWriteRightUser" ng-options="user as user.firstName + ' ' + user.lastName for user in users"></select>
+ <a class="btn btn-success btn-xs" ng-click="addWriteRightUser()" ng-disabled="!newWriteRightUser">
<span class="glyphicon glyphicon-ok"></span>
</a>
</div>
@@ -409,14 +423,17 @@
<input type="radio" name="rejectUnknownSenderField"
ng-model="selectedMailFolder.rejectUnknownSender" ng-value="undefined"> valeur du noeud parent
</label>
- </div>
+ </div>
-
-
<div class="form-group">
<label for="ediFolderField">Dossier (FS) de dépôt des demandes EDI</label>
<input type="text" class="form-control" id="ediFolderField" ng-model="selectedMailFolder.ediFolder">
</div>
+
+ <div class="form-group">
+ <label for="faxDomainField">Domaines des fax</label>
+ <input type="text" class="form-control" id="faxDomainField" ng-model="selectedMailFolder.faxDomain">
+ </div>
</div>
</div>
</div>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 18:45:22 UTC (rev 122)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 20:10:28 UTC (rev 123)
@@ -138,6 +138,8 @@
$scope.newReplyAddress;
// {Array} Colonnes selectionnées pour le dossier courant
$scope.folderTableColumns;
+ // {Array} Users
+ $scope.users = ConfigurationData.users;
// creation d'un nouveau noeud racine
$scope.newRoot = function() {
@@ -171,6 +173,9 @@
if (!$scope.selectedMailFolder.folderTableColumns) {
$scope.selectedMailFolder.folderTableColumns = [];
}
+ if (!$scope.selectedMailFolder.writeRightUsers) {
+ $scope.selectedMailFolder.writeRightUsers = [];
+ }
// initialise la liste des colonnes pour le dossier courant
$scope.folderTableColumns = [];
@@ -238,6 +243,17 @@
$scope.selectedMailFolder.replyAddresses.splice(index, 1);
};
+ // add reply address
+ $scope.addWriteRightUser = function() {
+ $scope.selectedMailFolder.writeRightUsers.push($scope.newWriteRightUser);
+ delete $scope.newWriteRightUser;
+ };
+
+ // remove customer responsible
+ $scope.removeWriteRightUser = function(index) {
+ $scope.selectedMailFolder.writeRightUsers.splice(index, 1);
+ };
+
// selection/deselection d'un état d'attente possible pour ce dossier
$scope.changeFolderEtatAttente = function(etatAttente) {
var index = $scope.selectedMailFolder.etatAttente.indexOf(etatAttente);
1
0
02 Jun '14
Author: echatellier
Date: 2014-06-02 20:45:22 +0200 (Mon, 02 Jun 2014)
New Revision: 122
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/122
Log:
Rectaroring (retours kevin)
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -251,10 +251,6 @@
public String getLdapPassword() {
return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_PASSWORD.getKey());
}
-
- public boolean isLdapMock() {
- return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.LDAP_MOCK.getKey());
- }
public String getInstanceUrl() {
return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey());
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -103,10 +103,6 @@
"faxtomail.ldap.password",
"Mot de passe pour la connexion au serveur LDAP", null, String.class),
- LDAP_MOCK(
- "faxtomail.ldap.mock",
- "Use mock ldap provider for test purpose", "false", Boolean.class),
-
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,40 +0,0 @@
-package com.franciaflex.faxtomail.persistence.entities;
-
-/*
- * #%L
- * FaxToMail :: Persistence
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2014 Franciaflex, Code Lutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author Kevin Morin (Code Lutin)
- * @since x.x
- */
-public enum Action {
-
- SAVE,
- TRANSMIT,
- PRINT,
- ARCHIVE,
- REPLY,
- GROUP
-
-}
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -0,0 +1,36 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id: Action.java 48 2014-04-25 13:43:04Z echatellier $
+ * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-persistence/src/main/ja… $
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public enum ContextAction {
+
+ CHANGE_PRIORITY,
+ AUTO_SAVE
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ContextAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java (from rev 121, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MainAction.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -0,0 +1,40 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public enum MainAction {
+
+ SAVE,
+ TRANSMIT,
+ PRINT,
+ ARCHIVE,
+ REPLY,
+ GROUP
+
+}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -33,7 +33,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -41,7 +40,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
import javax.activation.DataSource;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -24,6 +24,26 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.decorator.Decorator;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
@@ -53,27 +73,6 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.commons.lang3.SystemUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.decorator.Decorator;
-import org.nuiton.jaxx.application.ApplicationTechnicalException;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-import static org.nuiton.i18n.I18n.t;
-
public class InitFaxToMailService extends FaxToMailServiceSupport {
private static final Log log = LogFactory.getLog(InitFaxToMailService.class);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,6 +1,8 @@
package com.franciaflex.faxtomail.services.service;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -15,29 +17,69 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserImpl;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
-import com.franciaflex.faxtomail.services.service.ldap.FakeLdapProvider;
-import com.franciaflex.faxtomail.services.service.ldap.LdapProvider;
import com.franciaflex.faxtomail.services.service.ldap.LdapUser;
+import com.unboundid.ldap.sdk.LDAPConnection;
+import com.unboundid.ldap.sdk.LDAPException;
+import com.unboundid.ldap.sdk.SearchResult;
+import com.unboundid.ldap.sdk.SearchResultEntry;
+import com.unboundid.ldap.sdk.SearchScope;
public class LdapService extends FaxToMailServiceSupport {
private static final Log log = LogFactory.getLog(LdapService.class);
- protected LdapProvider ldapProvider;
+ /**
+ * Get ldap connection.
+ *
+ * @return
+ * @throws LDAPException
+ */
+ protected LDAPConnection getLDAPConnection() throws LDAPException {
+ // host, port, username and password
+ return new LDAPConnection(getApplicationConfig().getLdapHost(),
+ getApplicationConfig().getLdapPort(),
+ getApplicationConfig().getLdapUser(),
+ getApplicationConfig().getLdapPassword());
+ }
- protected LdapProvider getLdapProvider() {
- if (ldapProvider == null) {
- FaxToMailConfiguration config = getApplicationConfig();
- if (config.isLdapMock()) {
- ldapProvider = new FakeLdapProvider();
- if (log.isInfoEnabled()) {
- log.info("Using fake ldap provider");
+ /**
+ * Get all user from ldap.
+ *
+ * @return ldap users with group infos
+ */
+ public Collection<LdapUser> getAllLdapUsers() {
+ Collection<LdapUser> results = new ArrayList<>();
+
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup"
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account"
+ String baseDN = "ou=People,DC=codelutin,DC=home";
+ String filter = "(objectClass=account)";
+
+ LDAPConnection connection = null;
+ try {
+ connection = getLDAPConnection();
+ if (connection.isConnected()) {
+ SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
+
+ List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
+ for (SearchResultEntry searchEntry : searchEntries) {
+ LdapUser user = new LdapUser();
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+
+ results.add(user);
}
- } else {
- ldapProvider = new LdapProvider(config);
}
+ } catch (LDAPException ex) {
+ throw new RuntimeException("Can't connect to ldap", ex);
+ } finally {
+ if (connection != null) {
+ connection.close();
+ }
}
- return ldapProvider;
+
+ return results;
}
/**
@@ -55,7 +97,7 @@
}
}
- Collection<LdapUser> ldapUsers = getLdapProvider().getAllLdapUsers();
+ Collection<LdapUser> ldapUsers = getAllLdapUsers();
FaxToMailUserTopiaDao faxtomailUserDao = getPersistenceContext().getFaxToMailUserDao();
FaxToMailUserGroupTopiaDao faxToMailUserGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -24,15 +24,15 @@
* #L%
*/
+import java.util.ArrayList;
+import java.util.List;
+
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ValidationService.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -24,12 +24,13 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import org.nuiton.validator.NuitonValidator;
import org.nuiton.validator.NuitonValidatorFactory;
import org.nuiton.validator.NuitonValidatorResult;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
/**
* To validate some incoming data using nuiton-validators.
*
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,33 +0,0 @@
-package com.franciaflex.faxtomail.services.service.ldap;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import com.unboundid.ldap.sdk.LDAPException;
-
-/**
- * Fake ldap provider for test/demo purpose.
- *
- * @author Eric Chatellier
- */
-public class FakeLdapProvider extends LdapProvider {
-
- @Override
- public Collection<LdapUser> getAllLdapUsers() {
-
- LdapUser ldapUser1 = new LdapUser();
- ldapUser1.setLogin("user1");
- ldapUser1.addGroup("Groupe 1");
-
- LdapUser ldapUser2 = new LdapUser();
- ldapUser2.setLogin("user2");
- ldapUser2.addGroup("Groupe 1");
-
- LdapUser ldapUser3 = new LdapUser();
- ldapUser3.setLogin("user3");
- ldapUser3.addGroup("Groupe 2");
-
- return Arrays.asList(ldapUser1, ldapUser2, ldapUser3);
- }
-
-}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,85 +0,0 @@
-package com.franciaflex.faxtomail.services.service.ldap;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import com.franciaflex.faxtomail.FaxToMailConfiguration;
-import com.unboundid.ldap.sdk.LDAPConnection;
-import com.unboundid.ldap.sdk.LDAPException;
-import com.unboundid.ldap.sdk.SearchResult;
-import com.unboundid.ldap.sdk.SearchResultEntry;
-import com.unboundid.ldap.sdk.SearchScope;
-
-/**
- * Real ldap provider.
- *
- * @author Eric Chatellier
- */
-public class LdapProvider {
-
- protected FaxToMailConfiguration config;
-
- protected LdapProvider() {
-
- }
-
- public LdapProvider(FaxToMailConfiguration config) {
- this();
- this.config = config;
- }
-
- /**
- * Get ldap connection.
- *
- * @return
- * @throws LDAPException
- */
- protected LDAPConnection getLDAPConnection() throws LDAPException {
- // host, port, username and password
- return new LDAPConnection(config.getLdapHost(),
- config.getLdapPort(),
- config.getLdapUser(),
- config.getLdapPassword());
- }
-
- /**
- * Get all user from ldap.
- *
- * @return ldap users with group infos
- */
- public Collection<LdapUser> getAllLdapUsers() {
- Collection<LdapUser> results = new ArrayList<>();
-
- // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup"
- // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account"
- String baseDN = "ou=People,DC=codelutin,DC=home";
- String filter = "(objectClass=account)";
-
- LDAPConnection connection = null;
- try {
- connection = getLDAPConnection();
- if (connection.isConnected()) {
- SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
-
- List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
- for (SearchResultEntry searchEntry : searchEntries) {
- LdapUser user = new LdapUser();
- user.setLogin(searchEntry.getAttributeValue("uid"));
- user.setLogin(searchEntry.getAttributeValue("uid"));
- user.setLogin(searchEntry.getAttributeValue("uid"));
-
- results.add(user);
- }
- }
- } catch (LDAPException ex) {
- throw new RuntimeException("Can't connect to ldap", ex);
- } finally {
- if (connection != null) {
- connection.close();
- }
- }
-
- return results;
- }
-}
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -24,11 +24,13 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailConfiguration;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.FaxToMailService;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.SystemUtils;
@@ -38,13 +40,11 @@
import org.junit.After;
import org.nuiton.util.FileUtil;
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.FaxToMailService;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
public class AbstractFaxToMailServiceTest {
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -26,14 +26,14 @@
import java.io.IOException;
-import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -33,14 +33,16 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Result;
-import com.franciaflex.faxtomail.persistence.entities.Action;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
+import com.franciaflex.faxtomail.persistence.entities.ContextAction;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.Field;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MainAction;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
@@ -70,7 +72,7 @@
protected List<MailFilter> mailFilters;
- protected List<String> groupNames;
+ protected List<FaxToMailUser> users;
protected List<EmailAccount> emailAccounts;
@@ -84,7 +86,7 @@
public String input() throws Exception {
etatAttentes = referentielService.getAllEtatAttente();
mailFolders = mailFolderService.getRootMailFolders();
- groupNames = Collections.emptyList(); //FIXME: configurationService.getAllGroups();
+ users = configurationService.getAllUsers();
emailAccounts = configurationService.getEmailAccounts();
mailFilters = configurationService.getMailFilters();
return INPUT;
@@ -133,11 +135,15 @@
this.etatAttentes = getGson().fromJson(json, type);
}
- public Map<Action, String> getEtatAttenteActions() {
- return getEnumAsMap(Action.values());
+ public Map<MainAction, String> getMainActions() {
+ return getEnumAsMap(MainAction.values());
}
- public Map<Field, String> getEtatAttenteFields() {
+ public Map<ContextAction, String> getContextActions() {
+ return getEnumAsMap(ContextAction.values());
+ }
+
+ public Map<Field, String> getFields() {
return getEnumAsMap(Field.values());
}
@@ -150,8 +156,8 @@
this.mailFolders = getGson().fromJson(json, type);
}
- public List<String> getGroupNames() {
- return groupNames;
+ public List<FaxToMailUser> getUsers() {
+ return users;
}
public List<MailFilter> getMailFilters() {
@@ -167,7 +173,7 @@
return emailAccounts;
}
- public void setEmailAccounts(String json) {
+ public void setEmailAccountsJson(String json) {
Type type = new TypeToken<List<EmailAccount>>() {}.getType();
this.emailAccounts = getGson().fromJson(json, type);
}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -0,0 +1,57 @@
+package com.franciaflex.faxtomail.web.action.admin;
+
+/*
+ * #%L
+ * FaxToMail :: Web
+ * $Id: UserFolderAction.java 121 2014-06-02 15:45:55Z echatellier $
+ * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/java/co… $
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.convention.annotation.Result;
+
+import com.franciaflex.faxtomail.services.service.LdapService;
+import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+
+public class LdapAction extends FaxToMailActionSupport {
+
+ private static final Log log = LogFactory.getLog(LdapAction.class);
+
+ protected LdapService ldapService;
+
+ public void setLdapService(LdapService ldapService) {
+ this.ldapService = ldapService;
+ }
+
+ @Override
+ @org.apache.struts2.convention.annotation.Action("ldap-input")
+ public String input() throws Exception {
+ return INPUT;
+ }
+
+ @Override
+ @org.apache.struts2.convention.annotation.Action(results = {
+ @Result(type = "redirectAction", params = {"actionName", "ldap-input"})})
+ public String execute() throws Exception {
+ ldapService.updateLdapData();
+ return SUCCESS;
+ }
+}
Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,28 +0,0 @@
-package com.franciaflex.faxtomail.web.job;
-
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
-import com.franciaflex.faxtomail.services.service.LdapService;
-
-/**
- * Ce job interroge périodiquement l'annuaire ldap pour mettre à jour la liste
- * des comptes et des utilisateurs directement dans la base de données faxtomail.
- *
- * @author Eric Chatellier
- */
-public class LdapJob extends AbstractFaxToMailJob {
-
- protected FaxToMailServiceContext serviceContext;
-
- @Override
- public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
- serviceContext = getServiceContext(jobExecutionContext);
-
- LdapService ldapService = serviceContext.newService(LdapService.class);
- ldapService.updateLdapData();
-
- }
-
-}
Modified: trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-02 18:45:22 UTC (rev 122)
@@ -1,9 +1,5 @@
-com.franciaflex.faxtomail.persistence.entities.Action.ARCHIVE=Archiver
-com.franciaflex.faxtomail.persistence.entities.Action.GROUP=Grouper
-com.franciaflex.faxtomail.persistence.entities.Action.PRINT=Imprimer
-com.franciaflex.faxtomail.persistence.entities.Action.REPLY=Repondre
-com.franciaflex.faxtomail.persistence.entities.Action.SAVE=Sauver
-com.franciaflex.faxtomail.persistence.entities.Action.TRANSMIT=Transfer
+com.franciaflex.faxtomail.persistence.entities.ContextAction.AUTO_SAVE=Sauver automatiquement
+com.franciaflex.faxtomail.persistence.entities.ContextAction.CHANGE_PRIORITY=Changer la priorité
com.franciaflex.faxtomail.persistence.entities.Field.ARCHIVE_DATE=Date d'archive
com.franciaflex.faxtomail.persistence.entities.Field.ATTACHMENT=Pièces jointes
com.franciaflex.faxtomail.persistence.entities.Field.CLIENT=Client
@@ -24,4 +20,10 @@
com.franciaflex.faxtomail.persistence.entities.Field.RECIPIENT=Destinataire
com.franciaflex.faxtomail.persistence.entities.Field.SENDER=Expéditeur
com.franciaflex.faxtomail.persistence.entities.Field.TAKEN_BY=Pris par
+com.franciaflex.faxtomail.persistence.entities.MainAction.ARCHIVE=Archiver
+com.franciaflex.faxtomail.persistence.entities.MainAction.GROUP=Grouper
+com.franciaflex.faxtomail.persistence.entities.MainAction.PRINT=Imprimer
+com.franciaflex.faxtomail.persistence.entities.MainAction.REPLY=Repondre
+com.franciaflex.faxtomail.persistence.entities.MainAction.SAVE=Sauver
+com.franciaflex.faxtomail.persistence.entities.MainAction.TRANSMIT=Déplacer
faxtomail.email.projectReference.default=
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-02 18:45:22 UTC (rev 122)
@@ -46,12 +46,15 @@
<script type="text/javascript">
angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable'])
.value('ConfigurationData', {
+ // enums
+ 'mainActions': <s:property value="toJson(mainActions)" escapeHtml="false"/>,
+ 'contextActions': <s:property value="toJson(contextActions)" escapeHtml="false"/>,
+ 'fields': <s:property value="toJson(fields)" escapeHtml="false"/>,
+ // datas
'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
- 'etatAttenteActions': <s:property value="toJson(etatAttenteActions)" escapeHtml="false"/>,
- 'etatAttenteFields': <s:property value="toJson(etatAttenteFields)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>,
- 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>,
+ 'users': <s:property value="toJson(users)" escapeHtml="false"/>,
'mailFilters': <s:property value="toJson(mailFilters)" escapeHtml="false"/>,
'emailAccounts': <s:property value="toJson(emailAccounts)" escapeHtml="false"/>
});
@@ -90,9 +93,6 @@
<s:textfield name="configuration.emailMaxSize"
label="Taille maximale des email (en bits)"/>
-
- <s:checkbox name="configuration.rejectUnknownSender"
- label="Refuser les mails dont l'email est inconnu de la base client"/>
<!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...).
Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)-->
@@ -119,14 +119,14 @@
<div class="col-md-7" ng-if="selectedEtatAttente">
<h3>Édition de l'état d'attente {{selectedEtatAttente.label}}</h3>
Champs obligatoires pour l'état d'attente :
- <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields">
- <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1"
- ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}}
+ <label class="checkbox" ng-repeat="(field,label) in fields">
+ <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(field) != -1"
+ ng-click="changeEtatAttenteField(field)"> {{label}}
</label>
Actions autorisées pour l'état d'attente :
- <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions">
- <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1"
- ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}}
+ <label class="checkbox" ng-repeat="(mainAction,label) in mainActions">
+ <input type="checkbox" ng-checked="selectedEtatAttente.mainActions.indexOf(mainAction) != -1"
+ ng-click="changeEtatAttenteAction(mainAction)"> {{label}}
</label>
</div>
<div class="col-md-7" ng-if="!selectedEtatAttente">
@@ -321,9 +321,9 @@
</div>
<div id="collapse5" class="panel-collapse collapse">
<div class="panel-body">
- <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions">
- <input type="checkbox" ng-checked="selectedMailFolder.folderActions.indexOf(etatAttenteAction) != -1"
- ng-click="changeFolderAction(etatAttenteAction)"> {{label}}
+ <label class="checkbox" ng-repeat="(contextAction,label) in contextActions">
+ <input type="checkbox" ng-checked="selectedMailFolder.contextActions.indexOf(contextAction) != -1"
+ ng-click="changeFolderAction(contextAction)"> {{label}}
</label>
</div>
</div>
@@ -334,7 +334,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse6">
- Configuration des colonnes a afficher
+ Configuration des colonnes à afficher
</a>
</h4>
</div>
@@ -396,6 +396,24 @@
</div>
<div class="form-group">
+ <label class="control-label">Refuser les mails dont l'email est inconnu de la base client</label><br />
+ <label class="radio-inline">
+ <input type="radio" name="rejectUnknownSenderField"
+ ng-model="selectedMailFolder.rejectUnknownSender" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="rejectUnknownSenderField"
+ ng-model="selectedMailFolder.rejectUnknownSender" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="rejectUnknownSenderField"
+ ng-model="selectedMailFolder.rejectUnknownSender" ng-value="undefined"> valeur du noeud parent
+ </label>
+ </div>
+
+
+
+ <div class="form-group">
<label for="ediFolderField">Dossier (FS) de dépôt des demandes EDI</label>
<input type="text" class="form-control" id="ediFolderField" ng-model="selectedMailFolder.ediFolder">
</div>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp 2014-06-02 18:45:22 UTC (rev 122)
@@ -0,0 +1,54 @@
+<%--
+ #%L
+ FaxToMail :: Web
+ $Id: user-folder-input.jsp 121 2014-06-02 15:45:55Z echatellier $
+ $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/webapp/… $
+ %%
+ Copyright (C) 2014 Franciaflex, Code Lutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html>
+ <head>
+ <title>Ldap</title>
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
+
+ <script type="text/javascript" src="<s:url value='/js/faxtomail.js' />"></script>
+ </head>
+
+ <body>
+
+ <div id="main-container" class="container">
+
+ <h1 class="page-header">Ldap</h1>
+
+ <s:form id="main_form" action="ldap" method="post">
+
+ <button type="submit" class="btn btn-primary navbar-btn">Mettre à jour les groupes et utilisateurs LDAP</button>
+
+ <nav class="navbar navbar-default navbar-fixed-bottom">
+ <!-- <div class="container">
+ <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
+ </div> -->
+ </nav>
+ </s:form>
+ </div>
+ </body>
+</html>
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/ldap-input.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 18:45:22 UTC (rev 122)
@@ -27,7 +27,7 @@
<html>
<head>
- <title>Import</title>
+ <title>Dossiers mis en avant par utilisateur</title>
<link rel="stylesheet" type="text/css" href="<s:url value='/webjars/select2/3.4.8/select2.css' />" />
<link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
@@ -55,7 +55,7 @@
<h1 class="page-header">Dossiers mis en avant par utilisateur</h1>
- <s:form id="main_form" action="user-folder" method="post" enctype="multipart/form-data" ng-controller="UserFolderController">
+ <s:form id="main_form" action="user-folder" method="post" ng-controller="UserFolderController">
<s:hidden name="userFoldersJson" value="{{userFolders}}" />
<table id='table-snapshot' class="table table-bordered">
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-06-02 18:45:22 UTC (rev 122)
@@ -52,11 +52,13 @@
</div>
<nav class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
- <li><a href="<s:url action='configuration-input' />">
+ <li><a href="<s:url action='ldap-input' namespace="/admin" />">
+ <span class="glyphicon glyphicon-retweet"></span> Ldap</a></li>
+ <li><a href="<s:url action='configuration-input' namespace="/admin" />">
<span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
- <li><a href="<s:url action='import-input' />">
+ <li><a href="<s:url action='import-input' namespace="/admin" />">
<span class="glyphicon glyphicon-upload"></span> Import</a></li>
- <li><a href="<s:url action='user-folder-input' />">
+ <li><a href="<s:url action='user-folder-input' namespace="/admin" />">
<span class="glyphicon glyphicon-th-list"></span> Dossiers utilisateur</a></li>
</ul>
</nav>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 15:45:55 UTC (rev 121)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-02 18:45:22 UTC (rev 122)
@@ -27,16 +27,16 @@
*/
FaxToMailModule.controller('ConfigurationController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
- //{Array} mail folders
- $scope.mailFolders = ConfigurationData.mailFolders;
//{Map} les actions possibles pour les etats d'attentes
- $scope.etatAttenteActions = ConfigurationData.etatAttenteActions;
+ $scope.mainActions = ConfigurationData.mainActions;
//{Map} les champs obligatoires possibles
- $scope.etatAttenteFields = ConfigurationData.etatAttenteFields;
+ $scope.fields = ConfigurationData.fields;
+ //{Map} les actions contextuelles possibles pour les dossiers
+ $scope.contextActions = ConfigurationData.contextActions;
//{Array} les etats d'attentes disponibles
$scope.etatAttentes = ConfigurationData.etatAttentes;
- // {Array} Liste des groupes ldap
- $scope.groupNames = ConfigurationData.groupNames;
+ //{Array} mail folders
+ $scope.mailFolders = ConfigurationData.mailFolders;
// method privée recursive pour retourner l'ensemble des dossiers
var recursiveAddMailFolder = function(result, mailFolders) {
@@ -103,24 +103,24 @@
};
// selection/deselection d'une action
- $scope.changeEtatAttenteAction = function(etatAttenteAction) {
+ $scope.changeEtatAttenteAction = function(action) {
- var index = $scope.selectedEtatAttente.actions.indexOf(etatAttenteAction);
+ var index = $scope.selectedEtatAttente.mainActions.indexOf(action);
if (index != -1) {
- $scope.selectedEtatAttente.actions.splice(index, 1);
+ $scope.selectedEtatAttente.mainActions.splice(index, 1);
} else {
- $scope.selectedEtatAttente.actions.push(etatAttenteAction);
+ $scope.selectedEtatAttente.mainActions.push(action);
}
};
// selection/deselection d'un champ
- $scope.changeEtatAttenteField = function(etatAttenteField) {
+ $scope.changeEtatAttenteField = function(field) {
- var index = $scope.selectedEtatAttente.fields.indexOf(etatAttenteField);
+ var index = $scope.selectedEtatAttente.fields.indexOf(field);
if (index != -1) {
$scope.selectedEtatAttente.fields.splice(index, 1);
} else {
- $scope.selectedEtatAttente.fields.push(etatAttenteField);
+ $scope.selectedEtatAttente.fields.push(field);
}
};
}]);
@@ -177,7 +177,7 @@
angular.forEach($scope.selectedMailFolder.folderTableColumns, function(folderTableColumn) {
$scope.folderTableColumns.push({
id: folderTableColumn,
- label: $scope.etatAttenteFields[folderTableColumn]
+ label: $scope.fields[folderTableColumn]
});
});
};
@@ -207,7 +207,7 @@
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
- angular.forEach($scope.etatAttenteFields, function(label, field) {
+ angular.forEach($scope.fields, function(label, field) {
resultArray.push({
id: field,
label: label
@@ -249,12 +249,12 @@
};
// selection/deselection d'une action possible du menu contextuel pour ce dossier
- $scope.changeFolderAction = function(etatAttenteAction) {
- var index = $scope.selectedMailFolder.folderActions.indexOf(etatAttenteAction);
+ $scope.changeFolderAction = function(contextAction) {
+ var index = $scope.selectedMailFolder.contextActions.indexOf(contextAction);
if (index != -1) {
- $scope.selectedMailFolder.folderActions.splice(index, 1);
+ $scope.selectedMailFolder.contextActions.splice(index, 1);
} else {
- $scope.selectedMailFolder.folderActions.push(etatAttenteAction);
+ $scope.selectedMailFolder.contextActions.push(contextAction);
}
};
}]);
@@ -294,14 +294,14 @@
angular.forEach(ConfigurationData.searchDisplayColumns, function(searchDisplayColumn) {
$scope.searchDisplayColumns.push({
id: searchDisplayColumn,
- label: $scope.etatAttenteFields[searchDisplayColumn]
+ label: $scope.fields[searchDisplayColumn]
});
});
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
- angular.forEach($scope.etatAttenteFields, function(label, field) {
+ angular.forEach($scope.fields, function(label, field) {
resultArray.push({
id: field,
label: label
1
0
r121 - in trunk: . faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 02 Jun '14
by echatellier@users.forge.codelutin.com 02 Jun '14
02 Jun '14
Author: echatellier
Date: 2014-06-02 17:45:55 +0200 (Mon, 02 Jun 2014)
New Revision: 121
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/121
Log:
refs #4662: Sauvegarde de la mise en avant des dossiers utilisateur
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-02 11:05:24 UTC (rev 120)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-02 15:45:55 UTC (rev 121)
@@ -24,6 +24,7 @@
* #L%
*/
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -45,6 +46,8 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.collect.Maps;
@@ -174,6 +177,27 @@
public List<FaxToMailUser> getAllUsers() {
FaxToMailUserTopiaDao faxToMailUserDao = getPersistenceContext().getFaxToMailUserDao();
- return faxToMailUserDao.findAll();
+ return faxToMailUserDao.forAll().setOrderByArguments(FaxToMailUser.PROPERTY_FIRST_NAME, FaxToMailUser.PROPERTY_LAST_NAME).findAll();
}
+
+ public void saveUserFolders(Map<String, Collection<MailFolder>> userFolders) {
+ log.warn("user folders = " + userFolders);
+
+ //MailFolderTopiaDao mailFolderTopiaDao = getPersistenceContext().getMailFolderDao();
+ FaxToMailUserTopiaDao faxToMailUserTopiaDao = getPersistenceContext().getFaxToMailUserDao();
+
+ for (Map.Entry<String, Collection<MailFolder>> entry : userFolders.entrySet()) {
+ String userId = entry.getKey();
+ Collection<MailFolder> mailFolders = entry.getValue();
+
+ FaxToMailUser user = faxToMailUserTopiaDao.findByTopiaId(userId);
+ user.clearAffectedFolders();
+ for (MailFolder mailFolder : mailFolders) {
+ user.addAffectedFolders(mailFolder);
+ }
+ faxToMailUserTopiaDao.update(user);
+ }
+
+ getPersistenceContext().commit();
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-06-02 11:05:24 UTC (rev 120)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-06-02 15:45:55 UTC (rev 121)
@@ -24,9 +24,13 @@
* #L%
*/
-import java.util.Collections;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Result;
@@ -36,6 +40,7 @@
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+import com.google.gson.reflect.TypeToken;
public class UserFolderAction extends FaxToMailActionSupport {
@@ -49,6 +54,8 @@
protected List<FaxToMailUser> users;
+ protected Map<String, Collection<MailFolder>> userFolders;
+
public void setConfigurationService(ConfigurationService configurationService) {
this.configurationService = configurationService;
}
@@ -62,6 +69,11 @@
public String input() throws Exception {
mailFolders = mailFolderService.getAllMailFolders();
users = configurationService.getAllUsers();
+
+ userFolders = new HashMap<>();
+ for (FaxToMailUser user : users) {
+ userFolders.put(user.getTopiaId(), CollectionUtils.emptyIfNull(user.getAffectedFolders()));
+ }
return INPUT;
}
@@ -69,9 +81,9 @@
@org.apache.struts2.convention.annotation.Action(results = {
@Result(type = "redirectAction", params = {"actionName", "user-folder-input"})})
public String execute() throws Exception {
- String result = super.execute();
- return result;
+ configurationService.saveUserFolders(userFolders);
+ return SUCCESS;
}
public List<MailFolder> getMailFolders() {
@@ -81,4 +93,13 @@
public List<FaxToMailUser> getUsers() {
return users;
}
+
+ public Map<String, Collection<MailFolder>> getUserFolders() {
+ return userFolders;
+ }
+
+ public void setUserFoldersJson(String json) {
+ Type type = new TypeToken<Map<String, Collection<MailFolder>>>() {}.getType();
+ this.userFolders = getGson().fromJson(json, type);
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 11:05:24 UTC (rev 120)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-02 15:45:55 UTC (rev 121)
@@ -28,18 +28,23 @@
<html>
<head>
<title>Import</title>
+ <link rel="stylesheet" type="text/css" href="<s:url value='/webjars/select2/3.4.8/select2.css' />" />
<link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
+ <script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/faxtomail.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/user-folder.js' />"></script>
<script type="text/javascript">
- angular.module('UserFolderModule', ['FaxToMail'])
+ angular.module('UserFolderModule', ['FaxToMail', 'ui.select2.sortable'])
.value('UserFolderData', {
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
- 'users': <s:property value="toJson(users)" escapeHtml="false"/>
+ 'users': <s:property value="toJson(users)" escapeHtml="false"/>,
+ 'userFolders': <s:property value="toJson(userFolders)" escapeHtml="false"/>
});
</script>
</head>
@@ -48,12 +53,12 @@
<div id="main-container" class="container" ng-app="UserFolderModule">
- <h1 class="page-header">Import</h1>
+ <h1 class="page-header">Dossiers mis en avant par utilisateur</h1>
- <s:form id="main_form" action="import" method="post" enctype="multipart/form-data" ng-controller="UserFolderController">
+ <s:form id="main_form" action="user-folder" method="post" enctype="multipart/form-data" ng-controller="UserFolderController">
+ <s:hidden name="userFoldersJson" value="{{userFolders}}" />
<table id='table-snapshot' class="table table-bordered">
- <caption>Dossiers mis en avant par utilisateur</caption>
<thead>
<tr>
<th>Utilisateur</th>
@@ -62,9 +67,11 @@
</thead>
<tbody>
<tr ng-repeat="user in users">
- <th>{{user.login}}</th>
+ <th>{{user.firstName}} {{user.lastName}}</th>
<td>
- <input type="text" />
+ <div class="controls">
+ <input type="hidden" ui-select2-sortable ng-model="userFolders[user.topiaId]" simple-query="getObjectsData" multiple sortable>
+ </div>
</td>
</tr>
</tbody>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-06-02 11:05:24 UTC (rev 120)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-06-02 15:45:55 UTC (rev 121)
@@ -31,6 +31,8 @@
$scope.mailFolders = UserFolderData.mailFolders;
// {Array} Liste des utilisateurs ldap
$scope.users = UserFolderData.users;
+ //{Map} Topia id : mailFolders
+ $scope.userFolders = UserFolderData.userFolders;
// method privée recursive pour retourner l'ensemble des dossiers
var recursiveAddMailFolder = function(result, mailFolders) {
@@ -48,4 +50,16 @@
recursiveAddMailFolder(flatMailFolders, $scope.mailFolders);
return flatMailFolders;
};
+
+ // fonction retournant l'ensemble des options disponibles
+ $scope.getObjectsData = function(term, result) {
+ var resultArray = [];
+ angular.forEach($scope.mailFolders, function(mailFolder) {
+ // select 2 require an id field
+ mailFolder.id = mailFolder.topiaId;
+ // select 2 can use 'name' for display, so it's ok
+ resultArray.push(mailFolder);
+ });
+ result(resultArray);
+ };
}]);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-02 11:05:24 UTC (rev 120)
+++ trunk/pom.xml 2014-06-02 15:45:55 UTC (rev 121)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>5.0.7</version>
+ <version>5.0.8</version>
</parent>
<groupId>com.franciaflex</groupId>
@@ -97,7 +97,7 @@
<nuitonI18nVersion>3.1</nuitonI18nVersion>
<nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
- <nuitonCsvVersion>3.0-rc-1</nuitonCsvVersion>
+ <nuitonCsvVersion>3.0-rc-2</nuitonCsvVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
<nuitonUtilsVersion>3.0-SNAPSHOT</nuitonUtilsVersion>
@@ -109,7 +109,7 @@
<hibernateVersion>4.3.5.Final</hibernateVersion>
<h2Version>1.3.176</h2Version>
- <jaxxVersion>2.8.6-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.8.6</jaxxVersion>
<!-- do not upgrade to 1.6.5-1 -->
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.15.1</xworkVersion>
@@ -553,7 +553,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>select2</artifactId>
- <version>3.4.8</version>
+ <version>3.4.8-1</version>
<scope>runtime</scope>
</dependency>
1
0
Build failed in Jenkins: faxtomail-ci » FaxToMail :: UI #87
by admin+ci-codelutin.com@codelutin.com 02 Jun '14
by admin+ci-codelutin.com@codelutin.com 02 Jun '14
02 Jun '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: UI 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 50.0 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 46.7 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (7 KB at 248.2 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (7 KB at 302.2 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (57 KB at 1483.9 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 53.7 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 51.7 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (4 KB at 139.4 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (4 KB at 139.4 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 73.0 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 69.8 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (5 KB at 213.4 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (5 KB at 213.4 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 66.5 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 60.7 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (5 KB at 230.0 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (5 KB at 219.5 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 63.9 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 58.6 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (6 KB at 236.3 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (6 KB at 216.6 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/topia/…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/nuiton…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (73 KB at 1545.1 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (96 KB at 1425.8 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (385 KB at 3886.8 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (505 KB at 4271.6 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-ui-swing ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-ui-swing ---
[INFO]
[INFO] --- jaxx-maven-plugin:2.8.6-SNAPSHOT:generate (default) @ faxtomail-ui-swing ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 51.9 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 50.1 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (4 KB at 160.5 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (4 KB at 168.2 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 63.5 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 60.8 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (5 KB at 194.8 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (5 KB at 194.8 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (401 KB at 4218.0 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (493 KB at 4978.5 KB/sec)
[INFO] use project compile scope class-path
[INFO] Detects 26 modified jaxx file(s).
[INFO] Generated 26 file(s) in 3.558s
[INFO]
[INFO] --- i18n-maven-plugin:3.1:parserJava (scan-sources) @ faxtomail-ui-swing ---
[INFO]
[INFO] --- i18n-maven-plugin:3.1:parserValidation (scan-sources) @ faxtomail-ui-swing ---
[INFO] Load rules file validation.rules
[INFO]
[INFO] >>> i18n-maven-plugin:3.1:gen (scan-sources) @ faxtomail-ui-swing >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.1:get (get) @ faxtomail-ui-swing ---
[INFO] Copying faxtomail-ui-swing.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.1:gen (scan-sources) @ faxtomail-ui-swing <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.1:gen (scan-sources) @ faxtomail-ui-swing ---
[WARNING] bundle fr_FR contains 27/287 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] >>> i18n-maven-plugin:3.1:bundle (make-bundle) @ faxtomail-ui-swing >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.1:collect-i18n-artifacts (collect-i18n-artifacts) @ faxtomail-ui-swing ---
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/topia/…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/2…
[INFO] collected 10 i18n artifacts for locale fr_FR stored in <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.1:bundle (make-bundle) @ faxtomail-ui-swing <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.1:bundle (make-bundle) @ faxtomail-ui-swing ---
[WARNING] bundle fr_FR contains 62/534 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- license-maven-plugin:1.7:update-project-license (attach-licenses) @ faxtomail-ui-swing ---
[INFO]
[INFO] --- license-maven-plugin:1.7:add-third-party (attach-licenses) @ faxtomail-ui-swing ---
[INFO] Load missing file <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] Missing file <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…> is up-to-date.
[INFO] Writing third-party file to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] Writing bundled third-party file to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] Will attach third party file from <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 45 resources
[INFO] Copying 3 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-ui-swing ---
[INFO] Compiling 107 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>:[272,29] unreported exception java.io.IOException; must be caught or declared to be thrown
[INFO] 1 error
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
8
r120 - in trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing: . content
by kmorin@users.forge.codelutin.com 02 Jun '14
by kmorin@users.forge.codelutin.com 02 Jun '14
02 Jun '14
Author: kmorin
Date: 2014-06-02 13:05:24 +0200 (Mon, 02 Jun 2014)
New Revision: 120
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/120
Log:
fix swing session new exception thrown
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-06-02 10:34:39 UTC (rev 119)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-06-02 11:05:24 UTC (rev 120)
@@ -170,7 +170,14 @@
handler.onCloseUI();
//close context
- context.getSwingSession().save();
+ try {
+ context.getSwingSession().save();
+
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("error while saving the swing session", e);
+ }
+ }
context.close();
if (exitCode != null) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-06-02 10:34:39 UTC (rev 119)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-06-02 11:05:24 UTC (rev 120)
@@ -54,6 +54,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeListenerProxy;
+import java.io.IOException;
import java.util.Locale;
import static org.nuiton.i18n.I18n.t;
@@ -145,8 +146,15 @@
// Init SwingSession
SwingSession swingSession = getContext().getSwingSession();
swingSession.add(ui);
- swingSession.save();
+ try {
+ swingSession.save();
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("error while saving the swing session", e);
+ }
+ }
+
// SwingUtil.getLayer(ui.getBody()).setUI(new BetaLayerUI());
changeTitle();
@@ -307,8 +315,15 @@
FaxToMailUI<?, ?> body = (FaxToMailUI<?, ?>) currentBody;
body.getHandler().onCloseUI();
- getContext().getSwingSession().save();
+ try {
+ getContext().getSwingSession().save();
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("error while saving the swing session", e);
+ }
+ }
+
ui.getBody().remove(currentBody);
currentBody = null;
1
0
02 Jun '14
Author: kmorin
Date: 2014-06-02 12:34:39 +0200 (Mon, 02 Jun 2014)
New Revision: 119
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/119
Log:
add transfert tables
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
1
0
01 Jun '14
Author: echatellier
Date: 2014-06-01 23:07:49 +0200 (Sun, 01 Jun 2014)
New Revision: 118
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/118
Log:
Retreive user from ldap
Added:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -251,6 +251,10 @@
public String getLdapPassword() {
return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_PASSWORD.getKey());
}
+
+ public boolean isLdapMock() {
+ return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.LDAP_MOCK.getKey());
+ }
public String getInstanceUrl() {
return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey());
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -94,7 +94,7 @@
LDAP_PORT(
"faxtomail.ldap.port",
"Port du serveur LDAP", "389", Integer.class),
-
+
LDAP_USER(
"faxtomail.ldap.user",
"Nom d'utilisateur pour la connexion au serveur ldap", null, String.class),
@@ -103,6 +103,10 @@
"faxtomail.ldap.password",
"Mot de passe pour la connexion au serveur LDAP", null, String.class),
+ LDAP_MOCK(
+ "faxtomail.ldap.mock",
+ "Use mock ldap provider for test purpose", "false", Boolean.class),
+
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-01 21:07:49 UTC (rev 118)
@@ -66,11 +66,16 @@
com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.mailFolder.tagvalue.notNull=true
com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.position.tagvalue.unique=true
-# FaxToMailGroup
-com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup.attribute.name.tagvalue.naturalId=true
-
# Email
com.franciaflex.faxtomail.persistence.entities.Email.attribute.mailFolder.tagvalue.notNull=true
# History
com.franciaflex.faxtomail.persistence.entities.History.attribute.type.tagvalue.notNull=true
+
+
+
+# FaxToMailUser
+com.franciaflex.faxtomail.persistence.entities.FaxToMailUser.attribute.login.tagvalue.naturalId=true
+
+# FaxToMailUserGroup
+com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup.attribute.name.tagvalue.naturalId=true
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -41,6 +41,8 @@
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountImpl;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
@@ -169,4 +171,9 @@
emailAccountTopiaDao.deleteAll(emailAccountMap.values());
getPersistenceContext().commit();
}
+
+ public List<FaxToMailUser> getAllUsers() {
+ FaxToMailUserTopiaDao faxToMailUserDao = getPersistenceContext().getFaxToMailUserDao();
+ return faxToMailUserDao.findAll();
+ }
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -1,77 +1,43 @@
package com.franciaflex.faxtomail.services.service;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserImpl;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.franciaflex.faxtomail.services.service.ldap.FakeLdapProvider;
+import com.franciaflex.faxtomail.services.service.ldap.LdapProvider;
import com.franciaflex.faxtomail.services.service.ldap.LdapUser;
-import com.unboundid.ldap.sdk.LDAPConnection;
-import com.unboundid.ldap.sdk.LDAPException;
-import com.unboundid.ldap.sdk.SearchResult;
-import com.unboundid.ldap.sdk.SearchResultEntry;
-import com.unboundid.ldap.sdk.SearchScope;
public class LdapService extends FaxToMailServiceSupport {
private static final Log log = LogFactory.getLog(LdapService.class);
- /**
- * Get ldap connection.
- *
- * @return
- * @throws LDAPException
- */
- protected LDAPConnection getLDAPConnection() throws LDAPException {
- // host, port, username and password
- return new LDAPConnection(getApplicationConfig().getLdapHost(),
- getApplicationConfig().getLdapPort(),
- getApplicationConfig().getLdapUser(),
- getApplicationConfig().getLdapPassword());
- }
+ protected LdapProvider ldapProvider;
- /**
- * Get all user from ldap.
- *
- * @return ldap users with group infos
- * @throws LDAPException
- */
- protected Collection<LdapUser> getAllLdapUsers() throws LDAPException {
- Collection<LdapUser> results = new ArrayList<>();
-
- // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup"
- // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account"
- String baseDN = "ou=People,DC=codelutin,DC=home";
- String filter = "(objectClass=account)";
-
- LDAPConnection connection = null;
- try {
- connection = getLDAPConnection();
- if (connection.isConnected()) {
- SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
-
- List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
- for (SearchResultEntry searchEntry : searchEntries) {
- LdapUser user = new LdapUser();
- user.setLogin(searchEntry.getAttributeValue("uid"));
- user.setLogin(searchEntry.getAttributeValue("uid"));
- user.setLogin(searchEntry.getAttributeValue("uid"));
-
- results.add(user);
+ protected LdapProvider getLdapProvider() {
+ if (ldapProvider == null) {
+ FaxToMailConfiguration config = getApplicationConfig();
+ if (config.isLdapMock()) {
+ ldapProvider = new FakeLdapProvider();
+ if (log.isInfoEnabled()) {
+ log.info("Using fake ldap provider");
}
+ } else {
+ ldapProvider = new LdapProvider(config);
}
- } finally {
- if (connection != null) {
- connection.close();
- }
}
-
-
- return results;
+ return ldapProvider;
}
/**
@@ -82,8 +48,52 @@
if (log.isDebugEnabled()) {
log.debug("Ldap service not configured !");
}
+ return;
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Updating user data from ldap");
+ }
}
+
+ Collection<LdapUser> ldapUsers = getLdapProvider().getAllLdapUsers();
+
+ FaxToMailUserTopiaDao faxtomailUserDao = getPersistenceContext().getFaxToMailUserDao();
+ FaxToMailUserGroupTopiaDao faxToMailUserGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
+ Binder<FaxToMailUser, FaxToMailUser> userBinder = BinderFactory.newBinder(FaxToMailUser.class);
+ for (LdapUser ldapUser : ldapUsers) {
+
+ // manage user from login
+ FaxToMailUser user = faxtomailUserDao.forLoginEquals(ldapUser.getLogin()).findUniqueOrNull();
+ if (user == null) {
+ user = new FaxToMailUserImpl();
+ }
+
+ // FIXME echatellier 20140601 : it's not necessary to save user in database if information didn't change
+ userBinder.copyExcluding(ldapUser, user,
+ FaxToMailUser.PROPERTY_TOPIA_ID,
+ FaxToMailUser.PROPERTY_TOPIA_CREATE_DATE,
+ FaxToMailUser.PROPERTY_TOPIA_VERSION,
+ FaxToMailUser.PROPERTY_FAX_TO_MAIL_USER_GROUP);
+
+ // manage user group
+ Collection<String> groups = ldapUser.getGroups();
+ user.clearFaxToMailUserGroup();
+ for (String group : groups) {
+ FaxToMailUserGroup userGroup = faxToMailUserGroupDao.forNameEquals(group).findUniqueOrNull();
+ if (userGroup == null) {
+ userGroup = faxToMailUserGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, group);
+ }
+ user.addFaxToMailUserGroup(userGroup);
+ }
+
+ // persist user
+ if (user.isPersisted()) {
+ faxtomailUserDao.update(user);
+ } else {
+ faxtomailUserDao.create(user);
+ }
+ }
-
+ getPersistenceContext().commit();
}
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -0,0 +1,33 @@
+package com.franciaflex.faxtomail.services.service.ldap;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import com.unboundid.ldap.sdk.LDAPException;
+
+/**
+ * Fake ldap provider for test/demo purpose.
+ *
+ * @author Eric Chatellier
+ */
+public class FakeLdapProvider extends LdapProvider {
+
+ @Override
+ public Collection<LdapUser> getAllLdapUsers() {
+
+ LdapUser ldapUser1 = new LdapUser();
+ ldapUser1.setLogin("user1");
+ ldapUser1.addGroup("Groupe 1");
+
+ LdapUser ldapUser2 = new LdapUser();
+ ldapUser2.setLogin("user2");
+ ldapUser2.addGroup("Groupe 1");
+
+ LdapUser ldapUser3 = new LdapUser();
+ ldapUser3.setLogin("user3");
+ ldapUser3.addGroup("Groupe 2");
+
+ return Arrays.asList(ldapUser1, ldapUser2, ldapUser3);
+ }
+
+}
Property changes on: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/FakeLdapProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -0,0 +1,85 @@
+package com.franciaflex.faxtomail.services.service.ldap;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.unboundid.ldap.sdk.LDAPConnection;
+import com.unboundid.ldap.sdk.LDAPException;
+import com.unboundid.ldap.sdk.SearchResult;
+import com.unboundid.ldap.sdk.SearchResultEntry;
+import com.unboundid.ldap.sdk.SearchScope;
+
+/**
+ * Real ldap provider.
+ *
+ * @author Eric Chatellier
+ */
+public class LdapProvider {
+
+ protected FaxToMailConfiguration config;
+
+ protected LdapProvider() {
+
+ }
+
+ public LdapProvider(FaxToMailConfiguration config) {
+ this();
+ this.config = config;
+ }
+
+ /**
+ * Get ldap connection.
+ *
+ * @return
+ * @throws LDAPException
+ */
+ protected LDAPConnection getLDAPConnection() throws LDAPException {
+ // host, port, username and password
+ return new LDAPConnection(config.getLdapHost(),
+ config.getLdapPort(),
+ config.getLdapUser(),
+ config.getLdapPassword());
+ }
+
+ /**
+ * Get all user from ldap.
+ *
+ * @return ldap users with group infos
+ */
+ public Collection<LdapUser> getAllLdapUsers() {
+ Collection<LdapUser> results = new ArrayList<>();
+
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup"
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account"
+ String baseDN = "ou=People,DC=codelutin,DC=home";
+ String filter = "(objectClass=account)";
+
+ LDAPConnection connection = null;
+ try {
+ connection = getLDAPConnection();
+ if (connection.isConnected()) {
+ SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
+
+ List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
+ for (SearchResultEntry searchEntry : searchEntries) {
+ LdapUser user = new LdapUser();
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+
+ results.add(user);
+ }
+ }
+ } catch (LDAPException ex) {
+ throw new RuntimeException("Can't connect to ldap", ex);
+ } finally {
+ if (connection != null) {
+ connection.close();
+ }
+ }
+
+ return results;
+ }
+}
Property changes on: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -24,9 +24,6 @@
* #L%
*/
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
import java.util.Collections;
import java.util.List;
@@ -34,10 +31,10 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Result;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
-import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
public class UserFolderAction extends FaxToMailActionSupport {
@@ -50,7 +47,7 @@
protected List<MailFolder> mailFolders;
- protected List<String> groupNames;
+ protected List<FaxToMailUser> users;
public void setConfigurationService(ConfigurationService configurationService) {
this.configurationService = configurationService;
@@ -64,7 +61,7 @@
@org.apache.struts2.convention.annotation.Action("user-folder-input")
public String input() throws Exception {
mailFolders = mailFolderService.getAllMailFolders();
- groupNames = Collections.emptyList(); //FIXME: configurationService.getAllGroups();
+ users = configurationService.getAllUsers();
return INPUT;
}
@@ -81,7 +78,7 @@
return mailFolders;
}
- public List<String> getGroupNames() {
- return groupNames;
+ public List<FaxToMailUser> getUsers() {
+ return users;
}
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java 2014-06-01 21:07:49 UTC (rev 118)
@@ -28,7 +28,6 @@
import com.franciaflex.faxtomail.services.service.EmailService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-06-01 21:07:49 UTC (rev 118)
@@ -39,7 +39,7 @@
angular.module('UserFolderModule', ['FaxToMail'])
.value('UserFolderData', {
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
- 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>
+ 'users': <s:property value="toJson(users)" escapeHtml="false"/>
});
</script>
</head>
@@ -61,8 +61,8 @@
</tr>
</thead>
<tbody>
- <tr ng-repeat="groupName in groupNames">
- <th>{{groupName}}</th>
+ <tr ng-repeat="user in users">
+ <th>{{user.login}}</th>
<td>
<input type="text" />
</td>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-05-30 21:01:38 UTC (rev 117)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-06-01 21:07:49 UTC (rev 118)
@@ -29,8 +29,8 @@
function($scope, $http, UserFolderData) {
//{Array} mail folders
$scope.mailFolders = UserFolderData.mailFolders;
- // {Array} Liste des groupes ldap
- $scope.groupNames = UserFolderData.groupNames;
+ // {Array} Liste des utilisateurs ldap
+ $scope.users = UserFolderData.users;
// method privée recursive pour retourner l'ensemble des dossiers
var recursiveAddMailFolder = function(result, mailFolders) {
1
0
r117 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 23:01:38 +0200 (Fri, 30 May 2014)
New Revision: 117
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/117
Log:
fix swing session new exception thrown
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-05-30 20:43:45 UTC (rev 116)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-05-30 21:01:38 UTC (rev 117)
@@ -77,6 +77,7 @@
import java.beans.PropertyChangeListener;
import java.io.Closeable;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
@@ -269,7 +270,7 @@
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
- this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+ this.swingSession = SwingSession.newSession(getConfig().getUIConfigFile(), false, additionalStates);
this.errorHelper = new ApplicationErrorHelper(this) {
1
0
r116 - in trunk: faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/resources/i18n
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 22:43:45 +0200 (Fri, 30 May 2014)
New Revision: 116
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/116
Log:
add validator on the range table
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java
trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-05-30 20:43:45 UTC (rev 116)
@@ -128,14 +128,15 @@
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
// if client code is null, do not manage client at all
- if (clientCode != null) {
- Client client = clientDao.forCodeEquals(clientCode).findAnyOrNull();
+ Client client = null;
+ if (StringUtils.isNotBlank(clientCode)) {
+ client = clientDao.forCodeEquals(clientCode).findAnyOrNull();
if (client == null) {
String message = t("faxtomail.service.email.save.clientCode.error", clientCode);
throw new InvalidClientException(message);
}
- email.setClient(client);
}
+ email.setClient(client);
if (attachments != null) {
Collection<Attachment> currentAttachments = CollectionUtils.emptyIfNull(email.getAttachment());
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-05-30 20:43:45 UTC (rev 116)
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
@@ -44,7 +43,6 @@
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
-import com.franciaflex.faxtomail.ui.swing.content.demande.RangeTableModel;
import com.google.common.collect.Maps;
import static org.nuiton.i18n.I18n.t;
@@ -73,8 +71,7 @@
persistedEmail = new EmailImpl();
}
- RangeTableModel rtm = (RangeTableModel) getUI().getRangeTable().getModel();
- List<RangeRowModel> rows = rtm.getRows();
+ Collection<RangeRowModel> rows = model.getValidRangeRowModels();
Collection<RangeRow> rangeRows = model.getRangeRow();
if (rangeRows == null) {
rangeRows = new ArrayList<>();
@@ -82,14 +79,13 @@
Map<String, RangeRow> rangeRowsById = Maps.uniqueIndex(rangeRows, TopiaEntities.getTopiaIdFunction());
+ model.setRangeRow(new ArrayList<RangeRow>());
for (RangeRowModel rangeRowModel : rows) {
- if (rangeRowModel.isValid()) {
- RangeRow rangeRow = rangeRowsById.get(rangeRowModel.getTopiaId());
- if (rangeRow == null) {
- model.addRangeRow(rangeRowModel.toEntity());
- } else {
- rangeRowModel.toEntity(rangeRow);
- }
+ RangeRow rangeRow = rangeRowsById.get(rangeRowModel.getTopiaId());
+ if (rangeRow == null) {
+ model.addRangeRow(rangeRowModel.toEntity());
+ } else {
+ model.addRangeRow(rangeRowModel.toEntity(rangeRow));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-05-30 20:43:45 UTC (rev 116)
@@ -279,6 +279,7 @@
#rangePanel {
visible: { model.isRangePanelVisible() };
+ _validatorLabel: { t("faxtomail.demande.rangeRow.label") };
}
#ediCodeNumberLabel {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-05-30 20:43:45 UTC (rev 116)
@@ -71,6 +71,7 @@
<field name='object' component='objectField'/>
<field name='demandType' component='docTypeComboBox'/>
<field name='projectReference' component='projectReferenceField'/>
+ <field name='validRangeRowModels' component='rangePanel'/>
</BeanValidator>
<JToolBar id='topToolBar'>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-05-30 20:43:45 UTC (rev 116)
@@ -100,7 +100,7 @@
initUI(ui);
- DemandeUIModel model = getModel();
+ final DemandeUIModel model = getModel();
Set<String> propertiesToIgnore = getPropertiesToIgnore();
monitor = new BeanMonitor(true, propertiesToIgnore.toArray(new String[propertiesToIgnore.size()]));
monitor.setBean(model);
@@ -182,8 +182,8 @@
for (RangeRow rangeRow : rangeRows) {
RangeRowModel rangeRowModel = new RangeRowModel();
rangeRowModel.fromEntity(rangeRow);
- rangeRowModel.setValid(isRangeRowValid(rangeRowModel));
rangeRowModels.add(rangeRowModel);
+ model.getValidRangeRowModels().add(rangeRowModel);
}
}
rangeTableModel.setRows(rangeRowModels);
@@ -199,11 +199,19 @@
protected PropertyChangeListener listener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
+ DemandeUIModel model = getModel();
+ String propertyName = evt.getPropertyName();
- RangeRowModel row = (RangeRowModel) evt.getSource();
- row.setValid(isRangeRowValid(row));
+ if (RangeRowModel.PROPERTY_VALID.equals(propertyName)) {
+ RangeRowModel row = (RangeRowModel) evt.getSource();
+ Boolean valid = (Boolean) evt.getNewValue();
+ if (Boolean.TRUE.equals(valid)) {
+ model.addValidRangeRow(row);
+ } else {
+ model.removeValidRangeRow(row);
+ }
+ }
- String propertyName = evt.getPropertyName();
if (RangeRowModel.PROPERTY_VALID.equals(propertyName)
|| RangeRow.PROPERTY_QUOTATION_QUANTITY.equals(propertyName)
|| RangeRow.PROPERTY_PRODUCT_QUANTITY.equals(propertyName)
@@ -211,7 +219,6 @@
List<RangeRowModel> rangeRows = rangeTableModel.getRows();
Map<String, Integer> quantities = FaxToMailUIUtil.computeQuantities(rangeRows);
- DemandeUIModel model = getModel();
model.setQuotationNb(quantities.get(DemandeUIModel.PROPERTY_QUOTATION_NB));
model.setPfNb(quantities.get(DemandeUIModel.PROPERTY_PF_NB));
model.setSavNb(quantities.get(DemandeUIModel.PROPERTY_SAV_NB));
@@ -421,10 +428,6 @@
return monitor;
}
- protected boolean isRangeRowValid(RangeRowModel rangeRow) {
- return rangeRow.getRange() != null;
- }
-
@Override
public boolean onHideTab(int currentIndex, int newIndex) {
closeButtonPopups();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-05-30 20:43:45 UTC (rev 116)
@@ -92,6 +92,7 @@
public static final String PROPERTY_EDITABLE = "editable";
public static final String PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER = "lastAttachmentOpeningInThisFolderUser";
public static final String PROPERTY_GROUPED_DEMANDES = "groupedDemandes";
+ public static final String PROPERTY_VALID_RANGE_ROW_MODELS = "validRangeRowModels";
protected final Email editObject = new EmailImpl();
@@ -99,6 +100,8 @@
protected final Collection<DemandeUIModel> groupedDemandes = new ArrayList<DemandeUIModel>();
+ protected final Collection<RangeRowModel> validRangeRowModels = new ArrayList<RangeRowModel>();
+
protected History firstOpeningHistory;
protected History lastModificationHistory;
@@ -388,7 +391,7 @@
public boolean isRangePanelVisible() {
DemandType demandType = getDemandType();
- return demandType != null && Boolean.TRUE.equals(demandType.getRangeNeeded());
+ return demandType != null && demandType.isRangeNeeded();
}
public DemandStatus getDemandStatus() {
@@ -814,6 +817,30 @@
return editObject.sizeReplies();
}
+
+ public Collection<RangeRowModel> getValidRangeRowModels() {
+ return validRangeRowModels;
+ }
+
+ public void setValidRangeRowModels(Collection<RangeRowModel> validRangeRowModels) {
+ Object oldValue = new ArrayList<RangeRowModel>(validRangeRowModels);
+ this.validRangeRowModels.clear();
+ this.validRangeRowModels.addAll(validRangeRowModels);
+ firePropertyChanged(PROPERTY_VALID_RANGE_ROW_MODELS, oldValue, validRangeRowModels);
+ }
+
+ public void addValidRangeRow(RangeRowModel row) {
+ Object oldValue = new ArrayList<RangeRowModel>(validRangeRowModels);
+ validRangeRowModels.add(row);
+ firePropertyChanged(PROPERTY_VALID_RANGE_ROW_MODELS, oldValue, validRangeRowModels);
+ }
+
+ public void removeValidRangeRow(RangeRowModel row) {
+ Object oldValue = new ArrayList<RangeRowModel>(validRangeRowModels);
+ validRangeRowModels.remove(row);
+ firePropertyChanged(PROPERTY_VALID_RANGE_ROW_MODELS, oldValue, validRangeRowModels);
+ }
+
@Override
protected Email newEntity() {
return new EmailImpl();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java 2014-05-30 20:43:45 UTC (rev 116)
@@ -107,6 +107,7 @@
Object oldValue = getRange();
editObject.setRange(range);
firePropertyChange(RangeRow.PROPERTY_RANGE, oldValue, range);
+ setValid(range != null);
}
public Range getRange() {
Modified: trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml 2014-05-30 20:43:45 UTC (rev 116)
@@ -30,6 +30,12 @@
<validators>
+ <field name="object">
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>faxtomail.validator.error.email.object.required</message>
+ </field-validator>
+ </field>
+
<field name="clientCode">
<field-validator type="requiredstring" short-circuit="true">
<message>faxtomail.validator.error.email.clientCode.required</message>
@@ -48,4 +54,11 @@
</field-validator>
</field>
+ <field name="validRangeRowModels">
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression"><![CDATA[ !isRangePanelVisible() || validRangeRowModels != null && !validRangeRowModels.isEmpty() ]]></param>
+ <message>faxtomail.validator.error.email.rangeRow.required</message>
+ </field-validator>
+ </field>
+
</validators>
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-05-30 16:32:40 UTC (rev 115)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-05-30 20:43:45 UTC (rev 116)
@@ -276,7 +276,9 @@
faxtomail.systemUser=Système
faxtomail.validator.error.email.clientCode.required=Code client requis
faxtomail.validator.error.email.demandType.required=Type de demande requis
+faxtomail.validator.error.email.object.required=Objet requis
faxtomail.validator.error.email.projectReference.required=Référence chantier requise
+faxtomail.validator.error.email.rangeRow.required=Tableau des gammes requis
faxtomail.validator.error.reply.from.required=
faxtomail.validator.error.reply.to.required=
jaxx.application.error.cannot.print=
1
0
r115 - in trunk: faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin
by echatellier@users.forge.codelutin.com 30 May '14
by echatellier@users.forge.codelutin.com 30 May '14
30 May '14
Author: echatellier
Date: 2014-05-30 18:32:40 +0200 (Fri, 30 May 2014)
New Revision: 115
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/115
Log:
refs #4662: Begin ldap job to update database
Added:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapUser.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/AbstractFaxToMailJob.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -24,27 +24,27 @@
* #L%
*/
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
+import com.franciaflex.faxtomail.persistence.entities.EmailAccountImpl;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
-import com.unboundid.ldap.sdk.LDAPConnection;
-import com.unboundid.ldap.sdk.LDAPException;
-import com.unboundid.ldap.sdk.SearchResult;
-import com.unboundid.ldap.sdk.SearchResultEntry;
-import com.unboundid.ldap.sdk.SearchScope;
+import com.google.common.collect.Maps;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -138,45 +138,35 @@
/**
*
- * @param emailAccounts
+ * @param newEmailAccounts new email account list to save
*/
- public void saveEmailAccounts(List<EmailAccount> emailAccounts) {
-
- }
+ public void saveEmailAccounts(List<EmailAccount> newEmailAccounts) {
+ List<EmailAccount> emailAccounts = getEmailAccounts();
+ Map<String, EmailAccount> emailAccountMap = new HashMap<>(Maps.uniqueIndex(emailAccounts, TopiaEntities.getTopiaIdFunction()));
+ Binder<EmailAccount, EmailAccount> binder = BinderFactory.newBinder(EmailAccount.class);
+ EmailAccountTopiaDao emailAccountTopiaDao = getPersistenceContext().getEmailAccountDao();
- /**
- * Get ldap connection.
- *
- * @return
- * @throws LDAPException
- */
- protected LDAPConnection getLDAPConnection() throws LDAPException {
- // host, port, username and password
- return new LDAPConnection(getApplicationConfig().getLdapHost(),
- getApplicationConfig().getLdapPort(),
- getApplicationConfig().getLdapUser(),
- getApplicationConfig().getLdapPassword());
- }
-
- public List<String> getAllGroups() throws LDAPException {
- List<String> results = new ArrayList<>();
-
- if (StringUtils.isNotBlank(getApplicationConfig().getLdapHost())) {
- // ldapsearch -h ldap.codelutin.home -b "ou=Group,DC=codelutin,DC=home" "objectClass=posixGroup"
- String baseDN = "ou=Group,DC=codelutin,DC=home";
- String filter = "(objectClass=posixGroup)";
-
- LDAPConnection connection = getLDAPConnection();
- if (connection.isConnected()) {
- SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
-
- List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
- for (SearchResultEntry searchEntry : searchEntries) {
- results.add(searchEntry.getAttributeValue("cn"));
- }
+ for (EmailAccount newEmailAccount : newEmailAccounts) {
+ EmailAccount emailAccount;
+ if (StringUtils.isNotBlank(newEmailAccount.getTopiaId())) {
+ emailAccount = emailAccountMap.remove(newEmailAccount.getTopiaId());
+ } else {
+ emailAccount = new EmailAccountImpl();
}
+
+ binder.copyExcluding(newEmailAccount, emailAccount,
+ EmailAccount.PROPERTY_TOPIA_ID,
+ EmailAccount.PROPERTY_TOPIA_CREATE_DATE,
+ EmailAccount.PROPERTY_TOPIA_VERSION);
+
+ if (emailAccount.isPersisted()) {
+ emailAccountTopiaDao.update(emailAccount);
+ } else {
+ emailAccountTopiaDao.create(emailAccount);
+ }
}
-
- return results;
+
+ emailAccountTopiaDao.deleteAll(emailAccountMap.values());
+ getPersistenceContext().commit();
}
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -0,0 +1,89 @@
+package com.franciaflex.faxtomail.services.service;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.franciaflex.faxtomail.services.service.ldap.LdapUser;
+import com.unboundid.ldap.sdk.LDAPConnection;
+import com.unboundid.ldap.sdk.LDAPException;
+import com.unboundid.ldap.sdk.SearchResult;
+import com.unboundid.ldap.sdk.SearchResultEntry;
+import com.unboundid.ldap.sdk.SearchScope;
+
+public class LdapService extends FaxToMailServiceSupport {
+
+ private static final Log log = LogFactory.getLog(LdapService.class);
+
+ /**
+ * Get ldap connection.
+ *
+ * @return
+ * @throws LDAPException
+ */
+ protected LDAPConnection getLDAPConnection() throws LDAPException {
+ // host, port, username and password
+ return new LDAPConnection(getApplicationConfig().getLdapHost(),
+ getApplicationConfig().getLdapPort(),
+ getApplicationConfig().getLdapUser(),
+ getApplicationConfig().getLdapPassword());
+ }
+
+ /**
+ * Get all user from ldap.
+ *
+ * @return ldap users with group infos
+ * @throws LDAPException
+ */
+ protected Collection<LdapUser> getAllLdapUsers() throws LDAPException {
+ Collection<LdapUser> results = new ArrayList<>();
+
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=posixGroup"
+ // ldapsearch -h ldap.codelutin.home -b "ou=People,DC=codelutin,DC=home" "objectClass=account"
+ String baseDN = "ou=People,DC=codelutin,DC=home";
+ String filter = "(objectClass=account)";
+
+ LDAPConnection connection = null;
+ try {
+ connection = getLDAPConnection();
+ if (connection.isConnected()) {
+ SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
+
+ List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
+ for (SearchResultEntry searchEntry : searchEntries) {
+ LdapUser user = new LdapUser();
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+ user.setLogin(searchEntry.getAttributeValue("uid"));
+
+ results.add(user);
+ }
+ }
+ } finally {
+ if (connection != null) {
+ connection.close();
+ }
+ }
+
+
+ return results;
+ }
+
+ /**
+ * Recupere les utilisateurs/groupes du ldap et met à jour la base locale.
+ */
+ public void updateLdapData() {
+ if (StringUtils.isBlank(getApplicationConfig().getLdapHost())) {
+ if (log.isDebugEnabled()) {
+ log.debug("Ldap service not configured !");
+ }
+ }
+
+
+ }
+}
Property changes on: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapUser.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapUser.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapUser.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -0,0 +1,23 @@
+package com.franciaflex.faxtomail.services.service.ldap;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserImpl;
+
+public class LdapUser extends FaxToMailUserImpl {
+
+ protected Collection<String> groups = new ArrayList<>();
+
+ public Collection<String> getGroups() {
+ return groups;
+ }
+
+ public void setGroups(Collection<String> groups) {
+ this.groups = groups;
+ }
+
+ public void addGroup(String group) {
+ this.groups.add(group);
+ }
+}
Property changes on: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ldap/LdapUser.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -88,11 +88,17 @@
.withIdentity("faxToMailJobs", "ediManagementJob")
.build();
+ JobDetail ldapJob = JobBuilder.newJob(EDIManagementJob.class)
+ .usingJobData(data)
+ .withIdentity("faxToMailJobs", "ldapJob")
+ .build();
+
try {
+
+ // schedule mail job (toutes les 20 minutes)
Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity("mailFiltering", "mailFilteringTrigger")
-// .withSchedule(CronScheduleBuilder.cronSchedule("* 0/1 * * * ?"))
.withSchedule(CronScheduleBuilder.cronSchedule("0/20 * * * * ?"))
.build();
@@ -100,6 +106,7 @@
scheduler.start();
scheduler.scheduleJob(mailFilteringJob, trigger);
+ // schedule EDI job (toutes les 5 heures)s
trigger = TriggerBuilder
.newTrigger()
.withIdentity("ediManagement", "ediManagementTrigger")
@@ -110,6 +117,17 @@
scheduler.start();
scheduler.scheduleJob(ediManagementJob, trigger);
+ // schedule ldap job (toutes les heures à 0 minute)
+ trigger = TriggerBuilder
+ .newTrigger()
+ .withIdentity("ldapManagement", "ldapManagementTrigger")
+ .withSchedule(CronScheduleBuilder.cronSchedule("0 * * * * ?"))
+ .build();
+
+ scheduler = new StdSchedulerFactory().getScheduler();
+ scheduler.start();
+ scheduler.scheduleJob(ldapJob, trigger);
+
log.debug("schedulers launched");
} catch (SchedulerException e) {
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -25,6 +25,7 @@
*/
import java.lang.reflect.Type;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -83,7 +84,7 @@
public String input() throws Exception {
etatAttentes = referentielService.getAllEtatAttente();
mailFolders = mailFolderService.getRootMailFolders();
- groupNames = configurationService.getAllGroups();
+ groupNames = Collections.emptyList(); //FIXME: configurationService.getAllGroups();
emailAccounts = configurationService.getEmailAccounts();
mailFilters = configurationService.getMailFilters();
return INPUT;
@@ -99,6 +100,7 @@
referentielService.saveEtatAttente(etatAttentes);
mailFolderService.saveMailFolders(mailFolders);
configurationService.saveMailFilters(mailFilters);
+ configurationService.saveEmailAccounts(emailAccounts);
return result;
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -27,6 +27,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.util.Collections;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -63,7 +64,7 @@
@org.apache.struts2.convention.annotation.Action("user-folder-input")
public String input() throws Exception {
mailFolders = mailFolderService.getAllMailFolders();
- groupNames = configurationService.getAllGroups();
+ groupNames = Collections.emptyList(); //FIXME: configurationService.getAllGroups();
return INPUT;
}
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/AbstractFaxToMailJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/AbstractFaxToMailJob.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/AbstractFaxToMailJob.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -0,0 +1,16 @@
+package com.franciaflex.faxtomail.web.job;
+
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+
+public abstract class AbstractFaxToMailJob implements Job {
+
+ public static final String SERVICE_CONTEXT = "serviceContext";
+
+ protected FaxToMailServiceContext getServiceContext(JobExecutionContext jobExecutionContext) {
+ FaxToMailServiceContext serviceContext = (FaxToMailServiceContext) jobExecutionContext.getMergedJobDataMap().get(SERVICE_CONTEXT);
+ return serviceContext;
+ }
+}
Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/AbstractFaxToMailJob.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/EDIManagementJob.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -36,17 +36,15 @@
* @author Kevin Morin (Code Lutin)
* @since x.x
*/
-public class EDIManagementJob implements Job {
+public class EDIManagementJob extends AbstractFaxToMailJob {
private static final Log log = LogFactory.getLog(EDIManagementJob.class);
- public static final String SERVICE_CONTEXT = "serviceContext";
-
protected FaxToMailServiceContext serviceContext;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
- serviceContext = (FaxToMailServiceContext) jobExecutionContext.getMergedJobDataMap().get(SERVICE_CONTEXT);
+ serviceContext = getServiceContext(jobExecutionContext);
EmailService emailService = serviceContext.newService(EmailService.class);
emailService.transmitPendingDemandsToEdi();
Added: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -0,0 +1,28 @@
+package com.franciaflex.faxtomail.web.job;
+
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.service.LdapService;
+
+/**
+ * Ce job interroge périodiquement l'annuaire ldap pour mettre à jour la liste
+ * des comptes et des utilisateurs directement dans la base de données faxtomail.
+ *
+ * @author Eric Chatellier
+ */
+public class LdapJob extends AbstractFaxToMailJob {
+
+ protected FaxToMailServiceContext serviceContext;
+
+ @Override
+ public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+ serviceContext = getServiceContext(jobExecutionContext);
+
+ LdapService ldapService = serviceContext.newService(LdapService.class);
+ ldapService.updateLdapData();
+
+ }
+
+}
Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/LdapJob.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-05-30 16:32:40 UTC (rev 115)
@@ -61,7 +61,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.decorator.Decorator;
-import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -83,18 +82,16 @@
* @author Kevin Morin (Code Lutin)
* @since x.x
*/
-public class MailFilterJob implements Job {
+public class MailFilterJob extends AbstractFaxToMailJob {
private static final Log log = LogFactory.getLog(MailFilterJob.class);
- public static final String SERVICE_CONTEXT = "serviceContext";
-
protected FaxToMailServiceContext serviceContext;
//TODO kmorin 20140414 handle imap protocol
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
- serviceContext = (FaxToMailServiceContext) jobExecutionContext.getMergedJobDataMap().get(SERVICE_CONTEXT);
+ serviceContext = getServiceContext(jobExecutionContext);
ConfigurationService configurationService = serviceContext.newService(ConfigurationService.class);
Collection<EmailAccount> emailAccounts = configurationService.getEmailAccounts();
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 15:20:22 UTC (rev 114)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 16:32:40 UTC (rev 115)
@@ -464,6 +464,8 @@
</div>
<div id="tabs-mailaccounts" class="tab-pane" ng-controller="ConfigurationEmailAccountsController">
+ <input type="hidden" name="emailAccountsJson" value="{{emailAccounts}}" />
+
<table id='table-snapshot' class="table table-bordered">
<thead>
<tr>
1
0