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
r194 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing
by echatellier@users.forge.codelutin.com 11 Jun '14
by echatellier@users.forge.codelutin.com 11 Jun '14
11 Jun '14
Author: echatellier
Date: 2014-06-11 18:00:34 +0200 (Wed, 11 Jun 2014)
New Revision: 194
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/194
Log:
R?\195?\169cup?\195?\169ration de l'utilsateur connect?\195?\169 via les variables d'env et le ldap
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-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
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/RunFaxToMail.java
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-11 15:29:45 UTC (rev 193)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-06-11 16:00:34 UTC (rev 194)
@@ -252,6 +252,10 @@
return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_PASSWORD.getKey());
}
+ public String getLdapTestPrincipal() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_TEST_PRINCIPAL.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-11 15:29:45 UTC (rev 193)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-06-11 16:00:34 UTC (rev 194)
@@ -103,6 +103,10 @@
"faxtomail.ldap.password",
"Mot de passe pour la connexion au serveur LDAP", null, String.class),
+ LDAP_TEST_PRINCIPAL(
+ "faxtomail.ldap.test.principal",
+ "Principal de test pour forcer un utilsateur particulier", null, String.class),
+
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
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-11 15:29:45 UTC (rev 193)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-11 16:00:34 UTC (rev 194)
@@ -335,4 +335,46 @@
return result;
}
+
+ public FaxToMailUser getUserFromPrincipal(String principal) throws AuthenticationException {
+
+ FaxToMailUser result = null;
+
+ try {
+ // first connexion to get full user login
+ LDAPConnection adminConnect = new LDAPConnection();
+ adminConnect.connect(getApplicationConfig().getLdapHost(), getApplicationConfig().getLdapPort());
+ adminConnect.bind(getApplicationConfig().getLdapUser(), getApplicationConfig().getLdapPassword());
+
+ // search user in ldap
+ String login = null;
+ SearchResultEntry searchEntry = null;
+ if (adminConnect.isConnected()) {
+ String filter = String.format("(userPrincipalName=%s@%s)", principal, "mac-groupe.net");
+ SearchResult searchResult = adminConnect.search("DC=mac-groupe,DC=net", SearchScope.SUB, filter);
+ if (!searchResult.getSearchEntries().isEmpty()) {
+ searchEntry = searchResult.getSearchEntries().get(0);
+ login = searchEntry.getAttributeValue("sn");
+ }
+ adminConnect.close();
+ }
+
+ if (searchEntry != null) {
+ FaxToMailUser user = updateUserFormLdap(searchEntry, login);
+
+ Binder<FaxToMailUser, FaxToMailUser> faxToMailUserBinder = BinderFactory.newBinder(FaxToMailUser.class);
+ result = new FaxToMailUserImpl();
+ faxToMailUserBinder.copyExcluding(user, result);
+ } else {
+ throw new AuthenticationException("Utilisateur inconnu : " + principal);
+ }
+
+ } catch (LDAPException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't login to ldap", ex);
+ }
+ throw new AuthenticationException(ex.getResultCode().getName(), ex);
+ }
+ return result;
+ }
}
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-06-11 15:29:45 UTC (rev 193)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-06-11 16:00:34 UTC (rev 194)
@@ -22,7 +22,45 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.Closeable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+
+import jaxx.runtime.swing.editor.bean.BeanDoubleList;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
+import jaxx.runtime.swing.session.BeanDoubleListState;
+import jaxx.runtime.swing.session.BeanFilterableComboBoxState;
+import jaxx.runtime.swing.session.State;
+import jaxx.runtime.swing.session.SwingSession;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractBean;
+import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.ClassPathI18nInitializer;
+import org.nuiton.jaxx.application.ApplicationConfiguration;
+import org.nuiton.jaxx.application.swing.ApplicationUIContext;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionEngine;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
+import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
+import org.nuiton.util.converter.ConverterUtil;
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
@@ -30,14 +68,15 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
-import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
+import com.franciaflex.faxtomail.services.service.LdapService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.services.service.UserService;
import com.franciaflex.faxtomail.services.service.ValidationService;
+import com.franciaflex.faxtomail.services.service.ldap.AuthenticationException;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.search.SearchUIModel;
@@ -46,46 +85,6 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-import jaxx.runtime.swing.editor.bean.BeanDoubleList;
-import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
-import jaxx.runtime.swing.session.BeanDoubleListState;
-import jaxx.runtime.swing.session.BeanFilterableComboBoxState;
-import jaxx.runtime.swing.session.State;
-import jaxx.runtime.swing.session.SwingSession;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.beans.AbstractBean;
-import org.nuiton.i18n.I18n;
-import org.nuiton.i18n.init.ClassPathI18nInitializer;
-import org.nuiton.i18n.init.DefaultI18nInitializer;
-import org.nuiton.i18n.init.UserI18nInitializer;
-import org.nuiton.jaxx.application.ApplicationConfiguration;
-import org.nuiton.jaxx.application.ApplicationIOUtil;
-import org.nuiton.jaxx.application.swing.ApplicationUIContext;
-import org.nuiton.jaxx.application.swing.action.ApplicationActionEngine;
-import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
-import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
-import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
-import org.nuiton.util.converter.ConverterUtil;
-
-import javax.swing.*;
-
-import java.awt.*;
-import java.beans.PropertyChangeEvent;
-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;
-import java.util.Set;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n.t;
-
/**
* UI application context.
*
@@ -150,13 +149,6 @@
protected final ApplicationErrorHelper errorHelper;
/**
- * Shared data context.
- *
- * @since 1.0.2
- */
-// protected TuttiDataContext dataContext;
-
- /**
* Current screen displayed in ui.
*
* @since 0.1
@@ -197,20 +189,6 @@
private JFrame secondaryFrame;
- /**
- * Flag to know if there is an exsiting db.
- *
- * @since 1.0
- */
- private boolean dbExist;
-
- /**
- * Flag to know if there is a loaded db.
- *
- * @since 1.0
- */
- private boolean dbLoaded;
-
private final ApplicationActionFactory faxToMailActionFactory;
private final ApplicationActionEngine faxToMailActionEngine;
@@ -370,52 +348,19 @@
I18n.init(new ClassPathI18nInitializer(), i18nLocale);
-// //--------------------------------------------------------------------//
-// // init help
-// //--------------------------------------------------------------------//
-//
-// File helpDirectory = config.getHelpDirectory();
-//
-// if (!config.isFullLaunchMode()) {
-//
-// if (!helpDirectory.exists()) {
-// helpDirectory = new File(config.getDataDirectory(), "help");
-// }
-// }
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Help directory: " + helpDirectory);
-// }
-// TuttiIOUtil.forceMkdir(
-// helpDirectory,
-// _("tutti.help.mkDir.error", helpDirectory));
-//
-// // load help mapping
-// String mappingProperties =
-// "/tutti-help-" + i18nLocale.getLanguage() + ".properties";
-// try {
-//
-// InputStream resourceAsStream =
-// getClass().getResourceAsStream(mappingProperties);
-// helpMapping = new Properties();
-// helpMapping.load(resourceAsStream);
-//
-// } catch (Exception eee) {
-// log.error("Failed to load help mapping file at '" +
-// mappingProperties + "'", eee);
-// }
-// if (log.isInfoEnabled()) {
-// log.info(String.format("Starts help with locale at [%s]",
-// helpDirectory));
-// }
-//
+ // try to get user from ldap
+ try {
+ String principal = getLoggedInUsername();
+ FaxToMailUser currentUser = getLdapService().getUserFromPrincipal(principal);
+ if (log.isInfoEnabled()) {
+ log.info("Connected as " + currentUser.getFirstName() + " " + currentUser.getLastName());
+ }
+ setCurrentUser(currentUser);
+ } catch (AuthenticationException ex) {
+ throw new RuntimeException(ex);
+ }
+
-// Company franciaflex = getCompanyService().getCompanyByName("Franciaflex");
-// setCurrentCompany(franciaflex);
-
- FaxToMailUser currentUser = getUserService().getUserByLogin("cbaillet");
- setCurrentUser(currentUser);
-
Configuration config = getConfigurationService().getConfiguration();
setFaxToMailConfiguration(config);
@@ -425,6 +370,14 @@
setActionUI(new ApplicationActionUI(null, this));
}
+ protected String getLoggedInUsername() {
+ String result = getConfig().getLdapTestPrincipal();
+ if (StringUtils.isBlank(result)) {
+ result = System.getProperty("user.name");
+ }
+ return result;
+ }
+
public void open() {
setLocale(config.getI18nLocale());
@@ -497,6 +450,10 @@
public UserService getUserService() {
return serviceContext.newService(UserService.class);
}
+
+ public LdapService getLdapService() {
+ return serviceContext.newService(LdapService.class);
+ }
public EmailService getEmailService() {
return serviceContext.newService(EmailService.class);
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-11 15:29:45 UTC (rev 193)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-06-11 16:00:34 UTC (rev 194)
@@ -27,15 +27,6 @@
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.actions.StartAction;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailExceptionHandler;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
-import com.itextpdf.text.*;
-import com.itextpdf.text.Image;
-import com.itextpdf.text.Rectangle;
-import com.itextpdf.text.pdf.ColumnText;
-import com.itextpdf.text.pdf.PdfContentByte;
-import com.itextpdf.text.pdf.PdfReader;
-import com.itextpdf.text.pdf.PdfStamper;
-import com.itextpdf.text.pdf.PdfWriter;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,10 +34,7 @@
import javax.swing.*;
import javax.swing.plaf.BorderUIResource;
import java.awt.*;
-import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.net.URL;
import java.util.Arrays;
/**
@@ -101,29 +89,6 @@
log.info("Full launch mode, try to update.");
}
- // check application url is reachable
-// boolean canUpdateApplication = context.checkUpdateApplicationReachable();
-
-// if (canUpdateApplication) {
-// // try to update jre - i18n - application - help and exit if so
-// UpdateApplicationAction logicAction = TuttiActionHelper.createLogicAction(new MainUIHandler(context),
-// UpdateApplicationAction.class);
-// TuttiActionHelper.runActionAndWait(logicAction);
-//
-// reload = logicAction.isReload();
-// }
-
- // check data url is reachable
-// boolean canUpdateData = context.checkUpdateDataReachable();
-
-// if (canUpdateData) {
-// // try to update report and exit if so
-// UpdateReportAction logicAction = TuttiActionHelper.createLogicAction(new MainUIHandler(context),
-// UpdateReportAction.class);
-// TuttiActionHelper.runActionAndWait(logicAction);
-//
-// reload |= logicAction.isReload();
-// }
}
if (!reload) {
1
0
r193 - in trunk: faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action faxtomail-ui-web/src/main/webapp/WEB-INF/content faxtomail-ui-web/src/main/webapp/WEB-INF/decorators
by echatellier@users.forge.codelutin.com 11 Jun '14
by echatellier@users.forge.codelutin.com 11 Jun '14
11 Jun '14
Author: echatellier
Date: 2014-06-11 17:29:45 +0200 (Wed, 11 Jun 2014)
New Revision: 193
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/193
Log:
Connexion ?\195?\160 l'application web ?\195?\160 partir du ldap
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/login-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
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-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/LdapService.java 2014-06-11 15:29:45 UTC (rev 193)
@@ -45,6 +45,7 @@
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.LDAPSearchException;
import com.unboundid.ldap.sdk.SearchResult;
import com.unboundid.ldap.sdk.SearchResultEntry;
import com.unboundid.ldap.sdk.SearchScope;
@@ -105,7 +106,7 @@
List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
for (SearchResultEntry searchEntry : searchEntries) {
LdapUser user = new LdapUser();
- user.setLogin(searchEntry.getAttributeValue("userPrincipalName"));
+ user.setLogin(searchEntry.getAttributeValue("sn"));
// Parse name
String fullName = searchEntry.getAttributeValue("name");
@@ -248,14 +249,90 @@
* @throws AuthenticationException if authentication fails
*/
public FaxToMailUser authenticateUser(String login, String password) throws AuthenticationException {
+
+ FaxToMailUser result = null;
+
+ try {
+ // first connexion to get full user login
+ LDAPConnection adminConnect = new LDAPConnection();
+ adminConnect.connect(getApplicationConfig().getLdapHost(), getApplicationConfig().getLdapPort());
+ adminConnect.bind(getApplicationConfig().getLdapUser(), getApplicationConfig().getLdapPassword());
+
+ // search user in ldap
+ String userDN = null;
+ SearchResultEntry searchEntry = null;
+ if (adminConnect.isConnected()) {
+ String filter = String.format("(sn=%s)", login);
+ SearchResult searchResult = adminConnect.search("DC=mac-groupe,DC=net", SearchScope.SUB, filter);
+ if (!searchResult.getSearchEntries().isEmpty()) {
+ searchEntry = searchResult.getSearchEntries().get(0);
+ userDN = searchEntry.getDN();
+ }
+ adminConnect.close();
+ }
+
+ if (searchEntry != null) {
+ // ouvre une connexion avec l'identification de l'utilisateur qui essaye de se connecter
+ // à l'application (ca permet de vérifier l'authentification)
+ LDAPConnection userConnect = new LDAPConnection();
+ userConnect.connect(getApplicationConfig().getLdapHost(), getApplicationConfig().getLdapPort());
+ userConnect.bind(userDN, password);
+
+ if (userConnect.isConnected()) {
+ FaxToMailUser user = updateUserFormLdap(searchEntry, login);
+
+ Binder<FaxToMailUser, FaxToMailUser> faxToMailUserBinder = BinderFactory.newBinder(FaxToMailUser.class);
+ result = new FaxToMailUserImpl();
+ faxToMailUserBinder.copyExcluding(user, result);
+ userConnect.close();
+ } else {
+ throw new AuthenticationException("Not connected");
+ }
+ } else {
+ throw new AuthenticationException("Utilisateur inconnu : " + login);
+ }
+
+ } catch (LDAPException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't login to ldap", ex);
+ }
+ throw new AuthenticationException(ex.getResultCode().getName(), ex);
+ }
+ return result;
+ }
+
+ protected FaxToMailUser updateUserFormLdap(SearchResultEntry searchEntry, String login) throws LDAPSearchException {
+
+ FaxToMailUser result = null;
+
+ // create or
FaxToMailUserTopiaDao faxtomailUserDao = getPersistenceContext().getFaxToMailUserDao();
- FaxToMailUser user = faxtomailUserDao.forAll().findAnyOrNull();
- FaxToMailUser result = null;
- if (user != null) {
- Binder<FaxToMailUser, FaxToMailUser> faxToMailUserBinder = BinderFactory.newBinder(FaxToMailUser.class);
+ result = faxtomailUserDao.forLoginEquals(login).findUniqueOrNull();
+
+ if (result == null) {
result = new FaxToMailUserImpl();
- faxToMailUserBinder.copyExcluding(user, result);
+ result.setLogin(login);
}
+
+ // update other ldap fields
+ String fullName = searchEntry.getAttributeValue("name");
+ if (fullName.indexOf(' ') != -1) {
+ String lastName = fullName.substring(0, fullName.indexOf(' '));
+ String firstName = fullName.substring(fullName.indexOf(' ') + 1);
+ result.setFirstName(firstName);
+ result.setLastName(lastName);
+ } else {
+ result.setFirstName("");
+ result.setLastName(fullName);
+ }
+
+ if (result.isPersisted()) {
+ result = faxtomailUserDao.update(result);
+ } else {
+ result = faxtomailUserDao.create(result);
+ }
+ getPersistenceContext().commit();
+
return result;
}
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-06-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-06-11 15:29:45 UTC (rev 193)
@@ -30,6 +30,7 @@
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
import com.franciaflex.faxtomail.web.DefaultFaxToMailWebApplicationContext;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.LogManager;
@@ -37,6 +38,8 @@
import java.io.File;
+import javassist.expr.NewArray;
+
public class FaxToMailApplicationContext {
private static Log log = LogFactory.getLog(FaxToMailApplicationContext.class);
@@ -133,6 +136,14 @@
// LocalizedTextUtil.addDefaultResourceBundle("i18n.faxtomail-web");
+ FaxToMailTopiaApplicationContext topiaAppContext = getTopiaApplicationContext();
+ if (topiaAppContext.isSchemaEmpty()) {
+ if (log.isInfoEnabled()) {
+ log.info("Create application schema");
+ }
+ topiaAppContext.createSchema();
+ }
+
FaxToMailTopiaPersistenceContext persistenceContext = newPersistenceContext();
FaxToMailServiceContext serviceContext = newServiceContext(persistenceContext);
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java 2014-06-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java 2014-06-11 15:29:45 UTC (rev 193)
@@ -25,12 +25,10 @@
*/
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserImpl;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.Collection;
-import java.util.UUID;
public class FaxToMailSession implements Serializable {
@@ -67,26 +65,19 @@
}
public String getAuthenticatedUserId() {
- //return authenticatedUserId;
- return UUID.randomUUID().toString();
+ return authenticatedUserId;
}
public void setAuthenticatedUserId(String authenticatedUserId) {
- //this.authenticatedUserId = authenticatedUserId;
+ this.authenticatedUserId = authenticatedUserId;
}
public FaxToMailUser getAuthenticatedFaxToMailUser() {
- //return authenticatedFaxToMailUser;
- FaxToMailUser result = new FaxToMailUserImpl();
- result.setTopiaId(UUID.randomUUID().toString());
- result.setFirstName("Demo");
- result.setLastName("Demo");
- result.setLogin("demo");
- return result;
+ return authenticatedFaxToMailUser;
}
public void setAuthenticatedFaxToMailUser(FaxToMailUser authenticatedFaxToMailUser) {
- //this.authenticatedFaxToMailUser = authenticatedFaxToMailUser;
+ this.authenticatedFaxToMailUser = authenticatedFaxToMailUser;
}
public void logout() {
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java 2014-06-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java 2014-06-11 15:29:45 UTC (rev 193)
@@ -70,10 +70,10 @@
String result = SUCCESS;
try {
FaxToMailUser user = ldapService.authenticateUser(login, password);
- //getSession().setAuthenticatedUserId(user.getTopiaId());
+ getSession().setAuthenticatedUserId(user.getTopiaId());
} catch (AuthenticationException ex) {
- result = ERROR;
- addActionError("Can't login");
+ result = INPUT;
+ addActionError("Impossible de se connecter (" + ex.getMessage() + ")");
}
return result;
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/login-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/login-input.jsp 2014-06-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/login-input.jsp 2014-06-11 15:29:45 UTC (rev 193)
@@ -34,22 +34,19 @@
<h1 class="page-header">Connexion</h1>
<s:form id="main_form" action="login" method="post" role="form" class="form-horizontal">
-
- <div class="alert alert-warning">
- <strong>Attention!</strong> Le formulaire de connexion n'est pas encore branché sur le serveur LDAP.
- Entrez n'importe quelles informations de connexion pour le moment.
- </div>
+ <s:actionerror/>
+
<div class="form-group">
<label for="loginField" class="col-sm-2 control-label">Identifiant LDAP :</label>
<div class="col-sm-10">
- <input type="email" class="form-control" id="loginField" placeholder="nom.prenom(a)franciaflex.fr">
+ <input type="text" name="login" class="form-control" id="loginField" placeholder="nom.prenom(a)franciaflex.fr" required>
</div>
</div>
<div class="form-group">
<label for="passwordField" class="col-sm-2 control-label">Mot de passe :</label>
<div class="col-sm-10">
- <input type="password" class="form-control" id="passwordField" placeholder="password">
+ <input type="password" name="password" class="form-control" id="passwordField" placeholder="password" required>
</div>
</div>
<!-- <div class="form-group">
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-11 15:28:27 UTC (rev 192)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-06-11 15:29:45 UTC (rev 193)
@@ -45,10 +45,7 @@
<div id="wrap-global">
<div id="wrap-main" class="<decorator:getProperty property="page.wide-display"/>">
<div id="faxtomail-body">
- <s:actionerror theme="bootstrap"/>
- <s:actionmessage theme="bootstrap"/>
- <s:fielderror theme="bootstrap"/>
-
+
<!-- navbar -->
<header class="navbar navbar-inverse navbar-static-top" role="banner">
<div class="container">
1
0
r192 - trunk/faxtomail-persistence/src/main/resources
by echatellier@users.forge.codelutin.com 11 Jun '14
by echatellier@users.forge.codelutin.com 11 Jun '14
11 Jun '14
Author: echatellier
Date: 2014-06-11 17:28:27 +0200 (Wed, 11 Jun 2014)
New Revision: 192
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/192
Log:
Passage d'hibernate en validate
Modified:
trunk/faxtomail-persistence/src/main/resources/faxToMail.properties
Modified: trunk/faxtomail-persistence/src/main/resources/faxToMail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/faxToMail.properties 2014-06-11 14:35:55 UTC (rev 191)
+++ trunk/faxtomail-persistence/src/main/resources/faxToMail.properties 2014-06-11 15:28:27 UTC (rev 192)
@@ -34,7 +34,7 @@
#hibernate.connection.username=fx
#hibernate.connection.password=FX2013!
-hibernate.hbm2ddl.auto=update
+hibernate.hbm2ddl.auto=validate
#hibernate.show_sql=true
#hibernate.format_sql=true
#hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
@@ -42,4 +42,4 @@
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
-hibernate.c3p0.max_statements=50
\ No newline at end of file
+hibernate.c3p0.max_statements=50
1
0
r191 - in trunk: . faxtomail-persistence faxtomail-service faxtomail-ui-swing faxtomail-ui-web
by maven-release@users.forge.codelutin.com 11 Jun '14
by maven-release@users.forge.codelutin.com 11 Jun '14
11 Jun '14
Author: maven-release
Date: 2014-06-11 16:35:55 +0200 (Wed, 11 Jun 2014)
New Revision: 191
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/191
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-service/pom.xml
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-web/pom.xml
trunk/pom.xml
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-06-11 14:35:50 UTC (rev 190)
+++ trunk/faxtomail-persistence/pom.xml 2014-06-11 14:35:55 UTC (rev 191)
@@ -25,7 +25,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-06-11 14:35:50 UTC (rev 190)
+++ trunk/faxtomail-service/pom.xml 2014-06-11 14:35:55 UTC (rev 191)
@@ -25,7 +25,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-06-11 14:35:50 UTC (rev 190)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-06-11 14:35:55 UTC (rev 191)
@@ -28,12 +28,12 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
<artifactId>faxtomail-ui-swing</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
<name>FaxToMail :: UI</name>
<properties>
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-06-11 14:35:50 UTC (rev 190)
+++ trunk/faxtomail-ui-web/pom.xml 2014-06-11 14:35:55 UTC (rev 191)
@@ -27,7 +27,7 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-11 14:35:50 UTC (rev 190)
+++ trunk/pom.xml 2014-06-11 14:35:55 UTC (rev 191)
@@ -32,7 +32,7 @@
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>FaxToMail</name>
@@ -71,9 +71,9 @@
</modules>
<scm>
- <url>https://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</url>
- <connection>scm:svn:https://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</connection>
- <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</developerConnection>
+ <url>https://svn.codelutin.com/faxtomail/trunk</url>
+ <connection>scm:svn:https://svn.codelutin.com/faxtomail/trunk</connection>
+ <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/trunk</developerConnection>
</scm>
<distributionManagement>
<site>
1
0
Author: maven-release
Date: 2014-06-11 16:35:50 +0200 (Wed, 11 Jun 2014)
New Revision: 190
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/190
Log:
[maven-release-plugin] copy for tag faxtomail-0.2
Added:
tags/faxtomail-0.2/
1
0
r189 - in trunk: . faxtomail-persistence faxtomail-service faxtomail-ui-swing faxtomail-ui-web
by maven-release@users.forge.codelutin.com 11 Jun '14
by maven-release@users.forge.codelutin.com 11 Jun '14
11 Jun '14
Author: maven-release
Date: 2014-06-11 16:35:44 +0200 (Wed, 11 Jun 2014)
New Revision: 189
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/189
Log:
[maven-release-plugin] prepare release faxtomail-0.2
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-service/pom.xml
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-web/pom.xml
trunk/pom.xml
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-06-11 14:32:38 UTC (rev 188)
+++ trunk/faxtomail-persistence/pom.xml 2014-06-11 14:35:44 UTC (rev 189)
@@ -25,7 +25,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-06-11 14:32:38 UTC (rev 188)
+++ trunk/faxtomail-service/pom.xml 2014-06-11 14:35:44 UTC (rev 189)
@@ -25,7 +25,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-06-11 14:32:38 UTC (rev 188)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-06-11 14:35:44 UTC (rev 189)
@@ -28,12 +28,12 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
<artifactId>faxtomail-ui-swing</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
<name>FaxToMail :: UI</name>
<properties>
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-06-11 14:32:38 UTC (rev 188)
+++ trunk/faxtomail-ui-web/pom.xml 2014-06-11 14:35:44 UTC (rev 189)
@@ -27,7 +27,7 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-11 14:32:38 UTC (rev 188)
+++ trunk/pom.xml 2014-06-11 14:35:44 UTC (rev 189)
@@ -32,7 +32,7 @@
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
<packaging>pom</packaging>
<name>FaxToMail</name>
@@ -71,9 +71,9 @@
</modules>
<scm>
- <url>https://svn.codelutin.com/faxtomail/trunk</url>
- <connection>scm:svn:https://svn.codelutin.com/faxtomail/trunk</connection>
- <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/trunk</developerConnection>
+ <url>https://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</url>
+ <connection>scm:svn:https://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</connection>
+ <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/tags/faxtomail-0.2</developerConnection>
</scm>
<distributionManagement>
<site>
1
0
11 Jun '14
Author: echatellier
Date: 2014-06-11 16:32:38 +0200 (Wed, 11 Jun 2014)
New Revision: 188
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/188
Log:
Add fields into model
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
1
0
Author: echatellier
Date: 2014-06-11 14:18:44 +0200 (Wed, 11 Jun 2014)
New Revision: 187
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/187
Log:
Add standalone file for release
Modified:
trunk/faxtomail-ui-swing/pom.xml
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-06-11 11:02:07 UTC (rev 186)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-06-11 12:18:44 UTC (rev 187)
@@ -469,6 +469,11 @@
<value>true</value>
</property>
</activation>
+ <properties>
+ <redmine.releaseFiles>
+ target/${project.build.finalName}-standalone.zip
+ </redmine.releaseFiles>
+ </properties>
<build>
<defaultGoal>package</defaultGoal>
<plugins>
1
0
11 Jun '14
Author: kmorin
Date: 2014-06-11 13:02:07 +0200 (Wed, 11 Jun 2014)
New Revision: 186
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/186
Log:
suppression des actions pour les dossiers
ajout des actions possibles quand un ?\195?\169lement est invalide mais n'a pas d'?\195?\169tat d'attente.
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java 2014-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java 2014-06-11 11:02:07 UTC (rev 186)
@@ -1,35 +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 FolderAction {
-
- COMPUTE_RANGE,
- NEW_DEMANDE
-}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-06-11 11:02:07 UTC (rev 186)
@@ -52,7 +52,6 @@
model.setDemandStatus(DemandStatus.QUALIFIED);
model.setTakenBy(null);
- //TODO kmorin 20140306
DemandesUI parentUI = (DemandesUI) getUI().getContextValue(JAXXContext.class, JAXXUtil.PARENT);
DemandeUI demandeUI = (DemandeUI) parentUI.getDemandsTabPane().getSelectedComponent();
SaveDemandeAction action = getContext().getActionFactory().createLogicAction(demandeUI.getHandler(),
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-11 11:02:07 UTC (rev 186)
@@ -31,7 +31,6 @@
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.FolderAction;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.History;
import com.franciaflex.faxtomail.persistence.entities.HistoryImpl;
@@ -53,6 +52,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
@@ -283,6 +285,31 @@
}
@Override
+ public void initDemandeTable(final JXTable table, boolean sortable) {
+ super.initDemandeTable(table, sortable);
+
+ HighlightPredicate testPredicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ int viewRow = adapter.row;
+ int modelRow = adapter.convertRowIndexToModel(viewRow);
+ DemandeUIModel row = ((AbstractApplicationTableModel<DemandeUIModel>) table.getModel()).getEntry(modelRow);
+ MailFolder folder = getModel().getSelectedFolder();
+ while (folder.getOpenAttachmentReportNoTaken() == null
+ && folder.getParent() != null) {
+ folder = folder.getParent();
+ }
+
+ return Boolean.TRUE.equals(folder.getOpenAttachmentReportNoTaken())
+ && row.getLastAttachmentOpeningInThisFolderUser() != null
+ && !row.getLastAttachmentOpeningInThisFolderUser().equals(row.getTakenBy());
+ }
+ };
+ Color color = Color.ORANGE;
+ table.addHighlighter(new ColorHighlighter(testPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
+ }
+
+ @Override
protected List<MailField> getColumns() {
List<MailField> tableColumns = null;
MailFolder selectedFolder = getModel().getSelectedFolder();
@@ -356,7 +383,6 @@
int selectedRowCount = getUI().getDataTable().getSelectedRowCount();
DemandeListUIModel model = getModel();
- //TODO kmorin 20140605 prendre en compte la conf en fonction des états d'attente
model.setReplyEnabled(selectedRowCount == 1 && model.getCurrentEmails().get(0).isEditable());
model.setArchiveEnabled(selectedRowCount > 1 ||
selectedRowCount > 0 && model.getCurrentEmails().get(0).isEditable());
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-11 11:02:07 UTC (rev 186)
@@ -135,19 +135,6 @@
Color color = new Color(255, 51, 51);
table.addHighlighter(new ColorHighlighter(rowIsInvalidPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
- HighlightPredicate testPredicate = new HighlightPredicate() {
- @Override
- public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
- int viewRow = adapter.row;
- int modelRow = adapter.convertRowIndexToModel(viewRow);
- DemandeUIModel row = ((AbstractApplicationTableModel<DemandeUIModel>) table.getModel()).getEntry(modelRow);
- return row.getLastAttachmentOpeningInThisFolderUser() != null
- && !row.getLastAttachmentOpeningInThisFolderUser().equals(row.getTakenBy());
- }
- };
- color = Color.ORANGE;
- table.addHighlighter(new ColorHighlighter(testPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
-
table.addMouseListener(getDataTableMouseListener());
}
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-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-06-11 11:02:07 UTC (rev 186)
@@ -159,6 +159,8 @@
faxtomail.demandeList.table.header.brand.tip=Marque
faxtomail.demandeList.table.header.client=Client
faxtomail.demandeList.table.header.client.tip=Client
+faxtomail.demandeList.table.header.commen=
+faxtomail.demandeList.table.header.commen.tip=
faxtomail.demandeList.table.header.companyReference=Notre ref
faxtomail.demandeList.table.header.companyReference.tip=Notre référence
faxtomail.demandeList.table.header.ediCodeNumber=Code EDI
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-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-11 11:02:07 UTC (rev 186)
@@ -44,7 +44,6 @@
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
-import com.franciaflex.faxtomail.persistence.entities.FolderAction;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -214,10 +213,6 @@
return getEnumAsMap(MailAction.values());
}
- public Map<FolderAction, String> getFolderActions() {
- return getEnumAsMap(FolderAction.values());
- }
-
public Map<MailField, String> getCanBeRequiredMailFields() {
return getEnumAsMap(MailField.getCanBeRequiredMailFields());
}
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-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-11 11:02:07 UTC (rev 186)
@@ -36,7 +36,6 @@
ConfigurationModule.value('ConfigurationData', {
// enums
'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>,
- 'folderActions': <s:property value="toJson(folderActions)" escapeHtml="false"/>,
'canBeRequiredMailFields': <s:property value="toJson(canBeRequiredMailFields)" escapeHtml="false"/>,
'tableMailFields': <s:property value="toJson(tableMailFields)" escapeHtml="false"/>,
'emailProtocolPorts': <s:property value="toJson(emailProtocolPorts)" escapeHtml="false"/>,
@@ -87,7 +86,15 @@
<label class="control-label" for="configurationEmailMaxSizeField">Taille maximale des email (en bits)</label>
<input type="text" id="configurationEmailMaxSizeField" class="form-control" ng-model="configuration.emailMaxSize" />
</div>
-
+
+ <div class="form-group">
+ Actions autorisées lorsque la demande n'a pas d'état d'attente et est <strong>invalide</strong> :
+ <label class="checkbox" ng-repeat="(mailAction,label) in mailActions">
+ <input type="checkbox" ng-checked="configuration.invalidFormDisabledActions.indexOf(mailAction) == -1"
+ ng-click="changeInvalidAction(mailAction)"> {{label}}
+ </label>
+ </div>
+
<table class="table table-bordered">
<caption>Commande de traitement des extensions de pièces jointes</caption>
<thead>
@@ -565,40 +572,6 @@
</div>
</div>
-
- <!-- Liste des emails expéditeur -->
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordion" href="#collapse5">
- Actions possibles du menu contextuel pour ce dossier
- </a>
- </h4>
- </div>
- <div id="collapse5" class="panel-collapse collapse">
- <div class="panel-body">
- <label ng-if="selectedMailFolder.$parent">
- <input type="radio" ng-model="selectedMailFolder.useCurrentLevelFolderActions"
- ng-value="false" ng-change="initFolderActions()" />
- Hériter des actions contextuelles déclarées sur les dossiers parent :
- </label>
- <label class="checkbox" ng-repeat="(folderAction,label) in folderActions" ng-if="selectedMailFolder.$parent && !selectedMailFolder.useCurrentLevelFolderActions">
- <input type="checkbox" ng-checked="parentScopeValues.folderActions.indexOf(folderAction) != -1"
- disabled> {{label}}
- </label>
- <label>
- <input type="radio" ng-model="selectedMailFolder.useCurrentLevelFolderActions" ng-value="true"
- ng-change="initFolderActions()" ng-if="selectedMailFolder.$parent" />
- Définir les actions contextuelles possibles pour ce dossier :
- </label>
- <label class="checkbox" ng-repeat="(folderAction,label) in folderActions" ng-if="selectedMailFolder.useCurrentLevelFolderActions || !selectedMailFolder.$parent">
- <input type="checkbox" ng-checked="selectedMailFolder.folderActions.indexOf(folderAction) != -1"
- ng-click="changeFolderAction(folderAction)"> {{label}}
- </label>
- </div>
- </div>
- </div>
-
<!-- configuration des colonnes a afficher -->
<div class="panel panel-default">
<div class="panel-heading">
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-11 05:32:51 UTC (rev 185)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-11 11:02:07 UTC (rev 186)
@@ -37,8 +37,6 @@
$scope.canBeRequiredMailFields = ConfigurationData.canBeRequiredMailFields;
//{Map} les champs possibles du tableau
$scope.tableMailFields = ConfigurationData.tableMailFields;
- //{Map} les actions contextuelles possibles pour les dossiers
- $scope.folderActions = ConfigurationData.folderActions;
//{Array} les etats d'attentes disponibles
$scope.etatAttentes = ConfigurationData.etatAttentes;
//{Array} les types de documents
@@ -105,6 +103,16 @@
ConfigurationModule.controller('ConfigurationMiscController', ['$scope', '$window', 'ConfigurationData',
function($scope, $window, ConfigurationData) {
+ // selection/deselection d'une action
+ $scope.changeInvalidAction = function(action) {
+ var index = $scope.configuration.invalidFormDisabledActions.indexOf(action);
+ if (index != -1) {
+ $scope.configuration.invalidFormDisabledActions.splice(index, 1);
+ } else {
+ $scope.configuration.invalidFormDisabledActions.push(action);
+ }
+ };
+
// Ajout d'une nouvelle ligne vide d'extension
$scope.addExtensionRow = function() {
if (!$scope.configuration.extensionCommands) {
@@ -285,7 +293,6 @@
useCurrentLevelEtatAttente: false,
useCurrentLevelTableColumns: false,
useCurrentLevelFaxDomain: false,
- useCurrentLevelFolderActions: false,
useCurrentLevelEdiFolder: false
};
// extend node (in faxtomail collapsed = extended)
@@ -320,9 +327,6 @@
if (!$scope.selectedMailFolder.replyDomains) {
$scope.selectedMailFolder.replyDomains = [];
}
- if (!$scope.selectedMailFolder.folderActions) {
- $scope.selectedMailFolder.folderActions = [];
- }
if (!$scope.selectedMailFolder.folderTableColumns) {
$scope.selectedMailFolder.folderTableColumns = [];
}
@@ -424,7 +428,6 @@
customerResponsibles: [],
replyAddresses: [],
replyDomains: [],
- folderActions: [],
folderTableColumns: [],
etatAttentes: [],
//rigths
@@ -508,9 +511,6 @@
if (!$scope.parentScopeValues.ediFolder) {
$scope.parentScopeValues.ediFolder = folder.ediFolder;
}
- if ((!$scope.parentScopeValues.folderActions || $scope.parentScopeValues.folderActions.length == 0) && folder.folderActions) {
- $scope.parentScopeValues.folderActions = folder.folderActions;
- }
if ((!$scope.parentScopeValues.folderTableColumns || $scope.parentScopeValues.folderTableColumns.length == 0) && folder.folderTableColumns) {
$scope.parentScopeValues.folderTableColumns = folder.folderTableColumns;
}
@@ -675,30 +675,9 @@
};
// initialise la liste des actions possibles avec celle des niveaux supérieurs
- $scope.initFolderActions = function() {
- if ($scope.selectedMailFolder.useCurrentLevelFolderActions) {
- if ($scope.parentScopeValues.folderActions) {
- $scope.selectedMailFolder.folderActions = $scope.parentScopeValues.folderActions.slice(); // soft copy
- }
- } else {
- delete $scope.selectedMailFolder.folderActions;
- }
- };
-
- // selection/deselection d'une action possible du menu contextuel pour ce dossier
- $scope.changeFolderAction = function(folderAction) {
- var index = $scope.selectedMailFolder.folderActions.indexOf(folderAction);
- if (index != -1) {
- $scope.selectedMailFolder.folderActions.splice(index, 1);
- } else {
- $scope.selectedMailFolder.folderActions.push(folderAction);
- }
- };
-
- // initialise la liste des actions possibles avec celle des niveaux supérieurs
$scope.initFolderColumns = function() {
if ($scope.selectedMailFolder.useCurrentLevelTableColumns) {
- if ($scope.parentScopeValues.folderActions) {
+ if ($scope.parentScopeValues.folderTableColumns) {
$scope.selectedMailFolder.folderTableColumns = $scope.parentScopeValues.folderTableColumns.slice(); // soft copy
// init select2 data
1
0
11 Jun '14
Author: kmorin
Date: 2014-06-11 07:32:51 +0200 (Wed, 11 Jun 2014)
New Revision: 185
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/185
Log:
- diff?\195?\169renciation des champs obligatoires et des champs des tableaux
- v?\195?\169rification du domaine des emails exp?\195?\169diteurs
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientService.java
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-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.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/DemandesUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
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/job/MailFilterJob.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/js/configuration.js
trunk/pom.xml
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -1,43 +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%
- */
-
-/**
- * Required email fields for specific {@link EtatAttente}.
- *
- * @author Eric Chatellier
- */
-public enum MailField {
-
- OBJECT,
- PROJECT_REFERENCE,
- PRIORITY,
- RANGE_ROW,
- CLIENT,
- ETAT_ATTENTE,
- COMPANY_REFERENCE,
- COMMENT
-
-}
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -0,0 +1,98 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id: MailField.java 145 2014-06-06 16:25:02Z 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%
+ */
+
+/**
+ * Required email fields for specific {@link EtatAttente}.
+ *
+ * @author Eric Chatellier
+ */
+public enum MailField {
+
+ OBJECT,
+ PROJECT_REFERENCE,
+ PRIORITY,
+ RANGE_ROW,
+ CLIENT,
+ ETAT_ATTENTE,
+ COMPANY_REFERENCE,
+ COMMENT,
+ DEMAND_TYPE,
+ CLIENT_CODE,
+ CLIENT_BRAND,
+ SENDER,
+ REFERENCE,
+ RECEPTION_DATE,
+ RECIPIENT,
+ DEMAND_STATUS,
+ PF_NB,
+ SAV_NB,
+ QUOTATION_NB,
+ TAKEN_BY,
+ LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
+ REPLIES,
+ ATTACHMENT,
+ EDI_RETURN;
+
+ public static MailField[] getCanBeRequiredMailFields() {
+ return new MailField[] {
+ OBJECT,
+ PROJECT_REFERENCE,
+ PRIORITY,
+ RANGE_ROW,
+ CLIENT,
+ ETAT_ATTENTE,
+ COMPANY_REFERENCE,
+ COMMENT
+ };
+ }
+
+ public static MailField[] getTableFields() {
+ return new MailField[] {
+ PRIORITY,
+ DEMAND_TYPE,
+ OBJECT,
+ CLIENT_CODE,
+ CLIENT_BRAND,
+ SENDER,
+ PROJECT_REFERENCE,
+ COMPANY_REFERENCE,
+ REFERENCE,
+ RECEPTION_DATE,
+ RECIPIENT,
+ DEMAND_STATUS,
+ ETAT_ATTENTE,
+ PF_NB,
+ SAV_NB,
+ QUOTATION_NB,
+ TAKEN_BY,
+ COMMENT,
+ EDI_RETURN,
+ LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
+ REPLIES,
+ ATTACHMENT
+ };
+ }
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientService.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientService.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -26,13 +26,16 @@
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.persistence.entities.ClientTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -51,7 +54,10 @@
private static final Log log = LogFactory.getLog(ClientService.class);
- public Client getClientForEmailAddress(String emailAddress, MailFolder folder) {
+ public Client getClientForEmailAddress(String emailAddress, Email email) {
+ Preconditions.checkNotNull(email);
+ Preconditions.checkNotNull(emailAddress);
+
ClientTopiaDao clientDao = getPersistenceContext().getClientDao();
Client client = null;
@@ -60,10 +66,16 @@
clients = clientDao.forEmailAddressEquals(emailAddress).findAll();
if (CollectionUtils.isEmpty(clients)) {
- clients = clientDao.forFaxNumberEquals(emailAddress).findAll();
+ emailAddress = emailAddress.substring(0, emailAddress.indexOf('@'));
+ if (NumberUtils.isNumber(emailAddress)) {
+ emailAddress = StringUtils.leftPad(emailAddress, 10, '0');
+ clients = clientDao.forFaxNumberEquals(emailAddress).findAll();
+ email.setFax(true);
+ }
}
if (CollectionUtils.isNotEmpty(clients)) {
+ MailFolder folder = email.getMailFolder();
if (clients.size() == 1) {
client = clients.get(0);
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-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -68,7 +68,6 @@
import com.franciaflex.faxtomail.persistence.entities.AttachmentFileTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl;
import com.franciaflex.faxtomail.persistence.entities.Client;
-import com.franciaflex.faxtomail.persistence.entities.ClientTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
@@ -203,7 +202,11 @@
Set<String> fieldSet = Sets.newHashSet(modifiedFields);
- if (StringUtils.isNotBlank(email.getMailFolder().getEdiFolder())) {
+ MailFolder folder = email.getMailFolder();
+ while (!folder.isUseCurrentLevelEdiFolder() && folder.getParent() != null) {
+ folder = folder.getParent();
+ }
+ if (StringUtils.isNotBlank(folder.getEdiFolder())) {
History transmissionToEdi = CollectionUtils.find(email.getHistory(), new Predicate<History>() {
@Override
public boolean evaluate(History object) {
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-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -260,7 +260,8 @@
Collections.shuffle(etatAttentes);
MailFolder sav = folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
MailFolder.PROPERTY_PARENT, franciaflex,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2));
+ MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
franciaflex.addChildren(sav);
folders.put("SAV", sav);
@@ -268,7 +269,8 @@
Collections.shuffle(etatAttentes);
MailFolder cyrilFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2));
+ MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
chargesClientelle.addChildren(cyrilFolder);
folders.put("Cyril", cyrilFolder);
@@ -280,7 +282,8 @@
Collections.shuffle(etatAttentes);
MailFolder agatheFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2));
+ MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
chargesClientelle.addChildren(agatheFolder);
folders.put("Agathe", agatheFolder);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -84,6 +84,11 @@
if (savQuantity != null) {
row.setSavQuantity(row.getSavQuantity() + savQuantity);
}
+
+ Integer quotationQuantity = rangeRow.getQuotationQuantity();
+ if (quotationQuantity != null) {
+ row.setQuotationQuantity(row.getQuotationQuantity() + quotationQuantity);
+ }
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -119,14 +119,13 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
MailFolder folder = (MailFolder) evt.getNewValue();
- while (folder.getParent() != null && !folder.isUseCurrentLevelFolderActions()) {
+ while (folder.getAllowCreateDemandIntoFolder() == null
+ && folder.getParent() != null) {
folder = folder.getParent();
}
DemandeListUIModel model = getModel();
- model.setComputeQuantitiesByRangeEnabled(folder != null
- && folder.containsFolderActions(FolderAction.COMPUTE_RANGE));
- model.setNewDemandEnabled(folder != null
- && folder.containsFolderActions(FolderAction.NEW_DEMANDE));
+ model.setComputeQuantitiesByRangeEnabled(true);
+ model.setNewDemandEnabled(folder != null && Boolean.TRUE.equals(folder.getAllowCreateDemandIntoFolder()));
LoadFolderEmailsAction loadFolderEmailsAction =
getContext().getActionFactory().createLogicAction(DemandeListUIHandler.this,
@@ -284,26 +283,18 @@
}
@Override
- protected Collection<String> getColumns() {
- Collection<String> columns = null;
+ protected List<MailField> getColumns() {
+ List<MailField> tableColumns = null;
MailFolder selectedFolder = getModel().getSelectedFolder();
if (selectedFolder != null) {
- List<MailField> tableColumns = selectedFolder.getFolderTableColumns();
- if (tableColumns != null) {
- Collections2.transform(tableColumns, new Function<MailField, String>() {
- @Override
- public String apply(MailField field) {
- return field.toString();
- }
- });
- }
+ tableColumns = selectedFolder.getFolderTableColumns();
}
- return columns;
+ return tableColumns;
}
@Override
- protected String[] getEditableTableProperties() {
- return new String[] { Email.PROPERTY_PRIORITY, Email.PROPERTY_ATTACHMENT, Email.PROPERTY_REPLIES };
+ protected MailField[] getEditableTableProperties() {
+ return new MailField[] { MailField.PRIORITY, MailField.ATTACHMENT, MailField.REPLIES };
}
@Override
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-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -200,22 +200,8 @@
*/
public void fromEntity(Email entity, boolean full) {
//super.fromEntity(entity);
- String[] propertiesToIgnore;
-// if (full) {
- propertiesToIgnore = new String[] {
- Email.PROPERTY_ATTACHMENT
- };
-// } else {
-// propertiesToIgnore = new String[] {
-// Email.PROPERTY_ATTACHMENT,
-// Email.PROPERTY_EMAIL_GROUP,
-// Email.PROPERTY_REPLIES,
-// Email.PROPERTY_MAIL_FOLDER,
-// Email.PROPERTY_HISTORY
-// };
-// }
- fromBeanBinder.copyExcluding(entity, this, propertiesToIgnore);
+ fromBeanBinder.copyExcluding(entity, this, Email.PROPERTY_ATTACHMENT);
// specific attachment copy
Collection<Attachment> attachmentCopy = new ArrayList<Attachment>();
if (entity.getAttachment() != null) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css 2014-06-11 05:32:51 UTC (rev 185)
@@ -42,7 +42,7 @@
#transmitButton {
text: "faxtomail.demande.transmit.button.label";
actionIcon: transmit;
- enabled: { model.getCurrentDemand().isValid() && model.getCurrentDemand().isEditable() };
+ enabled: { model.isTransmitEnabled() };
}
#printButton {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -26,6 +26,8 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.MailAction;
import com.franciaflex.faxtomail.ui.swing.actions.ArchiveAction;
import com.franciaflex.faxtomail.ui.swing.actions.GoToPreviousScreenAction;
import com.franciaflex.faxtomail.ui.swing.actions.SaveAndOpenDialogAction;
@@ -38,6 +40,8 @@
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
import org.nuiton.jaxx.application.swing.ApplicationUI;
import org.nuiton.jaxx.application.swing.tab.CustomTab;
@@ -62,6 +66,8 @@
*/
public class DemandesUIHandler extends AbstractFaxToMailUIHandler<DemandesUIModel, DemandesUI> implements TabContainerHandler, CloseableUI {
+ private static final Log log = LogFactory.getLog(DemandesUIHandler.class);
+
protected DelegateTabContainerHandler delegateTabHandler;
@Override
@@ -88,6 +94,7 @@
final PropertyChangeListener demandEnabledAndValidListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
+
if (evt.getPropertyName().equals(DemandeUIModel.PROPERTY_VALID)
|| evt.getPropertyName().equals(DemandeUIModel.PROPERTY_EDITABLE)
|| evt.getPropertyName().equals(Email.PROPERTY_ARCHIVE_DATE)) {
@@ -98,7 +105,20 @@
ui.processDataBinding(DemandesUI.BINDING_REPLY_BUTTON_ENABLED);
ui.processDataBinding(DemandesUI.BINDING_SAVE_BUTTON_ENABLED);
ui.processDataBinding(DemandesUI.BINDING_TRANSMIT_BUTTON_ENABLED);
+
}
+
+ if (evt.getPropertyName().equals(DemandeUIModel.PROPERTY_VALID)
+ || evt.getPropertyName().equals(Email.PROPERTY_ETAT_ATTENTE)) {
+
+ DemandeUIModel model = (DemandeUIModel) evt.getSource();
+ EtatAttente etatAttente = model.getEtatAttente();
+ boolean transmitEnabled = model.isEditable()
+ && (etatAttente == null
+ || model.isValid() && !etatAttente.containsValidFormDisabledActions(MailAction.TRANSMIT)
+ || !model.isValid() && !etatAttente.containsInvalidFormDisabledActions(MailAction.TRANSMIT));
+ getModel().setTransmitEnabled(transmitEnabled);
+ }
}
};
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -43,17 +43,30 @@
private static final Log log = LogFactory.getLog(DemandesUIModel.class);
public static final String PROPERTY_CURRENT_DEMAND = "currentDemand";
+ public static final String PROPERTY_TRANSMIT_ENABLED = "transmitEnabled";
+ protected boolean transmitEnabled;
+
protected List<DemandeUIModel> demands = new ArrayList<DemandeUIModel>();
protected List<DemandsListener> listeners = new ArrayList<DemandsListener>();
+ protected int currentIndex = -1;
+
+ public boolean isTransmitEnabled() {
+ return transmitEnabled;
+ }
+
+ public void setTransmitEnabled(boolean transmitEnabled) {
+ Object oldValue = isTransmitEnabled();
+ this.transmitEnabled = transmitEnabled;
+ firePropertyChange(PROPERTY_TRANSMIT_ENABLED,oldValue, transmitEnabled);
+ }
+
protected List<DemandeUIModel> getDemands() {
return demands;
}
- protected int currentIndex = -1;
-
public void addDemand(DemandeUIModel demand) {
boolean added = !demands.contains(demand);
if (added) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -77,6 +77,7 @@
RangeRowModel row = new RangeRowModel();
row.setProductQuantity(0);
row.setSavQuantity(0);
+ row.setQuotationQuantity(0);
row.setValid(false);
return row;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css 2014-06-11 05:32:51 UTC (rev 185)
@@ -74,7 +74,7 @@
text: { t("faxtomail.reply.attachments.title",
getModel().getTotalAttachmentLength(),
getModel().getMaxAttachmentLength()) };
- foreground: { getModel().isValid() ? Color.BLACK : Color.RED }
+ foreground: { getModel().isAttachmentSizeValid(getModel().getTotalAttachmentLength()) ? Color.BLACK : Color.RED }
}
#addAttachmentForm {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx 2014-06-11 05:32:51 UTC (rev 185)
@@ -50,6 +50,7 @@
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='from' component='fromComboBox'/>
<field name='to' component='toField'/>
+ <field name='totalAttachmentLength' component="attachmentsPanel"/>
</BeanValidator>
<CardLayout2Ext id='fromPanelLayout'
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -133,11 +133,14 @@
model.setMessage(quotedReply);
MailFolder folder = demand.getMailFolder();
- Collection<String> folderReplyAdresses;
- do {
- folderReplyAdresses = folder.getReplyAddresses();
+ List<String> folderReplyAdresses = new ArrayList<String>();
+ List<String> folderReplyDomains = new ArrayList<String>();
+ while (folder != null) {
+ folderReplyAdresses.addAll(folder.getReplyAddresses());
+ folderReplyDomains.addAll(folder.getReplyDomains());
folder = folder.getParent();
- } while (CollectionUtils.isEmpty(folderReplyAdresses) && folder != null);
+ }
+ model.setSenderAllowedDomains(folderReplyDomains);
List<String> replyToAddresses = Lists.newArrayList(demand.getRecipient());
if (folderReplyAdresses != null) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -27,6 +27,7 @@
import com.franciaflex.faxtomail.persistence.entities.AttachmentFile;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
+import com.google.common.base.Preconditions;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,6 +35,7 @@
import java.io.File;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
/**
@@ -51,9 +53,10 @@
public static final String PROPERTY_ORIGINAL_DEMAND = "originalDemand";
public static final String PROPERTY_ATTACHMENT = "attachment";
public static final String PROPERTY_READONLY = "readonly";
- public static final String PROPERTY_MAX_ATTACHMENT_LENGHT = "maxAttachmentLength";
- public static final String PROPERTY_TOTAL_ATTACHMENT_LENGHT = "totalAttachmentLength";
+ public static final String PROPERTY_MAX_ATTACHMENT_LENGTH = "maxAttachmentLength";
+ public static final String PROPERTY_TOTAL_ATTACHMENT_LENGTH = "totalAttachmentLength";
public static final String PROPERTY_VALID = "valid";
+ public static final String PROPERTY_SENDER_ALLOWED_DOMAINS = "senderAllowedDomains";
protected String to;
protected String from;
@@ -64,6 +67,7 @@
protected long totalAttachmentLength = 0;
protected boolean valid = true;
protected boolean readonly = false;
+ protected List<String> senderAllowedDomains;
protected Set<AttachmentFile> attachments = new HashSet<AttachmentFile>();
protected Set<AttachmentFile> availableAttachments = new HashSet<AttachmentFile>();
@@ -128,22 +132,14 @@
attachments.add(attachment);
firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachments());
- Object oldValue = getTotalAttachmentLength();
- totalAttachmentLength += attachment.getLength();
- firePropertyChange(PROPERTY_TOTAL_ATTACHMENT_LENGHT, oldValue, getTotalAttachmentLength());
-
- recomputeValidity();
+ setTotalAttachmentLength(totalAttachmentLength + attachment.getLength());
}
public void removeAttachment(AttachmentFile attachment) {
attachments.remove(attachment);
firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachments());
- Object oldValue = getTotalAttachmentLength();
- totalAttachmentLength -= attachment.getLength();
- firePropertyChange(PROPERTY_TOTAL_ATTACHMENT_LENGHT, oldValue, getTotalAttachmentLength());
-
- recomputeValidity();
+ setTotalAttachmentLength(totalAttachmentLength - attachment.getLength());
}
public Set<AttachmentFile> getAvailableAttachments() {
@@ -183,15 +179,19 @@
public void setMaxAttachmentLength(long maxAttachmentLength) {
Object oldValue = getMaxAttachmentLength();
this.maxAttachmentLength = maxAttachmentLength;
- firePropertyChange(PROPERTY_MAX_ATTACHMENT_LENGHT, oldValue, maxAttachmentLength);
-
- recomputeValidity();
+ firePropertyChange(PROPERTY_MAX_ATTACHMENT_LENGTH, oldValue, maxAttachmentLength);
}
public long getTotalAttachmentLength() {
return totalAttachmentLength / 1024;
}
+ public void setTotalAttachmentLength(long totalAttachmentLength) {
+ Object oldValue = getTotalAttachmentLength();
+ this.totalAttachmentLength = totalAttachmentLength;
+ firePropertyChange(PROPERTY_TOTAL_ATTACHMENT_LENGTH, oldValue, getTotalAttachmentLength());
+ }
+
public boolean isValid() {
return valid;
}
@@ -202,8 +202,30 @@
firePropertyChange(PROPERTY_VALID, oldValue, valid);
}
- public void recomputeValidity() {
- setValid(totalAttachmentLength < maxAttachmentLength);
+ // Do not remove the unused parameter, it is just for the validation
+ // to bind the totalAttachmentLength property
+ public boolean isAttachmentSizeValid(long totalAttachmentLength) {
+ return maxAttachmentLength == 0 || this.totalAttachmentLength < maxAttachmentLength;
+ }
+ public List<String> getSenderAllowedDomains() {
+ return senderAllowedDomains;
}
+
+ public void setSenderAllowedDomains(List<String> senderAllowedDomains) {
+ Object oldValue = getSenderAllowedDomains();
+ this.senderAllowedDomains = senderAllowedDomains;
+ firePropertyChange(PROPERTY_SENDER_ALLOWED_DOMAINS, oldValue, senderAllowedDomains);
+ }
+
+ public boolean isDomainAllowed(String from) {
+ Preconditions.checkNotNull(from);
+ for (String domain : getSenderAllowedDomains()) {
+ log.info(domain + " " + from);
+ if (from.endsWith(domain)) {
+ return true;
+ }
+ }
+ return getSenderAllowedDomains().isEmpty();
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -25,25 +25,17 @@
*/
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
-import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailField;
-import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.GroupAction;
-import com.franciaflex.faxtomail.ui.swing.actions.SearchAction;
import com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction;
-import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
import com.franciaflex.faxtomail.ui.swing.util.Cancelable;
-import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
@@ -228,18 +220,9 @@
}
@Override
- protected Collection<String> getColumns() {
- Collection<String> columns = null;
+ protected List<MailField> getColumns() {
List<MailField> tableColumns = getContext().getFaxToMailConfiguration().getSearchDisplayColumns();
- if (tableColumns != null) {
- Collections2.transform(tableColumns, new Function<MailField, String>() {
- @Override
- public String apply(MailField field) {
- return field.toString();
- }
- });
- }
- return columns;
+ return tableColumns;
}
protected boolean isDemandSelectable(DemandeUIModel demand) {
@@ -260,8 +243,8 @@
}
@Override
- protected String[] getEditableTableProperties() {
- return new String[0];
+ protected MailField[] getEditableTableProperties() {
+ return new MailField[0];
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -25,48 +25,30 @@
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.MailField;
-import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.SearchAction;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
-import com.franciaflex.faxtomail.ui.swing.util.CheckBoxListCellRenderer;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import jaxx.runtime.swing.editor.bean.BeanUIUtil;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
-import javax.swing.event.ListDataListener;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import static org.nuiton.i18n.I18n.t;
@@ -199,18 +181,9 @@
}
@Override
- protected Collection<String> getColumns() {
- Collection<String> columns = null;
+ protected List<MailField> getColumns() {
List<MailField> tableColumns = getContext().getFaxToMailConfiguration().getSearchDisplayColumns();
- if (tableColumns != null) {
- Collections2.transform(tableColumns, new Function<MailField, String>() {
- @Override
- public String apply(MailField field) {
- return field.toString();
- }
- });
- }
- return columns;
+ return tableColumns;
}
@Override
@@ -265,8 +238,8 @@
}
@Override
- protected String[] getEditableTableProperties() {
- return new String[] { Email.PROPERTY_ATTACHMENT, Email.PROPERTY_REPLIES };
+ protected MailField[] getEditableTableProperties() {
+ return new MailField[] { MailField.ATTACHMENT, MailField.REPLIES };
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -69,7 +69,6 @@
}
// init tree
-// Company franciaflex = getContext().getCurrentCompany();
Collection<MailFolder> folders = getContext().getMailFolderService().getRootMailFolders();
JTree navigationTree = ui.getNavigationTree();
@@ -81,8 +80,14 @@
DefaultMutableTreeNode node = nodesByFolder.get(folder);
if (node.getClass().isAssignableFrom(FolderTreeNode.class)) {
FolderTreeNode folderTreeNode = (FolderTreeNode) node;
+ MailFolder folderWithAllowMoveDemandIntoFolder = folder;
+ while (folderWithAllowMoveDemandIntoFolder.getAllowMoveDemandIntoFolder() == null
+ && folderWithAllowMoveDemandIntoFolder.getParent() != null) {
+ folderWithAllowMoveDemandIntoFolder = folderWithAllowMoveDemandIntoFolder.getParent();
+ }
folderTreeNode.setCanSelect(!currentFolder.equals(folder) &&
- (CollectionUtils.isNotEmpty(foldersWithEtatAttente)
+ Boolean.TRUE.equals(folderWithAllowMoveDemandIntoFolder.getAllowMoveDemandIntoFolder()) &&
+ (CollectionUtils.isEmpty(foldersWithEtatAttente)
|| foldersWithEtatAttente.contains(folder)));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -30,6 +30,7 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.persistence.entities.Reply;
@@ -150,50 +151,51 @@
table.addMouseListener(getDataTableMouseListener());
}
- protected abstract Collection<String> getColumns();
+ protected abstract List<MailField> getColumns();
public String populateColumnModel(JXTable table, boolean sortable) {
- Collection<String> columns = getColumns();
+ List<MailField> columns = getColumns();
TableColumnModelExt columnModel = new DefaultTableColumnModelExt();
if (CollectionUtils.isEmpty(columns)) {
- columns = Lists.newArrayList(Email.PROPERTY_PRIORITY,
- Email.PROPERTY_DEMAND_TYPE,
- Email.PROPERTY_OBJECT,
- DemandeUIModel.PROPERTY_CLIENT_CODE,
- DemandeUIModel.PROPERTY_CLIENT_BRAND,
- Email.PROPERTY_SENDER,
- Email.PROPERTY_PROJECT_REFERENCE,
- Email.PROPERTY_COMPANY_REFERENCE,
- DemandeUIModel.PROPERTY_REFERENCE,
- Email.PROPERTY_RECEPTION_DATE,
- Email.PROPERTY_RECIPIENT,
- Email.PROPERTY_DEMAND_STATUS,
- Email.PROPERTY_ETAT_ATTENTE,
- DemandeUIModel.PROPERTY_PF_NB,
- DemandeUIModel.PROPERTY_SAV_NB,
- Email.PROPERTY_TAKEN_BY,
- DemandeUIModel.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
- Email.PROPERTY_REPLIES,
- Email.PROPERTY_ATTACHMENT);
+// columns = Lists.newArrayList(MailField.PROPERTY_PRIORITY,
+// MailField.PROPERTY_DEMAND_TYPE,
+// MailField.PROPERTY_OBJECT,
+// MailField.PROPERTY_CLIENT_CODE,
+// MailField.PROPERTY_CLIENT_BRAND,
+// MailField.PROPERTY_SENDER,
+// MailField.PROPERTY_PROJECT_REFERENCE,
+// MailField.PROPERTY_COMPANY_REFERENCE,
+// MailField.PROPERTY_REFERENCE,
+// MailField.PROPERTY_RECEPTION_DATE,
+// MailField.PROPERTY_RECIPIENT,
+// MailField.PROPERTY_DEMAND_STATUS,
+// MailField.PROPERTY_ETAT_ATTENTE,
+// MailField.PROPERTY_PF_NB,
+// MailField.PROPERTY_SAV_NB,
+// MailField.PROPERTY_TAKEN_BY,
+// MailField.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
+// MailField.PROPERTY_REPLIES,
+// MailField.PROPERTY_ATTACHMENT);
+ columns = Lists.newArrayList(MailField.getTableFields());
}
- for (String columnName : columns) {
+ for (MailField columnName : columns) {
- if (Email.PROPERTY_PRIORITY.equals(columnName)) {
+ if (MailField.PRIORITY.equals(columnName)) {
addComboDataColumnToModel(columnModel,
DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName),
getDecorator(Priority.class, null),
getContext().getReferentielService().getAllPriority()).setSortable(sortable);
- } else if (Email.PROPERTY_ATTACHMENT.equals(columnName)) {
+ } else if (MailField.ATTACHMENT.equals(columnName)) {
addColumnToModel(columnModel,
AttachmentCellEditor.newEditor(ui),
AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName)).setSortable(sortable);
- } else if (Email.PROPERTY_REPLIES.equals(columnName)) {
+ } else if (MailField.REPLIES.equals(columnName)) {
addColumnToModel(columnModel,
RepliesCellEditor.newEditor(ui),
RepliesCellRenderer.newRender(getDecorator(Reply.class, null)),
@@ -202,11 +204,11 @@
} else {
TableCellRenderer tableCellRenderer;
switch (columnName) {
- case Email.PROPERTY_RECEPTION_DATE:
+ case RECEPTION_DATE:
tableCellRenderer = newTableCellRender(Date.class);
break;
- case DemandeUIModel.PROPERTY_PF_NB:
+ case PF_NB:
tableCellRenderer = new QuantityTableCellRenderer(new Function<RangeRow, Integer>() {
@Override
public Integer apply(RangeRow input) {
@@ -214,7 +216,7 @@
}
});
break;
- case DemandeUIModel.PROPERTY_SAV_NB:
+ case SAV_NB:
tableCellRenderer = new QuantityTableCellRenderer(new Function<RangeRow, Integer>() {
@Override
public Integer apply(RangeRow input) {
@@ -223,17 +225,17 @@
});
break;
- case Email.PROPERTY_DEMAND_STATUS:
+ case DEMAND_STATUS:
tableCellRenderer = newTableCellRender(DemandStatus.class);
break;
- case Email.PROPERTY_DEMAND_TYPE:
- case Email.PROPERTY_ETAT_ATTENTE:
+ case DEMAND_TYPE:
+ case ETAT_ATTENTE:
tableCellRenderer = newTableCellRender(HasLabel.class);
break;
- case Email.PROPERTY_TAKEN_BY:
- case DemandeUIModel.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER:
+ case TAKEN_BY:
+ case LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER:
tableCellRenderer = newTableCellRender(FaxToMailUser.class);
break;
@@ -308,7 +310,7 @@
super.autoSelectRowInTable(e, popup);
}
- protected abstract String[] getEditableTableProperties();
+ protected abstract MailField[] getEditableTableProperties();
protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) {
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -24,6 +24,7 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,133 +47,145 @@
private static final Log log = LogFactory.getLog(DemandeTableModel.class);
- public static final Map<String, ColumnIdentifier<Email>> COLUMN_IDENTIFIERS = new HashMap<String, ColumnIdentifier<Email>>() {{
- put(Email.PROPERTY_SENDER,
+ public static final Map<MailField, ColumnIdentifier<Email>> COLUMN_IDENTIFIERS = new HashMap<MailField, ColumnIdentifier<Email>>() {{
+ put(MailField.SENDER,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_SENDER,
n("faxtomail.demandeList.table.header.sender"),
n("faxtomail.demandeList.table.header.sender.tip")));
- put(Email.PROPERTY_OBJECT,
+ put(MailField.OBJECT,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_OBJECT,
n("faxtomail.demandeList.table.header.object"),
n("faxtomail.demandeList.table.header.object.tip")));
- put(Email.PROPERTY_RECEPTION_DATE,
+ put(MailField.RECEPTION_DATE,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_RECEPTION_DATE,
n("faxtomail.demandeList.table.header.receptionDate"),
n("faxtomail.demandeList.table.header.receptionDate.tip")));
- put(Email.PROPERTY_RECIPIENT,
+ put(MailField.RECIPIENT,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_RECIPIENT,
n("faxtomail.demandeList.table.header.recipient"),
n("faxtomail.demandeList.table.header.recipient.tip")));
- put(DemandeUIModel.PROPERTY_CLIENT_CODE,
+ put(MailField.CLIENT_CODE,
ColumnIdentifier.<Email>newReadOnlyId(
DemandeUIModel.PROPERTY_CLIENT_CODE,
n("faxtomail.demandeList.table.header.client"),
n("faxtomail.demandeList.table.header.client.tip")));
- put(DemandeUIModel.PROPERTY_CLIENT_BRAND,
+ put(MailField.CLIENT_BRAND,
ColumnIdentifier.<Email>newReadOnlyId(
DemandeUIModel.PROPERTY_CLIENT_BRAND,
n("faxtomail.demandeList.table.header.brand"),
n("faxtomail.demandeList.table.header.brand.tip")));
- put(Email.PROPERTY_DEMAND_STATUS,
+ put(MailField.DEMAND_STATUS,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_DEMAND_STATUS,
n("faxtomail.demandeList.table.header.status"),
n("faxtomail.demandeList.table.header.status.tip")));
- put(Email.PROPERTY_DEMAND_TYPE,
+ put(MailField.DEMAND_TYPE,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_DEMAND_TYPE,
n("faxtomail.demandeList.table.header.type"),
n("faxtomail.demandeList.table.header.type.tip")));
- put(Email.PROPERTY_EDI_CODE_NUMBER,
+ put(MailField.EDI_RETURN,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_EDI_CODE_NUMBER,
n("faxtomail.demandeList.table.header.ediCodeNumber"),
n("faxtomail.demandeList.table.header.ediCodeNumber.tip")));
- put(Email.PROPERTY_ETAT_ATTENTE,
+ put(MailField.ETAT_ATTENTE,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_ETAT_ATTENTE,
n("faxtomail.demandeList.table.header.waitingState"),
n("faxtomail.demandeList.table.header.waitingState.tip")));
- put(Email.PROPERTY_TAKEN_BY,
+ put(MailField.TAKEN_BY,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_TAKEN_BY,
n("faxtomail.demandeList.table.header.user"),
n("faxtomail.demandeList.table.header.user.tip")));
- put(Email.PROPERTY_PRIORITY,
+ put(MailField.PRIORITY,
ColumnIdentifier.<Email>newId(
Email.PROPERTY_PRIORITY,
n("faxtomail.demandeList.table.header.priority"),
n("faxtomail.demandeList.table.header.priority.tip")));
- put(Email.PROPERTY_PROJECT_REFERENCE,
+ put(MailField.PROJECT_REFERENCE,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_PROJECT_REFERENCE,
n("faxtomail.demandeList.table.header.projectReference"),
n("faxtomail.demandeList.table.header.projectReference.tip")));
- put(Email.PROPERTY_COMPANY_REFERENCE,
+ put(MailField.COMPANY_REFERENCE,
ColumnIdentifier.<Email>newReadOnlyId(
Email.PROPERTY_COMPANY_REFERENCE,
n("faxtomail.demandeList.table.header.companyReference"),
n("faxtomail.demandeList.table.header.companyReference.tip")));
- put(DemandeUIModel.PROPERTY_REFERENCE,
+ put(MailField.REFERENCE,
ColumnIdentifier.<Email>newReadOnlyId(
DemandeUIModel.PROPERTY_REFERENCE,
n("faxtomail.demandeList.table.header.reference"),
n("faxtomail.demandeList.table.header.reference.tip")));
- put(DemandeUIModel.PROPERTY_PF_NB,
+ put(MailField.PF_NB,
ColumnIdentifier.<Email>newReadOnlyId(
DemandeUIModel.PROPERTY_PF_NB,
n("faxtomail.demandeList.table.header.pfNb"),
n("faxtomail.demandeList.table.header.pfNb.tip")));
- put(DemandeUIModel.PROPERTY_SAV_NB,
+ put(MailField.SAV_NB,
ColumnIdentifier.<Email>newReadOnlyId(
DemandeUIModel.PROPERTY_SAV_NB,
n("faxtomail.demandeList.table.header.savNb"),
n("faxtomail.demandeList.table.header.savNb.tip")));
- put(Email.PROPERTY_REPLIES,
+ put(MailField.QUOTATION_NB,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ DemandeUIModel.PROPERTY_QUOTATION_NB,
+ n("faxtomail.demandeList.table.header.quotationNb"),
+ n("faxtomail.demandeList.table.header.quotationNb.tip")));
+
+ put(MailField.REPLIES,
ColumnIdentifier.<Email>newId(
Email.PROPERTY_REPLIES,
n("faxtomail.demandeList.table.header.replies"),
n("faxtomail.demandeList.table.header.replies.tip")));
- put(Email.PROPERTY_ATTACHMENT,
+ put(MailField.ATTACHMENT,
ColumnIdentifier.<Email>newId(
Email.PROPERTY_ATTACHMENT,
n("faxtomail.demandeList.table.header.attachment"),
n("faxtomail.demandeList.table.header.attachment.tip")));
- put(DemandeUIModel.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
+ put(MailField.LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
ColumnIdentifier.<Email>newId(
DemandeUIModel.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
n("faxtomail.demandeList.table.header.lastAttachmentOpeningUser"),
n("faxtomail.demandeList.table.header.lastAttachmentOpeningUser.tip")));
+ put(MailField.COMMENT,
+ ColumnIdentifier.<Email>newId(
+ Email.PROPERTY_COMMENT,
+ n("faxtomail.demandeList.table.header.commen"),
+ n("faxtomail.demandeList.table.header.commen.tip")));
+
}};
- public DemandeTableModel(TableColumnModelExt columnModel, String... editableProperties) {
+ public DemandeTableModel(TableColumnModelExt columnModel, MailField... editableProperties) {
super(columnModel, false, false);
List<ColumnIdentifier> nonEditableColumns = new ArrayList<ColumnIdentifier>(COLUMN_IDENTIFIERS.values());
- for (String editableProperty : editableProperties) {
+ for (MailField editableProperty : editableProperties) {
nonEditableColumns.remove(COLUMN_IDENTIFIERS.get(editableProperty));
}
setNoneEditableCols(nonEditableColumns.toArray(new ColumnIdentifier[nonEditableColumns.size()]));
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-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-06-11 05:32:51 UTC (rev 185)
@@ -173,6 +173,8 @@
faxtomail.demandeList.table.header.priority.tip=Priorité
faxtomail.demandeList.table.header.projectReference=Ref chantier
faxtomail.demandeList.table.header.projectReference.tip=Référence chantier
+faxtomail.demandeList.table.header.quotationNb=Qté devis
+faxtomail.demandeList.table.header.quotationNb.tip=Quantité de devis
faxtomail.demandeList.table.header.receptionDate=Date de réception
faxtomail.demandeList.table.header.receptionDate.tip=Date de réception
faxtomail.demandeList.table.header.recipient=Destinataire
@@ -284,8 +286,12 @@
faxtomail.validator.error.email.priority.required=
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.email=
+faxtomail.validator.error.reply.from.invalidDomain=
faxtomail.validator.error.reply.from.required=
+faxtomail.validator.error.reply.to.email=
faxtomail.validator.error.reply.to.required=
+faxtomail.validator.error.reply.totalAttachmentLength.required=
jaxx.application.error.cannot.print=
jaxx.application.error.desktop.not.supported=
jaxx.application.error.desktop.print.not.supported=
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-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -29,6 +29,7 @@
import java.util.List;
import java.util.Map;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
@@ -45,7 +46,6 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FolderAction;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
@@ -218,9 +218,13 @@
return getEnumAsMap(FolderAction.values());
}
- public Map<MailField, String> getMailFields() {
- return getEnumAsMap(MailField.values());
+ public Map<MailField, String> getCanBeRequiredMailFields() {
+ return getEnumAsMap(MailField.getCanBeRequiredMailFields());
}
+
+ public Map<MailField, String> getTableMailFields() {
+ return getEnumAsMap(MailField.getTableFields());
+ }
public Map<EmailProtocol, Integer> getEmailProtocolPorts() {
Map<EmailProtocol, Integer> result = new LinkedHashMap<>();
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-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-06-11 05:32:51 UTC (rev 185)
@@ -225,7 +225,7 @@
modifiedProperties.add(Email.PROPERTY_SENDER);
Client client = serviceContext.newService(ClientService.class)
- .getClientForEmailAddress(sender, email.getMailFolder());
+ .getClientForEmailAddress(sender, email);
if (client != null) {
String object = client.getCaracteristic1() + " / " +
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-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties 2014-06-11 05:32:51 UTC (rev 185)
@@ -9,21 +9,29 @@
com.franciaflex.faxtomail.persistence.entities.MailField.ARCHIVE_DATE=Date d'archive
com.franciaflex.faxtomail.persistence.entities.MailField.ATTACHMENT=Pièces jointes
com.franciaflex.faxtomail.persistence.entities.MailField.CLIENT=Client
+com.franciaflex.faxtomail.persistence.entities.MailField.CLIENT_BRAND=Marque
+com.franciaflex.faxtomail.persistence.entities.MailField.CLIENT_CODE=Code client
com.franciaflex.faxtomail.persistence.entities.MailField.COMMENT=Commentaire
com.franciaflex.faxtomail.persistence.entities.MailField.COMPANY_REFERENCE=Référence
-com.franciaflex.faxtomail.persistence.entities.MailField.DEMANDE_STATUS=Statut de demande
+com.franciaflex.faxtomail.persistence.entities.MailField.DEMAND_STATUS=Statut de demande
com.franciaflex.faxtomail.persistence.entities.MailField.DEMAND_TYPE=Type de demande
-com.franciaflex.faxtomail.persistence.entities.MailField.EDI_CODE_NUMBER=Code EDI
+com.franciaflex.faxtomail.persistence.entities.MailField.EDI_RETURN=Retour EDI
com.franciaflex.faxtomail.persistence.entities.MailField.ETAT_ATTENTE=État d'attente
com.franciaflex.faxtomail.persistence.entities.MailField.FAX=Fax
+com.franciaflex.faxtomail.persistence.entities.MailField.LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER=Dernier à ouvrir une PJ
com.franciaflex.faxtomail.persistence.entities.MailField.MAIL_FOLDER=Dossier
com.franciaflex.faxtomail.persistence.entities.MailField.OBJECT=Objet
com.franciaflex.faxtomail.persistence.entities.MailField.ORIGINAL_EMAIL=Email original
+com.franciaflex.faxtomail.persistence.entities.MailField.PF_NB=Quantité de produits
com.franciaflex.faxtomail.persistence.entities.MailField.PRIORITY=Priorité
com.franciaflex.faxtomail.persistence.entities.MailField.PROJECT_REFERENCE=Réference projet
+com.franciaflex.faxtomail.persistence.entities.MailField.QUOTATION_NB=Quantité de devis
com.franciaflex.faxtomail.persistence.entities.MailField.RANGE_ROW=Gamme
com.franciaflex.faxtomail.persistence.entities.MailField.RECEPTION_DATE=Date de réception
com.franciaflex.faxtomail.persistence.entities.MailField.RECIPIENT=Destinataire
+com.franciaflex.faxtomail.persistence.entities.MailField.REFERENCE=Référence
+com.franciaflex.faxtomail.persistence.entities.MailField.REPLY=Réponses
+com.franciaflex.faxtomail.persistence.entities.MailField.SAV_NB=Quantité de SAV
com.franciaflex.faxtomail.persistence.entities.MailField.SENDER=Expéditeur
com.franciaflex.faxtomail.persistence.entities.MailField.TAKEN_BY=Pris par
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-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-11 05:32:51 UTC (rev 185)
@@ -37,7 +37,8 @@
// enums
'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>,
'folderActions': <s:property value="toJson(folderActions)" escapeHtml="false"/>,
- 'mailFields': <s:property value="toJson(mailFields)" escapeHtml="false"/>,
+ 'canBeRequiredMailFields': <s:property value="toJson(canBeRequiredMailFields)" escapeHtml="false"/>,
+ 'tableMailFields': <s:property value="toJson(tableMailFields)" escapeHtml="false"/>,
'emailProtocolPorts': <s:property value="toJson(emailProtocolPorts)" escapeHtml="false"/>,
// datas
'configuration': <s:property value="toJson(configuration)" escapeHtml="false"/>,
@@ -194,7 +195,7 @@
<div class="col-md-8" ng-if="selectedDemandType">
<h3>Édition du type de document {{selectedDemandType.label}}</h3>
Champs obligatoires pour le type de document :
- <label class="checkbox" ng-repeat="(mailField,label) in mailFields">
+ <label class="checkbox" ng-repeat="(mailField,label) in canBeRequiredMailFields">
<input type="checkbox" ng-checked="selectedDemandType.fields.indexOf(mailField) != -1"
ng-click="changeDemandTypeField(mailField)"> {{label}}
</label>
@@ -628,7 +629,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="mailField in parentFolderTableColumns">{{mailFields[mailField.id]}}</th>
+ <th ng-repeat="mailField in parentFolderTableColumns">{{tableMailFields[mailField.id]}}</th>
</tr>
</thead>
</table>
@@ -653,7 +654,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="mailField in folderTableColumns">{{mailFields[mailField.id]}}</th>
+ <th ng-repeat="mailField in folderTableColumns">{{tableMailFields[mailField.id]}}</th>
</tr>
</thead>
</table>
@@ -852,7 +853,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="etatAttenteField in searchDisplayColumns">{{mailFields[etatAttenteField.id]}}</th>
+ <th ng-repeat="etatAttenteField in searchDisplayColumns">{{tableMailFields[etatAttenteField.id]}}</th>
</tr>
</thead>
</table>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-11 05:32:51 UTC (rev 185)
@@ -34,7 +34,9 @@
//{Map} les actions possibles pour les etats d'attentes
$scope.mailActions = ConfigurationData.mailActions;
//{Map} les champs obligatoires possibles
- $scope.mailFields = ConfigurationData.mailFields;
+ $scope.canBeRequiredMailFields = ConfigurationData.canBeRequiredMailFields;
+ //{Map} les champs possibles du tableau
+ $scope.tableMailFields = ConfigurationData.tableMailFields;
//{Map} les actions contextuelles possibles pour les dossiers
$scope.folderActions = ConfigurationData.folderActions;
//{Array} les etats d'attentes disponibles
@@ -352,7 +354,7 @@
angular.forEach($scope.selectedMailFolder.folderTableColumns, function(folderTableColumn) {
$scope.folderTableColumns.push({
id: folderTableColumn,
- label: $scope.mailFields[folderTableColumn]
+ label: $scope.tableMailFields[folderTableColumn]
});
});
@@ -441,7 +443,7 @@
angular.forEach($scope.parentScopeValues.folderTableColumns, function(folderTableColumn) {
$scope.parentFolderTableColumns.push({
id: folderTableColumn,
- label: $scope.mailFields[folderTableColumn]
+ label: $scope.tableMailFields[folderTableColumn]
});
});
}
@@ -566,7 +568,7 @@
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
- angular.forEach($scope.mailFields, function(label, field) {
+ angular.forEach($scope.tableMailFields, function(label, field) {
resultArray.push({
id: field,
label: label
@@ -704,7 +706,7 @@
angular.forEach($scope.selectedMailFolder.folderTableColumns, function(folderTableColumn) {
$scope.folderTableColumns.push({
id: folderTableColumn,
- label: $scope.mailFields[folderTableColumn]
+ label: $scope.tableMailFields[folderTableColumn]
});
});
}
@@ -870,7 +872,7 @@
angular.forEach($scope.configuration.searchDisplayColumns, function(searchDisplayColumn) {
$scope.searchDisplayColumns.push({
id: searchDisplayColumn,
- label: $scope.mailFields[searchDisplayColumn]
+ label: $scope.tableMailFields[searchDisplayColumn]
});
});
}
@@ -887,7 +889,7 @@
// fonction retournant l'ensemble des options disponibles
$scope.getObjectsData = function(term, result) {
var resultArray = [];
- angular.forEach($scope.mailFields, function(label, mailField) {
+ angular.forEach($scope.tableMailFields, function(label, mailField) {
resultArray.push({
id: mailField,
label: label
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-06-10 18:57:47 UTC (rev 184)
+++ trunk/pom.xml 2014-06-11 05:32:51 UTC (rev 185)
@@ -109,7 +109,7 @@
<hibernateVersion>4.3.5.Final</hibernateVersion>
<h2Version>1.3.176</h2Version>
- <jaxxVersion>2.8.6</jaxxVersion>
+ <jaxxVersion>2.8.7</jaxxVersion>
<!-- do not upgrade to 1.6.5-1 -->
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.15.1</xworkVersion>
1
0