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
14 Feb '14
Author: kmorin
Date: 2014-02-14 18:28:56 +0100 (Fri, 14 Feb 2014)
New Revision: 10
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/10
Log:
continue
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entity/
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.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-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml
trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml
trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh
trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml
trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh
trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml
trunk/faxtomail-ui-swing/src/main/filtered-resources/log4j.properties
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.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
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
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/DemandeListUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
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/SearchUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Cancelable.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CloseableUI.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/RemoveablePropertyChangeListener.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/UIMessageNotifier.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-swing/src/main/resources/log4j.properties
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/pom.xml
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -0,0 +1,11 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public enum HistoryType {
+
+ OPENING,
+ MODIFICATION
+}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -28,6 +28,7 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
+import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.franciaflex.faxtomail.services.service.MailFilterService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
@@ -74,7 +75,12 @@
public MailFolderService getMailFolderService() {
return newService(MailFolderService.class);
}
+
public MailFilterService getMailFilterService() {
return newService(MailFilterService.class);
}
+
+ public EmailService getEmailService() {
+ return newService(EmailService.class);
+ }
}
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,11 +2,18 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.History;
+import com.franciaflex.faxtomail.persistence.entities.HistoryTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
/**
@@ -15,8 +22,30 @@
*/
public class EmailService extends FaxToMailServiceSupport {
+ private static final Log log = LogFactory.getLog(EmailService.class);
+
public List<Email> getEmailForFolder(MailFolder folder) {
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
return new ArrayList<>(dao.forMailFolderEquals(folder).findAll());
}
+
+ public Email addToOpeningHistory(Email email, FaxToMailUser user, Date date) {
+ HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.OPENING,
+ History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_MODIFICATION_DATE, date);
+
+ email.addHistory(history);
+
+ if (email.getTakenBy() == null) {
+ email.setTakenBy(user);
+ }
+
+ EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
+ email = emailDao.update(email);
+ getPersistenceContext().commit();
+
+ log.info("history " + email.getHistory().size());
+ return email;
+ }
}
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -38,6 +38,9 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.History;
+import com.franciaflex.faxtomail.persistence.entities.HistoryTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Priority;
@@ -151,94 +154,152 @@
rangeDao.create(Range.PROPERTY_LABEL, "Accessoires")
);
+ FaxToMailUserTopiaDao userDao = getPersistenceContext().getFaxToMailUserDao();
+ FaxToMailUser marc = userDao.create(FaxToMailUser.PROPERTY_NAME, "Marc Lefebvre", FaxToMailUser.PROPERTY_LOGIN, "mlefebvre");
+ FaxToMailUser cyril = userDao.create(FaxToMailUser.PROPERTY_NAME, "Cyril Baillet", FaxToMailUser.PROPERTY_LOGIN, "cbaillet");
+ FaxToMailUser frederic = userDao.create(FaxToMailUser.PROPERTY_NAME, "Frédéric Viala", FaxToMailUser.PROPERTY_LOGIN, "fviala");
+ FaxToMailUser claire = userDao.create(FaxToMailUser.PROPERTY_NAME, "Claire Marquis", FaxToMailUser.PROPERTY_LOGIN, "cmarquis");
+ FaxToMailUser agathe = userDao.create(FaxToMailUser.PROPERTY_NAME, "Agathe Borde", FaxToMailUser.PROPERTY_LOGIN, "aborde");
+ FaxToMailUser jeanne = userDao.create(FaxToMailUser.PROPERTY_NAME, "Jeanne Bourgoin", FaxToMailUser.PROPERTY_LOGIN, "jbourgoin");
+
MailFolderTopiaDao folderDao = getPersistenceContext().getMailFolderDao();
List<MailFolder> folders = new ArrayList<>();
Random random = new Random();
EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
+ HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
- MailFolder cyril = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril");
+ MailFolder cyrilFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril");
int r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, cyril,
+ Email.PROPERTY_MAIL_FOLDER, cyrilFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, cyril, new Date());
+ }
}
- MailFolder claire = folderDao.create(MailFolder.PROPERTY_NAME, "Claire");
+ MailFolder claireFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Claire");
r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, claire,
+ Email.PROPERTY_MAIL_FOLDER, claireFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, claire, new Date());
+ }
}
- MailFolder agathe = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe");
+ MailFolder agatheFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe");
r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, agathe,
+ Email.PROPERTY_MAIL_FOLDER, agatheFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, agathe, new Date());
+ }
}
folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "Chargés de clientèle",
- MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(cyril, claire, agathe)));
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(cyrilFolder, claireFolder, agatheFolder)));
- MailFolder marc = folderDao.create(MailFolder.PROPERTY_NAME, "Marc");
+ MailFolder marcFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Marc");
r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, marc,
+ Email.PROPERTY_MAIL_FOLDER, marcFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, marc, new Date());
+ }
}
- MailFolder frederic = folderDao.create(MailFolder.PROPERTY_NAME, "Frédéric");
+ MailFolder fredericFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Frédéric");
r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, frederic,
+ Email.PROPERTY_MAIL_FOLDER, fredericFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, frederic, new Date());
+ }
}
- MailFolder jeanne = folderDao.create(MailFolder.PROPERTY_NAME, "Jeanne");
+ MailFolder jeanneFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Jeanne");
r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
- emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_MODIFICATION_DATE, new Date());
+
+ Email email = emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
Email.PROPERTY_RECEPTION_DATE, new Date(),
- Email.PROPERTY_MAIL_FOLDER, jeanne,
+ Email.PROPERTY_MAIL_FOLDER, jeanneFolder,
Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
- Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))),
+ Email.PROPERTY_HISTORY, Lists.newArrayList(history));
+
+ if (random.nextBoolean()) {
+ getEmailService().addToOpeningHistory(email, jeanne, new Date());
+ }
}
folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
- MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(marc, frederic, jeanne)));
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(marcFolder, fredericFolder, jeanneFolder)));
// companies
CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -20,6 +20,12 @@
return new ArrayList<>(dao.findAll());
}
+ public FaxToMailUser getUserByLogin(String login) {
+ FaxToMailUserTopiaDao dao = getPersistenceContext().getFaxToMailUserDao();
+ FaxToMailUser user = dao.forLoginEquals(login).findUnique();
+ return user;
+ }
+
public List<FaxToMailUserGroup> getAllUserGroups() {
FaxToMailUserGroupTopiaDao dao = getPersistenceContext().getFaxToMailUserGroupDao();
return new ArrayList<>(dao.findAll());
Modified: trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+###
+# #%L
+# FaxToMail :: UI
+# %%
+# Copyright (C) 2014 Franciaflex
+# %%
+# 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%
+###
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
Modified: trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/faxtomail-full-component.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: tutti-full-component.xml 1460 2013-12-10 18:52:55Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<component
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full/faxtomail.sh 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,7 +1,29 @@
#!/bin/bash
+###
+# #%L
+# FaxToMail :: UI
+# %%
+# Copyright (C) 2014 Franciaflex
+# %%
+# 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%
+###
+
export FAXTOMAIL_BASEDIR=$(pwd)
-export FAXTOMAIL_HOME=$FAXTOMAIL_BASEDIR/tutti
+export FAXTOMAIL_HOME=$FAXTOMAIL_BASEDIR/faxtomail
export JAVA_HOME=$FAXTOMAIL_BASEDIR/jre
export JAVA_COMMAND=$JAVA_HOME/bin/java
export FAXTOMAIL_LOG_FILE=$FAXTOMAIL_BASEDIR/data/faxtomail-${project.version}.log
Modified: trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-linux-i586.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: full-linux-i586.xml 248 2013-01-28 11:22:28Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-linux-x64.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: full-linux-x64.xml 248 2013-01-28 11:22:28Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-windows-i586.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: full-windows-i586.xml 248 2013-01-28 11:22:28Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/full-windows-x64.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: full-windows-x64.xml 248 2013-01-28 11:22:28Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/i18n.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,14 +1,12 @@
<!--
#%L
- Tutti :: UI
- $Id: i18n.xml 582 2013-03-12 09:33:46Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 - 2013 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -16,7 +14,7 @@
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
+ 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%
@@ -37,8 +35,8 @@
<directory>target/classes/META-INF</directory>
<outputDirectory/>
<includes>
- <include>tutti-i18n*.properties</include>
- <include>tutti-i18n*.csv</include>
+ <include>faxtomail-i18n*.properties</include>
+ <include>faxtomail-i18n*.csv</include>
</includes>
</fileSet>
Modified: trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/min/launch.sh 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
#!/bin/bash
+###
+# #%L
+# FaxToMail :: UI
+# %%
+# Copyright (C) 2014 Franciaflex
+# %%
+# 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%
+###
+
MEMORY="-Xmx1024M -XX:MaxPermSize=128M"
#FAXTOMAIL_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
@@ -9,7 +31,7 @@
#echo "java command: $JAVA_COMMAND"
-$JAVA_COMMAND $MEMORY $FAXTOMAIL_JVM_OPTS -Dtutti.log.file=$FAXTOMAIL_LOG_FILE -jar ${project.build.finalName}.${project.packaging} $*
+$JAVA_COMMAND $MEMORY $FAXTOMAIL_JVM_OPTS -Dfaxtomail.log.file=$FAXTOMAIL_LOG_FILE -jar ${project.build.finalName}.${project.packaging} $*
exitcode=$?
echo "Stop FaxToMail with exitcode: $exitcode"
exit $exitcode
Modified: trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/assembly/standalone.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- Tutti :: UI
- $Id: standalone.xml 399 2013-02-11 17:33:57Z tchemit $
- $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/asse… $
+ FaxToMail :: UI
%%
- Copyright (C) 2012 Ifremer
+ Copyright (C) 2014 Franciaflex
%%
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
+ 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,
@@ -17,12 +15,13 @@
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
+ 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%
-->
+
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/faxtomail-ui-swing/src/main/filtered-resources/log4j.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/filtered-resources/log4j.properties 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/filtered-resources/log4j.properties 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+###
+# #%L
+# FaxToMail :: UI
+# %%
+# Copyright (C) 2014 Franciaflex
+# %%
+# 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%
+###
# Global logging configuration
log4j.rootLogger=ERROR, stdout, file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: TuttiActionFactory.java 1566 2014-02-04 08:31:02Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 - 2013 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,7 +16,7 @@
* 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
+ * 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%
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailScreen.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
+
/**
* Enumeration of any internal screen of application.
*
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,10 +1,34 @@
package com.franciaflex.faxtomail.ui.swing;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+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;
@@ -13,6 +37,7 @@
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
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.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
import com.google.common.base.Preconditions;
@@ -41,14 +66,19 @@
import org.nuiton.util.converter.ConverterUtil;
import javax.swing.*;
+import javax.swing.event.RowSorterEvent;
+import javax.swing.tree.TreePath;
import java.awt.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Closeable;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.List;
import static org.nuiton.i18n.I18n.t;
@@ -181,8 +211,12 @@
protected Company currentCompany;
+ protected FaxToMailUser currentUser;
+
protected Email currentEmail;
+ protected List<MailFolder> expandedFolders = new ArrayList<MailFolder>();
+
public static FaxToMailUIContext newContext(FaxToMailConfiguration config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -405,6 +439,9 @@
Company franciaflex = getCompanyService().getCompanyByName("Franciaflex");
setCurrentCompany(franciaflex);
+ FaxToMailUser currentUser = getUserService().getUserByLogin("mlefebvre");
+ setCurrentUser(currentUser);
+
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
@@ -480,6 +517,10 @@
return serviceContext.newService(CompanyService.class);
}
+ public UserService getUserService() {
+ return serviceContext.newService(UserService.class);
+ }
+
public EmailService getEmailService() {
return serviceContext.newService(EmailService.class);
}
@@ -641,6 +682,14 @@
this.currentCompany = currentCompany;
}
+ public FaxToMailUser getCurrentUser() {
+ return currentUser;
+ }
+
+ public void setCurrentUser(FaxToMailUser currentUser) {
+ this.currentUser = currentUser;
+ }
+
public Email getCurrentEmail() {
return currentEmail;
}
@@ -648,4 +697,12 @@
public void setCurrentEmail(Email currentEmail) {
this.currentEmail = currentEmail;
}
+
+ public List<MailFolder> getExpandedFolders() {
+ return expandedFolders;
+ }
+
+ public void setExpandedFolders(List<MailFolder> expandedFolders) {
+ this.expandedFolders = expandedFolders;
+ }
}
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
@@ -135,7 +157,7 @@
handler.onCloseUI();
//close context
-// context.getSwingSession().save();
+ context.getSwingSession().save();
context.close();
if (exitCode != null) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.ProgressionModel;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import static org.nuiton.i18n.I18n.t;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,8 +1,38 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+import javax.swing.*;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n.t;
+
/**
* To show demande screen.
*
@@ -12,6 +42,17 @@
public class ShowDemandeAction extends AbstractChangeScreenAction {
public ShowDemandeAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.DEMANDE);
+ super(handler, false, FaxToMailScreen.DEMANDE);
}
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+
+ Email currentEmail = getContext().getCurrentEmail();
+ if (!getContext().getCurrentUser().equals(currentEmail.getTakenBy())) {
+ displayWarningMessage(t("faxtomail.alert.alreadyTakenBy.title"),
+ t("faxtomail.alert.alreadyTakenBy.message", currentEmail.getTakenBy().getName()));
+ }
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.actions;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,4 +1,25 @@
/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
+/*
#busyBlockLayerUI {
useIcon:false;
blockingColor: {model.getConfig().getColorBlockingLayer()};
@@ -20,6 +41,7 @@
}
#menuFileDemandeList {
+ actionIcon: list;
text: "faxtomail.main.action.demandeList";
toolTipText: "faxtomail.main.action.demandeList.tip";
i18nMnemonic: "faxtomail.main.action.demandeList.mnemonic";
@@ -28,6 +50,7 @@
}
#menuFileRecherche {
+ actionIcon: search;
text: "faxtomail.main.action.recherche";
toolTipText: "faxtomail.main.action.recherche.tip";
i18nMnemonic: "faxtomail.main.action.recherche.mnemonic";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,6 +1,27 @@
+<!--
+ #%L
+ FaxToMail :: UI
+ %%
+ Copyright (C) 2014 Franciaflex
+ %%
+ 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%
+ -->
<JFrame id='mainFrame'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailUIContext, MainUIHandler>'
- width='800' height='600'>
+ width='1024' height='780'>
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,28 @@
package com.franciaflex.faxtomail.ui.swing.content;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
@@ -14,6 +37,8 @@
import com.google.common.base.Preconditions;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.JAXXWidgetUtil;
+import jaxx.runtime.swing.session.SwingSession;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -117,9 +142,9 @@
// ui.applyDataBinding(MainUI.BINDING_MENU_CHANGE_LOCALE_UK_ENABLED);
// Init SwingSession
-// SwingSession swingSession = context.getSwingSession();
-// swingSession.add(ui);
-// swingSession.save();
+ SwingSession swingSession = getContext().getSwingSession();
+ swingSession.add(ui);
+ swingSession.save();
// SwingUtil.getLayer(ui.getBody()).setUI(new BetaLayerUI());
@@ -281,7 +306,7 @@
FaxToMailUI<?, ?> body = (FaxToMailUI<?, ?>) currentBody;
body.getHandler().onCloseUI();
-// context.getSwingSession().save();
+ getContext().getSwingSession().save();
ui.getBody().remove(currentBody);
@@ -308,20 +333,21 @@
case SEARCH:
screenUI = new SearchUI(ui);
screenTitle = t("faxtomail.search.title");
- icon = ui.getMenuFileConfiguration().getIcon();
+ icon = ui.getMenuFileRecherche().getIcon();
break;
case DEMANDE:
screenUI = new DemandeUI(ui);
- screenTitle = t("faxtomail.demande.title");
- icon = ui.getMenuFileConfiguration().getIcon();
+ Email currentEmail = getContext().getCurrentEmail();
+ screenTitle = currentEmail.getObject();
+ icon = JAXXWidgetUtil.createActionIcon("email");
break;
default:
case LIST:
screenUI = new DemandeListUI(ui);
screenTitle = t("faxtomail.demandeList.title");
- icon = ui.getMenuFileConfiguration().getIcon();
+ icon = ui.getMenuFileDemandeList().getIcon();
break;
}
@@ -336,7 +362,7 @@
// }
// rightDecoration.add(showHelp, 0);
this.currentBody = screenUI;
-// context.getSwingSession().add(currentBody, true);
+ getContext().getSwingSession().add(currentBody, true);
ui.getBody().setTitle(screenTitle);
ui.getBody().add(currentBody);
ui.getBody().setLeftDecoration(new JLabel(icon));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.css 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.css 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
#configTopPanel {
_help: {"faxtomail.config.help"};
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ FaxToMail :: UI
+ %%
+ Copyright (C) 2014 Franciaflex
+ %%
+ 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%
+ -->
<JPanel id='configTopPanel' layout='{new BorderLayout()}'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailUIContext, FaxToMailConfigUIHandler>'>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.content.config;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.actions.ReloadFaxToMailAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
#navigationTree {
font-size: "11";
rootVisible: false;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ FaxToMail :: UI
+ %%
+ Copyright (C) 2014 Franciaflex
+ %%
+ 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%
+ -->
<JPanel id='demandeListPanel' layout='{new BorderLayout()}'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<DemandeListUIModel, DemandeListUIHandler>'>
@@ -42,7 +63,6 @@
</JScrollPane>
<JPanel layout='{new BorderLayout()}'>
- <JLabel id="selectedFolder" constraints='BorderLayout.NORTH'/>
<JScrollPane constraints='BorderLayout.CENTER'>
<JXTable id='dataTable'
onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: EditCruiseUIHandler.java 1282 2013-10-07 14:46:55Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,7 +16,7 @@
* 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
+ * 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%
@@ -30,32 +28,47 @@
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
+import com.google.common.collect.Lists;
import jaxx.runtime.swing.JAXXWidgetUtil;
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.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.RowSorterEvent;
+import javax.swing.event.RowSorterListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
+import javax.swing.table.TableModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import static org.nuiton.i18n.I18n.t;
@@ -70,25 +83,6 @@
/** Logger. */
private static final Log log = LogFactory.getLog(DemandeListUIHandler.class);
-
- public static String getTitle(boolean exist) {
-
- String result;
- if (exist) {
- result = t("tutti.editCruise.title.edit.cruise");
- } else {
- result = t("tutti.editCruise.title.create.cruise");
- }
- return result;
- }
-
- /**
- * Persistence service.
- *
- * @since 0.1
- */
-// private final PersistenceService persistenceService;
-
@Override
public void beforeInit(DemandeListUI ui) {
@@ -119,8 +113,11 @@
// init tree
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+
+ List<MailFolder> foldersToExpand = getContext().getExpandedFolders();
+ Map<MailFolder, DefaultMutableTreeNode> nodesByFolder = new HashMap<MailFolder, DefaultMutableTreeNode>();
for (MailFolder folder : getModel().getFolders()) {
- createFolderTree(root, folder);
+ nodesByFolder.putAll(createFolderTree(root, folder));
}
TreeModel treeModel = new DefaultTreeModel(root);
@@ -133,7 +130,6 @@
renderer.setLeafIcon(folderIcon);
navigationTree.setCellRenderer(renderer);
- JAXXWidgetUtil.expandTree(navigationTree);
navigationTree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
@@ -143,6 +139,12 @@
}
});
+ // expand nodes
+ for (MailFolder folder : foldersToExpand) {
+ DefaultMutableTreeNode node = nodesByFolder.get(folder);
+ navigationTree.expandPath(new TreePath(node.getPath()));
+ }
+
// init table
TableColumnModelExt columnModel = new DefaultTableColumnModelExt();
Company franciaflex = getContext().getCurrentCompany();
@@ -161,18 +163,51 @@
.setSortable(true);
}
- final AbstractApplicationTableModel tableModel = new DemandeTableModel(columnModel);
+ final AbstractApplicationTableModel<Email> tableModel = new DemandeTableModel(columnModel);
JXTable table = ui.getDataTable();
table.setModel(tableModel);
table.setColumnModel(columnModel);
table.getTableHeader().setReorderingAllowed(false);
+ Highlighter highlighter = new Highlighter() {
+ @Override
+ public Component highlight(Component renderer, ComponentAdapter adapter) {
+ int viewRow = adapter.row;
+ int modelRow = adapter.convertRowIndexToModel(viewRow);
+ Email row = (Email) tableModel.getEntry(modelRow);
+ boolean highlight = row.getTakenBy() == null;
+ if (highlight) {
+ Font font = renderer.getFont();
+ renderer.setFont(font.deriveFont(Font.BOLD));
+ }
+ return renderer;
+ }
+
+ @Override
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ @Override
+ public void removeChangeListener(ChangeListener l) {
+ }
+
+ @Override
+ public ChangeListener[] getChangeListeners() {
+ return new ChangeListener[0];
+ }
+ };
+ table.addHighlighter(highlighter);
+
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
if (evt.getClickCount() == 2) {
int rowIndex = table.getSelectedRow();
- Email selectedEmail = (Email) tableModel.getEntry(rowIndex);
+ rowIndex = table.convertRowIndexToModel(rowIndex);
+
+ Email selectedEmail = tableModel.getEntry(rowIndex);
+ selectedEmail = getContext().getEmailService().addToOpeningHistory(selectedEmail, getContext().getCurrentUser(), new Date());
+
getContext().setCurrentEmail(selectedEmail);
getContext().getActionEngine().runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
}
@@ -186,25 +221,37 @@
tableModel.setRows(emails);
}
});
- getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- MailFolder folder = (MailFolder) evt.getNewValue();
- String name = folder != null ? folder.getName() : null;
- getUI().getSelectedFolder().setText(name);
- }
- });
+ Email currentEmail = getContext().getCurrentEmail();
+ if (currentEmail != null) {
+ MailFolder folder = currentEmail.getMailFolder();
+ DefaultMutableTreeNode node = nodesByFolder.get(folder);
+ navigationTree.setSelectionPath(new TreePath(node.getPath()));
+ int row = tableModel.getRowIndex(currentEmail);
+ table.setRowSelectionInterval(row, row);
+ }
+
}
- protected void createFolderTree(DefaultMutableTreeNode parent, MailFolder folder) {
+ /**
+ * Creates the tree nodes and returns a map of the nodes by folder
+ * @param parent the node parent
+ * @param folder the folder to add to the tree
+ * @return the map of the nodes by folder
+ */
+ protected Map<MailFolder, DefaultMutableTreeNode> createFolderTree(DefaultMutableTreeNode parent, MailFolder folder) {
+ Map<MailFolder, DefaultMutableTreeNode> result = new HashMap<MailFolder, DefaultMutableTreeNode>();
+
DefaultMutableTreeNode node = new FolderTreeNode(folder);
+ result.put(folder, node);
+
parent.add(node);
if (folder.isChildrenNotEmpty()) {
for (MailFolder child : folder.getChildren()) {
- createFolderTree(node, child);
+ result.putAll(createFolderTree(node, child));
}
}
+ return result;
}
@Override
@@ -217,8 +264,22 @@
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
}
+
+ JTree tree = getUI().getNavigationTree();
+ TreeModel treeModel = tree.getModel();
+ Enumeration<TreePath> paths = tree.getExpandedDescendants(new TreePath(treeModel.getRoot()));
+
+ List<MailFolder> folders = new ArrayList<MailFolder>();
+ while (paths.hasMoreElements()) {
+ TreePath path = paths.nextElement();
+ Object lastPathComponent = path.getLastPathComponent();
+ if (FolderTreeNode.class.isAssignableFrom(lastPathComponent.getClass())) {
+ folders.add(((FolderTreeNode) lastPathComponent).getMailFolder());
+ }
+ }
+ getContext().setExpandedFolders(folders);
+
clearValidators();
-
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import org.jdesktop.beans.AbstractSerializableBean;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
import org.apache.commons.logging.Log;
@@ -80,9 +102,9 @@
n("faxtomail.demandeList.table.header.waitingState"),
n("faxtomail.demandeList.table.header.waitingState")));
- put(Email.PROPERTY_FAX_TO_MAIL_USER,
+ put(Email.PROPERTY_TAKEN_BY,
ColumnIdentifier.<Email>newReadOnlyId(
- Email.PROPERTY_FAX_TO_MAIL_USER,
+ Email.PROPERTY_TAKEN_BY,
n("faxtomail.demandeList.table.header.user"),
n("faxtomail.demandeList.table.header.user")));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
BeanFilterableComboBox {
showReset: true;
bean: {model};
@@ -24,8 +45,7 @@
}
#receivedDateField {
- text: {getDateFormat().format(model.getReceptionDate())};
- editable: false;
+ text: {SimpleDateFormat.getDateTimeInstance().format(model.getReceptionDate())};
}
#senderLabel {
@@ -34,7 +54,6 @@
#senderField {
text: {model.getSenderEmailAddress()};
- editable: false;
}
#clientLabel {
@@ -121,21 +140,65 @@
text: "faxtomail.demande.message.label";
}
+#takenByLabel {
+ text: "faxtomail.demande.takenBy.label";
+}
+
+#takenByField {
+ text: {model.getTakenBy().getName()};
+}
+
+#firstOpenedByLabel {
+ text: "faxtomail.demande.firstOpenedBy.label";
+}
+
+#firstOpenedByField {
+ text: {model.getFirstOpeningUserName()};
+}
+
+#firstOpeningDateLabel {
+ text: "faxtomail.demande.firstOpeningDate.label";
+}
+
+#firstOpeningDateField {
+ text: {SimpleDateFormat.getDateTimeInstance().format(model.getFirstOpeningDate())};
+}
+
+#lastModifiedByLabel {
+ text: "faxtomail.demande.lastModifiedBy.label";
+}
+
+#lastModifiedByField {
+ text: {model.getLastModificationUserName()};
+}
+
+#lastModificationDateLabel {
+ text: "faxtomail.demande.lastModificationDate.label";
+}
+
+#lastModificationDateField {
+ text: {SimpleDateFormat.getDateTimeInstance().format(model.getLastModificationDate())};
+}
+
#backButton {
text: "faxtomail.demande.back.button.label";
+ actionIcon: cancel;
_applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction.class};
}
#saveButton {
text: "faxtomail.demande.save.button.label";
+ actionIcon: save;
}
#transmitButton {
text: "faxtomail.demande.transmit.button.label";
+ actionIcon: transmit;
}
#printButton {
text: "faxtomail.demande.print.button.label";
+ actionIcon: print;
}
#archiveButton {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ FaxToMail :: UI
+ %%
+ Copyright (C) 2014 Franciaflex
+ %%
+ 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%
+ -->
<JPanel id='demandePanel' layout='{new BorderLayout()}'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<DemandeUIModel, DemandeUIHandler>'>
@@ -32,40 +53,35 @@
<DemandeUIModel id='model'
initializer='getContextValue(DemandeUIModel.class)'/>
- <String id='patternLayout' javaBean='"dd/MM/yyyy HH:mm:ss"'/>
-
- <SimpleDateFormat id='dateFormat' constructorParams='patternLayout'/>
-
- <Date id='date' javaBean='new Date()'/>
-
<JScrollPane id='demandeScrollPane' constraints='BorderLayout.CENTER'>
<JPanel layout='{new GridLayout(0,1)}'>
- <Table fill='both'>
-
+ <Table fill='horizontal'>
<row>
- <cell anchor='east'>
+ <cell>
<JLabel id='receivedDateLabel'/>
</cell>
- <cell weightx='1'>
- <JTextField id='receivedDateField'/>
+ <cell>
+ <JLabel id='receivedDateField'/>
</cell>
- <cell anchor='east'>
+ <cell>
<JLabel id='senderLabel'/>
</cell>
- <cell weightx='1'>
- <JTextField id='senderField'/>
+ <cell>
+ <JLabel id='senderField'/>
</cell>
- <cell anchor='east'>
+ <cell>
<JLabel id='clientLabel'/>
</cell>
<cell weightx='1'>
<JTextField id='clientField'/><!-- TODO list of clients -->
</cell>
</row>
+ </Table>
+ <Table fill='horizontal'>
<row>
<cell anchor='east'>
<JLabel id='objectLabel'/>
@@ -174,8 +190,43 @@
<JTextArea id='messageField'/>
</JScrollPane>
</cell>
- </row>
+ </row>
+ </Table>
+ <Table fill='horizontal'>
+ <row>
+ <cell>
+ <JLabel id="takenByLabel"/>
+ </cell>
+ <cell weightx='1' >
+ <JLabel id="takenByField"/>
+ </cell>
+ <cell>
+ <JLabel id="firstOpenedByLabel"/>
+ </cell>
+ <cell>
+ <JLabel id="firstOpenedByField"/>
+ </cell>
+ <cell>
+ <JLabel id="firstOpeningDateLabel"/>
+ </cell>
+ <cell weightx='1' >
+ <JLabel id="firstOpeningDateField"/>
+ </cell>
+ <cell>
+ <JLabel id="lastModifiedByLabel"/>
+ </cell>
+ <cell>
+ <JLabel id="lastModifiedByField"/>
+ </cell>
+ <cell>
+ <JLabel id="lastModificationDateLabel"/>
+ </cell>
+ <cell weightx='1'>
+ <JLabel id="lastModificationDateField"/>
+ </cell>
+ </row>
+
</Table>
<JPanel id="attachmentsPanel"
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: EditCruiseUIHandler.java 1282 2013-10-07 14:46:55Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,12 +16,13 @@
* 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
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
+
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -57,18 +56,6 @@
/** Logger. */
private static final Log log = LogFactory.getLog(DemandeUIHandler.class);
-
- public static String getTitle(boolean exist) {
-
- String result;
- if (exist) {
- result = t("tutti.editCruise.title.edit.cruise");
- } else {
- result = t("tutti.editCruise.title.create.cruise");
- }
- return result;
- }
-
/**
* Persistence service.
*
@@ -83,7 +70,6 @@
DemandeUIModel model = new DemandeUIModel();
model.fromBean(getContext().getCurrentEmail());
- log.debug(model.getDemandStatus());
this.ui.setContextValue(model);
}
@@ -100,7 +86,6 @@
initBeanFilterableComboBox(ui.getStatusComboBox(), referentielService.getAllDemandStatus(), model.getDemandStatus());
initBeanFilterableComboBox(ui.getPriorityComboBox(), referentielService.getAllPriority(), model.getPriority());
initBeanFilterableComboBox(ui.getGammeComboBox(), referentielService.getAllRange(), null);
-
}
@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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
@@ -7,21 +29,34 @@
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.History;
+import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
+import java.util.Collection;
import java.util.Date;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
*/
public class DemandeUIModel extends AbstractFaxToMailBeanUIModel<Email, DemandeUIModel> {
+ private static final Log log = LogFactory.getLog(DemandeUIModel.class);
+
protected final Email editObject = new EmailImpl();
+ protected History firstOpeningHistory;
+
+ protected History lastModificationHistory;
+
protected static Binder<DemandeUIModel, Email> toBeanBinder =
BinderFactory.newBinder(DemandeUIModel.class,
Email.class);
@@ -33,6 +68,13 @@
super(fromBeanBinder, toBeanBinder);
}
+ @Override
+ public void fromEntity(Email entity) {
+ super.fromEntity(entity);
+ firstOpeningHistory = null;
+ lastModificationHistory = null;
+ }
+
public void setSavNumber(String savNumber) {
Object oldValue = getSavNumber();
editObject.setSavNumber(savNumber);
@@ -103,14 +145,14 @@
return editObject.getEtatAttente();
}
- public void setFaxToMailUser(FaxToMailUser faxToMailUser) {
- Object oldValue = getFaxToMailUser();
- editObject.setFaxToMailUser(faxToMailUser);
- firePropertyChanged(Email.PROPERTY_FAX_TO_MAIL_USER, oldValue, faxToMailUser);
+ public void setTakenBy(FaxToMailUser faxToMailUser) {
+ Object oldValue = getTakenBy();
+ editObject.setTakenBy(faxToMailUser);
+ firePropertyChanged(Email.PROPERTY_TAKEN_BY, oldValue, faxToMailUser);
}
- public FaxToMailUser getFaxToMailUser() {
- return editObject.getFaxToMailUser();
+ public FaxToMailUser getTakenBy() {
+ return editObject.getTakenBy();
}
public Priority getPriority() {
@@ -183,6 +225,82 @@
return editObject.getProjectReference();
}
+ public void setHistory(Collection<History> history) {
+ Object oldValue = getHistory();
+ editObject.setHistory(history);
+ firePropertyChanged(Email.PROPERTY_HISTORY, oldValue, history);
+ }
+
+ public Collection<History> getHistory() {
+ return editObject.getHistory();
+ }
+
+ public void findFirstOpeningHistory() {
+ History result = null;
+ Date date = null;
+ for (History history : getHistory()) {
+ if (HistoryType.OPENING.equals(history.getType())) {
+ if (date == null || date.after(history.getModificationDate())) {
+ date = history.getModificationDate();
+ result = history;
+ }
+ }
+ }
+ firstOpeningHistory = result;
+ }
+
+ public void findLastModificationHistory() {
+ History result = null;
+ Date date = null;
+ for (History history : getHistory()) {
+ if (HistoryType.MODIFICATION.equals(history.getType())) {
+ if (date == null || date.before(history.getModificationDate())) {
+ date = history.getModificationDate();
+ result = history;
+ }
+ }
+ }
+ lastModificationHistory = result;
+ }
+
+ public History getFirstOpeningHistory() {
+ if (firstOpeningHistory == null) {
+ findFirstOpeningHistory();
+ }
+ return firstOpeningHistory;
+ }
+
+ public String getFirstOpeningUserName() {
+ return getFirstOpeningHistory().getFaxToMailUser().getName();
+ }
+
+ public Date getFirstOpeningDate() {
+ return getFirstOpeningHistory().getModificationDate();
+ }
+
+ public History getLastModificationHistory() {
+ if (lastModificationHistory == null) {
+ findLastModificationHistory();
+ }
+ return lastModificationHistory;
+ }
+
+ public String getLastModificationUserName() {
+ String result;
+ FaxToMailUser user = getLastModificationHistory().getFaxToMailUser();
+ if (user != null) {
+ result = user.getName();
+ } else {
+ result = t("faxtomail.systemUser");
+ }
+ return result;
+ }
+
+ public Date getLastModificationDate() {
+ return getLastModificationHistory().getModificationDate();
+ }
+
+
@Override
protected Email newEntity() {
return new EmailImpl();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,6 +1,29 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import org.apache.commons.logging.LogFactory;
import javax.swing.tree.DefaultMutableTreeNode;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
BeanFilterableComboBox {
showReset: true;
bean: {model};
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ FaxToMail :: UI
+ %%
+ Copyright (C) 2014 Franciaflex
+ %%
+ 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%
+ -->
<JPanel id='searchPanel' layout='{new BorderLayout()}'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<SearchUIModel, SearchUIHandler>'>
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: EditCruiseUIHandler.java 1282 2013-10-07 14:46:55Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,7 +16,7 @@
* 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
+ * 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%
@@ -60,18 +58,6 @@
/** Logger. */
private static final Log log = LogFactory.getLog(SearchUIHandler.class);
-
- public static String getTitle(boolean exist) {
-
- String result;
- if (exist) {
- result = t("tutti.editCruise.title.edit.cruise");
- } else {
- result = t("tutti.editCruise.title.create.cruise");
- }
- return result;
- }
-
/**
* Persistence service.
*
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.content.search;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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 kmorin <kmorin(a)codelutin.com>
* @since x.x
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: AbstractTuttiBeanUIModel.java 1564 2014-01-31 10:56:26Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,7 +16,7 @@
* 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
+ * 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%
@@ -109,7 +107,7 @@
}
//------------------------------------------------------------------------//
- //-- TuttiEntity methods --//
+ //-- Entity methods --//
//------------------------------------------------------------------------//
// @Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.DecoratorService;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Cancelable.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Cancelable.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Cancelable.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
+
/**
* To cancel contract.
*
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CloseableUI.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CloseableUI.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CloseableUI.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
+
/**
* Contract to close an ui.
*
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.franciaflex.faxtomail.ui.swing.actions.AbstractChangeScreenAction;
import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction;
import org.apache.commons.logging.Log;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import jaxx.runtime.JAXXObject;
import org.nuiton.jaxx.application.swing.ApplicationUI;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -2,15 +2,13 @@
/*
* #%L
- * Tutti :: UI
- * $Id: TuttiUIUtil.java 1298 2013-10-14 18:30:59Z tchemit $
- * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * FaxToMail :: UI
* %%
- * Copyright (C) 2012 Ifremer
+ * Copyright (C) 2014 Franciaflex
* %%
* 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
+ * 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,
@@ -18,7 +16,7 @@
* 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
+ * 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%
@@ -31,6 +29,12 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
+import javax.swing.*;
+import javax.swing.tree.TreePath;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/RemoveablePropertyChangeListener.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/RemoveablePropertyChangeListener.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/RemoveablePropertyChangeListener.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import java.beans.PropertyChangeListener;
/**
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/UIMessageNotifier.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/UIMessageNotifier.java 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/UIMessageNotifier.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,5 +1,27 @@
package com.franciaflex.faxtomail.ui.swing.util;
+/*
+ * #%L
+ * FaxToMail :: UI
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * 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%
+ */
+
/**
* To notify somemessage in ui.
*
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-14 17:28:56 UTC (rev 10)
@@ -13,6 +13,8 @@
application.action.create.error=
application.error.ui.business.warning=
faxtomail.action.create.error=
+faxtomail.alert.alreadyTakenBy.message=
+faxtomail.alert.alreadyTakenBy.title=
faxtomail.archive.button.label=
faxtomail.back.button.label=
faxtomail.common.askBeforeDelete.help=
@@ -61,6 +63,8 @@
faxtomail.config.parse.error=
faxtomail.config.save.error=
faxtomail.config.title=
+faxtomail.demand.alreadyTakenBy=
+faxtomail.demande.alreadyTakenBy=
faxtomail.demande.archive.button.label=
faxtomail.demande.back.button.label=
faxtomail.demande.client.label=
@@ -69,7 +73,11 @@
faxtomail.demande.ediCodeNumber.label=
faxtomail.demande.etatAttente.label=
faxtomail.demande.finishedProducts.label=
+faxtomail.demande.firstOpenedBy.label=
+faxtomail.demande.firstOpeningDate.label=
faxtomail.demande.gamme.label=
+faxtomail.demande.lastModificationDate.label=
+faxtomail.demande.lastModifiedBy.label=
faxtomail.demande.message.label=
faxtomail.demande.object.label=
faxtomail.demande.print.button.label=
@@ -82,6 +90,7 @@
faxtomail.demande.save.button.label=
faxtomail.demande.sender.label=
faxtomail.demande.status.label=
+faxtomail.demande.takenBy.label=
faxtomail.demande.tcc.label=
faxtomail.demande.title=
faxtomail.demande.transmit.button.label=
@@ -159,6 +168,7 @@
faxtomail.search.sender.label=
faxtomail.search.status.label=
faxtomail.search.title=
+faxtomail.systemUser=
faxtomail.transmit.button.label=
swing.error.cannot.mail=
swing.error.cannot.open.link=
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-14 17:28:56 UTC (rev 10)
@@ -12,62 +12,23 @@
Voir=
application.action.create.error=
application.error.ui.business.warning=
-faxtomail.action.create.error=
-faxtomail.common.askBeforeDelete.help=
-faxtomail.common.askCancelEditBeforeLeaving.help=
-faxtomail.common.askCancelEditBeforeLeaving.title=
-faxtomail.common.askOverwriteFile.help=
-faxtomail.common.askOverwriteFile.message=
-faxtomail.common.askOverwriteFile.title=
-faxtomail.common.askSaveBeforeLeaving.help=
-faxtomail.common.askSaveBeforeLeaving.title=
-faxtomail.common.datefield.tip=
-faxtomail.config.action.reload.actions=
-faxtomail.config.action.reload.application=
-faxtomail.config.action.reload.ui=
+faxtomail.alert.alreadyTakenBy.message=Le document est déjà attribué à l'utilisateur %s.
+faxtomail.alert.alreadyTakenBy.title=Document déjà attribué
faxtomail.config.application=
-faxtomail.config.category.applications=
-faxtomail.config.category.applications.description=
-faxtomail.config.category.technical=
-faxtomail.config.category.technical.description=
-faxtomail.config.category.ui=
-faxtomail.config.category.ui.description=
-faxtomail.config.option.basedir.shortLabel=
-faxtomail.config.option.csv.separator.shortLabel=
-faxtomail.config.option.help.directory.description=
-faxtomail.config.option.help.directory.shortLabel=
-faxtomail.config.option.i18n.directory.description=
-faxtomail.config.option.i18n.directory.shortLabel=
-faxtomail.config.option.i18n.locale.description=
-faxtomail.config.option.launch.mode.description=
-faxtomail.config.option.site.url.shortLabel=
-faxtomail.config.option.startActionFile.description=
-faxtomail.config.option.tmp.directory.shortLabel=
-faxtomail.config.option.ui.autoPopupNumberEditor.description=
-faxtomail.config.option.ui.color.alternateRow.description=
-faxtomail.config.option.ui.color.alternateRow.shortLabel=
-faxtomail.config.option.ui.color.blockingLayer.description=
-faxtomail.config.option.ui.color.blockingLayer.shortLabel=
-faxtomail.config.option.ui.color.selectedRow.description=
-faxtomail.config.option.ui.color.selectedRow.shortLabel=
-faxtomail.config.option.ui.config.file.description=
-faxtomail.config.option.ui.config.file.shortLabel=
-faxtomail.config.option.ui.dateFormat.description=
-faxtomail.config.option.ui.dateFormat.shortLabel=
-faxtomail.config.option.ui.shortcut.closePopup.description=
-faxtomail.config.option.ui.showNumberEditorButton.description=
-faxtomail.config.parse.error=
-faxtomail.config.save.error=
faxtomail.config.title=
faxtomail.demande.archive.button.label=Archiver
-faxtomail.demande.back.button.label=Retour
+faxtomail.demande.back.button.label=Annuler
faxtomail.demande.client.label=Client
faxtomail.demande.demandeNumber.label=N° Devis/Cde
faxtomail.demande.docType.label=Type
faxtomail.demande.ediCodeNumber.label=Retour EDI
faxtomail.demande.etatAttente.label=État attente
faxtomail.demande.finishedProducts.label=Produits finis
+faxtomail.demande.firstOpenedBy.label=Première ouverture par
+faxtomail.demande.firstOpeningDate.label=le
faxtomail.demande.gamme.label=Gamme
+faxtomail.demande.lastModificationDate.label=le
+faxtomail.demande.lastModifiedBy.label=Dernière modification par
faxtomail.demande.message.label=Message
faxtomail.demande.object.label=Objet
faxtomail.demande.print.button.label=Imprimer
@@ -78,7 +39,7 @@
faxtomail.demande.save.button.label=Enregistrer
faxtomail.demande.sender.label=Émetteur
faxtomail.demande.status.label=Statut
-faxtomail.demande.title=Demande
+faxtomail.demande.takenBy.label=Pris par
faxtomail.demande.transmit.button.label=Transmettre
faxtomail.demandeList.action.attachment=Ajouter une pièce-jointe
faxtomail.demandeList.action.attachment.mnemonic=A
@@ -105,12 +66,6 @@
faxtomail.demandeList.table.header.user=Pris pas
faxtomail.demandeList.table.header.waitingState=État attente
faxtomail.demandeList.title=Gestion des fax
-faxtomail.error.delete.startActionFile=
-faxtomail.error.errorpane.htmlmessage=
-faxtomail.error.read.startActionFile=
-faxtomail.error.ui.business.error=
-faxtomail.error.ui.business.warning=
-faxtomail.error.ui.other.error=
faxtomail.i18n.deleteCache.error=
faxtomail.i18n.mkDir.error=
faxtomail.main.action.configuration=Configuration
@@ -130,13 +85,9 @@
faxtomail.main.menu.file=Fichier
faxtomail.main.menu.file.mnemonic=
faxtomail.main.menu.file.tip=Menu fichier
-faxtomail.main.title.action=
faxtomail.main.title.application=FaxToMail
faxtomail.main.title.applicationName=FaxToMail
faxtomail.main.title.nodb=
-faxtomail.message.action.running=
-faxtomail.property.get.error=
-faxtomail.property.set.error=
faxtomail.search.between2ndPart.label=et le
faxtomail.search.button.label=Rechercher
faxtomail.search.chantier.label=Chantier
@@ -152,10 +103,4 @@
faxtomail.search.sender.label=Émetteur
faxtomail.search.status.label=Statut
faxtomail.search.title=Recherche
-swing.error.cannot.mail=
-swing.error.cannot.open.link=
-swing.error.desktop.browse.not.supported=
-swing.error.desktop.mail.not.supported=
-swing.error.desktop.not.supported=
-tutti.editCruise.title.create.cruise=
-tutti.editCruise.title.edit.cruise=
+faxtomail.systemUser=Système
Modified: trunk/faxtomail-ui-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/log4j.properties 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-swing/src/main/resources/log4j.properties 2014-02-14 17:28:56 UTC (rev 10)
@@ -1,3 +1,24 @@
+###
+# #%L
+# FaxToMail :: UI
+# %%
+# Copyright (C) 2014 Franciaflex
+# %%
+# 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%
+###
log4j.rootCategory=WARN, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
@@ -5,7 +26,7 @@
log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %M %m%n
# global level
-log4j.logger.com.franciaflex.faxtomail=TRACE
+log4j.logger.com.franciaflex.faxtomail=DEBUG
### persistence level
# log4j.logger.org.nuiton.topia=TRACE
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-02-12 17:16:05 UTC (rev 9)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-14 17:28:56 UTC (rev 10)
@@ -163,7 +163,7 @@
result.put(Email.PROPERTY_CLIENT, "Client");
result.put(Email.PROPERTY_DEMAND_STATUS, "Statut");
result.put(Email.PROPERTY_DEMAND_TYPE, "Type");
- result.put(Email.PROPERTY_FAX_TO_MAIL_USER, "Pris par");
+ result.put(Email.PROPERTY_TAKEN_BY, "Pris par");
result.put(Email.PROPERTY_ETAT_ATTENTE, "État attente");
return result;
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-12 17:16:05 UTC (rev 9)
+++ trunk/pom.xml 2014-02-14 17:28:56 UTC (rev 10)
@@ -92,7 +92,7 @@
<hibernateVersion>4.2.8.Final</hibernateVersion>
<h2Version>1.3.174</h2Version>
- <jaxxVersion>2.8</jaxxVersion>
+ <jaxxVersion>2.8.2-SNAPSHOT</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.15.1</xworkVersion>
@@ -117,7 +117,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- Last JRE version to use -->
- <jreVersion>1.7.45</jreVersion>
+ <jreVersion>1.7.51</jreVersion>
</properties>
1
0
12 Feb '14
Author: kmorin
Date: 2014-02-12 18:16:05 +0100 (Wed, 12 Feb 2014)
New Revision: 9
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/9
Log:
continue swing ui
Added:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
trunk/faxtomail-ui-swing/src/main/resources/log4j.properties
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-swing/pom.xml
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
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
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/DemandeListUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
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
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/pom.xml 2014-02-12 17:16:05 UTC (rev 9)
@@ -150,6 +150,7 @@
<defaultPackage>com.franciaflex.faxtomail.persistence.entities</defaultPackage>
<fullPackagePath>com.franciaflex.faxtomail.persistence.entities</fullPackagePath>
<templates>
+ org.nuiton.eugene.java.JavaInterfaceTransformer,
org.nuiton.topia.templates.TopiaMetaTransformer
</templates>
</configuration>
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -134,19 +134,19 @@
FaxToMailConfigurationOption.BASEDIR.getKey(),
faxToMailBasedir.getAbsolutePath());
- if (log.isInfoEnabled()) {
- StringBuilder builder = new StringBuilder();
- List<FaxToMailConfigurationOption> options =
- Lists.newArrayList(FaxToMailConfigurationOption.values());
- for (FaxToMailConfigurationOption option : options) {
- String key = option.getKey();
- Object value = applicationConfig.getOption(option);
- builder.append(String.format("\n%1$-40s = %2$s",
- key,
- value));
- }
- log.info("faxtomail: " + builder.toString());
- }
+// if (log.isInfoEnabled()) {
+// StringBuilder builder = new StringBuilder();
+// List<FaxToMailConfigurationOption> options =
+// Lists.newArrayList(FaxToMailConfigurationOption.values());
+// for (FaxToMailConfigurationOption option : options) {
+// String key = option.getKey();
+// Object value = applicationConfig.getOption(option);
+// builder.append(String.format("\n%1$-40s = %2$s",
+// key,
+// value));
+// }
+// log.info("faxtomail: " + builder.toString());
+// }
}
public void prepareDirectories() {
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/LabelAware.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,14 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import java.io.Serializable;
-
-/**
- * A contract to decorate some objects
- * (not known at this level but with a label property to display them).
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public interface LabelAware extends Serializable {
- String getLabel();
-}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,11 +24,14 @@
* #L%
*/
-import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.decorator.Decorator;
import org.nuiton.decorator.DecoratorProvider;
import java.io.File;
+import java.text.DateFormat;
+import java.util.Date;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
@@ -41,22 +44,6 @@
*/
public class DecoratorService extends FaxToMailServiceSupport {
- public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
-
- public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
-
- public static final String FROM_PROTOCOL = "fromProtocol";
-
- public static final String GEAR_WITH_RANK_ORDER = "gearWithrankOrder";
-
- public static final String BY_NAME = "byName";
-
- public static final String ONLY_NAME = "onlyName";
-
- public static final String FILE_NAME_COMPATIBLE = "fileNameCompatible";
-
public static final String SEPARATOR = "#";
/** Delegate decorator provider. */
@@ -102,7 +89,18 @@
return bean == null ? "" : String.valueOf(bean);
}
});
- registerMultiJXPathDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
+ registerDecorator(new Decorator<Date>(Date.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ if (bean == null) {
+ return "";
+ }
+ return DateFormat.getDateTimeInstance().format(bean);
+ }
+ });
+ registerMultiJXPathDecorator(HasLabel.class, "${label}$s", SEPARATOR, " - ");
}
};
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -40,6 +40,12 @@
return company;
}
+ public Company getCompanyByName(String name) {
+ CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
+ Company company = dao.forNameEquals(name).findAny();
+ return company;
+ }
+
public Company saveCompany(Company company, Collection<MailFolder> mailFolders, Map<MailFilter, String> mailFilters) {
Preconditions.checkNotNull(company);
Added: 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 (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,22 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class EmailService extends FaxToMailServiceSupport {
+
+ public List<Email> getEmailForFolder(MailFolder folder) {
+ EmailTopiaDao dao = getPersistenceContext().getEmailDao();
+ return new ArrayList<>(dao.forMailFolderEquals(folder).findAll());
+ }
+}
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -28,16 +28,34 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatusTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.persistence.entities.PriorityTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
public class InitFaxToMailService extends FaxToMailServiceSupport {
@@ -100,27 +118,136 @@
}
protected void initSampleData() {
+ log.debug("init Sample Data");
- // companies
- CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
- ConfigurationTopiaDao configurationTopiaDao = getPersistenceContext().getConfigurationDao();
+ DemandTypeTopiaDao demandTypeDao = getPersistenceContext().getDemandTypeDao();
+ long count = demandTypeDao.count();
- long count = companyTopiaDao.count();
+ if (count == 0) {
+ List<DemandType> types = Lists.newArrayList(
+ demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande"),
+ demandTypeDao.create(DemandType.PROPERTY_LABEL, "SAV")
+ );
- log.debug("sample data: " + count);
- if (count == 0) {
- log.debug("add sample data");
- companyTopiaDao.create(Company.PROPERTY_NAME, "Franciaflex", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
+ DemandStatusTopiaDao demandStatusDao = getPersistenceContext().getDemandStatusDao();
+ List<DemandStatus> statuses = Lists.newArrayList(
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "Non traîtée"),
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "En cours"),
+ demandStatusDao.create(DemandStatus.PROPERTY_LABEL, "Validée")
+ );
+
+ PriorityTopiaDao priorityDao = getPersistenceContext().getPriorityDao();
+ List<Priority> priorities = Lists.newArrayList(
+ priorityDao.create(Priority.PROPERTY_LABEL, "Basse"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Normale"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Haute"),
+ priorityDao.create(Priority.PROPERTY_LABEL, "Urgente")
+ );
+
+ RangeTopiaDao rangeDao = getPersistenceContext().getRangeDao();
+ List<Range> ranges = Lists.newArrayList(
+ rangeDao.create(Range.PROPERTY_LABEL, "Menuiserie"),
+ rangeDao.create(Range.PROPERTY_LABEL, "Volets roulants"),
+ rangeDao.create(Range.PROPERTY_LABEL, "Accessoires")
+ );
+
+ MailFolderTopiaDao folderDao = getPersistenceContext().getMailFolderDao();
+ List<MailFolder> folders = new ArrayList<>();
+
+ Random random = new Random();
+ EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
+
+ MailFolder cyril = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril");
+ int r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, cyril,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder claire = folderDao.create(MailFolder.PROPERTY_NAME, "Claire");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, claire,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder agathe = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, agathe,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "Chargés de clientèle",
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(cyril, claire, agathe)));
+
+ MailFolder marc = folderDao.create(MailFolder.PROPERTY_NAME, "Marc");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, marc,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder frederic = folderDao.create(MailFolder.PROPERTY_NAME, "Frédéric");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, frederic,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+
+ MailFolder jeanne = folderDao.create(MailFolder.PROPERTY_NAME, "Jeanne");
+ r = random.nextInt(10) + 5;
+ for (int i = 0 ; i < r ; i++) {
+ emailDao.create(Email.PROPERTY_SENDER_EMAIL_ADDRESS, RandomStringUtils.randomAlphabetic(8) + "@" + RandomStringUtils.randomAlphabetic(5) + ".fr",
+ Email.PROPERTY_OBJECT, RandomStringUtils.randomAlphabetic(10),
+ Email.PROPERTY_RECEPTION_DATE, new Date(),
+ Email.PROPERTY_MAIL_FOLDER, jeanne,
+ Email.PROPERTY_DEMAND_TYPE, types.get(random.nextInt(types.size())),
+ Email.PROPERTY_DEMAND_STATUS, statuses.get(random.nextInt(statuses.size())),
+ Email.PROPERTY_PRIORITY, priorities.get(random.nextInt(priorities.size())),
+ Email.PROPERTY_RANGE, Lists.newArrayList(ranges.get(random.nextInt(ranges.size()))));
+ }
+ folders.add(folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
+ MailFolder.PROPERTY_CHILDREN, Lists.newArrayList(marc, frederic, jeanne)));
+
+ // companies
+ CompanyTopiaDao companyTopiaDao = getPersistenceContext().getCompanyDao();
+ ConfigurationTopiaDao configurationTopiaDao = getPersistenceContext().getConfigurationDao();
+ companyTopiaDao.create(Company.PROPERTY_NAME, "Franciaflex", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create(), Company.PROPERTY_MAIL_FOLDER, folders);
companyTopiaDao.create(Company.PROPERTY_NAME, "Faber", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
companyTopiaDao.create(Company.PROPERTY_NAME, "France Fermeture", Company.PROPERTY_CONFIGURATION, configurationTopiaDao.create());
- getPersistenceContext().commit();
- log.debug("sample data " + companyTopiaDao.count());
- }
-
- FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
- count = userGroupDao.count();
- if (count == 0) {
+ FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Chargés de clientèle");
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Commerciaux");
userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "SAV");
@@ -128,19 +255,6 @@
getPersistenceContext().commit();
}
-
- FaxToMailUserTopiaDao userDao = getPersistenceContext().getFaxToMailUserDao();
- count = userDao.count();
- if (count == 0) {
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Marc Lefebvre", FaxToMailUser.PROPERTY_LOGIN, "mlefebvre");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Cyril Baillet", FaxToMailUser.PROPERTY_LOGIN, "cbaillet");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Frédéric Viala", FaxToMailUser.PROPERTY_LOGIN, "fviala");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Claire Marquis", FaxToMailUser.PROPERTY_LOGIN, "cmarquis");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Agathe Borde", FaxToMailUser.PROPERTY_LOGIN, "aborde");
- userDao.create(FaxToMailUser.PROPERTY_NAME, "Jeanne Bourgoin", FaxToMailUser.PROPERTY_LOGIN, "jbourgoin");
-
- getPersistenceContext().commit();
- }
}
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -20,6 +20,11 @@
private static final Log log = LogFactory.getLog(MailFolderService.class);
+ public List<MailFolder> getAllMailFolders() {
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ return new ArrayList<MailFolder>(dao.findAll());
+ }
+
public List<MailFolder> getMailFolders(Collection<String> ids) {
MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
return new ArrayList<MailFolder>(dao.forTopiaIdIn(ids).findAll());
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,41 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatusTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.persistence.entities.PriorityTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class ReferentielService extends FaxToMailServiceSupport {
+
+ public List<DemandStatus> getAllDemandStatus() {
+ DemandStatusTopiaDao dao = getPersistenceContext().getDemandStatusDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<DemandType> getAllDemandType() {
+ DemandTypeTopiaDao dao = getPersistenceContext().getDemandTypeDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<Priority> getAllPriority() {
+ PriorityTopiaDao dao = getPersistenceContext().getPriorityDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<Range> getAllRange() {
+ RangeTopiaDao dao = getPersistenceContext().getRangeDao();
+ return new ArrayList<>(dao.findAll());
+ }
+}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-02-12 17:16:05 UTC (rev 9)
@@ -63,13 +63,25 @@
<dependencies>
+
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>faxtomail-persistence</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>faxtomail-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
@@ -210,6 +222,13 @@
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+
</dependencies>
<build>
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,18 @@
package com.franciaflex.faxtomail.ui.swing;
import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
+import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.services.service.EmailService;
+import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
import com.google.common.base.Preconditions;
@@ -170,6 +179,10 @@
private final ApplicationActionEngine faxToMailActionEngine;
+ protected Company currentCompany;
+
+ protected Email currentEmail;
+
public static FaxToMailUIContext newContext(FaxToMailConfiguration config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
@@ -200,8 +213,16 @@
this.config = config;
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
this.serviceContext = new FaxToMailServiceContext();
+ FaxToMailTopiaApplicationContext topiaApplicationContext = new FaxToMailTopiaApplicationContext(config.getTopiaProperties());
+ FaxToMailTopiaPersistenceContext persistenceContext = topiaApplicationContext.newPersistenceContext();
+ serviceContext.setPersistenceContext(persistenceContext);
serviceContext.setApplicationConfig(config);
+ InitFaxToMailService initExtranetService =
+ serviceContext.newService(InitFaxToMailService.class);
+
+ initExtranetService.init();
+
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
@@ -380,6 +401,10 @@
// helpDirectory));
// }
//
+
+ Company franciaflex = getCompanyService().getCompanyByName("Franciaflex");
+ setCurrentCompany(franciaflex);
+
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
@@ -447,6 +472,22 @@
return serviceContext.newService(DecoratorService.class);
}
+ public MailFolderService getMailFolderService() {
+ return serviceContext.newService(MailFolderService.class);
+ }
+
+ public CompanyService getCompanyService() {
+ return serviceContext.newService(CompanyService.class);
+ }
+
+ public EmailService getEmailService() {
+ return serviceContext.newService(EmailService.class);
+ }
+
+ public ReferentielService getReferentielService() {
+ return serviceContext.newService(ReferentielService.class);
+ }
+
//------------------------------------------------------------------------//
//-- DataContext methods --//
//------------------------------------------------------------------------//
@@ -592,4 +633,19 @@
firePropertyChange(PROPERTY_LOCALE, null, locale);
}
+ public Company getCurrentCompany() {
+ return currentCompany;
+ }
+
+ public void setCurrentCompany(Company currentCompany) {
+ this.currentCompany = currentCompany;
+ }
+
+ public Email getCurrentEmail() {
+ return currentEmail;
+ }
+
+ public void setCurrentEmail(Email currentEmail) {
+ this.currentEmail = currentEmail;
+ }
}
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -35,7 +35,7 @@
// Create configuration
FaxToMailConfiguration config =
- new FaxToMailConfiguration("faxtomail.config", args);
+ new FaxToMailConfiguration("faxtomail.properties", args);
// Create application context
FaxToMailUIContext context = FaxToMailUIContext.newContext(config);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,68 +1,33 @@
-BeanFilterableComboBox {
- showReset: true;
- bean: {model};
+#navigationTree {
+ font-size: "11";
+ rootVisible: false;
+ showsRootHandles: true;
}
-JXDatePicker {
- _selectOnFocus: {true};
+#dataTable {
+ editable: false;
+ autoCreateRowSorter: true;
}
-JTextField {
- _selectOnFocus: {true};
+#printMenu {
+ actionIcon: print;
+ text: "faxtomail.demandeList.action.print";
+ toolTipText: "faxtomail.demandeList.action.print.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.print.mnemonic";
}
-.between2ndPartLabel {
- text: "faxtomail.search.between2ndPart.label";
+#replyMenu {
+ actionIcon: reply;
+ text: "faxtomail.demandeList.action.reply";
+ toolTipText: "faxtomail.demandeList.action.reply.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.reply.mnemonic";
+ enabled: {model.isReplyEnabled()};
}
-#modifiedByLabel {
- text: "faxtomail.search.modifiedBy.label";
-}
-
-#modifiedBetweenLabel {
- text: "faxtomail.search.modifiedBetween.label";
-}
-
-#receivedBetweenLabel {
- text: "faxtomail.search.receivedBetween.label";
-}
-
-#printedBetweenLabel {
- text: "faxtomail.search.printedBetween.label";
-}
-
-#objectLabel {
- text: "faxtomail.search.object.label";
-}
-
-#statusLabel {
- text: "faxtomail.search.status.label";
-}
-
-#senderLabel {
- text: "faxtomail.search.sender.label";
-}
-
-#docTypeLabel {
- text: "faxtomail.search.docType.label";
-}
-
-#clientAccountLabel {
- text: "faxtomail.search.clientAccount.label";
-}
-
-#refLabel {
- text: "faxtomail.search.ref.label";
-}
-
-#commentLabel {
- text: "faxtomail.search.comment.label";
-}
-
-#chantierLabel {
- text: "faxtomail.search.chantier.label";
-}
-
-#searchButton {
- text: "faxtomail.search.button.label"
+#addAttachmentMenu {
+ actionIcon: attachment;
+ text: "faxtomail.demandeList.action.attachment";
+ toolTipText: "faxtomail.demandeList.action.attachment.tip";
+ i18nMnemonic: "faxtomail.demandeList.action.attachment.mnemonic";
+ enabled: {model.isAddAttachmentEnabled()};
}
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,7 +5,6 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -23,18 +22,31 @@
<DemandeListUIModel id='model'
initializer='getContextValue(DemandeListUIModel.class)'/>
+ <!--
+ Au dessus du tableau, mettre les totaux des quantités PF et SAV. Mettre à jour en fonction des éléments affichés (suivant le filtre)
+ Liste des éléments globale (de tous les dossiers accessibles).
+ -->
+
+ <JPopupMenu id='tablePopup'>
+ <JMenuItem id='printMenu'
+ onActionPerformed='handler.print()'/>
+ <JMenuItem id='replyMenu'
+ onActionPerformed='handler.reply()'/>
+ <JMenuItem id='addAttachmentMenu'
+ onActionPerformed='handler.addAttachment()'/>
+ </JPopupMenu>
+
<JSplitPane constraints='BorderLayout.CENTER'>
<JScrollPane>
- <JTree id="navigationTree"
- font-size='11'
- rootVisible='false'
- showsRootHandles='false'/>
+ <JTree id="navigationTree"/>
</JScrollPane>
<JPanel layout='{new BorderLayout()}'>
- <JLabel id="selectedFolder" text="1 - Volets roulants" constraints='BorderLayout.NORTH'/>
+ <JLabel id="selectedFolder" constraints='BorderLayout.NORTH'/>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JXTable id='dataTable' autoCreateRowSorter='true'/>
+ <JXTable id='dataTable'
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
</JSplitPane>
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,24 +24,38 @@
* #L%
*/
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
+import jaxx.runtime.swing.JAXXWidgetUtil;
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.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
import static org.nuiton.i18n.I18n.t;
@@ -75,58 +89,124 @@
*/
// private final PersistenceService persistenceService;
+ @Override
+ public void beforeInit(DemandeListUI ui) {
+ super.beforeInit(ui);
+
+ DemandeListUIModel model = new DemandeListUIModel();
+ Company franciaflex = getContext().getCurrentCompany();
+ Collection<MailFolder> folders = franciaflex.getMailFolder();
+ model.setFolders(new ArrayList<MailFolder>(folders));
+
+ model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ DemandeListUIModel model = (DemandeListUIModel) evt.getSource();
+ MailFolder folder = (MailFolder) evt.getNewValue();
+ List<Email> emails = getContext().getEmailService().getEmailForFolder(folder);
+ model.setEmails(emails);
+ }
+ });
+
+ this.ui.setContextValue(model);
+ }
+
@Override
public void afterInit(DemandeListUI ui) {
initUI(ui);
+ // init tree
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+ for (MailFolder folder : getModel().getFolders()) {
+ createFolderTree(root, folder);
+ }
- DefaultMutableTreeNode commandes = new DefaultMutableTreeNode("Commandes");
- commandes.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
- commandes.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
+ TreeModel treeModel = new DefaultTreeModel(root);
+ JTree navigationTree = ui.getNavigationTree();
+ navigationTree.setModel(treeModel);
- DefaultMutableTreeNode devis = new DefaultMutableTreeNode("Devis");
- devis.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
- devis.add(new DefaultMutableTreeNode("FME - 1 - Volets roulants"));
+ // use the folder icon for the leaf
+ DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
+ Icon folderIcon = renderer.getDefaultClosedIcon();
+ renderer.setLeafIcon(folderIcon);
+ navigationTree.setCellRenderer(renderer);
- root.add(commandes);
- root.add(devis);
+ JAXXWidgetUtil.expandTree(navigationTree);
+ navigationTree.addTreeSelectionListener(new TreeSelectionListener() {
+ @Override
+ public void valueChanged(TreeSelectionEvent e) {
+ FolderTreeNode folderNode = (FolderTreeNode) e.getPath().getLastPathComponent();
+ MailFolder folder = folderNode.getMailFolder();
+ getModel().setSelectedFolder(folder);
+ }
+ });
- TreeModel treeModel = new DefaultTreeModel(root);
- ui.getNavigationTree().setModel(treeModel);
+ // init table
+ TableColumnModelExt columnModel = new DefaultTableColumnModelExt();
+ Company franciaflex = getContext().getCurrentCompany();
+ String columns = franciaflex.getConfiguration().getTableColumns();
+ if (columns == null) {
+ columns = StringUtils.join(new String[] {
+ Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE, Email.PROPERTY_SENDER_EMAIL_ADDRESS
+ }, ',');
+ }
+ String[] columnNames = columns.split(",");
+ for (String columnName : columnNames) {
+ addColumnToModel(columnModel,
+ null,
+ Email.PROPERTY_RECEPTION_DATE.equals(columnName) ? newTableCellRender(Date.class): null,
+ DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName))
+ .setSortable(true);
+ }
+ final AbstractApplicationTableModel tableModel = new DemandeTableModel(columnModel);
+ JXTable table = ui.getDataTable();
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+ table.getTableHeader().setReorderingAllowed(false);
- String[][] data = new String[][] {
- { "Sté 1", "Utilisateur 1", "Objet 1", "10/01/14 12:12" },
- { "Sté 2", "Utilisateur 2", "Objet 2", "13/01/14 12:12" },
- { "Sté 3", "Utilisateur 3", "Objet 3", "14/01/14 12:12" }
- };
- String[] columns = new String[] {
- "De",
- "Nom TCC",
- "Objet",
- "Reçu le"
- };
- TableModel tableModel = new DefaultTableModel(data, columns);
- ui.getDataTable().setModel(tableModel);
- ui.getDataTable().setEditable(false);
-
- ui.getDataTable().addMouseListener(new MouseAdapter() {
+ table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
if (evt.getClickCount() == 2) {
+ int rowIndex = table.getSelectedRow();
+ Email selectedEmail = (Email) tableModel.getEntry(rowIndex);
+ getContext().setCurrentEmail(selectedEmail);
getContext().getActionEngine().runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
}
}
});
-// initBeanFilterableComboBox(ui.getModifiedByComboBox(), createLabelList("Utilisateur A", "Utilisateur B", "Utilisateur C"), null);
-// initBeanFilterableComboBox(ui.getStatusComboBox(), createLabelList("Nouveau", "En cours", "Archivé"), null);
-// initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
+ getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_EMAILS, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ List<Email> emails = (List<Email>) evt.getNewValue();
+ tableModel.setRows(emails);
+ }
+ });
+ getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ MailFolder folder = (MailFolder) evt.getNewValue();
+ String name = folder != null ? folder.getName() : null;
+ getUI().getSelectedFolder().setText(name);
+ }
+ });
+
}
+ protected void createFolderTree(DefaultMutableTreeNode parent, MailFolder folder) {
+ DefaultMutableTreeNode node = new FolderTreeNode(folder);
+ parent.add(node);
+ if (folder.isChildrenNotEmpty()) {
+ for (MailFolder child : folder.getChildren()) {
+ createFolderTree(node, child);
+ }
+ }
+ }
+
@Override
protected JComponent getComponentToFocus() {
return getUI().getNavigationTree();
@@ -158,4 +238,25 @@
public SwingValidator<DemandeListUIModel> getValidator() {
return null;
}
+
+ @Override
+ protected void beforeOpenPopup(int rowIndex, int columnIndex) {
+ super.beforeOpenPopup(rowIndex, columnIndex);
+
+ int selectedRowCount = getUI().getDataTable().getSelectedRowCount();
+ getModel().setAddAttachmentEnabled(selectedRowCount == 1);
+ getModel().setReplyEnabled(selectedRowCount == 1);
+ }
+
+ public void print() {
+ log.debug("print");
+ }
+
+ public void reply() {
+ log.debug("reply");
+ }
+
+ public void addAttachment() {
+ log.debug("addAttachment");
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,74 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+import java.util.List;
+
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
*/
-public class DemandeListUIModel {
+public class DemandeListUIModel extends AbstractSerializableBean {
+ public static final String PROPERTY_FOLDERS = "folders";
+ public static final String PROPERTY_EMAILS = "emails";
+ public static final String PROPERTY_SELECTED_FOLDER = "selectedFolder";
+
+ protected List<MailFolder> folders;
+
+ protected List<Email> emails;
+
+ protected MailFolder selectedFolder;
+
+ protected boolean replyEnabled;
+
+ protected boolean addAttachmentEnabled;
+
+ public List<MailFolder> getFolders() {
+ return folders;
+ }
+
+ public void setFolders(List<MailFolder> folders) {
+ Object oldValue = getFolders();
+ this.folders = folders;
+ firePropertyChange(PROPERTY_FOLDERS, oldValue, folders);
+ }
+
+ public List<Email> getEmails() {
+ return emails;
+ }
+
+ public void setEmails(List<Email> emails) {
+ Object oldValue = getEmails();
+ this.emails = emails;
+ firePropertyChange(PROPERTY_EMAILS, oldValue, emails);
+ }
+
+ public MailFolder getSelectedFolder() {
+ return selectedFolder;
+ }
+
+ public void setSelectedFolder(MailFolder selectedFolder) {
+ Object oldValue = getSelectedFolder();
+ this.selectedFolder = selectedFolder;
+ firePropertyChange(PROPERTY_SELECTED_FOLDER, oldValue, selectedFolder);
+ }
+
+ public boolean isReplyEnabled() {
+ return replyEnabled;
+ }
+
+ public void setReplyEnabled(boolean replyEnabled) {
+ this.replyEnabled = replyEnabled;
+ }
+
+ public boolean isAddAttachmentEnabled() {
+ return addAttachmentEnabled;
+ }
+
+ public void setAddAttachmentEnabled(boolean addAttachmentEnabled) {
+ this.addAttachmentEnabled = addAttachmentEnabled;
+ }
}
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeTableModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,129 @@
+package com.franciaflex.faxtomail.ui.swing.content.demande;
+
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
+import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
+
+import javax.swing.table.AbstractTableModel;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n.n;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class DemandeTableModel extends AbstractApplicationTableModel<Email> {
+
+ 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_EMAIL_ADDRESS,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_SENDER_EMAIL_ADDRESS,
+ n("faxtomail.demandeList.table.header.senderEmail"),
+ n("faxtomail.demandeList.table.header.senderEmail")));
+
+ put(Email.PROPERTY_OBJECT,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_OBJECT,
+ n("faxtomail.demandeList.table.header.object"),
+ n("faxtomail.demandeList.table.header.object")));
+
+ put(Email.PROPERTY_RECEPTION_DATE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_RECEPTION_DATE,
+ n("faxtomail.demandeList.table.header.receptionDate"),
+ n("faxtomail.demandeList.table.header.receptionDate")));
+
+ put(Email.PROPERTY_CLIENT,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_CLIENT,
+ n("faxtomail.demandeList.table.header.client"),
+ n("faxtomail.demandeList.table.header.client")));
+
+ put(Email.PROPERTY_COMMAND_NB,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_COMMAND_NB,
+ n("faxtomail.demandeList.table.header.commandNb"),
+ n("faxtomail.demandeList.table.header.commandNb")));
+
+ put(Email.PROPERTY_DEMAND_STATUS,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_DEMAND_STATUS,
+ n("faxtomail.demandeList.table.header.status"),
+ n("faxtomail.demandeList.table.header.status")));
+
+ put(Email.PROPERTY_DEMAND_TYPE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_DEMAND_TYPE,
+ n("faxtomail.demandeList.table.header.type"),
+ n("faxtomail.demandeList.table.header.type")));
+
+ put(Email.PROPERTY_EDI_CODE_NUMBER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_EDI_CODE_NUMBER,
+ n("faxtomail.demandeList.table.header.ediCodeNumber"),
+ n("faxtomail.demandeList.table.header.ediCodeNumber")));
+
+ put(Email.PROPERTY_ETAT_ATTENTE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_ETAT_ATTENTE,
+ n("faxtomail.demandeList.table.header.waitingState"),
+ n("faxtomail.demandeList.table.header.waitingState")));
+
+ put(Email.PROPERTY_FAX_TO_MAIL_USER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_FAX_TO_MAIL_USER,
+ n("faxtomail.demandeList.table.header.user"),
+ n("faxtomail.demandeList.table.header.user")));
+
+ put(Email.PROPERTY_MAIL_FOLDER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_MAIL_FOLDER,
+ n("faxtomail.demandeList.table.header.folder"),
+ n("faxtomail.demandeList.table.header.folder")));
+
+ put(Email.PROPERTY_PRIORITY,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_PRIORITY,
+ n("faxtomail.demandeList.table.header.priority"),
+ n("faxtomail.demandeList.table.header.priority")));
+
+ put(Email.PROPERTY_PROJECT_REFERENCE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_PROJECT_REFERENCE,
+ n("faxtomail.demandeList.table.header.projectReference"),
+ n("faxtomail.demandeList.table.header.projectReference")));
+
+ put(Email.PROPERTY_RANGE,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_RANGE,
+ n("faxtomail.demandeList.table.header.range"),
+ n("faxtomail.demandeList.table.header.range")));
+
+ put(Email.PROPERTY_SAV_NUMBER,
+ ColumnIdentifier.<Email>newReadOnlyId(
+ Email.PROPERTY_SAV_NUMBER,
+ n("faxtomail.demandeList.table.header.savNumber"),
+ n("faxtomail.demandeList.table.header.savNumber")));
+
+ }};
+
+ protected DemandeTableModel(TableColumnModelExt columnModel) {
+ super(columnModel, false, false);
+ }
+
+ @Override
+ public Email createNewRow() {
+ return new EmailImpl();
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-12 17:16:05 UTC (rev 9)
@@ -15,38 +15,104 @@
text: "faxtomail.demande.object.label";
}
-#receivedLabel {
- text: "faxtomail.demande.received.label";
+#objectField {
+ text: {model.getObject()};
}
-#tccLabel {
- text: "faxtomail.demande.tcc.label";
+#receivedDateLabel {
+ text: "faxtomail.demande.receivedDate.label";
}
-#docTypeLabel {
- text: "faxtomail.demande.docType.label";
+#receivedDateField {
+ text: {getDateFormat().format(model.getReceptionDate())};
+ editable: false;
}
-#statusLabel {
- text: "faxtomail.demande.status.label";
+#senderLabel {
+ text: "faxtomail.demande.sender.label";
}
-#priorityLabel {
- text: "faxtomail.demande.priority.label";
+#senderField {
+ text: {model.getSenderEmailAddress()};
+ editable: false;
}
#clientLabel {
text: "faxtomail.demande.client.label";
}
+#docTypeLabel {
+ text: "faxtomail.demande.docType.label";
+}
+
+#docTypeComboBox {
+ property: demandType;
+ selectedItem: {model.getDemandType()};
+}
+
#demandeNumberLabel {
text: "faxtomail.demande.demandeNumber.label";
}
-#refLabel {
- text: "faxtomail.demande.ref.label";
+#demandeNumberField {
+ text: {model.getCommandNb()};
}
+#ediCodeNumberLabel {
+ text: "faxtomail.demande.ediCodeNumber.label";
+}
+
+#ediCodeNumberField {
+ text: {model.getEdiCodeNumber()};
+ editable: false;
+}
+
+#priorityLabel {
+ text: "faxtomail.demande.priority.label";
+}
+
+#priorityComboBox {
+ property: priority;
+ selectedItem: {model.getPriority()};
+}
+
+#statusLabel {
+ text: "faxtomail.demande.status.label";
+}
+
+#statusComboBox {
+ property: demandStatus;
+ selectedItem: {model.getDemandStatus()};
+}
+
+#etatAttenteLabel {
+ text: "faxtomail.demande.etatAttente.label";
+}
+
+#projectReferenceLabel {
+ text: "faxtomail.demande.projectReference.label";
+}
+
+#projectReferenceField {
+ text: {model.getProjectReference()};
+}
+
+#savNumberLabel {
+ text: "faxtomail.demande.savNumber.label";
+}
+
+#savNumberField {
+ text: {model.getSavNumber()};
+}
+
+#finishedProductsLabel {
+ text: "faxtomail.demande.finishedProducts.label";
+}
+
+//#finishedProductsField {
+//
+//}
+
#gammeLabel {
text: "faxtomail.demande.gamme.label";
}
@@ -74,4 +140,4 @@
#archiveButton {
text: "faxtomail.demande.archive.button.label";
-}
\ No newline at end of file
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,8 +5,13 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
+ com.franciaflex.faxtomail.persistence.entities.Email
+ com.franciaflex.faxtomail.persistence.entities.DemandType
+ com.franciaflex.faxtomail.persistence.entities.DemandStatus
+ com.franciaflex.faxtomail.persistence.entities.Range
+ com.franciaflex.faxtomail.persistence.entities.Priority
+
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
org.jdesktop.swingx.JXDatePicker
@@ -25,7 +30,7 @@
]]></script>
<DemandeUIModel id='model'
- initializer='getContextValue(DemandeUIModel.class)'/>
+ initializer='getContextValue(DemandeUIModel.class)'/>
<String id='patternLayout' javaBean='"dd/MM/yyyy HH:mm:ss"'/>
@@ -37,106 +42,139 @@
<JPanel layout='{new GridLayout(0,1)}'>
<Table fill='both'>
+
<row>
- <cell anchor='west'>
- <JLabel id='objectLabel'/>
+ <cell anchor='east'>
+ <JLabel id='receivedDateLabel'/>
</cell>
- <cell weightx='1' columns="3">
- <JTextField id='objectField'/>
+ <cell weightx='1'>
+ <JTextField id='receivedDateField'/>
</cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel id='receivedLabel'/>
+ <cell anchor='east'>
+ <JLabel id='senderLabel'/>
</cell>
<cell weightx='1'>
- <JAXXDatePicker id='receivedDatePicker'
- date='{date}'
- patternLayout='{patternLayout}'/>
+ <JTextField id='senderField'/>
</cell>
- <cell>
- <JLabel id='tccLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='clientLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='tccField'/>
+ <JTextField id='clientField'/><!-- TODO list of clients -->
</cell>
</row>
<row>
- <cell anchor='west' columns='4'>
- <JLabel text="Dernière modification par Utilisateur 1 le 14/01/2014 à 08:42"/>
+ <cell anchor='east'>
+ <JLabel id='objectLabel'/>
</cell>
+ <cell weightx='1' columns="5">
+ <JTextField id='objectField'
+ onKeyReleased='handler.setText(event, "object")'/>
+ </cell>
</row>
- </Table>
- <Table>
<row>
- <cell anchor='west'>
+ <cell anchor='east'>
<JLabel id='docTypeLabel'/>
</cell>
<cell weightx='1'>
<BeanFilterableComboBox id='docTypeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandType"/>
</cell>
- <cell anchor='west'>
+
+ <cell anchor='east'>
+ <JLabel id='demandeNumberLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JTextField id='demandeNumberField'
+ onKeyReleased='handler.setText(event, "commandNb")'/>
+ </cell>
+
+ <cell anchor='east'>
+ <JLabel id='ediCodeNumberLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JTextField id='ediCodeNumberField'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell anchor='east'>
+ <JLabel id='priorityLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <BeanFilterableComboBox id='priorityComboBox'
+ constructorParams='this'
+ genericType="Priority"/>
+ </cell>
+
+ <cell anchor='east'>
<JLabel id='statusLabel'/>
</cell>
<cell weightx='1'>
<BeanFilterableComboBox id='statusComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandStatus"/>
</cell>
- <cell anchor='west'>
- <JLabel id='priorityLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='etatAttenteLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='priorityComboBox'
+ <BeanFilterableComboBox id='etatAttenteComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="DemandStatus"/>
</cell>
</row>
<row>
- <cell anchor='west'>
- <JLabel id='clientLabel'/>
+ <cell anchor='east'>
+ <JLabel id='projectReferenceLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='clientField'/>
+ <JTextField id='projectReferenceField'/>
</cell>
- <cell anchor='west'>
- <JLabel id='demandeNumberLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='savNumberLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='demandeNumberField'/>
+ <JTextField id='savNumberField'/>
</cell>
- <cell anchor='west'>
- <JLabel id='refLabel'/>
+
+ <cell anchor='east'>
+ <JLabel id='finishedProductsLabel'/>
</cell>
<cell weightx='1'>
- <JTextField id='refField'/>
+ <JTextField id='finishedProductsField'/>
</cell>
</row>
<row>
- <cell anchor='west'>
+ <cell anchor='east'>
<JLabel id='gammeLabel'/>
</cell>
- <cell weightx='1'>
+ <cell weightx='1' columns='6'>
<BeanFilterableComboBox id='gammeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="Range"/>
</cell>
- <cell anchor='west'>
+ </row>
+
+ <row>
+ <cell anchor='east'>
<JLabel id='messageLabel'/>
</cell>
- <cell weightx='3' columns='3'>
+ <cell weightx='1' columns='5'>
<JScrollPane id='commentPane'>
<JTextArea id='messageField'/>
</JScrollPane>
</cell>
- </row>
+ </row>
</Table>
@@ -158,15 +196,6 @@
<JButton text="Ajouter"/>
</JPanel>
- <JPanel id="faxInfoPanel"
- border='{BorderFactory.createTitledBorder("Informations fax")}'
- layout='{new GridLayout(0,1)}'>
- <JLabel text="Télécopie reçue le 10/01/2014 à 13:37"/>
- <JLabel text="Origine : 02 34 56 78 90"/>
- <JLabel text="Nombre de pages : 1, durée : 13 secondes, vitesse : 31200"/>
- <JLabel text="Numéro SDA : 6374"/>
- </JPanel>
-
</JPanel>
</JScrollPane>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -24,6 +24,10 @@
* #L%
*/
+import com.franciaflex.faxtomail.persistence.entities.Company;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.content.search.SearchUI;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
@@ -34,6 +38,12 @@
import javax.swing.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
import static org.nuiton.i18n.I18n.t;
/**
@@ -66,17 +76,31 @@
*/
// private final PersistenceService persistenceService;
+ @Override
+ public void beforeInit(DemandeUI ui) {
+ super.beforeInit(ui);
+
+ DemandeUIModel model = new DemandeUIModel();
+ model.fromBean(getContext().getCurrentEmail());
+ log.debug(model.getDemandStatus());
+
+ this.ui.setContextValue(model);
+ }
+
@Override
public void afterInit(DemandeUI ui) {
initUI(ui);
- initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
- initBeanFilterableComboBox(ui.getStatusComboBox(), createLabelList("Non traité", "En cours", "Clos"), null);
- initBeanFilterableComboBox(ui.getPriorityComboBox(), createLabelList("Basse", "Normale", "Haute", "Urgente"), null);
- initBeanFilterableComboBox(ui.getGammeComboBox(), createLabelList("FFE"), null);
+ DemandeUIModel model = getModel();
+ ReferentielService referentielService = getContext().getReferentielService();
+ initBeanFilterableComboBox(ui.getDocTypeComboBox(), referentielService.getAllDemandType(), model.getDemandType());
+ initBeanFilterableComboBox(ui.getStatusComboBox(), referentielService.getAllDemandStatus(), model.getDemandStatus());
+ initBeanFilterableComboBox(ui.getPriorityComboBox(), referentielService.getAllPriority(), model.getPriority());
+ initBeanFilterableComboBox(ui.getGammeComboBox(), referentielService.getAllRange(), null);
+
}
@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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,9 +1,190 @@
package com.franciaflex.faxtomail.ui.swing.content.demande;
+import com.franciaflex.faxtomail.persistence.entities.Client;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.DemandType;
+import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.util.Date;
+
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
*/
-public class DemandeUIModel {
+public class DemandeUIModel extends AbstractFaxToMailBeanUIModel<Email, DemandeUIModel> {
+ protected final Email editObject = new EmailImpl();
+
+ protected static Binder<DemandeUIModel, Email> toBeanBinder =
+ BinderFactory.newBinder(DemandeUIModel.class,
+ Email.class);
+
+ protected static Binder<Email, DemandeUIModel> fromBeanBinder =
+ BinderFactory.newBinder(Email.class, DemandeUIModel.class);
+
+ public DemandeUIModel() {
+ super(fromBeanBinder, toBeanBinder);
+ }
+
+ public void setSavNumber(String savNumber) {
+ Object oldValue = getSavNumber();
+ editObject.setSavNumber(savNumber);
+ firePropertyChanged(Email.PROPERTY_SAV_NUMBER, oldValue, savNumber);
+ }
+
+ public String getSavNumber() {
+ return editObject.getSavNumber();
+ }
+
+ public void setSenderEmailAddress(String senderEmailAddress) {
+ Object oldValue = getSenderEmailAddress();
+ editObject.setSenderEmailAddress(senderEmailAddress);
+ firePropertyChanged(Email.PROPERTY_SENDER_EMAIL_ADDRESS, oldValue, senderEmailAddress);
+ }
+
+ public String getSenderEmailAddress() {
+ return editObject.getSenderEmailAddress();
+ }
+
+ public void setSenderFaxNumber(String senderFaxNumber) {
+ Object oldValue = getSenderFaxNumber();
+ editObject.setSenderFaxNumber(senderFaxNumber);
+ firePropertyChanged(Email.PROPERTY_SENDER_FAX_NUMBER, oldValue, senderFaxNumber);
+ }
+
+ public String getSenderFaxNumber() {
+ return editObject.getSenderFaxNumber();
+ }
+
+ public void setReceptionEmailAddress(String receptionEmailAddress) {
+ Object oldValue = getReceptionEmailAddress();
+ editObject.setReceptionEmailAddress(receptionEmailAddress);
+ firePropertyChanged(Email.PROPERTY_RECEPTION_EMAIL_ADDRESS, oldValue, receptionEmailAddress);
+ }
+
+ public String getReceptionEmailAddress() {
+ return editObject.getReceptionEmailAddress();
+ }
+
+ public void setObject(String object) {
+ Object oldValue = getObject();
+ editObject.setObject(object);
+ firePropertyChanged(Email.PROPERTY_OBJECT, oldValue, object);
+ }
+
+ public String getObject() {
+ return editObject.getObject();
+ }
+
+ public void setClient(Client client) {
+ Object oldValue = getClient();
+ editObject.setClient(client);
+ firePropertyChanged(Email.PROPERTY_CLIENT, oldValue, client);
+ }
+
+ public Client getClient() {
+ return editObject.getClient();
+ }
+
+ public void setEtatAttente(EtatAttente etatAttente) {
+ Object oldValue = getEtatAttente();
+ editObject.setEtatAttente(etatAttente);
+ firePropertyChanged(Email.PROPERTY_ETAT_ATTENTE, oldValue, etatAttente);
+ }
+
+ public EtatAttente getEtatAttente() {
+ return editObject.getEtatAttente();
+ }
+
+ public void setFaxToMailUser(FaxToMailUser faxToMailUser) {
+ Object oldValue = getFaxToMailUser();
+ editObject.setFaxToMailUser(faxToMailUser);
+ firePropertyChanged(Email.PROPERTY_FAX_TO_MAIL_USER, oldValue, faxToMailUser);
+ }
+
+ public FaxToMailUser getFaxToMailUser() {
+ return editObject.getFaxToMailUser();
+ }
+
+ public Priority getPriority() {
+ return editObject.getPriority();
+ }
+
+ public void setPriority(Priority priority) {
+ Object oldValue = getPriority();
+ editObject.setPriority(priority);
+ firePropertyChanged(Email.PROPERTY_PRIORITY, oldValue, priority);
+ }
+
+ public DemandType getDemandType() {
+ return editObject.getDemandType();
+ }
+
+ public void setDemandType(DemandType demandType) {
+ Object oldValue = getDemandType();
+ editObject.setDemandType(demandType);
+ firePropertyChanged(Email.PROPERTY_DEMAND_TYPE, oldValue, demandType);
+ }
+
+ public DemandStatus getDemandStatus() {
+ return editObject.getDemandStatus();
+ }
+
+ public void setDemandStatus(DemandStatus demandStatus) {
+ Object oldValue = getDemandStatus();
+ editObject.setDemandStatus(demandStatus);
+ firePropertyChanged(Email.PROPERTY_DEMAND_STATUS, oldValue, demandStatus);
+ }
+
+ public void setReceptionDate(Date receptionDate) {
+ Object oldValue = getReceptionDate();
+ editObject.setReceptionDate(receptionDate);
+ firePropertyChanged(Email.PROPERTY_RECEPTION_DATE, oldValue, receptionDate);
+ }
+
+ public Date getReceptionDate() {
+ return editObject.getReceptionDate();
+ }
+
+ public void setEdiCodeNumber(String ediCodeNumber) {
+ Object oldValue = getEdiCodeNumber();
+ editObject.setEdiCodeNumber(ediCodeNumber);
+ firePropertyChanged(Email.PROPERTY_EDI_CODE_NUMBER, oldValue, ediCodeNumber);
+ }
+
+ public String getEdiCodeNumber() {
+ return editObject.getEdiCodeNumber();
+ }
+
+ public void setCommandNb(String commandNb) {
+ Object oldValue = getCommandNb();
+ editObject.setCommandNb(commandNb);
+ firePropertyChanged(Email.PROPERTY_COMMAND_NB, oldValue, commandNb);
+ }
+
+ public String getCommandNb() {
+ return editObject.getCommandNb();
+ }
+
+ public void setProjectReference(String projectReference) {
+ Object oldValue = getProjectReference();
+ editObject.setProjectReference(projectReference);
+ firePropertyChanged(Email.PROPERTY_PROJECT_REFERENCE, oldValue, projectReference);
+ }
+
+ public String getProjectReference() {
+ return editObject.getProjectReference();
+ }
+
+ @Override
+ protected Email newEntity() {
+ return new EmailImpl();
+ }
}
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/FolderTreeNode.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,26 @@
+package com.franciaflex.faxtomail.ui.swing.content.demande;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class FolderTreeNode extends DefaultMutableTreeNode {
+
+ public FolderTreeNode(MailFolder folder) {
+ super(folder);
+ }
+
+ public MailFolder getMailFolder() {
+ return (MailFolder) userObject;
+ }
+
+ @Override
+ public String toString() {
+ MailFolder folder = (MailFolder) userObject;
+ return folder.getName();
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-12 17:16:05 UTC (rev 9)
@@ -5,8 +5,9 @@
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
- com.franciaflex.faxtomail.ui.swing.util.Label
+ com.franciaflex.faxtomail.persistence.entities.HasLabel
+
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
org.jdesktop.swingx.JXDatePicker
@@ -34,7 +35,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='modifiedByComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
@@ -107,7 +108,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='statusComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
@@ -135,7 +136,7 @@
<cell weightx='1'>
<BeanFilterableComboBox id='docTypeComboBox'
constructorParams='this'
- genericType="Label"/>
+ genericType="HasLabel"/>
</cell>
<cell>
</cell>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,13 +1,12 @@
package com.franciaflex.faxtomail.ui.swing.util;
import com.franciaflex.faxtomail.FaxToMailConfiguration;
-import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -18,6 +17,7 @@
import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -81,8 +81,8 @@
Decorator decorator = decoratorService.getDecoratorByType(type, name);
if (decorator == null) {
- if (LabelAware.class.isAssignableFrom(type)) {
- decorator = getDecorator(LabelAware.class, null);
+ if (HasLabel.class.isAssignableFrom(type)) {
+ decorator = getDecorator(HasLabel.class, null);
}
}
Preconditions.checkNotNull(decorator);
@@ -188,10 +188,15 @@
ui.getHandler().onCloseUI();
}
- protected List<Label> createLabelList(String... labels) {
- List<Label> labelList = Lists.newArrayList();
- for (String label : labels) {
- labelList.add(new Label(label));
+ protected List<HasLabel> createLabelList(String... labels) {
+ List<HasLabel> labelList = new ArrayList<HasLabel>();
+ for (final String label : labels) {
+ labelList.add(new HasLabel() {
+ @Override
+ public String getLabel() {
+ return label;
+ }
+ });
}
return labelList;
}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -1,21 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util;
-
-import com.franciaflex.faxtomail.LabelAware;
-
-/**
- * @author kmorin <kmorin(a)codelutin.com>
- * @since x.x
- */
-public class Label implements LabelAware {
-
- String label;
-
- public Label(String label) {
- this.label = label;
- }
-
- @Override
- public String getLabel() {
- return label;
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -66,18 +66,49 @@
faxtomail.demande.client.label=
faxtomail.demande.demandeNumber.label=
faxtomail.demande.docType.label=
+faxtomail.demande.ediCodeNumber.label=
+faxtomail.demande.etatAttente.label=
+faxtomail.demande.finishedProducts.label=
faxtomail.demande.gamme.label=
faxtomail.demande.message.label=
faxtomail.demande.object.label=
faxtomail.demande.print.button.label=
faxtomail.demande.priority.label=
+faxtomail.demande.projectReference.label=
faxtomail.demande.received.label=
+faxtomail.demande.receivedDate.label=
faxtomail.demande.ref.label=
+faxtomail.demande.savNumber.label=
faxtomail.demande.save.button.label=
+faxtomail.demande.sender.label=
faxtomail.demande.status.label=
faxtomail.demande.tcc.label=
faxtomail.demande.title=
faxtomail.demande.transmit.button.label=
+faxtomail.demandeList.action.attachment=
+faxtomail.demandeList.action.attachment.mnemonic=
+faxtomail.demandeList.action.attachment.tip=
+faxtomail.demandeList.action.print=
+faxtomail.demandeList.action.print.mnemonic=
+faxtomail.demandeList.action.print.tip=
+faxtomail.demandeList.action.reply=
+faxtomail.demandeList.action.reply.mnemonic=
+faxtomail.demandeList.action.reply.tip=
+faxtomail.demandeList.table.header.client=
+faxtomail.demandeList.table.header.commandNb=
+faxtomail.demandeList.table.header.ediCodeNumber=
+faxtomail.demandeList.table.header.folder=
+faxtomail.demandeList.table.header.object=
+faxtomail.demandeList.table.header.priority=
+faxtomail.demandeList.table.header.projectReference=
+faxtomail.demandeList.table.header.range=
+faxtomail.demandeList.table.header.receptionDate=
+faxtomail.demandeList.table.header.savNumber=
+faxtomail.demandeList.table.header.senderEmail=
+faxtomail.demandeList.table.header.status=
+faxtomail.demandeList.table.header.type=
+faxtomail.demandeList.table.header.user=
+faxtomail.demandeList.table.header.waitingState=
faxtomail.demandeList.title=
faxtomail.error.delete.startActionFile=
faxtomail.error.errorpane.htmlmessage=
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -62,20 +62,48 @@
faxtomail.demande.archive.button.label=Archiver
faxtomail.demande.back.button.label=Retour
faxtomail.demande.client.label=Client
-faxtomail.demande.demandeNumber.label=N° Devis/Commande
+faxtomail.demande.demandeNumber.label=N° Devis/Cde
faxtomail.demande.docType.label=Type
+faxtomail.demande.ediCodeNumber.label=Retour EDI
+faxtomail.demande.etatAttente.label=État attente
+faxtomail.demande.finishedProducts.label=Produits finis
faxtomail.demande.gamme.label=Gamme
faxtomail.demande.message.label=Message
faxtomail.demande.object.label=Objet
faxtomail.demande.print.button.label=Imprimer
faxtomail.demande.priority.label=Priorité
-faxtomail.demande.received.label=Reçu le
-faxtomail.demande.ref.label=Rèf
+faxtomail.demande.projectReference.label=Référence travaux
+faxtomail.demande.receivedDate.label=Reçu le
+faxtomail.demande.savNumber.label=SAV
faxtomail.demande.save.button.label=Enregistrer
+faxtomail.demande.sender.label=Émetteur
faxtomail.demande.status.label=Statut
-faxtomail.demande.tcc.label=Tcc par
faxtomail.demande.title=Demande
faxtomail.demande.transmit.button.label=Transmettre
+faxtomail.demandeList.action.attachment=Ajouter une pièce-jointe
+faxtomail.demandeList.action.attachment.mnemonic=A
+faxtomail.demandeList.action.attachment.tip=Ajouter une pièce-jointe
+faxtomail.demandeList.action.print=Imprimer
+faxtomail.demandeList.action.print.mnemonic=I
+faxtomail.demandeList.action.print.tip=Imprimer
+faxtomail.demandeList.action.reply=Répondre
+faxtomail.demandeList.action.reply.mnemonic=R
+faxtomail.demandeList.action.reply.tip=Répondre
+faxtomail.demandeList.table.header.client=Client
+faxtomail.demandeList.table.header.commandNb=Numéro de commande
+faxtomail.demandeList.table.header.ediCodeNumber=Code EDI
+faxtomail.demandeList.table.header.folder=Dossier
+faxtomail.demandeList.table.header.object=Objet
+faxtomail.demandeList.table.header.priority=Priorité
+faxtomail.demandeList.table.header.projectReference=Référence travaux
+faxtomail.demandeList.table.header.range=Gamme
+faxtomail.demandeList.table.header.receptionDate=Date de réception
+faxtomail.demandeList.table.header.savNumber=Numéro SAV
+faxtomail.demandeList.table.header.senderEmail=Email de l'émetteur
+faxtomail.demandeList.table.header.status=Statut
+faxtomail.demandeList.table.header.type=Type
+faxtomail.demandeList.table.header.user=Pris pas
+faxtomail.demandeList.table.header.waitingState=État attente
faxtomail.demandeList.title=Gestion des fax
faxtomail.error.delete.startActionFile=
faxtomail.error.errorpane.htmlmessage=
@@ -129,17 +157,5 @@
swing.error.desktop.browse.not.supported=
swing.error.desktop.mail.not.supported=
swing.error.desktop.not.supported=
-tutti.action.create.error=
-tutti.db.deleteCache.error=
-tutti.editCruise.askCancelEditBeforeLeaving.cancelSaveCruise=
-tutti.editCruise.askSaveBeforeLeaving.saveCruise=
tutti.editCruise.title.create.cruise=
tutti.editCruise.title.edit.cruise=
-tutti.error.ui.business.error=
-tutti.help.mkDir.error=
-tutti.main.title.noSelectedCruise=
-tutti.main.title.noSelectedProgram=
-tutti.main.title.noSelectedProtocol=
-tutti.main.title.selectedCruise=
-tutti.main.title.selectedProgram=
-tutti.main.title.selectedProtocol=
Copied: trunk/faxtomail-ui-swing/src/main/resources/log4j.properties (from rev 7, trunk/faxtomail-ui-web/src/main/resources/log4j.properties)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/log4j.properties (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/resources/log4j.properties 2014-02-12 17:16:05 UTC (rev 9)
@@ -0,0 +1,15 @@
+log4j.rootCategory=WARN, console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %M %m%n
+
+# global level
+log4j.logger.com.franciaflex.faxtomail=TRACE
+
+### persistence level
+# log4j.logger.org.nuiton.topia=TRACE
+# log4j.logger.com.franciaflex.faxtomail.persistence=TRACE
+
+### services level
+# log4j.logger.com.franciaflex.faxtomail.services=TRACE
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-02-11 10:12:54 UTC (rev 8)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-12 17:16:05 UTC (rev 9)
@@ -150,11 +150,21 @@
public Map<String, String> getEmailFields() {
Map<String, String> result = new HashMap<>();
- result.put(Email.PROPERTY_EMAIL_ADDRESS, "Adresse email");
+ result.put(Email.PROPERTY_SENDER_EMAIL_ADDRESS, "Adresse email");
result.put(Email.PROPERTY_RECEPTION_DATE, "Date de réception");
result.put(Email.PROPERTY_EDI_CODE_NUMBER, "Code EDI");
result.put(Email.PROPERTY_COMMAND_NB, "Numéro de commande");
- result.put(Email.PROPERTY_PROJECT_REFERENCE, "Référence travaux");
+ result.put(Email.PROPERTY_OBJECT, "Objet");
+ result.put(Email.PROPERTY_PROJECT_REFERENCE, "Référence travaux");
+ result.put(Email.PROPERTY_PRIORITY, "Priorité");
+ result.put(Email.PROPERTY_SAV_NUMBER, "Numéro SAV");
+ result.put(Email.PROPERTY_RANGE, "Gamme");
+ result.put(Email.PROPERTY_MAIL_FOLDER, "Dossier");
+ result.put(Email.PROPERTY_CLIENT, "Client");
+ result.put(Email.PROPERTY_DEMAND_STATUS, "Statut");
+ result.put(Email.PROPERTY_DEMAND_TYPE, "Type");
+ result.put(Email.PROPERTY_FAX_TO_MAIL_USER, "Pris par");
+ result.put(Email.PROPERTY_ETAT_ATTENTE, "État attente");
return result;
}
1
0
11 Feb '14
Author: kmorin
Date: 2014-02-11 11:12:54 +0100 (Tue, 11 Feb 2014)
New Revision: 8
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/8
Log:
web admin part
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entity/
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
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.jsp
trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -29,6 +29,7 @@
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import com.franciaflex.faxtomail.services.service.MailFilterService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
import java.util.Date;
@@ -73,4 +74,7 @@
public MailFolderService getMailFolderService() {
return newService(MailFolderService.class);
}
+ public MailFilterService getMailFilterService() {
+ return newService(MailFilterService.class);
+ }
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/CompanyService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -3,13 +3,22 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+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.Collections2;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
+import java.util.Map;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -21,7 +30,7 @@
public List<Company> getAllCompanies() {
CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
- List<Company> companies = Lists.newArrayList(dao.findAll());
+ List<Company> companies = new ArrayList<>(dao.findAll());
return companies;
}
@@ -31,14 +40,27 @@
return company;
}
- public Company saveCompany(Company company) {
+ public Company saveCompany(Company company, Collection<MailFolder> mailFolders, Map<MailFilter, String> mailFilters) {
Preconditions.checkNotNull(company);
+
ConfigurationService configurationService = getConfigurationService();
configurationService.saveConfiguration(company.getConfiguration());
MailFolderService mailFolderService = getMailFolderService();
- mailFolderService.saveMailFolders(company.getMailFolder());
+ mailFolders = mailFolderService.saveMailFolders(mailFolders);
+ company.setMailFolder(mailFolders);
+ if (mailFilters != null) {
+ Map<String, MailFolder> foldersById = Maps.uniqueIndex(mailFolders, TopiaEntities.getTopiaIdFunction());
+ for (MailFilter filter : mailFilters.keySet()) {
+ MailFolder folder = foldersById.get(mailFilters.get(filter));
+ filter.setMailFolder(folder);
+ }
+ }
+ MailFilterService mailFilterService = getMailFilterService();
+ Collection<MailFilter> filters = mailFilterService.saveMailFilters(mailFilters.keySet());
+ company.setMailFilter(filters);
+
CompanyTopiaDao dao = getPersistenceContext().getCompanyDao();
company = dao.update(company);
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-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -28,6 +28,10 @@
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -114,6 +118,29 @@
log.debug("sample data " + companyTopiaDao.count());
}
+ FaxToMailUserGroupTopiaDao userGroupDao = getPersistenceContext().getFaxToMailUserGroupDao();
+ count = userGroupDao.count();
+ if (count == 0) {
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Chargés de clientèle");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Commerciaux");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "SAV");
+ userGroupDao.create(FaxToMailUserGroup.PROPERTY_NAME, "Administrateurs");
+
+ getPersistenceContext().commit();
+ }
+
+ FaxToMailUserTopiaDao userDao = getPersistenceContext().getFaxToMailUserDao();
+ count = userDao.count();
+ if (count == 0) {
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Marc Lefebvre", FaxToMailUser.PROPERTY_LOGIN, "mlefebvre");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Cyril Baillet", FaxToMailUser.PROPERTY_LOGIN, "cbaillet");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Frédéric Viala", FaxToMailUser.PROPERTY_LOGIN, "fviala");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Claire Marquis", FaxToMailUser.PROPERTY_LOGIN, "cmarquis");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Agathe Borde", FaxToMailUser.PROPERTY_LOGIN, "aborde");
+ userDao.create(FaxToMailUser.PROPERTY_NAME, "Jeanne Bourgoin", FaxToMailUser.PROPERTY_LOGIN, "jbourgoin");
+
+ getPersistenceContext().commit();
+ }
}
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFilterService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,41 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class MailFilterService extends FaxToMailServiceSupport {
+
+ public Collection<MailFilter> saveMailFilters(Collection<MailFilter> mailFilters) {
+ MailFilterTopiaDao dao = getPersistenceContext().getMailFilterDao();
+
+ Collection<MailFilter> result = new ArrayList<>();
+ for (MailFilter mailFilter : mailFilters) {
+
+ MailFilter filter;
+ boolean create = mailFilter.getTopiaId() == null;
+ if (create) {
+ filter = dao.newInstance();
+ } else {
+ filter = dao.findByTopiaId(mailFilter.getTopiaId());
+ }
+ filter.setExpression(mailFilter.getExpression());
+ filter.setMailFolder(mailFilter.getMailFolder());
+
+ if (create) {
+ filter = dao.create(filter);
+ } else {
+ filter = dao.update(filter);
+ }
+ result.add(filter);
+ }
+ return result;
+ }
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -8,7 +8,9 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaIdFactory;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -18,6 +20,11 @@
private static final Log log = LogFactory.getLog(MailFolderService.class);
+ public List<MailFolder> getMailFolders(Collection<String> ids) {
+ MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
+ return new ArrayList<MailFolder>(dao.forTopiaIdIn(ids).findAll());
+ }
+
public Collection<MailFolder> saveMailFolders(Collection<MailFolder> mailFolders) {
if (mailFolders == null) {
return null;
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/UserService.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,27 @@
+package com.franciaflex.faxtomail.services.service;
+
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
+import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since x.x
+ */
+public class UserService extends FaxToMailServiceSupport {
+
+ public List<FaxToMailUser> getAllUsers() {
+ FaxToMailUserTopiaDao dao = getPersistenceContext().getFaxToMailUserDao();
+ return new ArrayList<>(dao.findAll());
+ }
+
+ public List<FaxToMailUserGroup> getAllUserGroups() {
+ FaxToMailUserGroupTopiaDao dao = getPersistenceContext().getFaxToMailUserGroupDao();
+ return new ArrayList<>(dao.findAll());
+ }
+}
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-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -24,7 +24,10 @@
protected static FaxToMailConfiguration applicationConfig;
public static FaxToMailConfiguration getApplicationConfig() {
- return FaxToMailConfiguration.getInstance();
+ if (applicationConfig == null) {
+ applicationConfig = new FaxToMailConfiguration("faxtomail.properties");
+ }
+ return applicationConfig;
}
public static FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
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-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-02-11 10:12:54 UTC (rev 8)
@@ -1,35 +1,44 @@
package com.franciaflex.faxtomail.web.action.admin;
import com.franciaflex.faxtomail.persistence.entities.Company;
-import com.franciaflex.faxtomail.persistence.entities.Configuration;
-import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterAbstract;
+import com.franciaflex.faxtomail.persistence.entities.MailFilterImpl;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.MailFolderAbstract;
import com.franciaflex.faxtomail.persistence.entities.MailFolderImpl;
import com.franciaflex.faxtomail.services.service.CompanyService;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+import com.franciaflex.faxtomail.services.service.UserService;
import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.GsonBuilder;
-import com.google.gson.InstanceCreator;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
-import com.google.gson.TypeAdapter;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonToken;
-import com.google.gson.stream.JsonWriter;
import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.collections4.ComparatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaIdFactory;
-import org.nuiton.topia.persistence.internal.DefaultTopiaIdFactory;
+import org.nuiton.topia.persistence.TopiaEntities;
-import java.io.IOException;
import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -43,12 +52,24 @@
protected CompanyService companyService;
+ protected MailFolderService mailFolderService;
+
+ protected UserService userService;
+
protected List<Company> companies;
protected Company company;
protected List<MailFolder> mailFolders;
+ protected Map<String, String> mailFoldersFlat;
+
+ protected List<MailFilterUIBean> mailFilters;
+
+ protected List<FaxToMailUser> allUsers;
+
+ protected List<FaxToMailUserGroup> allUserGroups;
+
protected String activeTab;
@Override
@@ -63,12 +84,19 @@
@Override
public String execute() throws Exception {
- log.debug("execute " + company);
String result = super.execute();
+
if (!ERROR.equals(result)) {
if (company != null) {
- company.setMailFolder(mailFolders);
- companyService.saveCompany(company);
+ log.debug(company.getMailFilter());
+ Map<MailFilter, String> folderIdByFilter = new HashMap<>();
+ if (mailFilters != null) {
+ for (MailFilterUIBean filter : mailFilters) {
+ String folderId = filter.getMailFolderId();
+ folderIdByFilter.put(filter, folderId);
+ }
+ }
+ companyService.saveCompany(company, mailFolders, folderIdByFilter);
}
result = INPUT;
}
@@ -79,8 +107,15 @@
this.companyService = companyService;
}
+ public void setMailFolderService(MailFolderService mailFolderService) {
+ this.mailFolderService = mailFolderService;
+ }
+
+ public void setUserService(UserService userService) {
+ this.userService = userService;
+ }
+
public void setCompanyId(String companyId) {
- log.debug("set company " + companyId);
if (StringUtils.isNotEmpty(companyId)) {
this.company = companyService.getCompany(companyId);
}
@@ -98,7 +133,6 @@
}
public Company getCompany() {
- log.debug("getCompany " + company);
return company;
}
@@ -115,7 +149,7 @@
}
public Map<String, String> getEmailFields() {
- Map<String, String> result = Maps.newHashMap();
+ Map<String, String> result = new HashMap<>();
result.put(Email.PROPERTY_EMAIL_ADDRESS, "Adresse email");
result.put(Email.PROPERTY_RECEPTION_DATE, "Date de réception");
result.put(Email.PROPERTY_EDI_CODE_NUMBER, "Code EDI");
@@ -129,21 +163,81 @@
return null;
}
GsonBuilder gsonBuilder = new GsonBuilder();
- String mailFodlers = gsonBuilder.create().toJson(company.getMailFolder());
- log.debug("getFolderTreeAsJson " + mailFodlers);
- return mailFodlers;
+ String mailFolders = gsonBuilder.create().toJson(company.getMailFolder());
+ return mailFolders;
}
public void setFoldersTreeAsJson(String json) {
- log.debug("setFoldersTreeAsJson " + json);
GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(MailFolder.class, new MailFolderDeserializer());
- mailFolders = Lists.newArrayList((MailFolder[])gsonBuilder.create().fromJson(json, MailFolder[].class));
- log.debug("mailfolders " + mailFolders);
- if (!mailFolders.isEmpty()) {
- log.debug("name : " + mailFolders.get(0).getName());
+ mailFolders = Arrays.asList((MailFolder[])gsonBuilder.create().fromJson(json, MailFolder[].class));
+ log.debug(mailFolders);
+ }
+
+ public Map<String, String> getAllFoldersFlat() {
+ if (mailFoldersFlat == null) {
+ mailFoldersFlat = new LinkedHashMap<>();
+ if (company.getMailFolder() != null) {
+ List<MailFolder> folders = new ArrayList<>(company.getMailFolder());
+ Collections.sort(folders, new Comparator<MailFolder>() {
+ @Override
+ public int compare(MailFolder o1, MailFolder o2) {
+ return ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName());
+ }
+ });
+ for (MailFolder folder : folders) {
+ mailFoldersFlat.putAll(getAllFoldersFlat(folder, ""));
+ }
+ }
}
+ return mailFoldersFlat;
}
+ public List<MailFilterUIBean> getMailFilters() {
+ if (mailFilters == null) {
+ mailFilters = new ArrayList<>();
+ }
+ return mailFilters;
+ }
+
+ public void setMailFilters(List<MailFilterUIBean> mailFilters) {
+ this.mailFilters = mailFilters;
+ }
+
+ public List<FaxToMailUser> getAllUsers() {
+ if (allUsers == null) {
+ allUsers = userService.getAllUsers();
+ }
+ return allUsers;
+ }
+
+ public List<FaxToMailUserGroup> getAllUserGroups() {
+ if (allUserGroups == null) {
+ allUserGroups = userService.getAllUserGroups();
+ }
+ return allUserGroups;
+ }
+
+ protected Map<String, String> getAllFoldersFlat(MailFolder mailFolder, String prefix) {
+ Map<String, String> result = new LinkedHashMap<>();
+ prefix += "/" + mailFolder.getName();
+ result.put(mailFolder.getTopiaId(), prefix);
+ log.debug(prefix);
+
+ if (mailFolder.getChildren() != null) {
+ List<MailFolder> children = new ArrayList<>(mailFolder.getChildren());
+ Collections.sort(children, new Comparator<MailFolder>() {
+ @Override
+ public int compare(MailFolder o1, MailFolder o2) {
+ return ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName());
+ }
+ });
+ for (MailFolder child : children) {
+ result.putAll(getAllFoldersFlat(child, prefix));
+ }
+ }
+ return result;
+ }
+
protected class MailFolderDeserializer implements JsonDeserializer<MailFolder> {
@Override
@@ -155,7 +249,7 @@
mailFolder.setName(name);
MailFolder[] children = context.deserialize(o.get(MailFolder.PROPERTY_CHILDREN), MailFolder[].class);
- List<MailFolder> mailFolders = Lists.newArrayList(children);
+ List<MailFolder> mailFolders = Arrays.asList(children);
mailFolder.setChildren(mailFolders);
String topiaId = o.get(MailFolder.PROPERTY_TOPIA_ID).getAsString();
@@ -164,4 +258,17 @@
return mailFolder;
}
}
+
+ public static class MailFilterUIBean extends MailFilterImpl {
+
+ protected String mailFolderId;
+
+ public String getMailFolderId() {
+ return mailFolderId;
+ }
+
+ public void setMailFolderId(String mailFolderId) {
+ this.mailFolderId = mailFolderId;
+ }
+ }
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp 2014-02-11 10:12:54 UTC (rev 8)
@@ -9,132 +9,24 @@
<script type="text/javascript" src="<s:url value='/js/select2/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/jstree/jstree.js' />"></script>
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/jstree/themes/default/style.min.css' />" />
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
<script>
-
- var createNewNode = function() {
- $('.jstree').jstree(true).create_node('#', 'Nouvelle racine');
- }
-
- var formatToSendData = function(mailFolders) {
- var result = [];
- for (var i = 0 ; i < mailFolders.length ; i++) {
- var mailFolder = mailFolders[i];
- var children = formatToSendData(mailFolder.children);
- result.push({ name: mailFolder.text, children: children, topiaId: mailFolder.id });
- }
- return result;
- }
-
- var formatReceivedData = function(mailFolders) {
- var result = [];
- for (var i = 0 ; i < mailFolders.length ; i++) {
- var mailFolder = mailFolders[i];
- var children = formatReceivedData(mailFolder.children);
- result.push({ text: mailFolder.name, children: children, id: mailFolder.topiaId });
- }
- return result;
- }
-
var emailFields = {};
<s:iterator value="emailFields">
- emailFields["<s:property value='key'/>"] = "<s:property value='value'/>";
+ emailFields["<s:property value='key'/>"] = "<s:property value='value' escapeHtml='false'/>";
</s:iterator>
- var updateTableSnapshot = function() {
- var tableHeader = $("#table-snapshot thead tr");
- tableHeader.empty();
- var value = $("#tableColumns").val();
- if (value) {
- var columns = value.split(",");
- for (var i = 0 ; i < columns.length ; i++) {
- tableHeader.append("<th>" + emailFields[columns[i]] + "</th>");
- }
- }
- }
+ var folderData = JSON.parse('<s:property value="foldersTreeAsJson" escapeHtml="false"/>');
+ </script>
+ <script type="text/javascript" src="<s:url value='/js/configuration.js' />"></script>
- $().ready(function() {
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/jstree/themes/default/style.min.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
- $('a[data-toggle="tab"]').on('shown', function (e) {
- var hash = e.target.hash;
- $(":input[name='activeTab']").val(hash);
-
- /*if (hash == "#tabs-3") {
- $('#treeDiagram').jstree(true).refresh();
-
- } else if (hash == "#tabs-4") {
- $('#treeDiagram2choose').jstree(true).refresh();
- }*/
- });
-
- var hash = $(":input[name='activeTab']").val();
- if (!hash) {
- hash = "#tabs-1";
- }
- $('#tabs a[href="' + hash + '"]').tab('show');
-
- // table columns
-
- $('#tableColumns').select2({tags:[
- <s:iterator value="emailFields">
- { id: "<s:property value='key'/>", text: "<s:property value='value' escapeHtml='false'/>" },
- </s:iterator>
- ]}).on("change", function(e) {
- console.log(e.val)
- updateTableSnapshot();
- });
-
- $("#tableColumns").select2("container").find("ul.select2-choices").sortable({
- containment: 'parent',
- start: function() { $("#tableColumns").select2("onSortStart"); },
- update: function() { $("#tableColumns").select2("onSortEnd"); }
- });
-
- updateTableSnapshot();
-
- // tree diagram
-
- var folderData = JSON.parse('<s:property value="foldersTreeAsJson" escapeHtml="false"/>');
- folderData = formatReceivedData(folderData);
-
- $.jstree.defaults.core.themes.variant = "large";
- // so that create works
- $.jstree.defaults.core.check_callback = true;
- $.jstree.defaults.core.multiple = false;
-
- $('#treeDiagram').jstree({
- core: {
- data: folderData
- },
- state: { key: "faxtomail-treeDiagram" },
- plugins: [ "contextmenu", "sort", "state", "unique", "dnd" ]
- });
-
- $('#treeDiagram2choose').jstree({
- core: {
- data: folderData
- },
- state: { key: "faxtomail-treeDiagram2choose" },
- plugins: [ "sort", "state" ]
- });
-
- $("#main_form").submit(function(event) {
- var mailFolders = $('#treeDiagram').jstree(true).get_json('#', {});
- var foldersAsJson = formatToSendData(mailFolders);
- console.log(foldersAsJson);
-
- var input = $("<input>")
- .attr("type", "hidden")
- .attr("name", "foldersTreeAsJson").val(JSON.stringify(foldersAsJson));
- $('#main_form').append($(input));
- });
- });
- </script>
</head>
<body>
+ <!-- navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
@@ -174,15 +66,17 @@
<s:hidden name="activeTab"/>
<ul id="tabs" class="nav nav-tabs">
- <li><a href="#tabs-1" data-toggle="tab">Général</a></li>
- <li><a href="#tabs-2" data-toggle="tab">Champs du tableau</a></li>
- <li><a href="#tabs-3" data-toggle="tab">Arborescence</a></li>
- <li><a href="#tabs-4" data-toggle="tab">Filtres de mail</a></li>
+ <li><a href="#tabs-general" data-toggle="tab">Général</a></li>
+ <li><a href="#tabs-table" data-toggle="tab">Champs du tableau</a></li>
+ <li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
+ <li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
+ <li><a href="#tabs-rights" data-toggle="tab">Droits</a></li>
+ <li><a href="#tabs-email-accounts" data-toggle="tab">Comptes mails</a></li>
</ul>
<div class="tab-content">
- <div id="tabs-1" class="tab-pane">
+ <div id="tabs-general" class="tab-pane">
<!-- Général -->
<s:checkbox name="company.configuration.sendAknowledgement"
@@ -201,7 +95,7 @@
</div>
- <div id="tabs-2" class="tab-pane">
+ <div id="tabs-table" class="tab-pane">
<!-- Champs du tableau -->
<div class="control-group ">
@@ -225,7 +119,7 @@
</div>
- <div id="tabs-3" class="tab-pane">
+ <div id="tabs-tree" class="tab-pane">
<!-- Tree Diagram -->
<div id="treeDiagram" class="jstree margin-bottom25">
@@ -237,7 +131,7 @@
</div>
- <div id="tabs-4" class="tab-pane">
+ <div id="tabs-filters" class="tab-pane">
<!-- Filtres de mail -->
<table id="filters" class="table table-bordered">
<thead>
@@ -246,16 +140,197 @@
<th>Dossier</th>
</tr>
</thead>
+ <tbody>
+ <s:iterator value="company.mailFilter" status="rowStatus" var="filter">
+ <tr>
+ <td>
+ <s:property value='expression'/>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].expression"
+ value="%{#filter.expression}"/>
+ </td>
+ <td>
+ <s:property value='allFoldersFlat.get(mailFolder.topiaId)'/>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].mailFolderId"
+ value="%{#filter.mailFolder.topiaId}"/>
+ </td>
+ <s:hidden name="mailFilters[%{#rowStatus.index}].topiaId"
+ value="%{#filter.topiaId}"/>
+ </tr>
+ </s:iterator>
+ </tbody>
</table>
- <s:textfield name="newFilterExpression"
- label="Nouveau filtre"/>
+ <fieldset class="margin-bottom25">
+ <legend>Nouveau filtre</legend>
- <div id="treeDiagram2choose" class="jstree">
- </div>
+ <div id="newFilterExpression-group" class="control-group">
+ <label for="newFilterExpression">Expression</label>
+ <div class="controls">
+ <input type="text"
+ id="newFilterExpression"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>/>
+ <span id="newFilterExpression-help" class="help-inline"></span>
+ </div>
+ </div>
+ <div id="newFilterFolder-group" class="control-group">
+ <label for="newFilterFolder">Dossier de destination</label>
+ <div class="controls">
+ <select id="newFilterFolder"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <s:iterator value="allFoldersFlat">
+ <option value="<s:property value='key'/>"><s:property value='value'/></option>
+ </s:iterator>
+ </select>
+ <span id="newFilterFolder-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewFilter()" <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
</div>
+ <div id="tabs-rights" class="tab-pane">
+ <!-- Droits d'accès -->
+ <table id="rights" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Utilisateur ou groupe</th>
+ <th>Dossier</th>
+ <th>Type</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <fieldset class="margin-bottom25">
+
+ <legend>Nouveau droit</legend>
+
+ <div id="newRightUser-group" class="control-group">
+ <label for="newRightUser">Utilisateur ou groupe</label>
+ <div class="controls">
+ <select id="newRightUser"
+ class="input-xxlarge"
+ <s:if test="allUsers.isEmpty() && allUserGroups.isEmpty()">disabled</s:if>>
+ <optgroup label="Utilisateurs">
+ <s:iterator value="allUsers">
+ <option value="<s:property value='topiaId'/>"><s:property value='name'/></option>
+ </s:iterator>
+ </optgroup>
+ <optgroup label="Groupes">
+ <s:iterator value="allUserGroups">
+ <option value="<s:property value='topiaId'/>"><s:property value='name'/></option>
+ </s:iterator>
+ </optgroup>
+ </select>
+ <span id="newRightUser-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newRightFolder-group" class="control-group">
+ <label for="newRightFolder">Dossier de destination</label>
+ <div class="controls">
+ <select id="newRightFolder"
+ class="input-xxlarge"
+ <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <s:iterator value="allFoldersFlat">
+ <option value="<s:property value='key'/>"><s:property value='value'/></option>
+ </s:iterator>
+ </select>
+ <span id="newRightFolder-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newRightTypes-group" class="control-group">
+ <label>Types</label>
+ <div class="controls">
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-read" value="READ"/> lecture
+ </label>
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-write" value="WRITE"/> écriture
+ </label>
+ <label class="checkbox inline">
+ <input type="checkbox" id="newRightType-archive" value="ARCHIVE"/> archives
+ </label>
+ <span id="newRightType-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewRight()" <s:if test="allFoldersFlat.isEmpty()">disabled</s:if>>
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
+
+ </div>
+
+ <div id="tabs-email-accounts" class="tab-pane">
+ <!-- Comptes email -->
+ <table id="emailAccounts" class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Nom d'utilisateur</th>
+ <th>Serveur</th>
+ <th>Port</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <fieldset class="margin-bottom25">
+ <legend>Nouveau compte mail</legend>
+
+ <div id="newEmailAccountUsername-group" class="control-group">
+ <label for="newEmailAccountUsername">Nom d'utilisateur</label>
+ <div class="controls">
+ <input type="text"
+ id="newEmailAccountUsername"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountUsername-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newEmailAccountServer-group" class="control-group">
+ <label for="newEmailAccountServer">Serveur</label>
+ <div class="controls">
+ <input type="text"
+ id="newEmailAccountServer"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountServer-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div id="newEmailAccountPort-group" class="control-group">
+ <label for="newEmailAccountPort">Port</label>
+ <div class="controls">
+ <input type="number"
+ id="newEmailAccountPort"
+ class="input-xxlarge"/>
+ <span id="newEmailAccountPort-help" class="help-inline"></span>
+ </div>
+ </div>
+
+ <div>
+ <button class="btn" type="button" onClick="createNewEmailAccount()">
+ <i class="icon-plus"></i> Ajouter
+ </button>
+ </div>
+
+ </fieldset>
+
+ </div>
+
</div>
<div class="form-actions">
@@ -264,7 +339,6 @@
</s:form>
</s:if>
-
</div>
</body>
</html>
Modified: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-02-11 10:12:54 UTC (rev 8)
@@ -21,4 +21,5 @@
}
#treeDiagram {
+ background: #f0f0f0;
}
\ No newline at end of file
Added: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-02-11 10:12:54 UTC (rev 8)
@@ -0,0 +1,238 @@
+/**
+ * adds a new folder in the tree
+ */
+var createNewNode = function() {
+ $('.jstree').jstree(true).create_node('#', 'Nouvelle racine');
+}
+
+/**
+ * adds a new filter in the table
+ */
+var createNewFilter = function() {
+ var filterExpression = $("#newFilterExpression").val();
+ if (!filterExpression) {
+ $("#newFilterExpression-group").addClass("error");
+ $("#newFilterExpression-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newFilterExpression-group").removeClass("error");
+ $("#newFilterExpression-group .help-inline").text("");
+
+ var filterFolderId = $("#newFilterFolder :selected").val();
+ var filterFolder = $("#newFilterFolder :selected").text();
+ if (!filterFolder) {
+ $("#newFilterFolder-group").addClass("error");
+ $("#newFilterFolder-group .help-inline").text("Veuillez sélectionner un dossier");
+ return;
+ }
+ $("#newFilterFolder-group").removeClass("error");
+ $("#newFilterFolder-group .help-inline").text("");
+
+ var index = $("#filters tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ filterExpression +
+ "<input type='hidden' name='mailFilters[" + index + "].expression' value='" + filterExpression + "'/>" +
+ "</td>" +
+ "<td>" +
+ filterFolder +
+ "<input type='hidden' name='mailFilters[" + index + "].mailFolderId' value='" + filterFolderId + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#filters tbody").append(row);
+}
+
+/**
+ * adds a new right in the table
+ */
+var createNewRight = function() {
+ var rightUserId = $("#newRightUser :selected").val();
+ var rightUser = $("#newRightUser :selected").text();
+ if (!rightUser) {
+ $("#newRightUser-group").addClass("error");
+ $("#newRightUser-group .help-inline").text("Veuillez sélectionner au moins un utilisateur");
+ return;
+ }
+ $("#newRightUser-group").removeClass("error");
+ $("#newRightUser-group .help-inline").text("");
+
+ var rightFolderId = $("#newRightFolder :selected").val();
+ var rightFolder = $("#newRightFolder :selected").text();
+ if (!rightFolder) {
+ $("#newRightFolder-group").addClass("error");
+ $("#newRightFolder-group .help-inline").text("Veuillez sélectionner un dossier");
+ return;
+ }
+ $("#newRightFolder-group").removeClass("error");
+ $("#newRightFolder-group .help-inline").text("");
+
+ var rightTypeIds = new Array();
+ var rightTypes = new Array();
+ var checkedTypes = $("#newRightTypes-group :checked");
+ if (checkedTypes.length == 0) {
+ $("#newRightTypes-group").removeClass("error");
+ $("#newRightTypes-group .help-inline").text("");
+ return;
+ }
+ $("#newRightTypes-group").addClass("error");
+ $("#newRightTypes-group .help-inline").text("Veuillez choisir au moins un type");
+ checkedTypes.each(function() {
+ rightTypeIds.push($(this).val());
+ rightTypes.push($(this).parent().text().trim());
+ });
+
+ var index = $("#rights tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ rightUser +
+ "<input type='hidden' name='rights[" + index + "].userId' value='" + rightUserId + "'/>" +
+ "</td>" +
+ "<td>" +
+ rightFolder +
+ "<input type='hidden' name='rights[" + index + "].mailFolderId' value='" + rightFolderId + "'/>" +
+ "</td>" +
+ "<td>" +
+ rightTypes.join(", ") +
+ "<input type='hidden' name='rights[" + index + "].types' value='" + rightTypeIds.join(",") + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#rights tbody").append(row);
+}
+
+var createNewEmailAccount = function() {
+ var emailAccountUsername = $("#newEmailAccountUsername").val();
+ if (!emailAccountUsername) {
+ $("#newEmailAccountUsername-group").addClass("error");
+ $("#newEmailAccountUsername-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountUsername-group").removeClass("error");
+ $("#newEmailAccountUsername-group .help-inline").text("");
+
+ var emailAccountServer = $("#newEmailAccountServer").val();
+ if (!emailAccountServer) {
+ $("#newEmailAccountServer-group").addClass("error");
+ $("#newEmailAccountServer-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountServer-group").removeClass("error");
+ $("#newEmailAccountServer-group .help-inline").text("");
+
+ var emailAccountPort = $("#newEmailAccountPort").val();
+ if (!emailAccountPort) {
+ $("#newEmailAccountPort-group").addClass("error");
+ $("#newEmailAccountPort-group .help-inline").text("Veuillez entrer une valeur");
+ return;
+ }
+ $("#newEmailAccountPort-group").removeClass("error");
+ $("#newEmailAccountPort-group .help-inline").text("");
+
+ var index = $("#emailAccounts tbody tr").length;
+ var row = "<tr>" +
+ "<td>" +
+ emailAccountUsername +
+ "<input type='hidden' name='emailAccounts[" + index + "].username' value='" + emailAccountUsername + "'/>" +
+ "</td>" +
+ "<td>" +
+ emailAccountServer +
+ "<input type='hidden' name='emailAccounts[" + index + "].server' value='" + emailAccountServer + "'/>" +
+ "</td>" +
+ "<td>" +
+ emailAccountPort +
+ "<input type='hidden' name='emailAccounts[" + index + "].port' value='" + emailAccountPort + "'/>" +
+ "</td>" +
+ "</tr>";
+ $("#emailAccounts tbody").append(row);
+ console.log("debig")
+}
+
+var formatToSendData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatToSendData(mailFolder.children);
+ result.push({ name: mailFolder.text, children: children, topiaId: mailFolder.id });
+ }
+ return result;
+}
+
+var formatReceivedData = function(mailFolders) {
+ var result = [];
+ for (var i = 0 ; i < mailFolders.length ; i++) {
+ var mailFolder = mailFolders[i];
+ var children = formatReceivedData(mailFolder.children);
+ result.push({ text: mailFolder.name, children: children, id: mailFolder.topiaId });
+ }
+ return result;
+}
+
+var updateTableSnapshot = function() {
+ var tableHeader = $("#table-snapshot thead tr");
+ tableHeader.empty();
+ var value = $("#tableColumns").val();
+ if (value) {
+ var columns = value.split(",");
+ for (var i = 0 ; i < columns.length ; i++) {
+ tableHeader.append("<th>" + emailFields[columns[i]] + "</th>");
+ }
+ }
+}
+
+$().ready(function() {
+
+ $('a[data-toggle="tab"]').on('shown', function (e) {
+ var hash = e.target.hash;
+ $(":input[name='activeTab']").val(hash);
+ });
+
+ var hash = $(":input[name='activeTab']").val();
+ if (!hash) {
+ hash = "#tabs-general";
+ }
+ $('#tabs a[href="' + hash + '"]').tab('show');
+
+ // table columns
+
+ var tableColumnTags = new Array();
+ for (var k in emailFields) {
+ tableColumnTags.push({ id: k, text: emailFields[k] })
+ }
+ $('#tableColumns').select2({tags:tableColumnTags}).on("change", function(e) {
+ updateTableSnapshot();
+ });
+
+ $("#tableColumns").select2("container").find("ul.select2-choices").sortable({
+ containment: 'parent',
+ start: function() { $("#tableColumns").select2("onSortStart"); },
+ update: function() { $("#tableColumns").select2("onSortEnd"); }
+ });
+
+ updateTableSnapshot();
+
+ // tree diagram
+ folderData = formatReceivedData(folderData);
+
+ $('#treeDiagram').jstree({
+ core: {
+ data: folderData,
+ check_callback: true,
+ multiple: false,
+ themes: {
+ variant: "large"
+ }
+ },
+ state: { key: "faxtomail-treeDiagram" },
+ plugins: [ "contextmenu", "sort", "state", "unique", "dnd" ]
+ });
+
+ $("#main_form").submit(function(event) {
+ var mailFolders = $('#treeDiagram').jstree(true).get_json('#', {});
+ var foldersAsJson = formatToSendData(mailFolders);
+ console.log(foldersAsJson);
+
+ var input = $("<input>")
+ .attr("type", "hidden")
+ .attr("name", "foldersTreeAsJson").val(JSON.stringify(foldersAsJson));
+ $('#main_form').append($(input));
+ });
+});
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
+++ trunk/pom.xml 2014-02-11 10:12:54 UTC (rev 8)
@@ -113,6 +113,9 @@
<license.organizationName>Franciaflex</license.organizationName>
<license.licenseName>gpl_v3</license.licenseName>
+ <!-- Java version -->
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
<!-- Last JRE version to use -->
<jreVersion>1.7.45</jreVersion>
@@ -451,6 +454,8 @@
</dependencyManagement>
<build>
+
+
<pluginManagement>
<plugins>
1
0
06 Feb '14
Author: kmorin
Date: 2014-02-06 17:42:22 +0100 (Thu, 06 Feb 2014)
New Revision: 7
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/7
Log:
use jaxx application api
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java
trunk/faxtomail-persistence/src/main/resources/META-INF/
trunk/faxtomail-persistence/src/main/resources/META-INF/services/
trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/
trunk/faxtomail-service/src/main/resources/META-INF/services/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
trunk/faxtomail-ui-swing/src/main/resources/META-INF/services/
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties
trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties
trunk/faxtomail-service/pom.xml
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
trunk/faxtomail-ui-swing/pom.xml
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
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
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/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
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/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-web/pom.xml
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -49,6 +49,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
</dependency>
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,124 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Persistence
- * $Id: ExtranetEncAhiApplicationConfig.java 866 2013-12-13 10:34:05Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.config.ApplicationConfig;
-import org.nuiton.config.ArgumentsParserException;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-public class FaxToMailApplicationConfig {
-
- private static final Log log = LogFactory.getLog(FaxToMailApplicationConfig.class);
-
- protected ApplicationConfig applicationConfig;
-
- public FaxToMailApplicationConfig() {
- applicationConfig = new ApplicationConfig();
- applicationConfig.loadDefaultOptions(FaxToMailApplicationConfigOption.values());
- applicationConfig.setConfigFileName("faxtomail.properties");
- try {
- applicationConfig.parse();
- } catch (ArgumentsParserException e) {
- throw new FaxToMailTechnicalException(e);
- }
- if (log.isInfoEnabled()) {
- StringBuilder builder = new StringBuilder();
- List<FaxToMailApplicationConfigOption> options =
- Lists.newArrayList(FaxToMailApplicationConfigOption.values());
- for (FaxToMailApplicationConfigOption option : options) {
- String key = option.getKey();
- Object value = applicationConfig.getOption(option);
- builder.append(String.format("\n%1$-40s = %2$s",
- key,
- value));
- }
- log.info("faxtomail: " + builder.toString());
- }
- }
-
- public boolean isDevMode() {
- boolean isDevMode = applicationConfig.getOptionAsBoolean(FaxToMailApplicationConfigOption.DEV_MODE.key);
- return isDevMode;
- }
-
- public Map<String, String> getTopiaProperties() {
- Map<String, String> jpaParameters = Maps.newHashMap();
- Properties hibernateProperties = applicationConfig.getOptionStartsWith("hibernate");
- jpaParameters.putAll((Map) hibernateProperties);
- return jpaParameters;
- }
-
- /**
- * @return Le nom d'hôte du serveur SMTP.
- */
- public String getSmtpHost() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_HOST.key);
- }
-
- /**
- * @return Le port du serveur SMTP.
- */
- public int getSmtpPort() {
- return applicationConfig.getOptionAsInt(FaxToMailApplicationConfigOption.SMTP_PORT.key);
- }
-
- /**
- * @return L'adresse d'expéditeur pour les mails de notifications
- */
- public String getSmtpFrom() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.SMTP_FROM.key);
- }
-
- public String getInstanceUrl() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_URL.key);
- }
-
- public String getInstanceDisclaimer() {
- return applicationConfig.getOption(FaxToMailApplicationConfigOption.INSTANCE_DISCLAIMER.key);
- }
-
- public File getStorageFile() {
- return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.STORAGE_FILE.key);
- }
-
- public boolean isLogConfigurationProvided() {
- boolean logConfigurationProvided =
- StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key));
- return logConfigurationProvided;
- }
-
- public File getLogConfigurationFile() {
- return applicationConfig.getOptionAsFile(FaxToMailApplicationConfigOption.LOG_CONFIGURATION_FILE.key);
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,142 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Persistence
- * $Id: ExtranetEncAhiApplicationConfigOption.java 869 2013-12-13 13:09:12Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import org.nuiton.config.ConfigOptionDef;
-
-import java.io.File;
-
-public enum FaxToMailApplicationConfigOption implements ConfigOptionDef {
-
- INSTANCE_URL(
- "faxtomail.instanceUrl",
- "URL à laquelle on peut accéder à l'instance de faxToMail",
- "http://localhost:8080/faxtomail", String.class),
-
- INSTANCE_DISCLAIMER(
- "faxtomail.instanceDisclaimer",
- "Avertissement à afficher aux utilisateurs si l'instance est instable",
- null, String.class),
-
- SMTP_HOST(
- "smtp.host",
- "Nom d'hôte du serveur SMTP",
- "", String.class),
-
- SMTP_PORT(
- "smtp.port",
- "Le port du serveur SMTP",
- "25", Integer.class),
-
- SMTP_FROM(
- "smtp.from",
- "L'adresse d'expéditeur pour les mails de notifications",
- "", String.class),
-
- DEV_MODE(
- "faxtomail.devMode",
- "Mode développement, court-circuite l'envoi de mail",
- "true", Boolean.class),
-
-// CREATE_TRAINING_USERS(
-// "extranetEncAhi.createTrainingUsers",
-// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
-// "true", Boolean.class),
-
- STORAGE_FILE(
- "faxtomail.storage",
- "L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
- "/tmp/faxtomail/storage", File.class),
-
-// SUPPORT_EMAIL(
-// "extranetEncAhi.supportEmail",
-// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
-// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
-
- LOG_CONFIGURATION_FILE(
- "logConfigurationFile",
- "Chemin vers le fichier de configuration des journaux",
- null,
- String.class);
-
- protected final String key;
- protected final String description;
- protected final Class<?> type;
- protected String defaultValue;
-
- private FaxToMailApplicationConfigOption(String key, String description,
- String defaultValue, Class<?> type) {
- this.key = key;
- this.description = description;
- this.defaultValue = defaultValue;
- this.type = type;
- }
-
- @Override
- public String getKey() {
- return key;
- }
-
- @Override
- public Class<?> getType() {
- return type;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- @Override
- public boolean isTransient() {
- return false;
- }
-
- @Override
- public boolean isFinal() {
- return false;
- }
-
- @Override
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public void setTransient(boolean isTransient) {
- // Nothing to do
- }
-
- @Override
- public void setFinal(boolean isFinal) {
- // Nothing to do
- }
-
-}
\ No newline at end of file
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailBusinessException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,24 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/**
- * To box any business exception.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailBusinessException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public FaxToMailBusinessException(String message) {
- super(message);
- }
-
- public FaxToMailBusinessException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FaxToMailBusinessException(Throwable cause) {
- super(cause);
- }
-}
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java (from rev 4, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfig.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,389 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfig.java 866 2013-12-13 10:34:05Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Charsets;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.config.ApplicationConfig;
+import org.nuiton.config.ApplicationConfigHelper;
+import org.nuiton.config.ApplicationConfigProvider;
+import org.nuiton.config.ArgumentsParserException;
+import org.nuiton.jaxx.application.ApplicationConfiguration;
+import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.util.Version;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n.t;
+
+public class FaxToMailConfiguration extends ApplicationConfiguration {
+
+ private static final Log log = LogFactory.getLog(FaxToMailConfiguration.class);
+
+ private static FaxToMailConfiguration instance;
+
+ public static FaxToMailConfiguration getInstance() {
+ return instance;
+ }
+
+ public static void setInstance(FaxToMailConfiguration instance) {
+ FaxToMailConfiguration.instance = instance;
+ }
+
+ protected final String[] optionKeyToNotSave;
+
+ protected File configFile;
+
+ public FaxToMailConfiguration(ApplicationConfig applicationConfig) {
+ super(applicationConfig);
+ optionKeyToNotSave = null;
+ }
+
+ public FaxToMailConfiguration(String file, String... args) {
+ super(new ApplicationConfig());
+ applicationConfig.setEncoding(Charsets.UTF_8.name());
+
+ // get all config providers
+ Set<ApplicationConfigProvider> providers =
+ ApplicationConfigHelper.getProviders(null,
+ null,
+ null,
+ true);
+
+ // load all default options
+ ApplicationConfigHelper.loadAllDefaultOption(applicationConfig,
+ providers);
+
+ // get all transient and final option keys
+ Set<String> optionToSkip =
+ ApplicationConfigHelper.getTransientOptionKeys(providers);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Option that won't be saved: " + optionToSkip);
+ }
+ optionKeyToNotSave = optionToSkip.toArray(new String[optionToSkip.size()]);
+
+ applicationConfig.setConfigFileName(file);
+
+ try {
+ applicationConfig.parse(args);
+
+ } catch (ArgumentsParserException e) {
+ throw new ApplicationTechnicalException(t("faxtomail.config.parse.error"), e);
+ }
+
+ //TODO Review this, this is very dirty to do this...
+ File faxToMailBasedir = applicationConfig.getOptionAsFile(
+ FaxToMailConfigurationOption.BASEDIR.getKey());
+
+ if (faxToMailBasedir == null) {
+ faxToMailBasedir = new File("");
+ }
+ if (!faxToMailBasedir.isAbsolute()) {
+ faxToMailBasedir = new File(faxToMailBasedir.getAbsolutePath());
+ }
+ if (faxToMailBasedir.getName().equals("..")) {
+ faxToMailBasedir = faxToMailBasedir.getParentFile().getParentFile();
+ }
+ if (faxToMailBasedir.getName().equals(".")) {
+ faxToMailBasedir = faxToMailBasedir.getParentFile();
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Application basedir: " + faxToMailBasedir);
+ }
+ applicationConfig.setOption(
+ FaxToMailConfigurationOption.BASEDIR.getKey(),
+ faxToMailBasedir.getAbsolutePath());
+
+ if (log.isInfoEnabled()) {
+ StringBuilder builder = new StringBuilder();
+ List<FaxToMailConfigurationOption> options =
+ Lists.newArrayList(FaxToMailConfigurationOption.values());
+ for (FaxToMailConfigurationOption option : options) {
+ String key = option.getKey();
+ Object value = applicationConfig.getOption(option);
+ builder.append(String.format("\n%1$-40s = %2$s",
+ key,
+ value));
+ }
+ log.info("faxtomail: " + builder.toString());
+ }
+ }
+
+ public void prepareDirectories() {
+
+ File dataDirectory = getDataDirectory();
+ ApplicationIOUtil.forceMkdir(
+ dataDirectory,
+ t("faxtomail.service.mkDir.error", dataDirectory));
+
+ File tmpDirectory = getTmpDirectory();
+ if (tmpDirectory.exists()) {
+
+ ApplicationIOUtil.deleteDirectory(
+ tmpDirectory,
+ t("faxtomail.service.config.deleteTempDirectory.error", tmpDirectory));
+ }
+ ApplicationIOUtil.forceMkdir(
+ tmpDirectory,
+ t("faxtomail.service.mkDir.error", tmpDirectory));
+
+ }
+
+ public File getConfigFile() {
+ if (configFile == null) {
+ File dir = getBasedir();
+ if (dir == null || !dir.exists() || !isFullLaunchMode()) {
+ dir = new File(applicationConfig.getUserConfigDirectory());
+ }
+ configFile = new File(dir, applicationConfig.getConfigFileName());
+ }
+ return configFile;
+ }
+
+ public void save() {
+
+ File file = getConfigFile();
+ if (log.isInfoEnabled()) {
+ log.info("Save configuration at: " + file);
+ }
+ try {
+ applicationConfig.save(file, false, optionKeyToNotSave);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(
+ t("tutti.config.save.error", file), e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this);
+ }
+
+ // OPTION SETTERS
+
+ public void setCsvSeparator(char c) {
+ applicationConfig.setOption(
+ FaxToMailConfigurationOption.CSV_SEPARATOR.getKey(), c + "");
+ }
+
+ // OPTION GETTERS
+
+ public boolean isDevMode() {
+ boolean isDevMode = applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.DEV_MODE.getKey());
+ return isDevMode;
+ }
+
+ public Map<String, String> getTopiaProperties() {
+ Map<String, String> jpaParameters = Maps.newHashMap();
+ Properties hibernateProperties = applicationConfig.getOptionStartsWith("hibernate");
+ jpaParameters.putAll((Map) hibernateProperties);
+ return jpaParameters;
+ }
+
+ /**
+ * @return Le nom d'hôte du serveur SMTP.
+ */
+ public String getSmtpHost() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.SMTP_HOST.getKey());
+ }
+
+ /**
+ * @return Le port du serveur SMTP.
+ */
+ public int getSmtpPort() {
+ return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.SMTP_PORT.getKey());
+ }
+
+ /**
+ * @return L'adresse d'expéditeur pour les mails de notifications
+ */
+ public String getSmtpFrom() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.SMTP_FROM.getKey());
+ }
+
+ public String getInstanceUrl() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey());
+ }
+
+ public String getInstanceDisclaimer() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_DISCLAIMER.getKey());
+ }
+
+ public File getStorageFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.STORAGE_FILE.getKey());
+ }
+
+ public boolean isLogConfigurationProvided() {
+ boolean logConfigurationProvided =
+ StringUtils.isNotBlank(applicationConfig.getOption(FaxToMailConfigurationOption.LOG_CONFIGURATION_FILE.getKey()));
+ return logConfigurationProvided;
+ }
+
+ public File getLogConfigurationFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.LOG_CONFIGURATION_FILE.getKey());
+ }
+
+ @Override
+ public String getApplicationName() {
+ return "FaxToMail";
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#VERSION} value */
+ @Override
+ public Version getVersion() {
+ return applicationConfig.getOptionAsVersion(FaxToMailConfigurationOption.VERSION.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#SITE_URL} value */
+ public URL getSiteUrl() {
+ return applicationConfig.getOptionAsURL(FaxToMailConfigurationOption.SITE_URL.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#ORGANIZATION_NAME} value */
+ public String getOrganizationName() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.ORGANIZATION_NAME.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#INCEPTION_YEAR} value */
+ public int getInceptionYear() {
+ return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.INCEPTION_YEAR.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#BASEDIR} value */
+ public File getBasedir() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.BASEDIR.getKey());
+ return result;
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#DATA_DIRECTORY} value */
+ public File getDataDirectory() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.DATA_DIRECTORY.getKey());
+ return result;
+ }
+
+ public File getTmpDirectory() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.TMP_DIRECTORY.getKey());
+ return result;
+ }
+
+ public File newTempFile(String basename) {
+ return new File(getTmpDirectory(), basename + "_" + System.nanoTime());
+ }
+
+ public char getCsvSeparator() {
+ return applicationConfig.getOption(
+ FaxToMailConfigurationOption.CSV_SEPARATOR.getKey()).charAt(0);
+ }
+
+ public boolean isFullLaunchMode() {
+ return "full".equals(getFaxToMailLaunchMode());
+ }
+
+ public String getFaxToMailLaunchMode() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.FAXTOMAIL_LAUNCH_MODE.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#UI_CONFIG_FILE} value */
+ public File getUIConfigFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.UI_CONFIG_FILE.getKey());
+ }
+
+ /** @return {@link FaxToMailConfigurationOption#START_ACTION_FILE} value */
+ public File getStartActionFile() {
+ return applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.START_ACTION_FILE.getKey());
+ }
+
+ public KeyStroke getShortCut(String actionName) {
+ KeyStroke result = applicationConfig.getOptionAsKeyStroke(
+ "faxtomail.ui." + actionName);
+ return result;
+ }
+
+ public boolean isAutoPopupNumberEditor() {
+ return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.AUTO_POPUP_NUMBER_EDITOR.getKey());
+ }
+
+ public boolean isShowNumberEditorButton() {
+ return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.SHOW_NUMBER_EDITOR_BUTTON.getKey());
+ }
+
+ public Color getColorBlockingLayer() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_BLOCKING_LAYER.getKey());
+ }
+
+ public Color getColorAlternateRow() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_ALTERNATE_ROW.getKey());
+ }
+
+ public Color getColorSelectedRow() {
+ return applicationConfig.getOptionAsColor(FaxToMailConfigurationOption.COLOR_SELECTED_ROW.getKey());
+ }
+
+ @Override
+ public KeyStroke getShortcutClosePopup() {
+ return applicationConfig.getOptionAsKeyStroke(FaxToMailConfigurationOption.SHORTCUT_CLOSE_POPUP.getKey());
+ }
+
+ public String getDateFormat() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.DATE_FORMAT.getKey());
+ }
+
+ public File getNewTmpDirectory(String name) {
+ return new File(getTmpDirectory(), name + "_" + System.nanoTime());
+ }
+
+ public File getI18nDirectory() {
+ return applicationConfig.getOptionAsFile(
+ FaxToMailConfigurationOption.FAXTOMAIL_I18N_DIRECTORY.getKey());
+ }
+
+ public Locale getI18nLocale() {
+ return applicationConfig.getOptionAsLocale(
+ FaxToMailConfigurationOption.FAXTOMAIL_I18N_LOCALE.getKey());
+ }
+
+ public void setI18nLocale(Locale locale) {
+ applicationConfig.setOption(FaxToMailConfigurationOption.FAXTOMAIL_I18N_LOCALE.getKey(), locale.toString());
+ }
+
+}
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java (from rev 4, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationConfigOption.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,335 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Persistence
+ * $Id: ExtranetEncAhiApplicationConfigOption.java 869 2013-12-13 13:09:12Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-persiste… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.config.ConfigOptionDef;
+import org.nuiton.util.Version;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.net.URL;
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.n;
+
+public enum FaxToMailConfigurationOption implements ConfigOptionDef {
+
+ INSTANCE_URL(
+ "faxtomail.instanceUrl",
+ "URL à laquelle on peut accéder à l'instance de faxToMail",
+ "http://localhost:8080/faxtomail", String.class),
+
+ INSTANCE_DISCLAIMER(
+ "faxtomail.instanceDisclaimer",
+ "Avertissement à afficher aux utilisateurs si l'instance est instable",
+ null, String.class),
+
+ SMTP_HOST(
+ "smtp.host",
+ "Nom d'hôte du serveur SMTP",
+ "", String.class),
+
+ SMTP_PORT(
+ "smtp.port",
+ "Le port du serveur SMTP",
+ "25", Integer.class),
+
+ SMTP_FROM(
+ "smtp.from",
+ "L'adresse d'expéditeur pour les mails de notifications",
+ "", String.class),
+
+ DEV_MODE(
+ "faxtomail.devMode",
+ "Mode développement, court-circuite l'envoi de mail",
+ "true", Boolean.class),
+
+// CREATE_TRAINING_USERS(
+// "extranetEncAhi.createTrainingUsers",
+// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
+// "true", Boolean.class),
+
+ STORAGE_FILE(
+ "faxtomail.storage",
+ "L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
+ "/tmp/faxtomail/storage", File.class),
+
+// SUPPORT_EMAIL(
+// "extranetEncAhi.supportEmail",
+// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
+// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
+
+ LOG_CONFIGURATION_FILE(
+ "logConfigurationFile",
+ "Chemin vers le fichier de configuration des journaux",
+ null,
+ String.class),
+
+ //SERVICE
+
+ // TRANSIENT CONFIG
+ VERSION(
+ "faxtomail.version",
+ n("faxtomail.config.option.version.description"),
+ "",
+ Version.class,
+ true),
+
+ SITE_URL(
+ "faxtomail.site.url",
+ n("faxtomail.config.option.site.url.description"),
+ "http://maven-site.forge.codelutin.com/faxtomail",
+ URL.class,
+ true),
+
+ ORGANIZATION_NAME(
+ "faxtomail.organizationName",
+ n("faxtomail.config.option.organizationName.description"),
+ "",
+ String.class,
+ true),
+
+ INCEPTION_YEAR(
+ "faxtomail.inceptionYear",
+ n("faxtomail.config.option.inceptionYear.description"),
+ "2012",
+ Integer.class,
+ true),
+
+ BASEDIR(
+ "faxtomail.basedir",
+ n("faxtomail.config.option.basedir.description"),
+ "${user.home}/.faxtomail",
+ File.class,
+ true
+ ),
+
+ DATA_DIRECTORY(
+ "faxtomail.data.directory",
+ n("faxtomail.config.option.data.directory.description"),
+ "${faxtomail.basedir}/data",
+ File.class,
+ true),
+
+ TMP_DIRECTORY(
+ "faxtomail.tmp.directory",
+ n("faxtomail.config.option.tmp.directory.description"),
+ "${faxtomail.data.directory}/temp",
+ File.class,
+ true),
+
+ // NOT TRANSIENT CONFIG
+
+ CSV_SEPARATOR(
+ "faxtomail.csv.separator",
+ n("faxtomail.config.option.csv.separator.description"),
+ ";",
+ char.class),
+
+ // UI
+
+ FAXTOMAIL_LAUNCH_MODE(
+ "faxtomail.launch.mode",
+ n("faxtomail.config.option.launch.mode.description"),
+ null,
+ String.class,
+ true
+ ),
+
+ FAXTOMAIL_I18N_DIRECTORY(
+ "faxtomail.i18n.directory",
+ n("faxtomail.config.option.i18n.directory.description"),
+ "${faxtomail.basedir}/i18n",
+ File.class,
+ true
+ ),
+
+// FAXTOMAIL_HELP_DIRECTORY(
+// "faxtomail.help.directory",
+// n("faxtomail.config.option.help.directory.description"),
+// "${faxtomail.basedir}/help",
+// File.class,
+// false,
+// true
+// ),
+
+ START_ACTION_FILE(
+ "faxtomail.startActionFile",
+ n("faxtomail.config.option.startActionFile.description"),
+ "${faxtomail.basedir}/faxtomail-start-action",
+ File.class,
+ true
+ ),
+ FAXTOMAIL_I18N_LOCALE(
+ "faxtomail.i18n.locale",
+ n("faxtomail.config.option.i18n.locale.description"),
+ Locale.FRANCE.getCountry(),
+ Locale.class
+ ),
+
+ UI_CONFIG_FILE(
+ "faxtomail.ui.config.file",
+ n("faxtomail.config.option.ui.config.file.description"),
+ "${faxtomail.data.directory}/faxtomailUI.xml",
+ File.class
+ ),
+
+ AUTO_POPUP_NUMBER_EDITOR(
+ "faxtomail.ui.autoPopupNumberEditor",
+ n("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
+ String.valueOf(false),
+ Boolean.class
+ ),
+
+ SHOW_NUMBER_EDITOR_BUTTON(
+ "faxtomail.ui.showNumberEditorButton",
+ n("faxtomail.config.option.ui.showNumberEditorButton.description"),
+ String.valueOf(true),
+ Boolean.class
+ ),
+
+ COLOR_ALTERNATE_ROW(
+ "faxtomail.ui.color.alternateRow",
+ n("faxtomail.config.option.ui.color.alternateRow.description"),
+ new Color(217, 217, 217).toString(),
+ Color.class
+ ),
+ COLOR_SELECTED_ROW(
+ "faxtomail.ui.color.selectedRow",
+ n("faxtomail.config.option.ui.color.selectedRow.description"),
+ new Color(57,105,138).toString(),
+ Color.class
+ ),
+
+ /*
+ UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+defaults.put("Table.alternateRowColor", new Color(217, 217, 217));
+ */
+ COLOR_BLOCKING_LAYER(
+ "faxtomail.ui.color.blockingLayer",
+ n("faxtomail.config.option.ui.color.blockingLayer.description"),
+ new Color(200, 200, 200).toString(),
+ Color.class
+ ),
+
+ SHORTCUT_CLOSE_POPUP(
+ "faxtomail.ui.shortcut.closePopup",
+ n("faxtomail.config.option.ui.shortcut.closePopup.description"),
+ "alt pressed F",
+ KeyStroke.class
+ ),
+
+ DATE_FORMAT(
+ "faxtomail.ui.dateFormat",
+ n("faxtomail.config.option.ui.dateFormat.description"),
+ "dd/MM/yyyy",
+ String.class
+ );
+
+ /** Configuration key. */
+ private final String key;
+
+ /** I18n key of option description */
+ private final String description;
+
+ /** Type of option */
+ private final Class<?> type;
+
+ /** Default value of option. */
+ private String defaultValue;
+
+ /** Flag to not keep option value on disk */
+ private boolean isTransient;
+
+ /** Flag to not allow option value modification */
+ private boolean isFinal;
+
+ FaxToMailConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type,
+ boolean isTransient) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.type = type;
+ this.isTransient = isTransient;
+ this.isFinal = isTransient;
+ }
+
+ FaxToMailConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type) {
+ this(key, description, defaultValue, type, true);
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return type;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return isTransient;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return isFinal;
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public void setTransient(boolean newValue) {
+ // not used
+ }
+
+ @Override
+ public void setFinal(boolean newValue) {
+ // not used
+ }
+
+}
\ No newline at end of file
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,63 @@
+package com.franciaflex.faxtomail;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id: TuttiConfigurationProvider.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-persistence/src/main/j… $
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.config.ApplicationConfigProvider;
+import org.nuiton.config.ConfigActionDef;
+import org.nuiton.config.ConfigOptionDef;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l;
+
+/**
+ * Tutti config provider (for site generation).
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class FaxToMailConfigurationProvider implements ApplicationConfigProvider {
+
+ @Override
+ public String getName() {
+ return "faxToMail";
+ }
+
+ @Override
+ public String getDescription(Locale locale) {
+ return l(locale, "faxToMail.config");
+ }
+
+ @Override
+ public ConfigOptionDef[] getOptions() {
+ return FaxToMailConfigurationOption.values();
+ }
+
+ @Override
+ public ConfigActionDef[] getActions() {
+ return new ConfigActionDef[0];
+ }
+}
\ No newline at end of file
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,231 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.vfs2.FileObject;
-import org.apache.commons.vfs2.FileSelector;
-import org.apache.commons.vfs2.FileSystemManager;
-import org.apache.commons.vfs2.FileType;
-import org.apache.commons.vfs2.VFS;
-import org.nuiton.util.ZipUtil;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-import java.util.UUID;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * Useful methods around IO, all method errors are boxes a
- * {@link FaxToMailTechnicalException}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.2
- */
-public class FaxToMailIOUtil {
-
- protected FaxToMailIOUtil() {
- // no instance
- }
-
- public static void close(Closeable toClose, String errorMessage) {
-
- try {
- toClose.close();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void zip(File source, File archiveFile, String errorMessage) {
- try {
- ZipUtil.compress(archiveFile, source);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void zip(File source, File archiveFile, List<File> files, String errorMessage) {
- try {
- ZipUtil.compressFiles(archiveFile, source, files);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, archiveFile), e);
- }
- }
-
- public static FileObject resolveFile(String file, String errorMessage) {
- try {
- FileSystemManager manager = VFS.getManager();
- FileObject targetObject = manager.resolveFile(file);
- return targetObject;
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static FileObject[] getChildren(FileObject objectFile, String errorMessage) {
- try {
- return objectFile.getChildren();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static FileObject getChild(FileObject objectFile, String name, String errorMessage) {
- try {
- return objectFile.getChild(name);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
-
- public static FileType getType(FileObject objectFile, String errorMessage) {
- try {
- return objectFile.getType();
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void explode(FileObject archiveFile,
- File target,
- FileSelector fileSelector, String errorMessage) {
- try {
- FileSystemManager manager = VFS.getManager();
- FileObject targetObject = manager.toFileObject(target);
- targetObject.copyFrom(archiveFile, fileSelector);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void forceMkdir(File dir, String errorMessage) {
- try {
- FileUtils.forceMkdir(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void cleanDirectory(File dir, String errorMessage) {
- try {
- FileUtils.cleanDirectory(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void deleteDirectory(File dir, String errorMessage) {
- try {
- FileUtils.deleteDirectory(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void forceDeleteOnExit(File dir, String errorMessage) {
- try {
- FileUtils.forceDeleteOnExit(dir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyDirectory(File source, File target, String errorMessage) {
- try {
- FileUtils.copyDirectory(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyFileToDirectory(File source, File target, String errorMessage) {
- try {
- FileUtils.copyFileToDirectory(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void copyFile(File source, File target, String errorMessage) {
- try {
- FileUtils.copyFile(source, target);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void deleteFile(File file, String errorMessage) {
- try {
- FileUtils.forceDelete(file);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static String getBaseName(String file) {
- return FilenameUtils.getBaseName(file);
- }
-
- public static String getExtension(String file) {
- return FilenameUtils.getExtension(file);
- }
-
- public static Reader newReader(File file, String errorMessage) {
- try {
- return Files.newReader(file, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- }
-
- public static Writer newWriter(File file, String errorMessage
- ) {
- try {
- return Files.newWriter(file, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- }
-
- public static File explodeZip(File rootDirectory,
- File file,
- String errorMessage) {
- File tempDir = new File(rootDirectory, UUID.randomUUID().toString());
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(t(errorMessage, file), e);
- }
- return tempDir;
- }
-
- public static String readContent(File file, String errorMessage) {
-
- try {
- return Files.readFirstLine(file, Charsets.UTF_8);
-
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
- }
-
- public static void writeContent(File file, String content, String errorMessage) {
- try {
- FileUtils.write(file, content, Charsets.UTF_8);
- } catch (IOException e) {
- throw new FaxToMailTechnicalException(errorMessage, e);
- }
-
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailTechnicalException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,27 +0,0 @@
-package com.franciaflex.faxtomail;
-
-/**
- * Any techincal exception should be boxed in a such exception.
- *
- * @author tchemit <chemit(a)codelutin.com/>
- * @since 0.1
- */
-public class FaxToMailTechnicalException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public FaxToMailTechnicalException() {
- }
-
- public FaxToMailTechnicalException(String message) {
- super(message);
- }
-
- public FaxToMailTechnicalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FaxToMailTechnicalException(Throwable cause) {
- super(cause);
- }
-}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/PropagatePropertyChangeListener.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,56 +0,0 @@
-package com.franciaflex.faxtomail;
-
-import org.jdesktop.beans.AbstractBean;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-/**
- * To listen a bean and propagate some of properties.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class PropagatePropertyChangeListener implements PropertyChangeListener {
-
- public static interface PropagatePropertyChange {
- void firePropertyChanged(String propertyName,
- Object oldValue,
- Object newValue);
- }
-
- public static void listenAndPropagate(AbstractBean producer,
- PropagatePropertyChange consumer,
- String propertyNameToListen,
- String propertyNameToForward) {
- PropagatePropertyChangeListener listener =
- new PropagatePropertyChangeListener(propertyNameToForward,
- consumer);
- producer.addPropertyChangeListener(propertyNameToListen, listener);
- }
-
- public static void listenAndPropagateAll(AbstractBean producer,
- PropagatePropertyChange consumer) {
- PropagatePropertyChangeListener listener =
- new PropagatePropertyChangeListener(null, consumer);
- producer.addPropertyChangeListener(listener);
- }
-
- private String propertyName;
-
- private PropagatePropertyChange editor;
-
- public PropagatePropertyChangeListener(String propertyName,
- PropagatePropertyChange editor) {
- this.propertyName = propertyName;
- this.editor = editor;
- }
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String name = propertyName == null ? evt.getPropertyName() : propertyName;
- editor.firePropertyChanged(name,
- evt.getOldValue(),
- evt.getNewValue());
- }
-}
\ No newline at end of file
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,6 +1,7 @@
package com.franciaflex.faxtomail.persistence;
import org.jdesktop.beans.AbstractSerializableBean;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
import org.nuiton.updater.DownloadMonitor;
/**
@@ -9,87 +10,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class ProgressionModel extends AbstractSerializableBean implements DownloadMonitor {
+public class ProgressionModel extends ApplicationProgressionModel implements DownloadMonitor {
private static final long serialVersionUID = 1L;
- public static final String PROPERTY_TOTAL = "total";
-
- public static final String PROPERTY_CURRENT = "current";
-
- public static final String PROPERTY_RATE = "rate";
-
- public static final String PROPERTY_MESSAGE = "message";
-
- protected int total;
-
- protected int current;
-
- protected float rate;
-
- protected String message;
-
- public int getTotal() {
- return total;
- }
-
- public void setTotal(int total) {
- Object oldValue = getTotal();
- this.total = total;
- firePropertyChange(PROPERTY_TOTAL, oldValue, total);
- setCurrent(0);
- }
-
- public void adaptTotal(int total) {
- long current = getCurrent();
- setTotal(total);
- increments((int) current);
- Object oldValue = getTotal();
- this.total = total;
- firePropertyChange(PROPERTY_TOTAL, oldValue, total);
- setCurrent(current);
- }
-
- public long getCurrent() {
- return current;
- }
-
- public void setCurrent(int current) {
- Object oldValue = getCurrent();
- this.current = current;
- firePropertyChange(PROPERTY_CURRENT, oldValue, current);
- }
-
- public void increments(int nb) {
- setCurrent(current + nb);
- setRate(getCurrent() / getTotal());
- }
-
- public float getRate() {
- return rate;
- }
-
- public void setRate(float rate) {
- Object oldValue = getRate();
- this.rate = rate;
- firePropertyChange(PROPERTY_RATE, oldValue, rate);
- }
-
- public String getMessage() {
- return message;
- }
-
- public void increments(String message) {
- increments(1);
- setMessage(message);
- }
-
- public void setMessage(String message) {
- Object oldValue = getMessage();
- this.message = message;
- firePropertyChange(PROPERTY_MESSAGE, oldValue, message);
- }
-
@Override
public void setSize(long size) {
setTotal((int) size);
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,7 +1,5 @@
package com.franciaflex.faxtomail.persistence;
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
@@ -9,6 +7,8 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
import java.io.IOException;
@@ -60,7 +60,7 @@
this.directories.add(directory);
// force to create directory
- FaxToMailIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
+ ApplicationIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
}
}
loader = null;
@@ -158,7 +158,7 @@
directories.toArray(new File[directories.size()]));
loader = URLClassLoader.newInstance(urls, null);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
+ throw new ApplicationTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
}
}
return loader;
Added: trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider (rev 0)
+++ trunk/faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1 @@
+com.franciaflex.faxtomail.FaxToMailConfigurationProvider
\ No newline at end of file
Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,2 +1,27 @@
+faxToMail.config=
+faxtomail.config.option.basedir.description=
+faxtomail.config.option.csv.separator.description=
+faxtomail.config.option.data.directory.description=
+faxtomail.config.option.i18n.directory.description=
+faxtomail.config.option.i18n.locale.description=
+faxtomail.config.option.inceptionYear.description=
+faxtomail.config.option.launch.mode.description=
+faxtomail.config.option.organizationName.description=
+faxtomail.config.option.site.url.description=
+faxtomail.config.option.startActionFile.description=
+faxtomail.config.option.tmp.directory.description=
+faxtomail.config.option.ui.autoPopupNumberEditor.description=
+faxtomail.config.option.ui.color.alternateRow.description=
+faxtomail.config.option.ui.color.blockingLayer.description=
+faxtomail.config.option.ui.color.selectedRow.description=
+faxtomail.config.option.ui.config.file.description=
+faxtomail.config.option.ui.dateFormat.description=
+faxtomail.config.option.ui.shortcut.closePopup.description=
+faxtomail.config.option.ui.showNumberEditorButton.description=
+faxtomail.config.option.version.description=
+faxtomail.config.parse.error=
faxtomail.persistence.loader.error=
faxtomail.persistence.mkDir.error=
+faxtomail.service.config.deleteTempDirectory.error=
+faxtomail.service.mkDir.error=
+tutti.config.save.error=
Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,2 +1,27 @@
+faxToMail.config=
+faxtomail.config.option.basedir.description=
+faxtomail.config.option.csv.separator.description=
+faxtomail.config.option.data.directory.description=
+faxtomail.config.option.i18n.directory.description=
+faxtomail.config.option.i18n.locale.description=
+faxtomail.config.option.inceptionYear.description=
+faxtomail.config.option.launch.mode.description=
+faxtomail.config.option.organizationName.description=
+faxtomail.config.option.site.url.description=
+faxtomail.config.option.startActionFile.description=
+faxtomail.config.option.tmp.directory.description=
+faxtomail.config.option.ui.autoPopupNumberEditor.description=
+faxtomail.config.option.ui.color.alternateRow.description=
+faxtomail.config.option.ui.color.blockingLayer.description=
+faxtomail.config.option.ui.color.selectedRow.description=
+faxtomail.config.option.ui.config.file.description=
+faxtomail.config.option.ui.dateFormat.description=
+faxtomail.config.option.ui.shortcut.closePopup.description=
+faxtomail.config.option.ui.showNumberEditorButton.description=
+faxtomail.config.option.version.description=
+faxtomail.config.parse.error=
faxtomail.persistence.loader.error=
faxtomail.persistence.mkDir.error=
+faxtomail.service.config.deleteTempDirectory.error=
+faxtomail.service.mkDir.error=
+tutti.config.save.error=
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -69,6 +69,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,110 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Tutti :: Application
+ * $Id: DecoratorService.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-service/src/main/java/… $
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.LabelAware;
+import org.nuiton.decorator.Decorator;
+import org.nuiton.decorator.DecoratorProvider;
+
+import java.io.File;
+
+import static org.nuiton.i18n.I18n.n;
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * Tutti decorator service.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class DecoratorService extends FaxToMailServiceSupport {
+
+ public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
+
+ public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
+
+ public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
+
+ public static final String FROM_PROTOCOL = "fromProtocol";
+
+ public static final String GEAR_WITH_RANK_ORDER = "gearWithrankOrder";
+
+ public static final String BY_NAME = "byName";
+
+ public static final String ONLY_NAME = "onlyName";
+
+ public static final String FILE_NAME_COMPATIBLE = "fileNameCompatible";
+
+ public static final String SEPARATOR = "#";
+
+ /** Delegate decorator provider. */
+ protected DecoratorProvider decoratorProvider;
+
+ public <O> Decorator<O> getDecorator(O object) {
+ return decoratorProvider.getDecorator(object);
+ }
+
+ public <O> Decorator<O> getDecorator(O object, String name) {
+ return decoratorProvider.getDecorator(object, name);
+ }
+
+ public <O> Decorator<O> getDecoratorByType(Class<O> type) {
+ return decoratorProvider.getDecoratorByType(type);
+ }
+
+ public <O> Decorator<O> getDecoratorByType(Class<O> type, String name) {
+ return decoratorProvider.getDecoratorByType(type, name);
+ }
+
+ @Override
+ public void setServiceContext(FaxToMailServiceContext context) {
+ super.setServiceContext(context);
+
+ decoratorProvider = new DecoratorProvider() {
+ @Override
+ protected void loadDecorators() {
+
+ registerDecorator(new Decorator<Float>(Float.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ return bean == null ? "" : String.valueOf(bean);
+ }
+ });
+ registerDecorator(new Decorator<Number>(Number.class) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String toString(Object bean) {
+ return bean == null ? "" : String.valueOf(bean);
+ }
+ });
+ registerMultiJXPathDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
+ }
+ };
+ }
+
+}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,113 +0,0 @@
-package com.franciaflex.faxtomail.services;
-
-/*
- * #%L
- * Extranet ENC-AHI :: Services
- * $Id: DefaultExtranetEncAhiServiceContext.java 827 2013-12-04 15:30:35Z bleny $
- * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
- * %%
- * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Date;
-import java.util.Random;
-
-public class DefaultFaxToMailServiceContext implements FaxToMailServiceContext {
-
- protected FaxToMailApplicationConfig applicationConfig;
-
- protected FaxToMailTopiaPersistenceContext persistenceContext;
-
- protected FaxToMailWebApplicationContext webApplicationContext;
-
- @Override
- public FaxToMailApplicationConfig getApplicationConfig() {
- return applicationConfig;
- }
-
- public void setPersistenceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
- this.persistenceContext = persistenceContext;
- }
-
- @Override
- public FaxToMailTopiaPersistenceContext getPersistenceContext() {
- return persistenceContext;
- }
-
- public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
- this.applicationConfig = applicationConfig;
- }
-
- @Override
- public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
-
- E service;
-
- try {
-
- Constructor<E> constructor = serviceClass.getConstructor();
-
- service = constructor.newInstance();
-
- } catch (NoSuchMethodException e) {
-
- throw new FaxToMailTechnicalException("all services must provide a non-argument constructor", e);
-
- } catch (InvocationTargetException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- } catch (InstantiationException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- } catch (IllegalAccessException e) {
-
- throw new FaxToMailTechnicalException("unable to instantiate service", e);
-
- }
-
- service.setServiceContext(this);
-
- return service;
-
- }
-
- @Override
- public Date getNow() {
- Date now = new Date();
- return now;
- }
-
- @Override
- public FaxToMailWebApplicationContext getWebApplicationContext() {
- return webApplicationContext;
- }
-
- public void setWebApplicationContext(FaxToMailWebApplicationContext webApplicationContext) {
- this.webApplicationContext = webApplicationContext;
- }
-
-}
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,21 +0,0 @@
-package com.franciaflex.faxtomail.services;
-
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
-
-import java.util.Date;
-
-public interface FaxToMailServiceContext {
-
- FaxToMailApplicationConfig getApplicationConfig();
-
- FaxToMailTopiaPersistenceContext getPersistenceContext();
-
- Date getNow();
-
- <E extends FaxToMailService> E newService(Class<E> serviceClass);
-
- FaxToMailWebApplicationContext getWebApplicationContext();
-
-}
Copied: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java (from rev 4, trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DefaultFaxToMailServiceContext.java)
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,112 @@
+package com.franciaflex.faxtomail.services;
+
+/*
+ * #%L
+ * Extranet ENC-AHI :: Services
+ * $Id: DefaultExtranetEncAhiServiceContext.java 827 2013-12-04 15:30:35Z bleny $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/extranet-enc-ahi/trunk/extranet-services… $
+ * %%
+ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
+import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Date;
+
+public class FaxToMailServiceContext {
+
+ private static final Log log =
+ LogFactory.getLog(FaxToMailServiceContext.class);
+
+ protected FaxToMailConfiguration applicationConfig;
+
+ protected FaxToMailTopiaPersistenceContext persistenceContext;
+
+ protected FaxToMailWebApplicationContext webApplicationContext;
+
+ public FaxToMailConfiguration getApplicationConfig() {
+ return applicationConfig;
+ }
+
+ public void setPersistenceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
+ this.persistenceContext = persistenceContext;
+ }
+
+ public FaxToMailTopiaPersistenceContext getPersistenceContext() {
+ return persistenceContext;
+ }
+
+ public void setApplicationConfig(FaxToMailConfiguration applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
+ public <E extends FaxToMailService> E newService(Class<E> serviceClass) {
+
+ E service;
+
+ try {
+
+ Constructor<E> constructor = serviceClass.getConstructor();
+
+ service = constructor.newInstance();
+
+ } catch (NoSuchMethodException e) {
+
+ throw new ApplicationTechnicalException("all services must provide a non-argument constructor", e);
+
+ } catch (InvocationTargetException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ } catch (InstantiationException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ } catch (IllegalAccessException e) {
+
+ throw new ApplicationTechnicalException("unable to instantiate service", e);
+
+ }
+
+ service.setServiceContext(this);
+
+ return service;
+
+ }
+
+ public Date getNow() {
+ Date now = new Date();
+ return now;
+ }
+
+ public FaxToMailWebApplicationContext getWebApplicationContext() {
+ return webApplicationContext;
+ }
+
+ public void setWebApplicationContext(FaxToMailWebApplicationContext webApplicationContext) {
+ this.webApplicationContext = webApplicationContext;
+ }
+
+}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
@@ -42,7 +42,7 @@
this.serviceContext = serviceContext;
}
- protected FaxToMailApplicationConfig getApplicationConfig() {
+ protected FaxToMailConfiguration getApplicationConfig() {
return serviceContext.getApplicationConfig();
}
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,19 +24,16 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.Company;
import com.franciaflex.faxtomail.persistence.entities.CompanyTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.validator.xwork2.XWork2ValidatorUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.File;
-import java.io.InputStream;
-import java.util.List;
public class InitFaxToMailService extends FaxToMailServiceSupport {
@@ -68,7 +65,7 @@
protected void checkStorage() {
- FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+ FaxToMailConfiguration applicationConfig = getApplicationConfig();
File storageFile = applicationConfig.getStorageFile();
@@ -84,16 +81,16 @@
boolean created = storageFile.mkdirs();
if ( ! created) {
- throw new FaxToMailTechnicalException("unable to create directory " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("unable to create directory " + storageFile.getAbsolutePath());
}
}
if ( ! storageFile.isDirectory()) {
- throw new FaxToMailTechnicalException("file exists but is not a directory " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("file exists but is not a directory " + storageFile.getAbsolutePath());
}
if ( ! storageFile.canWrite()) {
- throw new FaxToMailTechnicalException("directory exists but is not writable " + storageFile.getAbsolutePath());
+ throw new ApplicationTechnicalException("directory exists but is not writable " + storageFile.getAbsolutePath());
}
}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -29,6 +29,7 @@
<jaxx.generateSearch>false</jaxx.generateSearch>
<jaxx.autoImportCss>true</jaxx.autoImportCss>
<jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss>
+ <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI>
<i18n.bundleOutputName>faxtomail-i18n</i18n.bundleOutputName>
<i18n.generateCsvFile>true</i18n.generateCsvFile>
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailActionFactory.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,61 @@
+package com.franciaflex.faxtomail.ui.swing;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id: TuttiActionFactory.java 1566 2014-02-04 08:31:02Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractMainUIFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class FaxToMailActionFactory extends ApplicationActionFactory {
+
+ @Override
+ public <A extends AbstractApplicationAction> A createLogicAction(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ FaxToMailUIContext context = (FaxToMailUIContext) handler.getContext();
+ if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
+ context.getMainUI() != null) {
+ handler = context.getMainUI().getHandler();
+ }
+
+ try {
+ // create action
+ A result = ConstructorUtils.invokeConstructor(actionName, (AbstractFaxToMailUIHandler) handler);
+ return result;
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(t("application.action.create.error", actionName), e);
+ }
+ }
+}
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,14 +1,11 @@
package com.franciaflex.faxtomail.ui.swing;
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailErrorHelper;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -17,7 +14,7 @@
import jaxx.runtime.swing.session.BeanDoubleListState;
import jaxx.runtime.swing.session.BeanFilterableComboBoxState;
import jaxx.runtime.swing.session.State;
-import org.apache.commons.io.IOUtils;
+import jaxx.runtime.swing.session.SwingSession;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -25,8 +22,19 @@
import org.nuiton.i18n.I18n;
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.util.Locale;
@@ -41,7 +49,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class FaxToMailUIContext extends AbstractBean implements Closeable, UIMessageNotifier {
+public class FaxToMailUIContext extends AbstractBean implements Closeable, UIMessageNotifier, ApplicationUIContext {
/** Logger. */
private static final Log log = LogFactory.getLog(FaxToMailUIContext.class);
@@ -50,6 +58,8 @@
public static final String PROPERTY_LOCALE = "locale";
+ public static final Set<String> PROPERTIES_TO_SAVE = Sets.newHashSet(PROPERTY_LOCALE);
+
public static final String PROPERTY_BUSY = "busy";
public static final String PROPERTY_HIDE_BODY = "hideBody";
@@ -66,7 +76,7 @@
*
* @since 0.1
*/
- protected final FaxToMailApplicationConfig config;
+ protected final FaxToMailConfiguration config;
/**
* ClassLoader ressource.
@@ -80,23 +90,30 @@
*
* @since 0.1
*/
-// protected final FaxToMailServiceContext serviceContext;
+ protected final FaxToMailServiceContext serviceContext;
/**
* Swing session used to save ui states.
*
* @since 0.1
*/
-// protected final SwingSession swingSession;
+ protected final SwingSession swingSession;
/**
* Erro helper.
*
* @since 1.0
*/
- protected final FaxToMailErrorHelper errorHelper;
+ protected final ApplicationErrorHelper errorHelper;
/**
+ * Shared data context.
+ *
+ * @since 1.0.2
+ */
+// protected TuttiDataContext dataContext;
+
+ /**
* Current screen displayed in ui.
*
* @since 0.1
@@ -133,10 +150,27 @@
private MainUI mainUI;
- private FaxToMailActionUI actionUI;
+ private ApplicationActionUI actionUI;
+ /**
+ * Flag to know if there is an exsiting db.
+ *
+ * @since 1.0
+ */
+ private boolean dbExist;
- public static FaxToMailUIContext newContext(FaxToMailApplicationConfig config) {
+ /**
+ * Flag to know if there is a loaded db.
+ *
+ * @since 1.0
+ */
+ private boolean dbLoaded;
+
+ private final ApplicationActionFactory faxToMailActionFactory;
+
+ private final ApplicationActionEngine faxToMailActionEngine;
+
+ public static FaxToMailUIContext newContext(FaxToMailConfiguration config) {
Preconditions.checkNotNull(config);
Preconditions.checkState(applicationContext == null,
"Application context was already opened!");
@@ -148,20 +182,47 @@
return applicationContext;
}
- public static FaxToMailErrorHelper getErrorHelper() {
+ public ApplicationErrorHelper getErrorHelper() {
return applicationContext.errorHelper;
}
- protected FaxToMailUIContext(FaxToMailApplicationConfig config) {
+ @Override
+ public String getI18nPrefix() {
+ return "faxtomail.property.";
+ }
+
+ @Override
+ public String getDateFormat() {
+ return getConfig().getDateFormat();
+ }
+
+ protected FaxToMailUIContext(FaxToMailConfiguration config) {
this.config = config;
this.resourceLoader = new RessourceClassLoader(Thread.currentThread().getContextClassLoader());
-// this.serviceContext = new DefaultFaxToMailServiceContext(resourceLoader, config.getServiceConfig());
+ this.serviceContext = new FaxToMailServiceContext();
+ serviceContext.setApplicationConfig(config);
Map<Class, State> additionalStates = Maps.newHashMap();
additionalStates.put(BeanFilterableComboBox.class, new BeanFilterableComboBoxState());
additionalStates.put(BeanDoubleList.class, new BeanDoubleListState());
-// this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+ this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false, additionalStates);
+ this.errorHelper = new ApplicationErrorHelper(this) {
+
+ @Override
+ public void showWarningDialog(String message) {
+
+ JOptionPane.showMessageDialog(context.getActionUI(), "<html><body>" + message + "</body></html>",
+ t("application.error.ui.business.warning"),
+ JOptionPane.WARNING_MESSAGE);
+ }
+
+ @Override
+ public void showErrorDialog(String message, Throwable cause) {
+ super.showErrorDialog(message, cause);
+ }
+ };
+
UIMessageNotifier logMessageNotifier = new UIMessageNotifier() {
@Override
@@ -183,17 +244,34 @@
this.messageNotifiers = Sets.newHashSet();
addMessageNotifier(logMessageNotifier);
- this.errorHelper = new FaxToMailErrorHelper(this);
+ faxToMailActionFactory = new FaxToMailActionFactory();
+ faxToMailActionEngine = new ApplicationActionEngine(faxToMailActionFactory);
+ }
+ @Override
+ public ApplicationConfiguration getConfiguration() {
+ return config;
}
+ @Override
+ public Component getBodyUI() {
+ MainUI mainUI = getMainUI();
+ return mainUI == null ? null : mainUI.getBody();
+ }
+
+ @Override
+ public Component getStatusUI() {
+ MainUI mainUI = getMainUI();
+ return mainUI == null ? null : mainUI.getStatus();
+ }
+
//------------------------------------------------------------------------//
//-- Open / close methods --//
//------------------------------------------------------------------------//
public void init() {
- config.getServiceConfig().prepareDirectories();
+ config.prepareDirectories();
// use our special classLoader (which will read some files from resources from a configuration directory)
Thread.currentThread().setContextClassLoader(getResourceLoader());
@@ -219,7 +297,7 @@
// init db configuration
//--------------------------------------------------------------------//
-// config.getServiceConfig().getPersistenceConfig().initConfig(getResourceLoader());
+// config.initConfig(getResourceLoader());
// // clean db cache (avoid a lots of headache :(
// File cacheDirectory = config.getServiceConfig().getPersistenceConfig().getCacheDirectory();
@@ -233,36 +311,36 @@
//--------------------------------------------------------------------//
// init i18n
//--------------------------------------------------------------------//
-// File i18nDirectory = config.getI18nDirectory();
-// if (!config.isFullLaunchMode()) {
-//
-// i18nDirectory = new File(config.getDataDirectory(), "i18n");
-//
-// if (i18nDirectory.exists()) {
-// // clean i18n cache
-// FaxToMailIOUtil.cleanDirectory(
-// i18nDirectory,
-// _("faxtomail.i18n.deleteCache.error", i18nDirectory));
-// }
-// }
-//
-// FaxToMailIOUtil.forceMkdir(i18nDirectory,
-// _("faxtomail.i18n.mkDir.error", i18nDirectory));
-//
-// if (log.isDebugEnabled()) {
-// log.debug("I18N directory: " + i18nDirectory);
-// }
-//
-// Locale i18nLocale = config.getI18nLocale();
-//
-// if (log.isInfoEnabled()) {
-// log.info(String.format("Starts i18n with locale [%s] at [%s]",
-// i18nLocale, i18nDirectory));
-// }
-// I18n.init(new UserI18nInitializer(
-// i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
-// i18nLocale);
+ File i18nDirectory = config.getI18nDirectory();
+ if (!config.isFullLaunchMode()) {
+ i18nDirectory = new File(config.getDataDirectory(), "i18n");
+
+ if (i18nDirectory.exists()) {
+ // clean i18n cache
+ ApplicationIOUtil.cleanDirectory(
+ i18nDirectory,
+ t("faxtomail.i18n.deleteCache.error", i18nDirectory));
+ }
+ }
+
+ ApplicationIOUtil.forceMkdir(i18nDirectory,
+ t("faxtomail.i18n.mkDir.error", i18nDirectory));
+
+ if (log.isDebugEnabled()) {
+ log.debug("I18N directory: " + i18nDirectory);
+ }
+
+ Locale i18nLocale = config.getI18nLocale();
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Starts i18n with locale [%s] at [%s]",
+ i18nLocale, i18nDirectory));
+ }
+ I18n.init(new UserI18nInitializer(
+ i18nDirectory, new DefaultI18nInitializer("faxtomail-i18n")),
+ i18nLocale);
+
// //--------------------------------------------------------------------//
// // init help
// //--------------------------------------------------------------------//
@@ -305,36 +383,31 @@
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
- setActionUI(new FaxToMailActionUI(null, this));
+ setActionUI(new ApplicationActionUI(null, this));
}
public void open() {
setLocale(config.getI18nLocale());
-// boolean dbExists =
-// config.getServiceConfig().getPersistenceConfig().isDbExists();
+// boolean dbExists = config.isDbExists();
//
// setDbExist(dbExists);
-//
-// if (!dbExists) {
-//
-// }
-//
-// // save back to config
-// saveContextToConfig();
-//
-// // list when programId or campaingId change to save the configuration
-// addPropertyChangeListener(new PropertyChangeListener() {
-//
-// @Override
-// public void propertyChange(PropertyChangeEvent evt) {
-//
-// if (PROPERTIES_TO_SAVE.contains(evt.getPropertyName())) {
-// saveContextToConfig();
-// }
-// }
-// });
+
+ // save back to config
+ saveContextToConfig();
+
+ // list when programId or campaingId change to save the configuration
+ addPropertyChangeListener(new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (PROPERTIES_TO_SAVE.contains(evt.getPropertyName())) {
+ saveContextToConfig();
+ }
+ }
+ });
}
@Override
@@ -350,13 +423,13 @@
// IOUtils.closeQuietly(serviceContext);
// // remove listeners
-// PropertyChangeListener[] listeners = getPropertyChangeListeners();
-// for (PropertyChangeListener listener : listeners) {
-// if (log.isDebugEnabled()) {
-// log.debug("Remove listener: " + listener);
-// }
-// removePropertyChangeListener(listener);
-// }
+ PropertyChangeListener[] listeners = getPropertyChangeListeners();
+ for (PropertyChangeListener listener : listeners) {
+ if (log.isDebugEnabled()) {
+ log.debug("Remove listener: " + listener);
+ }
+ removePropertyChangeListener(listener);
+ }
setMainUI(null);
if (actionUI != null) {
@@ -370,9 +443,9 @@
//-- Service methods --//
//------------------------------------------------------------------------//
-// public DecoratorService getDecoratorService() {
-// return serviceContext.getService(DecoratorService.class);
-// }
+ public DecoratorService getDecoratorService() {
+ return serviceContext.newService(DecoratorService.class);
+ }
//------------------------------------------------------------------------//
//-- DataContext methods --//
@@ -382,7 +455,7 @@
//-- Config methods --//
//------------------------------------------------------------------------//
- public FaxToMailApplicationConfig getConfig() {
+ public FaxToMailConfiguration getConfig() {
return config;
}
@@ -395,7 +468,7 @@
// config.setProgramId(getProgramId());
// config.setCruiseId(getCruiseId());
// config.setProtocolId(getProtocolId());
-// config.setI18nLocale(getLocale());
+ config.setI18nLocale(getLocale());
config.save();
}
@@ -411,17 +484,31 @@
this.mainUI = mainUI;
}
- public FaxToMailActionUI getActionUI() {
+ @Override
+ public ApplicationActionUI getActionUI() {
return actionUI;
}
- public void setActionUI(FaxToMailActionUI actionUI) {
+ @Override
+ public ApplicationActionUI getExistingActionUI() {
+ while (actionUI == null) {
+
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // ignore this one
+ }
+ }
+ return actionUI;
+ }
+
+ public void setActionUI(ApplicationActionUI actionUI) {
this.actionUI = actionUI;
}
-// public SwingSession getSwingSession() {
-// return swingSession;
-// }
+ public SwingSession getSwingSession() {
+ return swingSession;
+ }
public FaxToMailScreen getScreen() {
return screen;
@@ -433,24 +520,42 @@
firePropertyChange(PROPERTY_SCREEN, oldValue, screen);
}
+ @Override
public boolean isBusy() {
return busy;
}
+ @Override
public void setBusy(boolean busy) {
this.busy = busy;
firePropertyChange(PROPERTY_BUSY, null, busy);
}
+ @Override
public boolean isHideBody() {
return hideBody;
}
+ @Override
public void setHideBody(boolean hideBody) {
this.hideBody = hideBody;
firePropertyChange(PROPERTY_HIDE_BODY, null, hideBody);
}
+ @Override
+ public Color getColorBlockingLayer() {
+ return getConfig().getColorBlockingLayer();
+ }
+
+ @Override
+ public ApplicationActionFactory getActionFactory() {
+ return faxToMailActionFactory;
+ }
+
+ @Override
+ public ApplicationActionEngine getActionEngine() {
+ return faxToMailActionEngine;
+ }
//------------------------------------------------------------------------//
//-- UIMessageNotifier methods --//
//------------------------------------------------------------------------//
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,11 +1,10 @@
package com.franciaflex.faxtomail.ui.swing;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-import com.franciaflex.faxtomail.ui.swing.content.StartAction;
+import com.franciaflex.faxtomail.ui.swing.actions.StartAction;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailExceptionHandler;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,18 +33,18 @@
log.info("Starting FaxToMail with arguments: " + Arrays.toString(args));
}
- // override default exception management (after config init)
- Thread.setDefaultUncaughtExceptionHandler(new FaxToMailExceptionHandler());
- // See http://forge.codelutin.com/issues/2055
- //System.setProperty("sun.awt.exception.handler", TuttiExceptionHandler.class.getName());
-
// Create configuration
- FaxToMailApplicationConfig config =
- new FaxToMailApplicationConfig("faxtomail.config", args);
+ FaxToMailConfiguration config =
+ new FaxToMailConfiguration("faxtomail.config", args);
// Create application context
FaxToMailUIContext context = FaxToMailUIContext.newContext(config);
+ // override default exception management (after config init)
+ Thread.setDefaultUncaughtExceptionHandler(new FaxToMailExceptionHandler(context.getErrorHelper()));
+ // See http://forge.codelutin.com/issues/2055
+ //System.setProperty("sun.awt.exception.handler", TuttiExceptionHandler.class.getName());
+
// prepare context (mainly init configs, i18n)
context.init();
@@ -123,9 +122,9 @@
});
// launch start action (use the tutti-start-action file)
- StartAction uiAction = FaxToMailActionHelper.createLogicAction(
+ StartAction uiAction = context.getActionFactory().createLogicAction(
mainUI.getHandler(), StartAction.class);
- FaxToMailActionHelper.runAction(uiAction);
+ context.getActionEngine().runAction(uiAction);
}
public static void closeFaxToMail(MainUIHandler handler, Integer exitCode) {
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractChangeScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,94 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.context.JAXXContextEntryDef;
+
+/**
+ * Action to change the screen.
+ * <p/>
+ * Will just check that the current screen can be quit via
+ * the {@link com.franciaflex.faxtomail.ui.swing.content.MainUIHandler#quitCurrentScreen()}.
+ * <p/>
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractChangeScreenAction extends AbstractMainUIFaxToMailAction {
+
+ /**
+ * Context entry to keep previous screen.
+ *
+ * @since 1.1
+ */
+ protected static final JAXXContextEntryDef<FaxToMailScreen> PREVIOUS_SCREEN =
+ SwingUtil.newContextEntryDef("previousScreen", FaxToMailScreen.class);
+
+ /**
+ * Screen where to go.
+ *
+ * @since 1.0
+ */
+ protected FaxToMailScreen screen;
+
+ /**
+ * Flag to skip the check of current screen.
+ *
+ * @since 1.1
+ */
+ protected boolean skipCheckCurrentScreen;
+
+ protected AbstractChangeScreenAction(MainUIHandler handler,
+ boolean hideBody,
+ FaxToMailScreen screen) {
+ super(handler, hideBody);
+ this.screen = screen;
+ }
+
+ public void setSkipCheckCurrentScreen(boolean skipCheckCurrentScreen) {
+ this.skipCheckCurrentScreen = skipCheckCurrentScreen;
+ }
+
+ protected void setScreen(FaxToMailScreen screen) {
+ this.screen = screen;
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+ boolean result = super.prepareAction();
+ result &= skipCheckCurrentScreen || getHandler().quitCurrentScreen();
+ return result;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ FaxToMailUIContext context = getContext();
+
+ FaxToMailScreen previousScreen = context.getScreen();
+ if (getUI() != null) {
+ if (previousScreen == null) {
+ PREVIOUS_SCREEN.removeContextValue(getUI());
+ } else {
+ PREVIOUS_SCREEN.setContextValue(getUI(), previousScreen);
+ }
+ }
+
+ // clean current screen
+ context.setScreen(null);
+
+ // change screen
+ context.setScreen(screen);
+ }
+
+ @Override
+ public void postFailedAction(Throwable error) {
+ if (error != null) {
+
+// getContext().setFallBackScreen();
+ }
+ }
+
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,334 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.google.common.base.Preconditions;
-import jaxx.runtime.FileChooserUtil;
-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.decorator.Decorator;
-
-import javax.swing.*;
-import java.io.File;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * FaxToMail base action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractFaxToMailAction<M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
- extends AbstractBean {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(AbstractFaxToMailAction.class);
-
- public static final String PROPERTY_DONE = "done";
-
- protected final H handler;
-
- protected String actionDescription;
-
- protected final boolean hideBody;
-
- protected final Object lock = new Object();
-
- public abstract void doAction() throws Exception;
-
- protected AbstractFaxToMailAction(H handler, boolean hideBody) {
- this.handler = handler;
- this.hideBody = hideBody;
- }
-
- public boolean prepareAction() throws Exception {
- // by default nothing to prepare
- return true;
- }
-
- protected void releaseAction() {
- // by default nothing to clean
- firePropertyChange(PROPERTY_DONE, null, true);
- }
-
- public void postSuccessAction() {
- // by default nothing to do after action
- }
-
- public void postFailedAction(Throwable error) {
- // by default nothing to do after action
- }
-
- public H getHandler() {
- return handler;
- }
-
- public M getModel() {
- return handler.getModel();
- }
-
- public final UI getUI() {
- return handler.getUI();
- }
-
- public FaxToMailUIContext getContext() {
- return handler.getContext();
- }
-
- public String getActionDescription() {
- return actionDescription;
- }
-
- public void setActionDescription(String actionDescription) {
- this.actionDescription = actionDescription;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- getContext().getActionUI().getModel().setProgressionModel(progressionModel);
- }
-
- protected ProgressionModel getProgressionModel() {
- return getContext().getActionUI().getModel().getProgressionModel();
- }
-
- public boolean isHideBody() {
- return hideBody;
- }
-
-// public TuttiDataContext getDataContext() {
-// return getContext().getDataContext();
-// }
-
-// protected FaxToMailApplicationConfig getConfig() {
-// return getContext().getConfig();
-// }
-
- protected void sendMessage(String message) {
- getContext().showInformationMessage(message);
- }
-
-// protected <O> Decorator<O> getDecorator(Class<O> type, String name) {
-// Decorator<O> decorator = handler.getDecorator(type, name);
-// Preconditions.checkNotNull(decorator);
-// return decorator;
-// }
-
-// protected String decorate(Object object) {
-// return getDecorator(object.getClass(), null).toString(object);
-// }
-//
-// protected String decorate(Object object, String context) {
-// return getDecorator(object.getClass(), context).toString(object);
-// }
-
-// protected boolean askAdminPassword(String askMessage,
-// String askMessageTitle,
-// String errorMessage,
-// String errorMessageTitle) {
-//
-// Component container = getContext().getActionUI();
-//
-// String answer;
-// boolean result;
-// do {
-// answer = JOptionPane.showInputDialog(container,
-// askMessage,
-// askMessageTitle,
-// JOptionPane.WARNING_MESSAGE);
-// if (answer != null) {
-// String cryptedAnswer = StringUtil.encodeMD5(answer);
-// String correctAnswer = getConfig().getAdminPassword();
-// result = StringUtils.equals(cryptedAnswer, correctAnswer);
-//
-// if (!result) {
-// JOptionPane.showMessageDialog(container,
-// errorMessage,
-// errorMessageTitle,
-// JOptionPane.ERROR_MESSAGE);
-// }
-//
-// } else {
-// result = false;
-// }
-//
-// } while (!result && answer != null);
-// return result;
-// }
-
- /**
- * Choisir un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou le fichier incoming si l'opération a été
- * annulée
- */
- protected File chooseFile(String title,
- String buttonLabel,
- String... filters) {
-
- File file = FileChooserUtil.getFile(title,
- buttonLabel,
- getContext().getMainUI(),
- filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- File newDir = file.isDirectory() ? file : file.getParentFile();
- FileChooserUtil.setCurrentDirectory(newDir);
- }
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(File defaultFile,
- String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- if (defaultFile != null && FileChooserUtil.isCurrentDirectoryDefault()) {
-
- // set default directory to this one
- FileChooserUtil.setCurrentDirectory(defaultFile);
- }
- File file = saveFile(filename, extension, title, buttonLabel, filters);
- return file;
- }
-
- /**
- * Sauver un fichier via un sélecteur graphique de fichiers.
- *
- * @param title le titre du dialogue de sélection
- * @param buttonLabel le label du boutton d'acceptation
- * @param filters les filtres + descriptions sur le sélecteur de
- * fichiers
- * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
- * pas voulu écrasé un fichier existant.
- */
- protected File saveFile(String filename,
- String extension,
- String title,
- String buttonLabel,
- String... filters) {
-
- boolean withExtension = StringUtils.isNotBlank(extension);
- String filenameSuffix = withExtension ? "." + extension : "";
- File file = FileChooserUtil.saveFile(filename + filenameSuffix, title, buttonLabel, getContext().getMainUI(), filters);
- if (log.isDebugEnabled()) {
- log.debug(title + " : " + file);
- }
- if (file != null) {
- Preconditions.checkState(!file.isDirectory());
-
- // add extension if missing
- if (withExtension && !file.getName().endsWith(filenameSuffix)) {
- file = new File(file.getParentFile(), file.getName() + filenameSuffix);
- }
-
- // ask user to confirm overwrite.
- boolean confirm = askOverwriteFile(file);
-
- if (confirm) {
-
- // on conserve le répertoire (pour une prochaine utilisation)
- FileChooserUtil.setCurrentDirectory(file.getParentFile());
- } else {
-
- // l'utilisateur n'a pas confirmé l'écrasement
- // donc pas de fichier en retour
- file = null;
- }
- }
-
- return file;
- }
-
- protected boolean askOverwriteFile(File file) {
- boolean result;
- if (file.exists()) {
-
- // file exists ask user to overwrite
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- _("faxtomail.common.askOverwriteFile.message", file),
- _("faxtomail.common.askOverwriteFile.help"));
-
- result = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- _("faxtomail.common.askOverwriteFile.title"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
- } else {
-
- // file does not exist
- result = true;
- }
- return result;
- }
-
- protected boolean askBeforeDelete(String title, String message) {
- String htmlMessage = String.format(
- AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- message,
- _("faxtomail.common.askBeforeDelete.help"));
- int i = JOptionPane.showConfirmDialog(
- getHandler().getTopestUI(),
- htmlMessage,
- title,
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- boolean result = i == JOptionPane.OK_OPTION;
- return result;
- }
-
- protected void displayInfoMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.INFORMATION_MESSAGE);
- }
-
- protected void displayWarningMessage(String title, String message) {
- JOptionPane.showMessageDialog(
- getHandler().getTopestUI(),
- message,
- title,
- JOptionPane.WARNING_MESSAGE);
- }
-
- protected void createProgressionModelIfRequired(int total) {
- ProgressionModel progressionModel = getProgressionModel();
- if (progressionModel==null) {
- progressionModel = new ProgressionModel();
- progressionModel.setTotal(total);
- progressionModel.setMessage("");
- progressionModel.setCurrent(0);
- setProgressionModel(progressionModel);
- } else {
- progressionModel.adaptTotal(total);
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,104 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.ProgressionModel;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
+import org.jdesktop.beans.AbstractBean;
+import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * FaxToMail base action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractFaxToMailAction <M extends AbstractBean, UI extends FaxToMailUI<M, ?>, H extends AbstractFaxToMailUIHandler<M, UI>>
+ extends AbstractApplicationAction<M, UI, H> {
+
+ public abstract void doAction() throws Exception;
+
+ protected AbstractFaxToMailAction(H handler, boolean hideBody) {
+ super(handler, hideBody);
+ }
+
+ @Override
+ public FaxToMailUIContext getContext() {
+ return handler.getContext();
+ }
+
+ public void setProgressionModel(ProgressionModel progressionModel) {
+ super.setProgressionModel(progressionModel);
+ }
+
+ @Override
+ protected ProgressionModel getProgressionModel() {
+ return (ProgressionModel) getContext().getActionUI().getModel().getProgressionModel();
+ }
+
+// public FaxToMailDataContext getDataContext() {
+// return getContext().getDataContext();
+// }
+
+ @Override
+ protected FaxToMailConfiguration getConfig() {
+ return getContext().getConfig();
+ }
+
+ @Override
+ protected void sendMessage(String message) {
+ getContext().showInformationMessage(message);
+ }
+
+ @Override
+ protected void createProgressionModelIfRequired(int total) {
+ ProgressionModel progressionModel = getProgressionModel();
+ if (progressionModel == null) {
+ progressionModel = new ProgressionModel();
+ progressionModel.setTotal(total);
+ progressionModel.setMessage("");
+ progressionModel.setCurrent(0);
+ setProgressionModel(progressionModel);
+ } else {
+ progressionModel.adaptTotal(total);
+ }
+ }
+
+ protected boolean askAdminPassword(String askMessage,
+ String askMessageTitle,
+ String errorMessage,
+ String errorMessageTitle) {
+
+ Component container = getContext().getActionUI();
+
+ String answer;
+ boolean result;
+ do {
+ answer = JOptionPane.showInputDialog(container,
+ askMessage,
+ askMessageTitle,
+ JOptionPane.WARNING_MESSAGE);
+// if (answer != null) {
+// String cryptedAnswer = StringUtil.encodeMD5(answer);
+// String correctAnswer = getConfig().getAdminPassword();
+// result = StringUtils.equals(cryptedAnswer, correctAnswer);
+//
+// if (!result) {
+// JOptionPane.showMessageDialog(container,
+// errorMessage,
+// errorMessageTitle,
+// JOptionPane.ERROR_MESSAGE);
+// }
+//
+// } else {
+ result = false;
+// }
+
+ } while (!result && answer != null);
+ return result;
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java (from rev 4, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractMainUIFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.MainUI;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public abstract class AbstractMainUIFaxToMailAction extends AbstractFaxToMailAction<FaxToMailUIContext, MainUI, MainUIHandler> {
+
+ protected AbstractMainUIFaxToMailAction(MainUIHandler handler,
+ boolean hideBody) {
+ super(handler, hideBody);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/CloseApplicationAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,42 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To close FaxToMail Application.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class CloseApplicationAction extends AbstractChangeScreenAction {
+
+ protected int exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
+
+ public CloseApplicationAction(MainUIHandler handler) {
+ super(handler, false, null);
+ setSkipCheckCurrentScreen(true);
+ setActionDescription(t("faxtomail.main.action.exit.tip"));
+ }
+
+ public void setExitCode(int exitCode) {
+ this.exitCode = exitCode;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ super.doAction();
+
+ RunFaxToMail.closeFaxToMail(getHandler(), exitCode);
+ }
+
+
+ @Override
+ public void releaseAction() {
+ exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
+ super.releaseAction();
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionException.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionException.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,34 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-/**
- * To box any error of a {@link AbstractFaxToMailAction}.
- *
- * @author kmorin
- * @since 0.1
- */
-public class FaxToMailActionException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- private final AbstractFaxToMailAction action;
-
- public FaxToMailActionException(AbstractFaxToMailAction action, Throwable cause) {
- super(cause);
- this.action = action;
- }
-
- public static FaxToMailActionException propagateError(AbstractFaxToMailAction action,
- Throwable cause) {
- FaxToMailActionException result;
- if (cause instanceof FaxToMailActionException) {
- result = ((FaxToMailActionException) cause);
- } else {
- result = new FaxToMailActionException(action, cause);
- }
- return result;
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionHelper.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,123 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractMainUIFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import com.google.common.base.Preconditions;
-import org.apache.commons.lang3.reflect.ConstructorUtils;
-
-import javax.swing.*;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Useful method around FaxToMailUIAction.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.2
- */
-public class FaxToMailActionHelper {
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(A action) {
- Throwable error = null;
-
- try {
- action.doAction();
- action.postSuccessAction();
- } catch (Throwable e) {
- error = e;
- throw FaxToMailActionException.propagateError(action, e);
- } finally {
- try {
- if (error != null) {
- action.postFailedAction(error);
- }
- } finally {
-
- action.releaseAction();
- }
- }
- }
-
- public static <A extends AbstractFaxToMailAction> void runInternalAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A action = createLogicAction(handler, actionName);
- runInternalAction(action);
- }
-
- public static <A extends AbstractFaxToMailAction> void runAction(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.actionPerformed(null);
- }
-
- public static void runAction(AbstractButton button) {
- button.getAction().actionPerformed(null);
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(A action) {
- FaxToMailUIAction<A> uiAction = createUIAction(null, action);
- uiAction.launchActionAndWait();
- }
-
- public static <A extends AbstractFaxToMailAction> void runActionAndWait(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- A logicAction = createLogicAction(handler, actionName);
- runActionAndWait(logicAction);
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- return createUIAction(handler, null, actionName);
- }
-
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractFaxToMailUIHandler handler,
- AbstractButton abstractButton,
- Class<A> actionName) {
- try {
-
- // create logic action
- A logicAction = createLogicAction(handler, actionName);
-
- // create ui action
- FaxToMailUIAction<A> result = createUIAction(abstractButton, logicAction);
- return result;
- } catch (Exception e) {
-// throw new FaxToMailTechnicalException(_("tutti.action.create.error", actionName), e);
- }
- return null;
- }
-
- public static <A extends AbstractFaxToMailAction> FaxToMailUIAction<A> createUIAction(AbstractButton abstractButton,
- A logicAction) {
-
- // create ui action
- FaxToMailUIAction<A> result = new FaxToMailUIAction<A>(abstractButton,
- logicAction);
- return result;
- }
-
- public static <A extends AbstractFaxToMailAction> A createLogicAction(AbstractFaxToMailUIHandler handler,
- Class<A> actionName) {
- try {
-
- if (AbstractMainUIFaxToMailAction.class.isAssignableFrom(actionName) &&
- handler.getContext().getMainUI() != null) {
- handler = handler.getContext().getMainUI().getHandler();
- }
-
- // create action
- A result = ConstructorUtils.invokeConstructor(actionName, handler);
- return result;
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
- }
- }
-
- public static <A extends AbstractFaxToMailAction> A getLogicAction(AbstractButton b) {
- Action action = b.getAction();
- Preconditions.checkNotNull(action);
- Preconditions.checkState(action instanceof FaxToMailUIAction);
- return ((FaxToMailUIAction<A>) action).getLogicAction();
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionSwingWorker.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionSwingWorker.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,161 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Worker to execute logic action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class FaxToMailActionSwingWorker<A extends AbstractFaxToMailAction> extends SwingWorker<Void, String> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionSwingWorker.class);
-
- /**
- * Timer used to launch timerTask (to open load dialog).
- *
- * @since 1.0.2
- */
- private static final Timer t = new Timer();
-
- protected final FaxToMailActionUI actionUI;
-
- protected final A action;
-
- protected Throwable error;
-
- protected TimerTask timer;
-
- protected FaxToMailActionSwingWorker(A action) {
-
- this.action = action;
- this.actionUI = action.getContext().getActionUI();
- }
-
- public Throwable getError() {
- return error;
- }
-
- public boolean isFailed() {
- return error != null;
- }
-
- @Override
- protected Void doInBackground() throws Exception {
-
- if (!isCancelled()) {
-
- timer = new FaxToMailActionTimerTask();
-
- t.schedule(timer, 1000);
-
- try {
-
- action.doAction();
-
- } catch (Throwable e) {
- if (log.isErrorEnabled()) {
- log.error("Task [" + this + "] Error while doAction: ", e);
- }
- error = e;
- } finally {
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] done");
- }
- }
- }
- return null;
- }
-
- @Override
- protected void done() {
- super.done();
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + this + "] execute done method after all");
- }
-
- if (error == null) {
-
- // success hook
- action.postSuccessAction();
- } else {
-
- // fail hook
- action.postFailedAction(error);
- }
-
- action.releaseAction();
-
- if (timer != null) {
-
- timer.cancel();
- }
-
- actionUI.close();
-
- updateBusyState(false);
- }
-
- protected void updateBusyState(boolean busy) {
-
- boolean hideBody = action.isHideBody();
-
- action.getContext().setBusy(busy);
-
- if (hideBody) {
- action.getContext().setHideBody(!busy);
- }
-
- }
-
- protected class FaxToMailActionTimerTask extends TimerTask {
-
- public FaxToMailActionTimerTask() {
- action.addPropertyChangeListener(AbstractFaxToMailAction.PROPERTY_DONE, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- if (actionUI.isVisible()) {
- actionUI.close();
- }
-
- // we do NOT want the timer to wake up then the actionUI dialog
- cancel();
- }
- });
- }
-
- @Override
- public void run() {
- if (isCancelled() || isDone()) {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] was already canceled or done, do nothing");
- }
- } else {
-
- if (log.isDebugEnabled()) {
- log.debug("Task [" + action + "] is started, show waiting dialog");
- }
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- actionUI.open(action);
- }
- });
- }
- }
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.css 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,45 +0,0 @@
-
-#busyBlockLayerUI {
- useIcon:false;
- blockingColor: {handler.getConfig().getColorBlockingLayer()};
- block:{true};
-}
-
-#globalPanel {
- border: {new TitledBorder((String) null)};
-}
-
-#globalActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#globalProgressBar {
- indeterminate: true;
-}
-
-#taskPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#taskProgressBar {
- indeterminate: false;
-}
-
-#taskActionLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#informationPanel {
- visible: false;
- border: {new TitledBorder((String) null)};
-}
-
-#informationLabel {
- border: {new EmptyBorder(5, 5, 5, 5)};
-}
-
-#okAction {
- actionIcon: information;
- text: "faxtomail.action.ok";
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUI.jaxx 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,59 +0,0 @@
-<JDialog width='300' height='200' modal='true'
- undecorated='true'
- implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<FaxToMailActionUIModel, FaxToMailActionUIHandler>'>
- <import>
-
- com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
- com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
-
- jaxx.runtime.swing.BlockingLayerUI
-
- javax.swing.border.EmptyBorder
- </import>
-
- <script><![CDATA[
-
- public FaxToMailActionUI(JFrame frame, FaxToMailUIContext context) {
- super(frame, true);
- FaxToMailActionUIHandler handler = new FaxToMailActionUIHandler(context, this);
- setContextValue(handler);
- handler.beforeInitUI();
- }
-
- public void open(AbstractFaxToMailAction action) {
- getModel().setAction(action);
- }
-
- public void close() {
- getModel().clear();
- }
-
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
- ]]></script>
-
-
- <BlockingLayerUI id='busyBlockLayerUI'/>
-
- <FaxToMailActionUIHandler id='handler'
- initializer='getContextValue(FaxToMailActionUIHandler.class)'/>
-
- <FaxToMailActionUIModel id='model'
- initializer='getContextValue(FaxToMailActionUIModel.class)'/>
-
- <JPanel id='rootPanel' layout='{new BorderLayout()}'
- constraints='BorderLayout.CENTER' decorator='boxed'>
- <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
- layout='{new BorderLayout()}'>
- <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
- layout='{new BorderLayout()}'>
- <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
- <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
- </JPanel>
- </JPanel>
-
-</JDialog>
\ No newline at end of file
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,251 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.MainUI;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.StatusMessagePanel;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIHandler extends AbstractFaxToMailUIHandler<FaxToMailActionUIModel, FaxToMailActionUI> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FaxToMailActionUIHandler.class);
-
- public FaxToMailActionUIHandler(FaxToMailUIContext context, FaxToMailActionUI ui) {
- super(context, ui);
- }
-
- protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- String propertyName = evt.getPropertyName();
- if (ProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
-
- // change message
- String newMessage = (String) evt.getNewValue();
- ui.getTaskActionLabel().setText("<html><body>" + newMessage + "</body></html>");
- ui.pack();
- } else if (ProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
-
- // change total progressbar max
- ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
-
- } else if (ProgressionModel.PROPERTY_CURRENT.equals(propertyName)) {
-
- // change value of progress bar
- ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
- }
- }
- };
-
- protected ComponentListener listener = new ComponentAdapter() {
- boolean moving;
-
- boolean resizing;
-
- @Override
- public void componentMoved(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!moving && mainUI.isShowing()) {
-
- moving = true;
- try {
- setLocation(mainUI);
- } finally {
- moving = false;
- }
- }
- }
-
- @Override
- public void componentResized(ComponentEvent e) {
-
- MainUI mainUI = (MainUI) e.getSource();
-
- if (!resizing && mainUI.isShowing()) {
-
- resizing = true;
- try {
- setSize(mainUI);
- } finally {
- resizing = false;
- }
- }
- }
- };
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public void beforeInitUI() {
- FaxToMailActionUIModel model = new FaxToMailActionUIModel();
- ui.setContextValue(model);
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // udpate global label
- AbstractFaxToMailAction action = (AbstractFaxToMailAction) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("Action to use: " + action);
- }
- if (action == null) {
-
- // stoping action
- hideAction();
- } else {
-
- // starting action
- showAction(action);
- }
- }
- });
-
- model.addPropertyChangeListener(FaxToMailActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
-
- // change progression model
-
- ProgressionModel oldValue = (ProgressionModel) evt.getOldValue();
- ProgressionModel newValue = (ProgressionModel) evt.getNewValue();
-
- if (log.isDebugEnabled()) {
- log.debug("progression model: " + newValue);
- }
- if (oldValue != null) {
- oldValue.removePropertyChangeListener(progressionListener);
- }
-
- if (newValue == null) {
-
- // remove progression model
- ui.getTaskPanel().setVisible(false);
- } else {
-
- // use progression model
- ui.getTaskPanel().setVisible(true);
-
- newValue.addPropertyChangeListener(progressionListener);
- }
- }
- });
- }
-
- @Override
- public void afterInitUI() {
-
- initUI(ui);
-
- // installation layer de blocage en mode busy
- SwingUtil.setLayerUI(ui.getRootPanel(), ui.getBusyBlockLayerUI());
-
- ui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- }
-
- @Override
- protected JComponent getComponentToFocus() {
- return null;
- }
-
- @Override
- public void onCloseUI() {
-
- }
-
- @Override
- public SwingValidator<FaxToMailActionUIModel> getValidator() {
- return null;
- }
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected void hideAction() {
- ui.setVisible(false);
- }
-
- protected void showAction(AbstractFaxToMailAction action) {
- ui.setTitle(_("faxtomail.main.title.action",
-// getConfig().getVersion(),
- "0.1",
- action.getActionDescription()));
- ui.getGlobalActionLabel().setText(
- _("faxtomail.message.action.running",
- action.getActionDescription()));
- ui.pack();
-
- MainUI mainUI = getContext().getMainUI();
- if (mainUI != null) {
- mainUI.addComponentListener(listener);
-
- setLocation(mainUI);
- setSize(mainUI);
- }
- try {
- ui.setVisible(true);
- } finally {
- if (mainUI != null) {
- mainUI.removeComponentListener(listener);
- }
- }
- }
-
- protected void setLocation(MainUI mainUI) {
- Container component = mainUI.getBody();
- StatusMessagePanel status = mainUI.getStatus();
- int width = component == null ? 0 : component.getWidth();
- int height = component == null ? 0 : component.getHeight() + status.getHeight();
-
- int x;
- int y;
- if (height == 0) {
- x = mainUI.getX() + 5;
- y = mainUI.getY() + 15;
- } else {
- x = mainUI.getX() + (mainUI.getWidth() - width);
- y = mainUI.getY() + (mainUI.getHeight() - height);
- }
- ui.setLocation(x, y);
- }
-
- protected void setSize(MainUI mainUI) {
- // Better to let his own size to the action progress bar
- // see http://forge.codelutin.com/issues/3263
-// Container component = mainUI.getBody();
-// int width = component == null ? 0 : component.getWidth();
-
- ui.pack();
-
-// if (width != 0 && ui.getWidth() < width) {
-// ui.setSize(width, ui.getHeight());
-// }
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIModel.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailActionUIModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,51 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import com.franciaflex.faxtomail.persistence.ProgressionModel;
-import com.google.common.base.Preconditions;
-import org.jdesktop.beans.AbstractSerializableBean;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailActionUIModel extends AbstractSerializableBean {
-
- private static final long serialVersionUID = 1L;
-
- public static final String PROPERTY_ACTION = "action";
-
- public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
-
- protected AbstractFaxToMailAction action;
-
- protected ProgressionModel progressionModel;
-
- public ProgressionModel getProgressionModel() {
- return progressionModel;
- }
-
- public void setProgressionModel(ProgressionModel progressionModel) {
- Object oldValue = getProgressionModel();
- this.progressionModel = progressionModel;
- firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
- }
-
- public AbstractFaxToMailAction getAction() {
- return action;
- }
-
- public void setAction(AbstractFaxToMailAction action) {
- Preconditions.checkNotNull(action, "action can not be null");
- Object oldValue = getAction();
- this.action = action;
- firePropertyChange(PROPERTY_ACTION, oldValue, action);
- }
-
- public void clear() {
-// setProgressionModel(null);
-
- Object oldValue = getAction();
- action = null;
- firePropertyChange(PROPERTY_ACTION, oldValue, null);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailUIAction.java 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/FaxToMailUIAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,201 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.action;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.TimeLog;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Abstract FaxToMail ui action which launch a {@link AbstractFaxToMailAction}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.2
- */
-public class FaxToMailUIAction<A extends AbstractFaxToMailAction> extends AbstractAction {
-
- private static final long serialVersionUID = 1L;
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(FaxToMailUIAction.class);
-
- private static final TimeLog TIME_LOG = new TimeLog(FaxToMailUIAction.class);
-
- public static final ExecutorService waitingThread =
- Executors.newSingleThreadExecutor();
-
- private static final String LOGIC_ACTION = "logicAction";
-
- private final Object lock = new Object();
-
- private boolean wait;
-
- private long t0;
-
- public FaxToMailUIAction(AbstractButton button, A action) {
-
- putValue(LOGIC_ACTION, action);
-
- // fill the ui action from the button
- setActionKey(action.getClass().getName());
- if (button != null) {
- setActionIcon(button.getIcon());
- setActionName(button.getText());
- setActionDescription(button.getToolTipText());
- setActionMnemonic(button.getMnemonic());
- }
- }
-
- public void launchActionAndWait() {
- wait = true;
- actionPerformed(null);
- lock();
- }
-
-
- @Override
- public final void actionPerformed(final ActionEvent event) {
-
- t0 = TimeLog.getTime();
-
- if (log.isInfoEnabled()) {
- log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
- }
-
- // prepare action
- boolean doAction;
-
- A action = getLogicAction();
-
- // reset status message
-// action.sendMessage("");
-
- try {
- doAction = action.prepareAction();
- } catch (Exception e) {
- action.releaseAction();
- throw FaxToMailActionException.propagateError(action, e);
- }
-
- if (doAction) {
-
- final FaxToMailActionSwingWorker<A> worker =
- new FaxToMailActionSwingWorker<A>(action);
-
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
-
- // make ui busy
- worker.updateBusyState(true);
-
- }
- });
-
- if (log.isDebugEnabled()) {
- log.debug("Before execute of action " + action);
- }
-
- // perform and release action
- worker.execute();
-
- // wait until action is done
- waitingThread.execute(
- new Runnable() {
- @Override
- public void run() {
-
- A action = getLogicAction();
- try {
- try {
- worker.get();
- } catch (ExecutionException e) {
- // don't care .
- } catch (CancellationException e) {
- // dont care ?
- } catch (InterruptedException e) {
- // don't care ?
- }
- if (log.isDebugEnabled()) {
- log.debug("After execute of action " + action + " (worker done? " + worker.isDone() + ")");
- }
-
- if (worker.isFailed()) {
-
- throw FaxToMailActionException.propagateError(action, worker.getError());
- }
- } finally {
- unlock();
- }
- }
- }
- );
-
- } else {
-
- try {
- // release action
- action.releaseAction();
-
- } finally {
- unlock();
- }
- }
- }
-
- public void setActionIcon(Icon actionIcon) {
- putValue(SMALL_ICON, actionIcon);
- putValue(LARGE_ICON_KEY, actionIcon);
- }
-
- public void setActionKey(String actionKey) {
- putValue(ACTION_COMMAND_KEY, actionKey);
- }
-
- public void setActionName(String actionName) {
- putValue(NAME, actionName);
- }
-
- public void setActionDescription(String actionDescription) {
- putValue(SHORT_DESCRIPTION, actionDescription);
- getLogicAction().setActionDescription(actionDescription);
- }
-
- public void setActionMnemonic(int key) {
- putValue(MNEMONIC_KEY, key);
- }
-
- public A getLogicAction() {
- return (A) getValue(LOGIC_ACTION);
- }
-
- protected void lock() {
- if (wait) {
- synchronized (lock) {
- try {
-
- lock.wait();
-
- } catch (InterruptedException e) {
- throw FaxToMailActionException.propagateError(getLogicAction(), e);
- } finally {
- wait = false;
- }
- }
- }
- }
-
- protected void unlock() {
- TIME_LOG.log(t0, "Task [" + getLogicAction().getClass().getSimpleName() + "] End");
- if (wait) {
- synchronized (lock) {
- lock.notifyAll();
- }
- }
- }
-}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GoToPreviousScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,22 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To return on previous screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class GoToPreviousScreenAction extends AbstractChangeScreenAction {
+
+ public GoToPreviousScreenAction(MainUIHandler handler) {
+ super(handler,
+ true,
+ PREVIOUS_SCREEN.getContextValue(handler.getUI())
+ );
+ setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReloadFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,28 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To reload FaxToMail application.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.3
+ */
+public class ReloadFaxToMailAction extends AbstractChangeScreenAction {
+
+ public ReloadFaxToMailAction(MainUIHandler handler) {
+ super(handler, true, null);
+ setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ // Close the application, will exit and restart application
+ RunFaxToMail.closeFaxToMail(getHandler(), RunFaxToMail.UPATE_EXIT_CODE);
+ }
+
+}
\ No newline at end of file
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowConfigAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show config screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowConfigAction extends AbstractChangeScreenAction {
+
+ public ShowConfigAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.CONFIG);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowDemandeAction extends AbstractChangeScreenAction {
+
+ public ShowDemandeAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.DEMANDE);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowDemandeListAction extends AbstractChangeScreenAction {
+
+ public ShowDemandeListAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.LIST);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java (from rev 2, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,17 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+
+/**
+ * To show demande screen.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.1
+ */
+public class ShowRechercheAction extends AbstractChangeScreenAction {
+
+ public ShowRechercheAction(MainUIHandler handler) {
+ super(handler, true, FaxToMailScreen.SEARCH);
+ }
+}
Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java (from rev 6, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java)
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/StartAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,88 @@
+package com.franciaflex.faxtomail.ui.swing.actions;
+
+import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Start action (when the start action file is present when
+ * starting application).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.4
+ */
+public class StartAction extends AbstractMainUIFaxToMailAction {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(StartAction.class);
+
+ protected AbstractMainUIFaxToMailAction delegateAction;
+
+ public StartAction(MainUIHandler handler) {
+ super(handler, true);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+// File actionfile = getConfig().getStartActionFile();
+ boolean doAction = false;//actionfile.exists();
+
+ if (doAction) {
+
+ try {
+ // get action to execute
+// String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
+// content = content.trim();
+
+// if (InstallDbAction.class.getName().equals(content)) {
+//
+// // install db
+// delegateAction = TuttiActionHelper.createLogicAction(getHandler(), InstallDbAction.class);
+//
+// if (log.isInfoEnabled()) {
+// log.info("Found install db action");
+// }
+// } else if (content.startsWith(ImportDbAction.class.getName())) {
+//
+// // import db
+// ImportDbAction action = TuttiActionHelper.createLogicAction(getHandler(), ImportDbAction.class);
+// File importFile = new File(content.substring(ImportDbAction.class.getName().length() + 1));
+// action.setImportFile(importFile);
+// delegateAction = action;
+// if (log.isInfoEnabled()) {
+// log.info("Found import db action (with file " + importFile + ")");
+// }
+// } else {
+ doAction = false;
+// }
+
+ } finally {
+
+ // delete start action file
+// FaxToMailIOUtil.deleteFile(
+// actionfile,
+// _("faxtomail.error.delete.startActionFile", actionfile));
+ }
+ }
+
+
+ if (doAction) {
+ setActionDescription(delegateAction.getActionDescription());
+ doAction = delegateAction.prepareAction();
+ }
+ return doAction;
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ getActionEngine().runInternalAction(delegateAction);
+ }
+
+ @Override
+ protected void releaseAction() {
+ delegateAction = null;
+ super.releaseAction();
+ }
+}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractChangeScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,93 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.context.JAXXContextEntryDef;
-
-/**
- * Action to change the screen.
- * <p/>
- * Will just check that the current screen can be quit via
- * the {@link MainUIHandler#quitCurrentScreen()}.
- * <p/>
- *
- * @author kmorin <kmorin(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractChangeScreenAction extends AbstractMainUIFaxToMailAction {
-
- /**
- * Context entry to keep previous screen.
- *
- * @since 1.1
- */
- protected static final JAXXContextEntryDef<FaxToMailScreen> PREVIOUS_SCREEN =
- SwingUtil.newContextEntryDef("previousScreen", FaxToMailScreen.class);
-
- /**
- * Screen where to go.
- *
- * @since 1.0
- */
- protected FaxToMailScreen screen;
-
- /**
- * Flag to skip the check of current screen.
- *
- * @since 1.1
- */
- protected boolean skipCheckCurrentScreen;
-
- protected AbstractChangeScreenAction(MainUIHandler handler,
- boolean hideBody,
- FaxToMailScreen screen) {
- super(handler, hideBody);
- this.screen = screen;
- }
-
- public void setSkipCheckCurrentScreen(boolean skipCheckCurrentScreen) {
- this.skipCheckCurrentScreen = skipCheckCurrentScreen;
- }
-
- protected void setScreen(FaxToMailScreen screen) {
- this.screen = screen;
- }
-
- @Override
- public boolean prepareAction() throws Exception {
- boolean result = super.prepareAction();
- result &= skipCheckCurrentScreen || getHandler().quitCurrentScreen();
- return result;
- }
-
- @Override
- public void doAction() throws Exception {
-
- FaxToMailUIContext context = getContext();
-
- FaxToMailScreen previousScreen = context.getScreen();
- if (getUI() != null) {
- if (previousScreen == null) {
- PREVIOUS_SCREEN.removeContextValue(getUI());
- } else {
- PREVIOUS_SCREEN.setContextValue(getUI(), previousScreen);
- }
- }
-
- // clean current screen
- context.setScreen(null);
-
- // change screen
- context.setScreen(screen);
- }
-
- @Override
- public void postFailedAction(Throwable error) {
- if (error != null) {
-
-// getContext().setFallBackScreen();
- }
- }
-
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/AbstractMainUIFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class AbstractMainUIFaxToMailAction extends AbstractFaxToMailAction<FaxToMailUIContext, MainUI, MainUIHandler> {
-
- protected AbstractMainUIFaxToMailAction(MainUIHandler handler,
- boolean hideBody) {
- super(handler, hideBody);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,41 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To close FaxToMail Application.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class CloseApplicationAction extends AbstractChangeScreenAction {
-
- protected int exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
-
- public CloseApplicationAction(MainUIHandler handler) {
- super(handler, false, null);
- setSkipCheckCurrentScreen(true);
- setActionDescription(t("faxtomail.main.action.exit.tip"));
- }
-
- public void setExitCode(int exitCode) {
- this.exitCode = exitCode;
- }
-
- @Override
- public void doAction() throws Exception {
-
- super.doAction();
-
- RunFaxToMail.closeFaxToMail(getHandler(), exitCode);
- }
-
-
- @Override
- public void releaseAction() {
- exitCode = RunFaxToMail.NORMAL_EXIT_CODE;
- super.releaseAction();
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,20 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To return on previous screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class GoToPreviousScreenAction extends AbstractChangeScreenAction {
-
- public GoToPreviousScreenAction(MainUIHandler handler) {
- super(handler,
- true,
- PREVIOUS_SCREEN.getContextValue(handler.getUI())
- );
- setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
toolTipText: "faxtomail.main.action.demandeList.tip";
i18nMnemonic: "faxtomail.main.action.demandeList.mnemonic";
enabled: true;//{model.getScreen() != TuttiScreen.LIST};
- _tuttiAction: {ShowDemandeListAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction.class};
}
#menuFileRecherche {
@@ -32,7 +32,7 @@
toolTipText: "faxtomail.main.action.recherche.tip";
i18nMnemonic: "faxtomail.main.action.recherche.mnemonic";
enabled: true;
- _tuttiAction: {ShowRechercheAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowRechercheAction.class};
}
#menuFileConfiguration {
@@ -41,7 +41,7 @@
toolTipText: "faxtomail.main.action.configuration.tip";
i18nMnemonic: "faxtomail.main.action.configuration.mnemonic";
enabled: true;//{model.getScreen() != TuttiScreen.CONFIG};
- _tuttiAction: {ShowConfigAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowConfigAction.class};
_help: {"faxtomail.main.menu.action.configuration.help"};
}
@@ -50,7 +50,7 @@
text: "faxtomail.main.action.exit";
toolTipText: "faxtomail.main.action.exit.tip";
i18nMnemonic: "faxtomail.main.action.exit.mnemonic";
- _tuttiAction: {CloseApplicationAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.CloseApplicationAction.class};
_help: {"faxtomail.main.menu.action.exit.help"};
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,8 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
+ com.franciaflex.faxtomail.ui.swing.actions.*
org.jdesktop.swingx.JXTitledPanel
@@ -13,21 +15,11 @@
<FaxToMailUIContext id='model'
initializer='getContextValue(FaxToMailUIContext.class)'/>
- <MainUIHandler id='handler'
- initializer='getContextValue(MainUIHandler.class)'/>
-
<script><![CDATA[
public MainUI(FaxToMailUIContext context) {
- setContextValue(context);
- MainUIHandler handler = new MainUIHandler(context, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setApplicationContext(this, context);
}
-
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
<!-- menu -->
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -11,7 +11,6 @@
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
import com.franciaflex.faxtomail.ui.swing.util.RemoveablePropertyChangeListener;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.SwingUtil;
@@ -19,6 +18,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.i18n.I18n;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
import javax.swing.Icon;
import javax.swing.JComponent;
@@ -43,26 +43,17 @@
protected JComponent currentBody;
-// protected PersistenceService persistenceService;
-
- protected MainUIHandler(FaxToMailUIContext context, MainUI ui) {
- super(context, ui);
-// this.persistenceService = context.getPersistenceService();
- context.setMainUI(ui);
- context.setActionUI(new FaxToMailActionUI(ui, context));
- }
-
- public MainUIHandler(FaxToMailUIContext context) {
- super(context, null);
-// this.persistenceService = null;
- }
-
//------------------------------------------------------------------------//
//-- AbstractTuttiUIHandler methods --//
//------------------------------------------------------------------------//
@Override
- public void beforeInitUI() {
+ public void beforeInit(MainUI ui) {
+ super.beforeInit(ui);
+ FaxToMailUIContext context = getContext();
+ ui.setContextValue(context);
+ context.setMainUI(ui);
+ context.setActionUI(new ApplicationActionUI(ui, context));
context.addPropertyChangeListener(new RemoveablePropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -114,7 +105,7 @@
}
@Override
- public void afterInitUI() {
+ public void afterInit(MainUI ui) {
initUI(ui);
@@ -137,37 +128,7 @@
// JToolBar bar = ui.getBottomBar();
// ui.getStatus().addWidget(bar, 0);
-// if (context.isDbLoaded()) {
-//
-// // db already opened (happens when reloading ui)
-// // just go to select cruise screen
-// TuttiUIAction<SelectCruiseAction> uiAction = TuttiActionHelper.createUIAction(this, SelectCruiseAction.class);
-// SelectCruiseAction logicAction = uiAction.getLogicAction();
-// logicAction.setSkipCheckCurrentScreen(true);
-// logicAction.setActionDescription(ui.getMenuActionSelectCruise().getToolTipText());
-// uiAction.actionPerformed(null);
-//
-// } else {
-//
-// if (context.isDbExist()) {
-//
-// // open tutti db (using a fake button to have simple api)
-// TuttiUIAction<OpenDbAction> uiAction = TuttiActionHelper.createUIAction(this, OpenDbAction.class);
-// OpenDbAction logicAction = uiAction.getLogicAction();
-// logicAction.setSkipCheckCurrentScreen(true);
-// logicAction.setUpdateReferentiel(true);
-// uiAction.actionPerformed(null);
-//
-// } else {
-//
-// // clean db context
-// context.clearDbContext();
-//
-// // go to manage db screen (to install db)
-// context.setScreen(TuttiScreen.MANAGE_DB);
-// }
-// }
- context.setScreen(FaxToMailScreen.LIST);
+ getContext().setScreen(FaxToMailScreen.LIST);
}
@Override
@@ -178,6 +139,8 @@
@Override
public void onCloseUI() {
+ FaxToMailUIContext context = getContext();
+
// remove any screen
context.setScreen(null);
context.removeMessageNotifier(this);
@@ -240,8 +203,7 @@
getModel().setLocale(locale);
//
// // change i18n locale
-// I18n.setDefaultLocale(getConfig().getI18nLocale());
- I18n.setDefaultLocale(Locale.FRENCH);
+ I18n.setDefaultLocale(getConfig().getI18nLocale());
//
// // reload decorator service (TODO Check if this is necessary)
// getContext().reloadDecoratorService();
@@ -265,6 +227,11 @@
// getModel().showHelp(ui, ui.getBroker(), null);
// }
+ @Override
+ public final void showInformationMessage(String message) {
+ ui.getStatus().setStatus("<html><body>" + message + "</body></html>");
+ }
+
public void registerValidator(SwingValidator validator) {
// ui.getValidatorMessageWidget().registerValidator(validator);
}
@@ -277,7 +244,7 @@
public boolean quitCurrentScreen() {
boolean canClose;
- if (context.getScreen() == null || currentBody == null) {
+ if (getContext().getScreen() == null || currentBody == null) {
// no screen, surely can quit
canClose = true;
@@ -303,30 +270,6 @@
return canClose;
}
- public AbstractFaxToMailUIHandler getCurrentHandler() {
- FaxToMailUI<?, ?> body = (FaxToMailUI<?, ?>) currentBody;
- return body.getHandler();
- }
-
- /**
- * Reload the persistence service and set the new ne into the handler.
- *
- * @since 1.0
- */
- public void reloadPersistenceService() {
-// this.persistenceService = context.reloadPersistenceService();
- }
-
- /**
- * Get the persistence service instance used by the handler.
- *
- * @return the persistence service instance used by the handler
- * @since 1.0
- */
-// public PersistenceService getPersistenceService() {
-// return persistenceService;
-// }
-
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
@@ -410,8 +353,8 @@
String title = getSelectedCruiseTitle();
ui.setTitle(t("faxtomail.main.title.application",
-// getConfig().getVersion(),
- "0.1",
+ getConfig().getVersion(),
+// "0.1",
title));
}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,27 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * To reload FaxToMail application.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class ReloadFaxToMailAction extends AbstractChangeScreenAction {
-
- public ReloadFaxToMailAction(MainUIHandler handler) {
- super(handler, true, null);
- setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
- }
-
- @Override
- public void doAction() throws Exception {
-
- // Close the application, will exit and restart application
- RunFaxToMail.closeFaxToMail(getHandler(), RunFaxToMail.UPATE_EXIT_CODE);
- }
-
-}
\ No newline at end of file
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowConfigAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show config screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowConfigAction extends AbstractChangeScreenAction {
-
- public ShowConfigAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.CONFIG);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowDemandeAction extends AbstractChangeScreenAction {
-
- public ShowDemandeAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.DEMANDE);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowDemandeListAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,16 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowDemandeListAction extends AbstractChangeScreenAction {
-
- public ShowDemandeListAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.LIST);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ShowRechercheAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,18 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractChangeScreenAction;
-import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-
-/**
- * To show demande screen.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.1
- */
-public class ShowRechercheAction extends AbstractChangeScreenAction {
-
- public ShowRechercheAction(MainUIHandler handler) {
- super(handler, true, FaxToMailScreen.SEARCH);
- }
-}
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,91 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.content;
-
-import com.franciaflex.faxtomail.FaxToMailIOUtil;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-
-/**
- * Start action (when the start action file is present when
- * starting application).
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 2.4
- */
-public class StartAction extends AbstractMainUIFaxToMailAction {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(StartAction.class);
-
- protected AbstractMainUIFaxToMailAction delegateAction;
-
- public StartAction(MainUIHandler handler) {
- super(handler, true);
- }
-
- @Override
- public boolean prepareAction() throws Exception {
-
-// File actionfile = getConfig().getStartActionFile();
- boolean doAction = false;//actionfile.exists();
-
- if (doAction) {
-
- try {
- // get action to execute
-// String content = FaxToMailIOUtil.readContent(actionfile, _("faxtomail.error.read.startActionFile", actionfile));
-// content = content.trim();
-
-// if (InstallDbAction.class.getName().equals(content)) {
-//
-// // install db
-// delegateAction = TuttiActionHelper.createLogicAction(getHandler(), InstallDbAction.class);
-//
-// if (log.isInfoEnabled()) {
-// log.info("Found install db action");
-// }
-// } else if (content.startsWith(ImportDbAction.class.getName())) {
-//
-// // import db
-// ImportDbAction action = TuttiActionHelper.createLogicAction(getHandler(), ImportDbAction.class);
-// File importFile = new File(content.substring(ImportDbAction.class.getName().length() + 1));
-// action.setImportFile(importFile);
-// delegateAction = action;
-// if (log.isInfoEnabled()) {
-// log.info("Found import db action (with file " + importFile + ")");
-// }
-// } else {
- doAction = false;
-// }
-
- } finally {
-
- // delete start action file
-// FaxToMailIOUtil.deleteFile(
-// actionfile,
-// _("faxtomail.error.delete.startActionFile", actionfile));
- }
- }
-
-
- if (doAction) {
- setActionDescription(delegateAction.getActionDescription());
- doAction = delegateAction.prepareAction();
- }
- return doAction;
- }
-
- @Override
- public void doAction() throws Exception {
-
- FaxToMailActionHelper.runInternalAction(delegateAction);
- }
-
- @Override
- protected void releaseAction() {
- delegateAction = null;
- super.releaseAction();
- }
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,29 +4,17 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
</import>
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public FaxToMailConfigUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- FaxToMailConfigUIHandler handler =
- new FaxToMailConfigUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <FaxToMailConfigUIHandler id='handler'
- initializer='getContextValue(FaxToMailConfigUIHandler.class)'/>
-
<FaxToMailUIContext id='model'
initializer='getContextValue(FaxToMailUIContext.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/config/FaxToMailConfigUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,10 +1,9 @@
package com.franciaflex.faxtomail.ui.swing.content.config;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.ReloadFaxToMailAction;
+import com.franciaflex.faxtomail.ui.swing.actions.ReloadFaxToMailAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -28,23 +27,14 @@
public static final String CALLBACK_SHORTCUT = "shortcut";
- public FaxToMailConfigUIHandler(FaxToMailUI<?, ?> parentUI, FaxToMailConfigUI ui) {
- super(parentUI.getHandler().getContext(), ui);
- }
-
@Override
public SwingValidator<FaxToMailUIContext> getValidator() {
return null;
}
@Override
- public void beforeInitUI() {
+ public void afterInit(FaxToMailConfigUI faxToMailConfigUI) {
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
// FaxToMailApplicationConfig config = getConfig();
@@ -165,8 +155,8 @@
}
protected void reloadApplication() {
- ReloadFaxToMailAction action = FaxToMailActionHelper.createLogicAction(this, ReloadFaxToMailAction.class);
- FaxToMailActionHelper.runAction(action);
+ ReloadFaxToMailAction action = getContext().getActionFactory().createLogicAction(this, ReloadFaxToMailAction.class);
+ getContext().getActionEngine().runAction(action);
// TuttiActionHelper.runActionAndWait(this, ReloadTuttiAction.class);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -13,25 +14,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public DemandeListUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- DemandeListUIHandler handler =
- new DemandeListUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <DemandeListUIHandler id='handler'
- initializer='getContextValue(DemandeListUIHandler.class)'/>
-
<DemandeListUIModel id='model'
initializer='getContextValue(DemandeListUIModel.class)'/>
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,11 +24,10 @@
* #L%
*/
-import com.franciaflex.faxtomail.ui.swing.content.ShowDemandeAction;
+import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -77,22 +76,9 @@
// private final PersistenceService persistenceService;
- public DemandeListUIHandler(FaxToMailUI parentUi, DemandeListUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(DemandeListUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
@@ -131,7 +117,7 @@
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
if (evt.getClickCount() == 2) {
- FaxToMailActionHelper.runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
+ getContext().getActionEngine().runAction(new ShowDemandeAction(getContext().getMainUI().getHandler()));
}
}
});
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-02-06 16:42:22 UTC (rev 7)
@@ -57,7 +57,7 @@
#backButton {
text: "faxtomail.demande.back.button.label";
- _tuttiAction: {com.franciaflex.faxtomail.ui.swing.content.ShowDemandeListAction.class};
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction.class};
}
#saveButton {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -17,25 +18,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public DemandeUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- DemandeUIHandler handler =
- new DemandeUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <DemandeUIHandler id='handler'
- initializer='getContextValue(DemandeUIHandler.class)'/>
-
<DemandeUIModel id='model'
initializer='getContextValue(DemandeUIModel.class)'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -67,22 +67,9 @@
// private final PersistenceService persistenceService;
- public DemandeUIHandler(FaxToMailUI parentUi, DemandeUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(DemandeUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
initBeanFilterableComboBox(ui.getDocTypeComboBox(), createLabelList("Commande", "SAV"), null);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-02-06 16:42:22 UTC (rev 7)
@@ -4,6 +4,7 @@
<import>
com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
com.franciaflex.faxtomail.ui.swing.util.Label
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -14,25 +15,12 @@
<script><![CDATA[
- protected FaxToMailUIContext uiContext;
-
public SearchUI(FaxToMailUI parentUI) {
- JAXXUtil.initContext(this, parentUI);
- uiContext = parentUI.getHandler().getContext();
- SearchUIHandler handler =
- new SearchUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
+ FaxToMailUIUtil.setParentUI(this, parentUI);
}
- protected void $afterCompleteSetup() {
- handler.afterInitUI();
- }
]]></script>
- <SearchUIHandler id='handler'
- initializer='getContextValue(SearchUIHandler.class)'/>
-
<SearchUIModel id='model'
initializer='getContextValue(SearchUIModel.class)'/>
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -80,22 +80,9 @@
// private final PersistenceService persistenceService;
- public SearchUIHandler(FaxToMailUI parentUi, SearchUI ui) {
- super(parentUi.getHandler().getContext(), ui);
-// persistenceService = context.getPersistenceService();
- }
-
-
@Override
- public void beforeInitUI() {
+ public void afterInit(SearchUI ui) {
-// getDataContext().resetValidationDataContext();
-
- }
-
- @Override
- public void afterInitUI() {
-
initUI(ui);
initBeanFilterableComboBox(ui.getModifiedByComboBox(), createLabelList("Utilisateur A", "Utilisateur B", "Utilisateur C"), null);
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -0,0 +1,160 @@
+package com.franciaflex.faxtomail.ui.swing.util;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id: AbstractTuttiBeanUIModel.java 1564 2014-01-31 10:56:26Z tchemit $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/java… $
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.jdesktop.beans.AbstractSerializableBean;
+import org.nuiton.jaxx.application.listener.PropagatePropertyChangeListener;
+import org.nuiton.util.CollectionUtil;
+import org.nuiton.util.beans.Binder;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Abstract UI model to edit a bean.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public abstract class AbstractFaxToMailBeanUIModel<E, B extends AbstractFaxToMailBeanUIModel<E, B>> extends AbstractSerializableBean implements PropagatePropertyChangeListener.PropagatePropertyChange {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_ID = "id";
+
+ public static final String PROPERTY_MODIFY = "modify";
+
+ public static final String PROPERTY_VALID = "valid";
+
+ protected String id;
+
+ protected boolean modify;
+
+ protected boolean valid;
+
+ private final Binder<E, B> fromBeanBinder;
+
+ private final Binder<B, E> toBeanBinder;
+
+ protected AbstractFaxToMailBeanUIModel(Binder<E, B> fromBeanBinder,
+ Binder<B, E> toBeanBinder) {
+ this.fromBeanBinder = fromBeanBinder;
+ this.toBeanBinder = toBeanBinder;
+ }
+
+ public void fromEntity(E entity) {
+ fromBean(entity);
+ }
+
+ public E toEntity() {
+ return toBean();
+ }
+
+ public final void fromBean(E bean) {
+ fromBeanBinder.copy(bean, (B) this);
+ }
+
+ public final E toBean() {
+ E result = newEntity();
+ toBeanBinder.copy((B) this, result);
+ return result;
+ }
+
+ protected abstract E newEntity();
+
+ public boolean isModify() {
+ return modify;
+ }
+
+ public void setModify(boolean modify) {
+ Object oldValue = isModify();
+ this.modify = modify;
+ firePropertyChange(PROPERTY_MODIFY, oldValue, modify);
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ Object oldValue = isValid();
+ this.valid = valid;
+ firePropertyChange(PROPERTY_VALID, oldValue, valid);
+ }
+
+ public boolean isCreate() {
+ return id == null;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- TuttiEntity methods --//
+ //------------------------------------------------------------------------//
+
+// @Override
+ public Integer getIdAsInt() {
+ return id == null ? null : Integer.valueOf(id);
+ }
+
+// @Override
+ public void setId(Integer id) {
+ if (id == null) {
+ this.id = null;
+ } else {
+ this.id = id.toString();
+ }
+ }
+
+// @Override
+ public String getId() {
+ return id;
+ }
+
+// @Override
+ public void setId(String id) {
+ Object oldValue = getId();
+ this.id = id;
+ firePropertyChange(PROPERTY_ID, oldValue, id);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- PropagatePropertyChangeListener methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void firePropertyChanged(String propertyName,
+ Object oldValue,
+ Object newValue) {
+ firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+ protected <B> B getChild(Collection<B> child, int index) {
+ return CollectionUtil.getOrNull(child, index);
+ }
+
+ protected <B> B getChild(List<B> child, int index) {
+ return CollectionUtil.getOrNull(child, index);
+ }
+
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,306 +1,98 @@
package com.franciaflex.faxtomail.ui.swing.util;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.LabelAware;
+import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.config.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionHelper;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionUI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import jaxx.runtime.JAXXUtil;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.editor.FileEditor;
-import jaxx.runtime.swing.editor.NumberEditor;
-import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
-import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.lang3.ArrayUtils;
+import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXDatePicker;
-import org.jdesktop.swingx.JXTable;
import org.nuiton.decorator.Decorator;
-import org.nuiton.decorator.JXPathDecorator;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
-import javax.swing.*;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.text.JTextComponent;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.File;
-import java.io.Serializable;
-import java.text.ParseException;
-import java.util.Date;
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.List;
-import java.util.Map;
+import java.util.Set;
-import static org.nuiton.i18n.I18n.t;
-
/**
* Contract of any UI handler.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public abstract class AbstractFaxToMailUIHandler<M, UI extends FaxToMailUI<M, ?>> implements UIMessageNotifier {
+public abstract class AbstractFaxToMailUIHandler<M, UI extends FaxToMailUI<M, ?>>
+ extends AbstractApplicationUIHandler<M, UI> implements UIMessageNotifier {
/** Logger. */
private static final Log log =
LogFactory.getLog(AbstractFaxToMailUIHandler.class);
- public abstract void beforeInitUI();
-
- public abstract void afterInitUI();
-
- public abstract void onCloseUI();
-
- public abstract SwingValidator<M> getValidator();
-
- /**
- * Global application context.
- *
- * @since 0.1
- */
- protected final FaxToMailUIContext context;
-
- /**
- * UI handled.
- *
- * @since 0.1
- */
- protected final UI ui;
-
- protected AbstractFaxToMailUIHandler(FaxToMailUIContext context, UI ui) {
- this.context = context;
- this.ui = ui;
- }
-
- //------------------------------------------------------------------------//
- //-- Public methods --//
- //------------------------------------------------------------------------//
-
- public DefaultComboBoxModel newComboModel(Object... items) {
- return new DefaultComboBoxModel(items);
- }
-
- public final M getModel() {
- return ui.getModel();
- }
-
- public final UI getUI() {
- return ui;
- }
-
@Override
public void showInformationMessage(String message) {
- context.showInformationMessage(message);
+ getContext().showInformationMessage(message);
}
public FaxToMailUIContext getContext() {
- return context;
+ return (FaxToMailUIContext) super.getContext();
}
// public FaxToMailDataContext getDataContext() {
// return getContext().getDataContext();
// }
- public FaxToMailApplicationConfig getConfig() {
- return context.getConfig();
+ public FaxToMailConfiguration getConfig() {
+ return getContext().getConfig();
}
- public void setText(KeyEvent event, String property) {
- JTextComponent field = (JTextComponent) event.getSource();
- String value = field.getText();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setFile(ActionEvent event, String property) {
- FileEditor field = (FileEditor) event.getSource();
- File value = field.getSelectedFile();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setBoolean(ItemEvent event, String property) {
- boolean value = event.getStateChange() == ItemEvent.SELECTED;
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
- public void setDate(ActionEvent event, String property) {
- JXDatePicker field = (JXDatePicker) event.getSource();
- Date value = field.getDate();
- FaxToMailUIUtil.setProperty(getModel(), property, value);
- }
-
-// public void selectListData(ListSelectionEvent event, String property) {
-// if (!event.getValueIsAdjusting()) {
-// JList list = (JList) event.getSource();
-// ListSelectionModel selectionModel = list.getSelectionModel();
-//
-// selectionModel.setValueIsAdjusting(true);
-// try {
-// List selectedList = Lists.newLinkedList();
-//
-// for (int index : list.getSelectedIndices()) {
-// Object o = list.getModel().getElementAt(index);
-// selectedList.add(o);
-// }
-// TuttiUIUtil.setProperty(getModel(), property, selectedList);
-// } finally {
-// selectionModel.setValueIsAdjusting(false);
-// }
-// }
-// }
-
- public void openDialog(FaxToMailUI dialogContent,
- String title, Dimension dim) {
- Component topestUI = getTopestUI();
-
- JDialog result;
- if (topestUI instanceof Frame) {
- result = new JDialog((Frame) topestUI, title, true);
- } else {
- result = new JDialog((Dialog) topestUI, title, true);
- }
-
- result.add((Component) dialogContent);
- result.setResizable(true);
-
- result.setSize(dim);
-
- final AbstractFaxToMailUIHandler handler = dialogContent.getHandler();
-
- if (handler instanceof Cancelable) {
-
- // add a auto-close action
- JRootPane rootPane = result.getRootPane();
-
-// KeyStroke shortcutClosePopup = getConfig().getShortcutClosePopup();
-
-// rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
-// shortcutClosePopup, "close");
- rootPane.getActionMap().put("close", new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void actionPerformed(ActionEvent e) {
- ((Cancelable) handler).cancel();
- }
- });
- }
-
- result.addWindowListener(new WindowAdapter() {
-
- @Override
- public void windowClosed(WindowEvent e) {
- Component ui = (Component) e.getSource();
- if (log.isDebugEnabled()) {
- log.debug("Destroy ui " + ui);
- }
- JAXXUtil.destroy(ui);
- }
- });
- SwingUtil.center(getContext().getMainUI(), result);
- result.setVisible(true);
- }
-
- public void closeDialog(FaxToMailUI ui) {
- SwingUtil.getParentContainer(ui, JDialog.class).setVisible(false);
- }
-
- public static final String CONFIRMATION_FORMAT = "<html>%s<hr/><br/>%s</html>";
-
- public int askSaveBeforeLeaving(String message) {
- String htmlMessage = String.format(
- CONFIRMATION_FORMAT,
- message,
- t("faxtomail.common.askSaveBeforeLeaving.help"));
- int result = JOptionPane.showConfirmDialog(
- getTopestUI(),
- htmlMessage,
- t("faxtomail.common.askSaveBeforeLeaving.title"),
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- return result;
- }
-
- public boolean askCancelEditBeforeLeaving(String message) {
- String htmlMessage = String.format(
- CONFIRMATION_FORMAT,
- message,
- t("faxtomail.common.askCancelEditBeforeLeaving.help"));
- int i = JOptionPane.showConfirmDialog(
- getTopestUI(),
- htmlMessage,
- t("faxtomail.common.askCancelEditBeforeLeaving.title"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- boolean result = i == JOptionPane.OK_OPTION;
- return result;
- }
-
- public void showSuccessMessage(String title, String message) {
-
- Component topestUI = getTopestUI();
- boolean alwaysOnTop = false;
-
- if (topestUI instanceof JDialog) {
- alwaysOnTop = ((JDialog) topestUI).isAlwaysOnTop();
- }
-
- if (alwaysOnTop) {
- ((JDialog) topestUI).setAlwaysOnTop(false);
- }
- try {
-
- JOptionPane.showMessageDialog(
- topestUI,
- message,
- title,
- JOptionPane.INFORMATION_MESSAGE,
- UIManager.getIcon("info")
- );
- } finally {
- if (alwaysOnTop) {
- ((JDialog) topestUI).setAlwaysOnTop(true);
- }
- }
- }
-
+ @Override
public Component getTopestUI() {
Component result;
- FaxToMailActionUI actionUI = getContext().getActionUI();
- if (actionUI.isVisible()) {
+ ApplicationActionUI actionUI = getContext().getActionUI();
+// if (actionUI.isVisible()) {
result = actionUI;
- } else {
- result = getContext().getMainUI();
- }
+// } else {
+// result = getContext().getMainUI();
+// }
return result;
}
public void clearValidators() {
- MainUI main = context.getMainUI();
+ MainUI main = getContext().getMainUI();
Preconditions.checkNotNull(
main, "No mainUI registred in application context");
MainUIHandler handler = main.getHandler();
handler.clearValidators();
}
+ @Override
+ public <O> Decorator<O> getDecorator(Class<O> type, String name) {
+ DecoratorService decoratorService =
+ getContext().getDecoratorService();
+
+ Preconditions.checkNotNull(type);
+
+ Decorator decorator = decoratorService.getDecoratorByType(type, name);
+ if (decorator == null) {
+
+ if (LabelAware.class.isAssignableFrom(type)) {
+ decorator = getDecorator(LabelAware.class, null);
+ }
+ }
+ Preconditions.checkNotNull(decorator);
+ return decorator;
+ }
+
+// @Override
// public <O> Decorator<O> getDecorator(Class<O> type, String name) {
// DecoratorService decoratorService =
-// context.getDecoratorService();
+// getContext().getDecoratorService();
//
// Preconditions.checkNotNull(type);
//
@@ -315,520 +107,33 @@
// return decorator;
// }
- public void autoSelectRowInTable(MouseEvent e, JPopupMenu popup) {
-
- boolean rightClick = SwingUtilities.isRightMouseButton(e);
-
- if (rightClick || SwingUtilities.isLeftMouseButton(e)) {
-
- // get the coordinates of the mouse click
- Point p = e.getPoint();
-
- JXTable source = (JXTable) e.getSource();
-
- int[] selectedRows = source.getSelectedRows();
- int[] selectedColumns = source.getSelectedColumns();
-
- // get the row index at this point
- int rowIndex = source.rowAtPoint(p);
-
- // get the column index at this point
- int columnIndex = source.columnAtPoint(p);
-
- if (log.isDebugEnabled()) {
- log.debug("At point [" + p + "] found Row " + rowIndex + ", Column " + columnIndex);
- }
-
- boolean canContinue = true;
-
- if (source.isEditing()) {
-
- // stop editing
- boolean stopEdit = source.getCellEditor().stopCellEditing();
- if (!stopEdit) {
- if (log.isWarnEnabled()) {
- log.warn("Could not stop edit cell...");
- }
- canContinue = false;
- }
- }
-
- if (canContinue) {
-
- // select row (could empty selection)
- if (rowIndex == -1) {
- source.clearSelection();
- } else if (!ArrayUtils.contains(selectedRows, rowIndex)) {
- if (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION == source.getSelectionMode()) {
- // add to selection
- source.addRowSelectionInterval(rowIndex, rowIndex);
- } else {
- // set selection
- source.setRowSelectionInterval(rowIndex, rowIndex);
- }
- }
-
- // select column (could empty selection)
- if (columnIndex == -1) {
- source.clearSelection();
- } else if (!ArrayUtils.contains(selectedColumns, columnIndex)) {
- source.setColumnSelectionInterval(columnIndex, columnIndex);
- }
-
- if (rightClick) {
-
- // use now model coordinate
- int modelRowIndex = source.convertRowIndexToModel(rowIndex);
- int modelColumnIndex = source.convertColumnIndexToModel(columnIndex);
-
-// beforeOpenPopup(modelRowIndex, modelColumnIndex);
-
- // on right click show popup
- popup.show(source, e.getX(), e.getY());
- }
- }
- }
- }
-
- public void openRowMenu(KeyEvent e, JPopupMenu popup) {
-
- if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
-
- JXTable source = (JXTable) e.getSource();
-
- // get the lowest selected row
- int[] selectedRows = source.getSelectedRows();
- int lowestRow = -1;
- for (int row : selectedRows) {
- lowestRow = Math.max(lowestRow, row);
- }
- // get the selected column
- int selectedColumn = source.getSelectedColumn();
- Rectangle r = source.getCellRect(lowestRow, selectedColumn, true);
-
- // get the point in the middle lower of the cell
- Point p = new Point(r.x + r.width / 2, r.y + r.height);
-
- if (log.isDebugEnabled()) {
- log.debug("Row " + lowestRow + " found t point [" + p + "]");
- }
-
- boolean canContinue = true;
-
- if (source.isEditing()) {
-
- // stop editing
- boolean stopEdit = source.getCellEditor().stopCellEditing();
- if (!stopEdit) {
- if (log.isWarnEnabled()) {
- log.warn("Could not stop edit cell...");
- }
- canContinue = false;
- }
- }
-
- if (canContinue) {
-
- // use now model coordinate
- int rowIndex = source.convertRowIndexToModel(lowestRow);
- int columnIndex = source.convertColumnIndexToModel(selectedColumn);
-// beforeOpenPopup(rowIndex, columnIndex);
-
- popup.show(source, p.x, p.y);
- }
- }
- }
-
- //------------------------------------------------------------------------//
- //-- Init methods --//
- //------------------------------------------------------------------------//
-
- protected void initUI(FaxToMailUI ui) {
-
- for (Map.Entry<String, Object> entry : ui.get$objectMap().entrySet()) {
- Object component = entry.getValue();
- if (component instanceof NumberEditor) {
-
- initNumberEditor((NumberEditor) component);
- } else if (component instanceof JXDatePicker) {
-
- initDatePicker((JXDatePicker) component);
- } else if (component instanceof JLabel) {
-
- initLabel((JLabel) component);
- } else if (component instanceof JTextField) {
-
- initTextField((JTextField) component);
- } else if (component instanceof AbstractButton) {
-
- initButton((AbstractButton) component);
- } else if (component instanceof JScrollPane) {
-
- initScrollPane((JScrollPane) component);
- }
- }
-
- ((Component) ui).addHierarchyListener(new HierarchyListener() {
+ protected void listenModelModifiy(AbstractFaxToMailBeanUIModel model) {
+ model.addPropertyChangeListener(AbstractFaxToMailBeanUIModel.PROPERTY_MODIFY, new PropertyChangeListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
- JComponent component = getComponentToFocus();
- if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0
- && e.getChanged().isShowing()
- && component != null) {
- component.requestFocus();
+ public void propertyChange(PropertyChangeEvent evt) {
+ Boolean modify = (Boolean) evt.getNewValue();
+ if (modify != null && modify) {
+ ((AbstractFaxToMailBeanUIModel) getModel()).setModify(true);
}
}
});
}
- protected abstract JComponent getComponentToFocus();
-
- protected void initTextField(JTextField jTextField) {
- Boolean computed = (Boolean) jTextField.getClientProperty("computed");
- if (computed != null && computed) {
- Font font = jTextField.getFont().deriveFont(Font.ITALIC);
- jTextField.setFont(font);
- jTextField.setEditable(false);
- jTextField.setEnabled(false);
-// jTextField.setDisabledTextColor(getConfig().getColorComputedWeights());
- }
- if (isAutoSelectOnFocus(jTextField)) {
- addAutoSelectOnFocus(jTextField);
- }
- }
-
- protected void initLabel(JLabel jLabel) {
- Boolean strongStyle = (Boolean) jLabel.getClientProperty("strongStyle");
- Boolean italicStyle = (Boolean) jLabel.getClientProperty("italicStyle");
- Font font = jLabel.getFont();
- int style = font.getStyle();
- if (strongStyle != null && strongStyle) {
- style |= Font.BOLD;
- }
- if (italicStyle != null && italicStyle) {
- style |= Font.ITALIC;
- }
- jLabel.setFont(font.deriveFont(style));
-
- }
-
-// protected void initButtonAttachment(ButtonAttachment component) {
+// //------------------------------------------------------------------------//
+// //-- Internal methods --//
+// //------------------------------------------------------------------------//
//
-// component.init();
-// }
-
- protected void initButton(AbstractButton abstractButton) {
-
- Class actionName = (Class) abstractButton.getClientProperty("tuttiAction");
- if (actionName != null) {
- Action action = FaxToMailActionHelper.createUIAction(this, abstractButton, actionName);
- abstractButton.setAction(action);
- }
- }
-
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param comboBox le component graphique à initialiser
- */
- protected <E extends Serializable> void initBeanFilterableComboBox(
- BeanFilterableComboBox<E> comboBox,
- List<E> data,
- E selectedData) {
-
- initBeanFilterableComboBox(comboBox, data, selectedData, null);
- }
-
- protected <E extends Serializable> void initBeanFilterableComboBox(
- BeanFilterableComboBox<E> comboBox,
- List<E> data,
- E selectedData,
- String decoratorContext) {
-
- Preconditions.checkNotNull(comboBox, "No comboBox!");
-
- Class<E> beanType = comboBox.getBeanType();
-
- Preconditions.checkNotNull(beanType, "No beanType on the combobox!");
-// Decorator<E> decorator = getDecorator(beanType, decoratorContext);;
-
- if (data == null) {
- data = Lists.newArrayList();
- }
-
- if (log.isDebugEnabled()) {
- log.debug("entity comboBox list [" + beanType.getName() + "] : " +
- (data == null ? 0 : data.size()));
- }
-
- comboBox.setI18nPrefix("tutti.property.");
-
- // add data list to combo box
-// comboBox.init((JXPathDecorator<E>) decorator, data);
-
-// comboBox.setSelectedItem(selectedData);
-
-// if (log.isDebugEnabled()) {
-// log.debug("combo [" + beanType.getName() + "] : " +
-// comboBox.getData().size());
+// protected void registerValidators(SwingValidator... validators) {
+// MainUI main = getContext().getMainUI();
+// Preconditions.checkNotNull(
+// main, "No mainUI registred in application context");
+// MainUIHandler handler = main.getHandler();
+// handler.clearValidators();
+// for (SwingValidator validator : validators) {
+// handler.registerValidator(validator);
// }
- }
-
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param list le component graphique à initialiser
- * @param data la liste des données à mettre dans la liste de gauche
- * @param selectedData la liste des données à mettre dans la liste de droite
- */
-// protected <E extends TuttiEntity> void initBeanList(
-// BeanDoubleList<E> list,
-// List<E> data,
-// List<E> selectedData,
-// Decorator<E> selectedDecorator) {
-//
-// Preconditions.checkNotNull(list, "No list!");
-//
-// Class<E> beanType = list.getBeanType();
-// Preconditions.checkNotNull(beanType, "No beanType on the double list!");
-//
-// DecoratorService decoratorService =
-// context.getDecoratorService();
-// Decorator<E> decorator = decoratorService.getDecoratorByType(beanType);
-//
-// if (log.isDebugEnabled()) {
-// log.debug("entity list [" + beanType.getName() + "] : " +
-// (data == null ? 0 : data.size()));
-// }
-//
-// list.setI18nPrefix("tutti.property.");
-//
-// // add data list to combo box
-// list.init((JXPathDecorator<E>) decorator,
-// (JXPathDecorator<E>) selectedDecorator,
-// data,
-// selectedData);
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Jlist [" + beanType.getName() + "] : " +
-// list.getUniverseList().getModel().getSize());
-// }
// }
- /**
- * Prépare un component de choix d'entités pour un type d'entité donné et
- * pour un service de persistance donné.
- *
- * @param list le component graphique à initialiser
- * @param data la liste des données à mettre dans la liste de gauche
- * @param selectedData la liste des données à mettre dans la liste de droite
- */
-// protected <E extends TuttiEntity> void initBeanList(
-// BeanDoubleList<E> list,
-// List<E> data,
-// List<E> selectedData) {
-//
-// initBeanList(list, data, selectedData, null);
-// }
-
- protected void initNumberEditor(NumberEditor editor) {
- if (log.isDebugEnabled()) {
- log.debug("init number editor " + editor.getName());
- }
- editor.init();
-
- // Force binding if value is already in model
- Number model = editor.getModel();
- if (model != null) {
- editor.setModel(null);
- editor.setModel(model);
- }
-
- if (isAutoSelectOnFocus(editor)) {
-
- addAutoSelectOnFocus(editor.getTextField());
- }
- }
-
-// protected void initTimeEditor(SimpleTimeEditor editor) {
-// if (log.isDebugEnabled()) {
-// log.debug("init time editor " + editor.getName() +
-// " for property " + editor.getModel().getProperty());
-// }
-// editor.init();
-//
-// if (isAutoSelectOnFocus(editor)) {
-// addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getHour().getEditor()).getTextField());
-// addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getMinute().getEditor()).getTextField());
-// }
-// }
-
-// protected void initCoordinateDMSEditor(DmsCoordinateEditor editor) {
-// editor.init();
-// }
-
-// protected void initCoordinateDMDEditor(DmdCoordinateEditor editor) {
-// editor.init();
-// }
-
- protected void initDatePicker(final JXDatePicker picker) {
-
- if (log.isDebugEnabled()) {
- log.debug("disable JXDatePicker editor" + picker.getName());
- }
-// String dateFormat = getConfig().getDateFormat();
- picker.setFormats("dd/MM/yyyy");
- picker.setToolTipText(t("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
- picker.getEditor().addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- try {
- picker.commitEdit();
-
- } catch (ParseException ex) {
- if (log.isDebugEnabled()) {
- log.debug("format error", ex);
- }
- picker.requestFocus();
- }
- }
- });
-
- if (isAutoSelectOnFocus(picker)) {
- addAutoSelectOnFocus(picker.getEditor());
- }
- }
-
- protected void initScrollPane(JScrollPane scrollPane) {
- Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable");
- if (onlyVerticalScrollable != null && onlyVerticalScrollable) {
- scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
- scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
-
- final JViewport viewport = scrollPane.getViewport();
- viewport.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- Dimension newDimension = new Dimension(viewport.getExtentSize().width,
- viewport.getViewSize().height);
- viewport.setViewSize(newDimension);
- }
- });
- }
- }
-
- protected boolean isAutoSelectOnFocus(JComponent comp) {
- Object selectOnFocus = comp.getClientProperty("selectOnFocus");
- return selectOnFocus != null && Boolean.valueOf(selectOnFocus.toString());
- }
-
- protected void addAutoSelectOnFocus(JTextField jTextField) {
- jTextField.addFocusListener(new FocusAdapter() {
- @Override
- public void focusGained(final FocusEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- JTextField source = (JTextField) e.getSource();
- source.selectAll();
- }
- });
-
- }
- });
- }
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected boolean quitScreen(boolean modelIsValid,
- boolean modelIsModify,
- String askGiveUpMessage,
- String askSaveMessage,
- Action saveAction) {
- boolean result;
-
- if (!modelIsValid) {
-
- // model is not valid
- // ask user to qui or not
- result = askCancelEditBeforeLeaving(askGiveUpMessage);
-
- } else if (modelIsModify) {
-
- // something is modify ask user what to do
- int answer = askSaveBeforeLeaving(askSaveMessage);
- switch (answer) {
- case JOptionPane.YES_OPTION:
-
- // ok save
- saveAction.actionPerformed(null);
- result = true;
- break;
- case JOptionPane.NO_OPTION:
-
- // do not save but can still quit the screen (so nothing to do)
- result = true;
- break;
- default:
- // do not save and stay here (so nothing to do)
- result = false;
-
- }
- } else {
-
- // model is valid and not modify, can safely quit screen
- result = true;
- }
- return result;
- }
-
- protected void registerValidators(SwingValidator... validators) {
- MainUI main = context.getMainUI();
- Preconditions.checkNotNull(
- main, "No mainUI registred in application context");
- MainUIHandler handler = main.getHandler();
- handler.clearValidators();
- for (SwingValidator validator : validators) {
- handler.registerValidator(validator);
- }
- }
-
- protected String decorate(Object object) {
- return decorate(object, null);
- }
-
- protected String decorate(Object object, String context) {
- String result = "";
-// if (object != null) {
-// result = getDecorator(object.getClass(), context).toString(object);
-// }
- return result;
- }
-
-// protected <O> ListCellRenderer newListCellRender(Class<O> type) {
-//
-// return newListCellRender(type, null);
-// }
-
-// protected <O> ListCellRenderer newListCellRender(Class<O> type, String name) {
-
-// Decorator<O> decorator = getDecorator(type, name);
-// return newListCellRender(decorator);
-// }
-
- protected <O> ListCellRenderer newListCellRender(Decorator<O> decorator) {
-
- Preconditions.checkNotNull(decorator);
-
- ListCellRenderer result = new DecoratorListCellRenderer(decorator);
- return result;
- }
-
// protected void listenValidatorValid(SimpleBeanValidator validator,
// final AbstractTuttiBeanUIModel model) {
// validator.addPropertyChangeListener(SimpleBeanValidator.VALID_PROPERTY, new PropertyChangeListener() {
@@ -836,14 +141,14 @@
// public void propertyChange(PropertyChangeEvent evt) {
// if (log.isDebugEnabled()) {
// log.debug("Model [" + model +
-// "] pass to valid state [" +
-// evt.getNewValue() + "]");
+// "] pass to valid state [" +
+// evt.getNewValue() + "]");
// }
// model.setValid((Boolean) evt.getNewValue());
// }
// });
// }
-
+//
// protected void listenValidationTableHasNoFatalError(final SimpleBeanValidator validator,
// final AbstractTuttiBeanUIModel model) {
// getContext().getMainUI().getValidatorMessageWidget().addTableModelListener(new TableModelListener() {
@@ -852,270 +157,37 @@
// boolean valid = !validator.hasFatalErrors();
// if (log.isDebugEnabled()) {
// log.debug("Model [" + model +
-// "] pass to valid state [" + valid + "]");
+// "] pass to valid state [" + valid + "]");
// }
// model.setValid(valid);
// }
// });
// }
-//
-// protected void listModelIsModify(AbstractTuttiBeanUIModel model) {
-// model.addPropertyChangeListener(new PropertyChangeListener() {
-//
-// final Set<String> excludeProperties = getPropertiesToIgnore();
-//
-// @Override
-// public void propertyChange(PropertyChangeEvent evt) {
-// if (!excludeProperties.contains(evt.getPropertyName())) {
-// ((AbstractTuttiBeanUIModel) evt.getSource()).setModify(true);
-// }
-// }
-// });
-// }
-// protected Set<String> getPropertiesToIgnore() {
-// return Sets.newHashSet(
-// AbstractTuttiBeanUIModel.PROPERTY_MODIFY,
-// AbstractTuttiBeanUIModel.PROPERTY_VALID);
-// }
+ protected void listModelIsModify(AbstractFaxToMailBeanUIModel model) {
+ model.addPropertyChangeListener(new PropertyChangeListener() {
- protected void closeUI(FaxToMailUI ui) {
- ui.getHandler().onCloseUI();
+ final Set<String> excludeProperties = getPropertiesToIgnore();
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!excludeProperties.contains(evt.getPropertyName())) {
+ ((AbstractFaxToMailBeanUIModel) evt.getSource()).setModify(true);
+ }
+ }
+ });
}
- protected <B> void changeValidatorContext(String newContext,
- SwingValidator<B> validator) {
- B bean = validator.getBean();
- validator.setContext(newContext);
- validator.setBean(bean);
+ protected Set<String> getPropertiesToIgnore() {
+ return Sets.newHashSet(
+ AbstractFaxToMailBeanUIModel.PROPERTY_MODIFY,
+ AbstractFaxToMailBeanUIModel.PROPERTY_VALID);
}
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// TableCellEditor editor,
-// TableCellRenderer renderer,
-// ColumnIdentifier<R> identifier) {
-//
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// TableCellEditor editor,
-// TableCellRenderer renderer,
-// ColumnIdentifier<R> identifier,
-// WeightUnit weightUnit) {
-//
-// TableColumnExt col = new TableColumnExt(model.getColumnCount());
-// col.setCellEditor(editor);
-// col.setCellRenderer(renderer);
-// String label = _(identifier.getHeaderI18nKey());
-// if (weightUnit != null) {
-// label = weightUnit.decorateLabel(label);
-// }
-// col.setHeaderValue(label);
-// String tip = _(identifier.getHeaderTipI18nKey());
-// if (weightUnit != null) {
-// tip = weightUnit.decorateTip(tip);
-// }
-// col.setToolTipText(tip);
-//
-// col.setIdentifier(identifier);
-// model.addColumn(col);
-// // by default no column is sortable, must specify it
-// col.setSortable(false);
-// return col;
-// }
+ protected void closeUI(FaxToMailUI ui) {
+ ui.getHandler().onCloseUI();
+ }
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier) {
-//
-// return addColumnToModel(model, null, null, identifier, null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addFloatColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// String numberPattern,
-// JTable table) {
-//
-// NumberCellEditor<Float> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(numberPattern);
-//
-// TableCellRenderer renderer =
-// newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-//
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addFloatColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// WeightUnit weightUnit,
-// JTable table) {
-//
-// Preconditions.checkNotNull(weightUnit);
-// NumberCellEditor<Float> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(weightUnit.getNumberEditorPattern());
-//
-// TableCellRenderer renderer =
-// newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-//
-// return addColumnToModel(model, editor, renderer, identifier, weightUnit);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addIntegerColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// String numberPattern,
-// JTable table) {
-//
-// NumberCellEditor<Integer> editor =
-// JAXXWidgetUtil.newNumberTableCellEditor(Integer.class, false);
-// editor.getNumberEditor().setSelectAllTextOnError(true);
-// editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
-// editor.getNumberEditor().setNumberPattern(numberPattern);
-//
-// TableCellRenderer renderer = newNumberCellRenderer(table.getDefaultRenderer(Number.class));
-// return addColumnToModel(model, editor, renderer, identifier, null);
-// }
-//
-//
-// TableCellRenderer newNumberCellRenderer(final TableCellRenderer defaultRenderer) {
-// TableCellRenderer result = new TableCellRenderer() {
-// @Override
-// public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-// Component result = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-// if (result instanceof JLabel) {
-// JLabel jLabel = (JLabel) result;
-// jLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
-//
-// }
-// return result;
-// }
-// };
-// return result;
-// }
-//
-//
-// protected <R extends AbstractTuttiBeanUIModel> TableColumnExt addBooleanColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// JTable table) {
-//
-// return addColumnToModel(model,
-// table.getDefaultEditor(Boolean.class),
-// table.getDefaultRenderer(Boolean.class),
-// identifier,
-// null);
-// }
-//
-// protected <R extends AbstractTuttiBeanUIModel, B> TableColumnExt addComboDataColumnToModel(TableColumnModel model,
-// ColumnIdentifier<R> identifier,
-// Decorator<B> decorator,
-// List<B> data) {
-// JComboBox comboBox = new JComboBox();
-// comboBox.setRenderer(newListCellRender(decorator));
-//
-// List<B> dataToList = Lists.newArrayList(data);
-//
-// // add a null value at first position
-// if (!dataToList.isEmpty() && dataToList.get(0) != null) {
-// dataToList.add(0, null);
-// }
-// SwingUtil.fillComboBox(comboBox, dataToList, null);
-//
-// ObjectToStringConverter converter = BeanUIUtil.newDecoratedObjectToStringConverter(decorator);
-// BeanUIUtil.decorate(comboBox, converter);
-// ComboBoxCellEditor editor = new ComboBoxCellEditor(comboBox);
-//
-// return addColumnToModel(model,
-// editor,
-// newTableCellRender(decorator),
-// identifier,
-// null);
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Class<O> type) {
-//
-// return newTableCellRender(type, null);
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Class<O> type, String name) {
-//
-// Decorator<O> decorator = getDecorator(type, name);
-//
-// TableCellRenderer result = newTableCellRender(decorator);
-// return result;
-// }
-//
-// protected <O> TableCellRenderer newTableCellRender(Decorator<O> decorator) {
-//
-// Preconditions.checkNotNull(decorator);
-//
-// DecoratorTableCellRenderer result = new DecoratorTableCellRenderer(decorator, true);
-// return result;
-// }
-//
-// /**
-// * Hook to prepare popup just before showing it.
-// * <p/>
-// * The right place to update actions accessibility; a quite better design
-// * than trying to update each time something change in the table...
-// *
-// * @param rowIndex selected row index (or lowest selected one)
-// * @param columnIndex selected column index
-// * @since 2.6
-// */
-// protected void beforeOpenPopup(int rowIndex, int columnIndex) {
-//
-// }
-//
-// protected String buildReminderLabelTitle(Species species,
-// Iterable<SampleCategory<?>> categories,
-// String prefix,
-// String suffix) {
-// return buildReminderLabelTitle(
-// decorate(species),
-// categories,
-// prefix,
-// suffix);
-//
-// }
-//
-// protected String buildReminderLabelTitle(String species,
-// Iterable<SampleCategory<?>> categories,
-// String prefix,
-// String suffix) {
-// StringBuilder title = new StringBuilder(prefix);
-//
-// title.append(" - [").append(species).append("]");
-//
-// if (categories != null) {
-// for (SampleCategory<?> sampleCategory : categories) {
-// if (sampleCategory.getCategoryValue() != null) {
-// title.append(" - ");
-// title.append(decorate(sampleCategory.getCategoryValue()));
-// }
-// }
-// }
-//
-// title.append(" - ").append(suffix);
-// return title.toString();
-// }
-//
-// protected void incrementsMessage(String message) {
-//
-// TuttiActionUI actionUI = context.getActionUI();
-// if (actionUI != null) {
-// ProgressionModel progressionModel = actionUI.getModel().getProgressionModel();
-// if (progressionModel != null)
-//
-// progressionModel.increments(message);
-// }
-// }
-
protected List<Label> createLabelList(String... labels) {
List<Label> labelList = Lists.newArrayList();
for (String label : labels) {
Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,88 +0,0 @@
-package com.franciaflex.faxtomail.ui.swing.util;
-
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import org.jdesktop.swingx.JXErrorPane;
-import org.jdesktop.swingx.error.ErrorInfo;
-import org.jdesktop.swingx.error.ErrorReporter;
-import org.nuiton.csv.ImportRuntimeException;
-
-import javax.swing.*;
-
-import static org.nuiton.i18n.I18n.t;
-
-/**
- * helper around errors in FaxToMail.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class FaxToMailErrorHelper implements ErrorReporter {
-
- protected FaxToMailUIContext context;
-
- public FaxToMailErrorHelper(FaxToMailUIContext context) {
- this.context = context;
- }
-
- /**
- * Display a user friendly error frame.
- *
- * @param message message for user
- * @param cause exception cause
- */
- public void showErrorDialog(String message, Throwable cause) {
-
- if (cause == null) {
- JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- t("faxtomail.error.ui.business.error"),
- JOptionPane.ERROR_MESSAGE);
-// } else if (cause instanceof FaxToMailBusinessException) {
-// JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
-// _("tutti.error.ui.business.error"),
-// JOptionPane.ERROR_MESSAGE);
- } else if (cause instanceof ImportRuntimeException) {
- JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
- t("faxtomail.error.ui.business.error"),
- JOptionPane.ERROR_MESSAGE);
- } else {
-
- JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(t("faxtomail.error.ui.other.error"),
- t("faxtomail.error.errorpane.htmlmessage", message), null, null,
- cause, null, null);
- pane.setErrorInfo(info);
- pane.setErrorReporter(this);
- JXErrorPane.showDialog(context.getActionUI(), pane);
- }
-
- }
-
- /**
- * Display a user friendly error frame.
- *
- * @param message message for user
- */
- public void showErrorDialog(String message) {
- showErrorDialog(message, null);
- }
-
- @Override
- public void reportError(ErrorInfo errorInfo) throws NullPointerException {
-
- showErrorDialog(errorInfo.getBasicErrorMessage(), errorInfo.getErrorException());
- }
-
- /**
- * Display a user friendly warning frame.
- *
- * @param message message for user
- */
- public void showWarningDialog(String message) {
-
- JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- t("faxtomail.error.ui.business.warning"),
- JOptionPane.WARNING_MESSAGE);
-
- }
-
-}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailExceptionHandler.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,13 +1,12 @@
package com.franciaflex.faxtomail.ui.swing.util;
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.AbstractChangeScreenAction;
-import com.franciaflex.faxtomail.ui.swing.action.AbstractFaxToMailAction;
-import com.franciaflex.faxtomail.ui.swing.action.FaxToMailActionException;
-import jaxx.runtime.swing.JAXXRuntimeException;
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractChangeScreenAction;
+import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionException;
+import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
+import org.nuiton.jaxx.application.swing.util.ApplicationExceptionHandler;
/**
* FaxToMail global exception handler.
@@ -20,57 +19,43 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class FaxToMailExceptionHandler implements Thread.UncaughtExceptionHandler {
+public class FaxToMailExceptionHandler extends ApplicationExceptionHandler {
private static final Log log =
LogFactory.getLog(FaxToMailExceptionHandler.class);
- @Override
- public void uncaughtException(Thread t, Throwable ex) {
- handleException(t.getName(), ex);
+ public FaxToMailExceptionHandler(ApplicationErrorHelper errorHelper) {
+ super(errorHelper);
}
- public void handle(Throwable thrown) {
- // for EDT exceptions
- handleException(Thread.currentThread().getName(), thrown);
- }
-
protected void handleException(String tname, Throwable ex) {
if (log.isErrorEnabled()) {
log.error("Global application exception [" + tname + "]", ex);
}
- Throwable cause = ex;
+ Throwable cause = getCause(ex);
- if (cause instanceof FaxToMailTechnicalException) {
- cause = cause.getCause();
- }
-
- if (cause instanceof JAXXRuntimeException) {
- cause = cause.getCause();
- }
-
boolean backToScreen = false;
AbstractFaxToMailAction action = null;
- if (cause instanceof FaxToMailActionException) {
+ if (cause instanceof ApplicationActionException) {
- FaxToMailActionException actionException = (FaxToMailActionException) cause;
+ ApplicationActionException actionException = (ApplicationActionException) cause;
cause = cause.getCause();
if (log.isDebugEnabled()) {
log.debug("Action error cause:", cause);
}
- action = actionException.getAction();
+ action = (AbstractFaxToMailAction) actionException.getAction();
if (action instanceof AbstractChangeScreenAction) {
backToScreen = true;
}
}
- FaxToMailUIContext.getErrorHelper().showErrorDialog(cause.getMessage(), cause);
+ showErrorDialog(cause.getMessage(), cause);
if (backToScreen) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUI.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -1,6 +1,7 @@
package com.franciaflex.faxtomail.ui.swing.util;
import jaxx.runtime.JAXXObject;
+import org.nuiton.jaxx.application.swing.ApplicationUI;
import javax.swing.UIManager;
import java.awt.Font;
@@ -11,93 +12,6 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public interface FaxToMailUI<M, H extends AbstractFaxToMailUIHandler<M, ?>> extends JAXXObject {
+public interface FaxToMailUI<M, H extends AbstractFaxToMailUIHandler<M, ?>> extends ApplicationUI<M, H> {
- M getModel();
-
- H getHandler();
-
- /**
- * Pattern to use for short numeric values in editors with max 1 digits.
- *
- * @since 0.2
- */
- public static final String INT_1_DIGITS_PATTERN = "\\d{0,1}";
-
- /**
- * Pattern to use for short numeric values in editors with max 2 digits.
- *
- * @since 0.1
- */
- public static final String INT_2_DIGITS_PATTERN = "\\d{0,2}";
-
- /**
- * Pattern to use for signed numeric values in editors with max 2 digits.
- *
- * @since 1.0
- */
- public static final String SIGNED_INT_2_DIGITS_PATTERN = "-?\\d{0,2}";
-
- /**
- * Pattern to use for short numeric values in editors with max 3 digits.
- *
- * @since 0.1
- */
- public static final String INT_3_DIGITS_PATTERN = "\\d{0,3}";
-
- /**
- * Pattern to use for singed numeric values in editors with max 3 digits.
- *
- * @since 1.0
- */
- public static final String SIGNED_INT_3_DIGITS_PATTERN = "-?\\d{0,3}";
-
- /**
- * Pattern to use for short numeric values in editors with max 4 digits.
- *
- * @since 0.2
- */
- public static final String INT_4_DIGITS_PATTERN = "\\d{0,4}";
-
- /**
- * Pattern to use for integer numeric values in editors with max 6 digits.
- *
- * @since 0.1
- */
- public static final String INT_6_DIGITS_PATTERN = "\\d{0,6}";
-
- /**
- * Pattern to use for integer numeric values in editors with max 7 digits.
- *
- * @since 0.1
- */
- public static final String INT_7_DIGITS_PATTERN = "\\d{0,7}";
-
- /**
- * Pattern to use for decimal numeric values with 2 decimal digits in
- * editors.
- *
- * @since 0.1
- */
- public static final String DECIMAL2_PATTERN = "\\d{0,6}(\\.\\d{0,2})?";
-
- /**
- * Pattern to use for decimal numeric values with 3 decimal digits in
- * editors.
- *
- * @since 0.1
- */
- public static final String DECIMAL3_PATTERN = "\\d{0,6}(\\.\\d{0,3})?";
-
- /**
- * Pattern to use for decimal numeric values with 2 digits + 3 decimal digits in
- * editors.
- *
- * @since 1.0
- */
- public static final String DECIMAL2_DIGITS_PATTERN = "\\d{0,2}(\\.\\d*)?";
-
- public static final Font TEXTFIELD_NORMAL_FONT = UIManager.getDefaults().getFont("TextField.font");
-
- public static final Font TEXTFIELD_COMPUTED_FONT = UIManager.getDefaults().getFont("TextField.font").deriveFont(Font.ITALIC);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,31 +24,18 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
-import com.google.common.base.Preconditions;
-import org.apache.commons.beanutils.PropertyUtils;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import jaxx.runtime.JAXXObject;
+import jaxx.runtime.JAXXUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
+import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
-import javax.swing.*;
-import javax.swing.table.JTableHeader;
-import java.awt.*;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-
-import static org.nuiton.i18n.I18n.t;
-
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public final class FaxToMailUIUtil {
+public final class FaxToMailUIUtil extends ApplicationUIUtil {
/** Logger. */
private static final Log log = LogFactory.getLog(FaxToMailUIUtil.class);
@@ -57,217 +44,12 @@
// never instanciate util class
}
- public static void setProperty(Object bean, String property, Object value) {
- Preconditions.checkNotNull(bean);
- Preconditions.checkNotNull(property);
- try {
- PropertyUtils.setSimpleProperty(bean, property, value);
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(t("faxtomail.property.set.error", property, bean.getClass().getName()), e);
- }
+ public static FaxToMailUIContext getApplicationContext(JAXXObject ui) {
+ return (FaxToMailUIContext) ApplicationUIUtil.getApplicationContext(ui);
}
- public static Object getProperty(Object bean, String property) {
- Preconditions.checkNotNull(bean);
- Preconditions.checkNotNull(property);
- try {
- return PropertyUtils.getSimpleProperty(bean, property);
- } catch (Exception e) {
- throw new FaxToMailTechnicalException(t("faxtomail.property.get.error", property, bean.getClass().getName()), e);
- }
+ public static void setParentUI(JAXXObject ui, FaxToMailUI<?, ?> parentUI) {
+ JAXXUtil.initContext(ui, parentUI);
+ setApplicationContext(ui, parentUI.getHandler().getContext());
}
-
- private static DecimalFormatSymbols symbols;
-
- public static DecimalFormatSymbols getDecimalFormatSymbols() {
- if (symbols == null) {
- symbols = new DecimalFormatSymbols();
- symbols.setDecimalSeparator('.');
- symbols.setGroupingSeparator(' ');
- }
- return symbols;
- }
-
- private static DecimalFormat decimalFormat;
-
- public static DecimalFormat getDecimalFormat(int minDecimal, int maxDecimal) {
- if (decimalFormat == null) {
- decimalFormat = new DecimalFormat();
- decimalFormat.setDecimalFormatSymbols(getDecimalFormatSymbols());
- decimalFormat.setGroupingUsed(false);
- }
- decimalFormat.setMinimumFractionDigits(minDecimal);
- decimalFormat.setMaximumFractionDigits(maxDecimal);
- return decimalFormat;
- }
-
- public static void openLink(URL url) {
- try {
- openLink(url.toURI());
- } catch (URISyntaxException e) {
- throw new FaxToMailTechnicalException(t("swing.error.cannot.open.link", url), e);
- }
- }
-
- public static Desktop getDesktopForBrowse() {
-
- if (!Desktop.isDesktopSupported()) {
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.not.supported"));
- }
-
- Desktop desktop = Desktop.getDesktop();
-
- if (!desktop.isSupported(Desktop.Action.BROWSE)) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.browse.not.supported"));
- }
-
- return desktop;
- }
-
- public static void openLink(URI uri) {
-
- Desktop desktop = getDesktopForBrowse();
-
- try {
-
- desktop.browse(uri);
- } catch (Exception e) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.cannot.open.link", uri), e);
- }
- }
-
- public static Desktop getDesktopForMail() {
-
- if (!Desktop.isDesktopSupported()) {
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.not.supported"));
- }
-
- Desktop desktop = Desktop.getDesktop();
-
- if (!desktop.isSupported(Desktop.Action.MAIL)) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.desktop.mail.not.supported"));
- }
-
- return desktop;
- }
-
- public static void mail(String subject, String body) {
-
- Desktop desktop = getDesktopForMail();
-
- try {
- URI mailtoURI = new URI("mailto", null, null, "subject=" + subject + "&body=" + body, null);
- desktop.mail(mailtoURI);
-
- } catch (Exception e) {
-
- throw new FaxToMailTechnicalException(
- t("swing.error.cannot.mail"), e);
- }
- }
-
- public static void selectFirstCellOnFirstRowAndStopEditing(JXTable table) {
-
- // select first cell
- doSelectCell(table, 0, 0);
-
- if (table.isEditing()) {
-
- // but no edit it
- table.getCellEditor().stopCellEditing();
- }
- }
-
- public static void selectFirstCellOnLastRow(JXTable table) {
-
- // select first cell
- doSelectCell(table, table.getRowCount() - 1, 0);
- }
-
- public static void selectFirstCellOnRow(JXTable table, int row, boolean stopEdit) {
-
- // select first cell
- doSelectCell(table, row, 0);
-
- if (stopEdit && table.isEditing()) {
-
- table.getCellEditor().stopCellEditing();
- }
- }
-
- public static void doSelectCell(JTable table,
- int rowIndex,
- int columnIndex) {
-
- int rowCount = table.getRowCount();
- if (rowCount == 0) {
-
- // no row, can not selected any cell
- if (log.isWarnEnabled()) {
- log.warn("No row in table, can not select any cell");
- }
- return;
- }
- int columnCount = table.getColumnCount();
- if (columnCount == 0) {
-
- // no column, can not selected any cell
- if (log.isWarnEnabled()) {
- log.warn("No column in table, can not select any cell");
- }
- return;
- }
- if (columnIndex > columnCount) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("ColumnIndex: %s is more than columnCount %s", columnIndex, columnCount));
- }
- columnIndex = columnCount - 1;
- }
- if (columnIndex < 0) {
- columnIndex = 0;
- }
- if (rowIndex >= rowCount) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("RowIndex: %s is more than rowCount %s", rowIndex, rowCount));
- }
- rowIndex = rowCount - 1;
- }
- if (rowIndex < 0) {
- rowIndex = 0;
- }
-
- table.setColumnSelectionInterval(columnIndex, columnIndex);
- table.setRowSelectionInterval(rowIndex, rowIndex);
- table.editCellAt(rowIndex, columnIndex);
- }
-
- protected static class ShowSpeciesDecoratorPopupListener extends MouseAdapter {
-
- private final JPopupMenu popup;
-
- public ShowSpeciesDecoratorPopupListener(JPopupMenu popup) {
- this.popup = popup;
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- JTableHeader source = (JTableHeader) e.getSource();
- Point point = e.getPoint();
- int columnIndex = source.columnAtPoint(point);
-
- boolean rightClick = SwingUtilities.isRightMouseButton(e);
- if (columnIndex == 0 && rightClick) {
- e.consume();
- popup.show(source, e.getX(), e.getY());
- }
- }
- }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/Label.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -18,4 +18,4 @@
public String getLabel() {
return label;
}
-}
\ No newline at end of file
+}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -10,6 +10,8 @@
Supprimer=
T\\u00e9l\\u00e9copie\ re\\u00e7ue\ le\ 10/01/2014\ \\u00e0\ 13\:37=
Voir=
+application.action.create.error=
+application.error.ui.business.warning=
faxtomail.action.create.error=
faxtomail.archive.button.label=
faxtomail.back.button.label=
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-02-06 16:42:22 UTC (rev 7)
@@ -10,6 +10,8 @@
Supprimer=
T\\u00e9l\\u00e9copie\ re\\u00e7ue\ le\ 10/01/2014\ \\u00e0\ 13\:37=
Voir=
+application.action.create.error=
+application.error.ui.business.warning=
faxtomail.action.create.error=
faxtomail.common.askBeforeDelete.help=
faxtomail.common.askCancelEditBeforeLeaving.help=
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/pom.xml 2014-02-06 16:42:22 UTC (rev 7)
@@ -63,6 +63,11 @@
</dependency>
<dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
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-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -2,22 +2,16 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
-import com.franciaflex.faxtomail.services.DefaultFaxToMailServiceContext;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
import com.franciaflex.faxtomail.web.DefaultFaxToMailWebApplicationContext;
-import com.opensymphony.xwork2.util.LocalizedTextUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.LogManager;
import org.apache.log4j.PropertyConfigurator;
-import org.nuiton.i18n.I18n;
-import org.nuiton.i18n.init.DefaultI18nInitializer;
-import org.nuiton.i18n.init.I18nInitializer;
import java.io.File;
-import java.util.Locale;
public class FaxToMailApplicationContext {
@@ -27,13 +21,10 @@
protected static FaxToMailTopiaApplicationContext topiaApplicationContext;
- protected static FaxToMailApplicationConfig applicationConfig;
+ protected static FaxToMailConfiguration applicationConfig;
- public static FaxToMailApplicationConfig getApplicationConfig() {
- if (applicationConfig == null) {
- applicationConfig = new FaxToMailApplicationConfig();
- }
- return applicationConfig;
+ public static FaxToMailConfiguration getApplicationConfig() {
+ return FaxToMailConfiguration.getInstance();
}
public static FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
@@ -53,10 +44,10 @@
public FaxToMailServiceContext newServiceContext(FaxToMailTopiaPersistenceContext persistenceContext) {
- DefaultFaxToMailServiceContext newServiceContext =
- new DefaultFaxToMailServiceContext();
+ FaxToMailServiceContext newServiceContext =
+ new FaxToMailServiceContext();
- FaxToMailApplicationConfig applicationConfig = getApplicationConfig();
+ FaxToMailConfiguration applicationConfig = getApplicationConfig();
newServiceContext.setApplicationConfig(applicationConfig);
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailTechnicalException;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.services.service.FaxToMailWebApplicationContext;
import com.google.common.base.Charsets;
@@ -33,6 +32,7 @@
import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
@@ -69,7 +69,7 @@
if (log.isErrorEnabled()) {
log.error("should never occur", e);
}
- throw new FaxToMailTechnicalException(e);
+ throw new ApplicationTechnicalException(e);
}
stringBuilder.append('?').append(Joiner.on('&').join(queryStringElements));
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,7 +24,7 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -39,15 +39,15 @@
public static final String NEXT = "next";
- protected FaxToMailApplicationConfig applicationConfig;
+ protected FaxToMailConfiguration applicationConfig;
private FaxToMailSession session;
- public void setApplicationConfig(FaxToMailApplicationConfig applicationConfig) {
+ public void setApplicationConfig(FaxToMailConfiguration applicationConfig) {
this.applicationConfig = applicationConfig;
}
- public FaxToMailApplicationConfig getApplicationConfig() {
+ public FaxToMailConfiguration getApplicationConfig() {
return applicationConfig;
}
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-02-06 08:35:48 UTC (rev 6)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-02-06 16:42:22 UTC (rev 7)
@@ -24,8 +24,8 @@
* #L%
*/
-import com.franciaflex.faxtomail.FaxToMailApplicationConfig;
import com.franciaflex.faxtomail.FaxToMailApplicationContext;
+import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.FaxToMailService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
@@ -116,7 +116,7 @@
toInject = faxToMailSession;
- } else if (FaxToMailApplicationConfig.class.isAssignableFrom(propertyType)) {
+ } else if (FaxToMailConfiguration.class.isAssignableFrom(propertyType)) {
toInject = getFaxToMailApplicationContext(invocation).getApplicationConfig();
1
0
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/2/changes>
Changes:
[kmorin] start web admin part
------------------------------------------
[...truncated 750 lines...]
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[40,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[30,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[29,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[34,1] cannot find symbol
[ERROR] symbol: static t
[ERROR] location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[481,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[496,36] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[511,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[525,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[547,38] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[568,33] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[583,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[597,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[618,38] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[640,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[647,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[668,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[682,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[763,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[771,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[779,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[367,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[368,33] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[376,39] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[377,46] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[387,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[388,44] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[396,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[397,37] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[407,35] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[408,42] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[437,55] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[438,66] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[439,64] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[441,68] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[443,59] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[473,18] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[352,32] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[623,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[637,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[653,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[682,36] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[702,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[723,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[743,30] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[762,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[773,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[787,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[801,31] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[816,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[823,28] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[837,29] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[852,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[859,32] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[971,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1003,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1008,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1013,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1018,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1028,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1033,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1038,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1043,27] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1049,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1054,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1059,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/ws/trunk/faxtomail-ui-swin…>:[1064,26] cannot find symbol
[ERROR] symbol: method t(java.lang.String)
[ERROR] location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faxtomail-ui-swing: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Failed to send e-mail to kmorin because no e-mail address is known, and no default e-mail domain is configured
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :faxtomail-ui-swing
Sending e-mails to: faxtomail-commits(a)list.forge.codelutin.com
channel stopped
Failed to send e-mail to kmorin because no e-mail address is known, and no default e-mail domain is configured
1
2
Build failed in Jenkins: faxtomail » FaxToMail :: Persistence #3
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
06 Feb '14
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: Persistence 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-persistence ---
[INFO] Deleting <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7.4:generate (default) @ faxtomail-persistence ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/top…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/nuiton/topia/topia-persistence/3.0-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/nuiton/topia/topia-persistence/3.0-… (0 B at 0.0 KB/sec)
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Will generate <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copy file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Generate one file in 12.139ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> for 1 file(s).
[INFO] Will generate <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copy file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Generate one file in 696.813ms.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagValue.java.lang.String] : the tagvalue 'java.lang.String' is unkown.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:303) loadModelTagValue - Invalid model tag value [model.tagValue.useEnumerationName] : this tagvalue 'useEnumerationName' can not be apply on the model.
INFO [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:270) loadModelProperties - 5 tag values were succesfull imported from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] No file generated.
[INFO] Apply generator TopiaMetaTransformer
[INFO] Add compile source root : <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (scan-sources) @ faxtomail-persistence ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-persistence ---
[INFO] Copying faxtomail-persistence.properties to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Copying faxtomail-persistence.properties to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence ---
[WARNING] bundle fr_FR contains 2/2 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 2/2 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 17 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-persistence ---
[INFO] Compiling 117 source files to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[20,1] cannot find symbol
symbol: static _
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[23,1] cannot find symbol
symbol: static _
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[59,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[187,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[197,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[208,51] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.FaxToMailIOUtil
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[63,55] cannot find symbol
symbol: method _(java.lang.String,java.io.File)
location: class com.franciaflex.faxtomail.persistence.RessourceClassLoader
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[161,55] cannot find symbol
symbol: method _(java.lang.String,java.util.List<java.io.File>)
location: class com.franciaflex.faxtomail.persistence.RessourceClassLoader
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
1
Jenkins build is back to normal : faxtomail » FaxToMail :: UI #4
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
by admin+ci-codelutin.com@codelutin.com 06 Feb '14
06 Feb '14
06 Feb '14
Author: kmorin
Date: 2014-02-06 09:35:48 +0100 (Thu, 06 Feb 2014)
New Revision: 6
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/6
Log:
replace i18n _ by t
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.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/action/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.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/DemandeUIHandler.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/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailIOUtil.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -20,7 +20,7 @@
import java.util.List;
import java.util.UUID;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Useful methods around IO, all method errors are boxes a
@@ -56,7 +56,7 @@
try {
ZipUtil.compressFiles(archiveFile, source, files);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, archiveFile), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, archiveFile), e);
}
}
@@ -184,7 +184,7 @@
return Files.newReader(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
}
@@ -194,7 +194,7 @@
return Files.newWriter(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
}
@@ -205,7 +205,7 @@
try {
ZipUtil.uncompress(file, tempDir);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_(errorMessage, file), e);
+ throw new FaxToMailTechnicalException(t(errorMessage, file), e);
}
return tempDir;
}
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -17,7 +17,7 @@
import java.util.Enumeration;
import java.util.List;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* A class loader that search first in a given directory before in parent
@@ -60,7 +60,7 @@
this.directories.add(directory);
// force to create directory
- FaxToMailIOUtil.forceMkdir(directory, _("faxtomail.persistence.mkDir.error", directory));
+ FaxToMailIOUtil.forceMkdir(directory, t("faxtomail.persistence.mkDir.error", directory));
}
}
loader = null;
@@ -158,7 +158,7 @@
directories.toArray(new File[directories.size()]));
loader = URLClassLoader.newInstance(urls, null);
} catch (IOException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.persistence.loader.error", directories), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.persistence.loader.error", directories), e);
}
}
return loader;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfig.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,8 +7,6 @@
import java.io.File;
import java.net.URL;
-import static org.nuiton.i18n.I18n._;
-
/**
* Configuration for the service layer.
*
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.io.File;
import java.net.URL;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Option for service configuration.
@@ -19,35 +19,35 @@
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
- n_("faxtomail.config.option.version.description"),
+ n("faxtomail.config.option.version.description"),
"",
Version.class,
true,
true),
SITE_URL(
"faxtomail.site.url",
- n_("faxtomail.config.option.site.url.description"),
+ n("faxtomail.config.option.site.url.description"),
"http://maven-site.forge.codelutin.com/faxtomail",
URL.class,
true,
true),
ORGANIZATION_NAME(
"faxtomail.organizationName",
- n_("faxtomail.config.option.organizationName.description"),
+ n("faxtomail.config.option.organizationName.description"),
"",
String.class,
true,
true),
INCEPTION_YEAR(
"faxtomail.inceptionYear",
- n_("faxtomail.config.option.inceptionYear.description"),
+ n("faxtomail.config.option.inceptionYear.description"),
"2012",
Integer.class,
true,
true),
BASEDIR(
"faxtomail.basedir",
- n_("faxtomail.config.option.basedir.description"),
+ n("faxtomail.config.option.basedir.description"),
"${user.home}/.faxtomail",
File.class,
true,
@@ -55,14 +55,14 @@
),
DATA_DIRECTORY(
"faxtomail.data.directory",
- n_("faxtomail.config.option.data.directory.description"),
+ n("faxtomail.config.option.data.directory.description"),
"${faxtomail.basedir}/data",
File.class,
true,
true),
TMP_DIRECTORY(
"faxtomail.tmp.directory",
- n_("faxtomail.config.option.tmp.directory.description"),
+ n("faxtomail.config.option.tmp.directory.description"),
"${faxtomail.data.directory}/temp",
File.class,
true,
@@ -72,7 +72,7 @@
CSV_SEPARATOR(
"faxtomail.csv.separator",
- n_("faxtomail.config.option.csv.separator.description"),
+ n("faxtomail.config.option.csv.separator.description"),
";",
char.class);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/config/FaxToMailServiceConfigProvider.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.util.Locale;
-import static org.nuiton.i18n.I18n.l_;
+import static org.nuiton.i18n.I18n.l;
/**
* Service config provider (for site generation).
@@ -23,7 +23,7 @@
@Override
public String getDescription(Locale locale) {
- return l_(locale, "faxtomail.config.service");
+ return l(locale, "faxtomail.config.service");
}
@Override
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-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -33,7 +33,7 @@
import java.util.Map;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* UI application context.
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/AbstractFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -16,7 +16,7 @@
import javax.swing.*;
import java.io.File;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* FaxToMail base action.
@@ -270,13 +270,13 @@
// file exists ask user to overwrite
String htmlMessage = String.format(
AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
- _("faxtomail.common.askOverwriteFile.message", file),
- _("faxtomail.common.askOverwriteFile.help"));
+ t("faxtomail.common.askOverwriteFile.message", file),
+ t("faxtomail.common.askOverwriteFile.help"));
result = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
- _("faxtomail.common.askOverwriteFile.title"),
+ t("faxtomail.common.askOverwriteFile.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
} else {
@@ -291,7 +291,7 @@
String htmlMessage = String.format(
AbstractFaxToMailUIHandler.CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askBeforeDelete.help"));
+ t("faxtomail.common.askBeforeDelete.help"));
int i = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionHelper.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -8,7 +8,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Useful method around FaxToMailUIAction.
@@ -110,7 +110,7 @@
A result = ConstructorUtils.invokeConstructor(actionName, handler);
return result;
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.action.create.error", actionName), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.action.create.error", actionName), e);
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/action/FaxToMailActionUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -18,7 +18,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -193,12 +193,12 @@
}
protected void showAction(AbstractFaxToMailAction action) {
- ui.setTitle(_("faxtomail.main.title.action",
+ ui.setTitle(t("faxtomail.main.title.action",
// getConfig().getVersion(),
"0.1",
action.getActionDescription()));
ui.getGlobalActionLabel().setText(
- _("faxtomail.message.action.running",
+ t("faxtomail.message.action.running",
action.getActionDescription()));
ui.pack();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfig.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -21,7 +21,7 @@
import java.util.Locale;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* FaxToMail application config.
@@ -82,7 +82,7 @@
applicationConfig.parse(args);
} catch (ArgumentsParserException e) {
- throw new FaxToMailTechnicalException(_("faxtomail.config.parse.error"), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.config.parse.error"), e);
}
//TODO Review this, this is very dirty to do this...
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigOption.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,7 +7,7 @@
import java.io.File;
import java.util.Locale;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* All FaxToMail configuration options.
@@ -19,7 +19,7 @@
FAXTOMAIL_LAUNCH_MODE(
"faxtomail.launch.mode",
- n_("faxtomail.config.option.launch.mode.description"),
+ n("faxtomail.config.option.launch.mode.description"),
null,
String.class,
true,
@@ -28,7 +28,7 @@
FAXTOMAIL_I18N_DIRECTORY(
"faxtomail.i18n.directory",
- n_("faxtomail.config.option.i18n.directory.description"),
+ n("faxtomail.config.option.i18n.directory.description"),
"${faxtomail.basedir}/i18n",
File.class,
false,
@@ -37,7 +37,7 @@
// FAXTOMAIL_HELP_DIRECTORY(
// "faxtomail.help.directory",
-// n_("faxtomail.config.option.help.directory.description"),
+// n("faxtomail.config.option.help.directory.description"),
// "${faxtomail.basedir}/help",
// File.class,
// false,
@@ -46,7 +46,7 @@
START_ACTION_FILE(
"faxtomail.startActionFile",
- n_("faxtomail.config.option.startActionFile.description"),
+ n("faxtomail.config.option.startActionFile.description"),
"${faxtomail.basedir}/faxtomail-start-action",
File.class,
true,
@@ -54,41 +54,41 @@
),
FAXTOMAIL_I18N_LOCALE(
"faxtomail.i18n.locale",
- n_("faxtomail.config.option.i18n.locale.description"),
+ n("faxtomail.config.option.i18n.locale.description"),
Locale.FRANCE.getCountry(),
Locale.class
),
UI_CONFIG_FILE(
"faxtomail.ui.config.file",
- n_("faxtomail.config.option.ui.config.file.description"),
+ n("faxtomail.config.option.ui.config.file.description"),
"${faxtomail.data.directory}/faxtomailUI.xml",
File.class
),
AUTO_POPUP_NUMBER_EDITOR(
"faxtomail.ui.autoPopupNumberEditor",
- n_("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
+ n("faxtomail.config.option.ui.autoPopupNumberEditor.description"),
String.valueOf(false),
Boolean.class
),
SHOW_NUMBER_EDITOR_BUTTON(
"faxtomail.ui.showNumberEditorButton",
- n_("faxtomail.config.option.ui.showNumberEditorButton.description"),
+ n("faxtomail.config.option.ui.showNumberEditorButton.description"),
String.valueOf(true),
Boolean.class
),
COLOR_ALTERNATE_ROW(
"faxtomail.ui.color.alternateRow",
- n_("faxtomail.config.option.ui.color.alternateRow.description"),
+ n("faxtomail.config.option.ui.color.alternateRow.description"),
new Color(217, 217, 217).toString(),
Color.class
),
COLOR_SELECTED_ROW(
"faxtomail.ui.color.selectedRow",
- n_("faxtomail.config.option.ui.color.selectedRow.description"),
+ n("faxtomail.config.option.ui.color.selectedRow.description"),
new Color(57,105,138).toString(),
Color.class
),
@@ -99,21 +99,21 @@
*/
COLOR_BLOCKING_LAYER(
"faxtomail.ui.color.blockingLayer",
- n_("faxtomail.config.option.ui.color.blockingLayer.description"),
+ n("faxtomail.config.option.ui.color.blockingLayer.description"),
new Color(200, 200, 200).toString(),
Color.class
),
SHORTCUT_CLOSE_POPUP(
"faxtomail.ui.shortcut.closePopup",
- n_("faxtomail.config.option.ui.shortcut.closePopup.description"),
+ n("faxtomail.config.option.ui.shortcut.closePopup.description"),
"alt pressed F",
KeyStroke.class
),
DATE_FORMAT(
"faxtomail.ui.dateFormat",
- n_("faxtomail.config.option.ui.dateFormat.description"),
+ n("faxtomail.config.option.ui.dateFormat.description"),
"dd/MM/yyyy",
String.class
);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/config/FaxToMailApplicationConfigProvider.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -6,7 +6,7 @@
import java.util.Locale;
-import static org.nuiton.i18n.I18n.l_;
+import static org.nuiton.i18n.I18n.l;
/**
* Application config provider (for site generation).
@@ -23,7 +23,7 @@
@Override
public String getDescription(Locale locale) {
- return l_(locale, "faxtomail.config.application");
+ return l(locale, "faxtomail.config.application");
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/CloseApplicationAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -2,7 +2,7 @@
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To close FaxToMail Application.
@@ -17,7 +17,7 @@
public CloseApplicationAction(MainUIHandler handler) {
super(handler, false, null);
setSkipCheckCurrentScreen(true);
- setActionDescription(_("faxtomail.main.action.exit.tip"));
+ setActionDescription(t("faxtomail.main.action.exit.tip"));
}
public void setExitCode(int exitCode) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/GoToPreviousScreenAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -1,6 +1,6 @@
package com.franciaflex.faxtomail.ui.swing.content;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To return on previous screen.
@@ -15,6 +15,6 @@
true,
PREVIOUS_SCREEN.getContextValue(handler.getUI())
);
- setActionDescription(_("faxtomail.main.action.goto.previousScreen.tip"));
+ setActionDescription(t("faxtomail.main.action.goto.previousScreen.tip"));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -30,7 +30,7 @@
import java.beans.PropertyChangeListenerProxy;
import java.util.Locale;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -358,26 +358,26 @@
case CONFIG:
screenUI = new FaxToMailConfigUI(ui);
- screenTitle = _("faxtomail.config.title");
+ screenTitle = t("faxtomail.config.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
case SEARCH:
screenUI = new SearchUI(ui);
- screenTitle = _("faxtomail.search.title");
+ screenTitle = t("faxtomail.search.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
case DEMANDE:
screenUI = new DemandeUI(ui);
- screenTitle = _("faxtomail.demande.title");
+ screenTitle = t("faxtomail.demande.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
default:
case LIST:
screenUI = new DemandeListUI(ui);
- screenTitle = _("faxtomail.demandeList.title");
+ screenTitle = t("faxtomail.demandeList.title");
icon = ui.getMenuFileConfiguration().getIcon();
break;
}
@@ -409,7 +409,7 @@
String title = getSelectedCruiseTitle();
- ui.setTitle(_("faxtomail.main.title.application",
+ ui.setTitle(t("faxtomail.main.title.application",
// getConfig().getVersion(),
"0.1",
title));
@@ -471,7 +471,7 @@
// no db loaded
- title = _("faxtomail.main.title.nodb");
+ title = t("faxtomail.main.title.nodb");
// }
return title;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/ReloadFaxToMailAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -2,7 +2,7 @@
import com.franciaflex.faxtomail.ui.swing.RunFaxToMail;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* To reload FaxToMail application.
@@ -14,7 +14,7 @@
public ReloadFaxToMailAction(MainUIHandler handler) {
super(handler, true, null);
- setActionDescription(_("faxtomail.main.action.reloadFaxToMail"));
+ setActionDescription(t("faxtomail.main.action.reloadFaxToMail"));
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/StartAction.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -7,8 +7,6 @@
import java.io.File;
-import static org.nuiton.i18n.I18n._;
-
/**
* Start action (when the start action file is present when
* starting application).
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-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -44,7 +44,7 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler}.
@@ -62,9 +62,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -34,7 +34,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link DemandeUIHandler}.
@@ -52,9 +52,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
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-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -47,7 +47,7 @@
import java.util.List;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Handler of UI {@link SearchUIHandler}.
@@ -65,9 +65,9 @@
String result;
if (exist) {
- result = _("tutti.editCruise.title.edit.cruise");
+ result = t("tutti.editCruise.title.edit.cruise");
} else {
- result = _("tutti.editCruise.title.create.cruise");
+ result = t("tutti.editCruise.title.create.cruise");
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -46,7 +46,7 @@
import java.util.List;
import java.util.Map;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* Contract of any UI handler.
@@ -225,11 +225,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askSaveBeforeLeaving.help"));
+ t("faxtomail.common.askSaveBeforeLeaving.help"));
int result = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("faxtomail.common.askSaveBeforeLeaving.title"),
+ t("faxtomail.common.askSaveBeforeLeaving.title"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
return result;
@@ -239,11 +239,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("faxtomail.common.askCancelEditBeforeLeaving.help"));
+ t("faxtomail.common.askCancelEditBeforeLeaving.help"));
int i = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("faxtomail.common.askCancelEditBeforeLeaving.title"),
+ t("faxtomail.common.askCancelEditBeforeLeaving.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
@@ -680,7 +680,7 @@
}
// String dateFormat = getConfig().getDateFormat();
picker.setFormats("dd/MM/yyyy");
- picker.setToolTipText(_("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
+ picker.setToolTipText(t("faxtomail.common.datefield.tip", "dd/MM/yyyy"));
picker.getEditor().addFocusListener(new FocusAdapter() {
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailErrorHelper.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -8,7 +8,7 @@
import javax.swing.*;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* helper around errors in FaxToMail.
@@ -34,7 +34,7 @@
if (cause == null) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("faxtomail.error.ui.business.error"),
+ t("faxtomail.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
// } else if (cause instanceof FaxToMailBusinessException) {
// JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
@@ -42,13 +42,13 @@
// JOptionPane.ERROR_MESSAGE);
} else if (cause instanceof ImportRuntimeException) {
JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
- _("faxtomail.error.ui.business.error"),
+ t("faxtomail.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
} else {
JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(_("faxtomail.error.ui.other.error"),
- _("faxtomail.error.errorpane.htmlmessage", message), null, null,
+ ErrorInfo info = new ErrorInfo(t("faxtomail.error.ui.other.error"),
+ t("faxtomail.error.errorpane.htmlmessage", message), null, null,
cause, null, null);
pane.setErrorInfo(info);
pane.setErrorReporter(this);
@@ -80,7 +80,7 @@
public void showWarningDialog(String message) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("faxtomail.error.ui.business.warning"),
+ t("faxtomail.error.ui.business.warning"),
JOptionPane.WARNING_MESSAGE);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-05 18:56:18 UTC (rev 5)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-02-06 08:35:48 UTC (rev 6)
@@ -42,7 +42,7 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.t;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -63,7 +63,7 @@
try {
PropertyUtils.setSimpleProperty(bean, property, value);
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.property.set.error", property, bean.getClass().getName()), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.property.set.error", property, bean.getClass().getName()), e);
}
}
@@ -73,7 +73,7 @@
try {
return PropertyUtils.getSimpleProperty(bean, property);
} catch (Exception e) {
- throw new FaxToMailTechnicalException(_("faxtomail.property.get.error", property, bean.getClass().getName()), e);
+ throw new FaxToMailTechnicalException(t("faxtomail.property.get.error", property, bean.getClass().getName()), e);
}
}
@@ -105,7 +105,7 @@
try {
openLink(url.toURI());
} catch (URISyntaxException e) {
- throw new FaxToMailTechnicalException(_("swing.error.cannot.open.link", url), e);
+ throw new FaxToMailTechnicalException(t("swing.error.cannot.open.link", url), e);
}
}
@@ -113,7 +113,7 @@
if (!Desktop.isDesktopSupported()) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.not.supported"));
+ t("swing.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -121,7 +121,7 @@
if (!desktop.isSupported(Desktop.Action.BROWSE)) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.browse.not.supported"));
+ t("swing.error.desktop.browse.not.supported"));
}
return desktop;
@@ -137,7 +137,7 @@
} catch (Exception e) {
throw new FaxToMailTechnicalException(
- _("swing.error.cannot.open.link", uri), e);
+ t("swing.error.cannot.open.link", uri), e);
}
}
@@ -145,7 +145,7 @@
if (!Desktop.isDesktopSupported()) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.not.supported"));
+ t("swing.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -153,7 +153,7 @@
if (!desktop.isSupported(Desktop.Action.MAIL)) {
throw new FaxToMailTechnicalException(
- _("swing.error.desktop.mail.not.supported"));
+ t("swing.error.desktop.mail.not.supported"));
}
return desktop;
@@ -170,7 +170,7 @@
} catch (Exception e) {
throw new FaxToMailTechnicalException(
- _("swing.error.cannot.mail"), e);
+ t("swing.error.cannot.mail"), e);
}
}
1
0
Author: kmorin
Date: 2014-02-05 19:56:18 +0100 (Wed, 05 Feb 2014)
New Revision: 5
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/5
Log:
use latest versions
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-05 18:34:13 UTC (rev 4)
+++ trunk/pom.xml 2014-02-05 18:56:18 UTC (rev 5)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.5</version>
+ <version>4.7</version>
</parent>
<groupId>com.franciaflex</groupId>
@@ -78,17 +78,17 @@
<!-- libraries version -->
- <nuitonI18nVersion>2.5.2</nuitonI18nVersion>
- <nuitonConfigVersion>3.0-alpha-1</nuitonConfigVersion>
- <nuitonCsvVersion>3.0-alpha-1</nuitonCsvVersion>
- <nuitonDecoratorVersion>3.0-alpha-2</nuitonDecoratorVersion>
- <nuitonUpdaterVersion>3.0-alpha-1</nuitonUpdaterVersion>
- <nuitonUtilsVersion>2.7.1</nuitonUtilsVersion>
- <nuitonValidatorVersion>3.0-alpha-2</nuitonValidatorVersion>
- <nuitonWebVersion>1.14</nuitonWebVersion>
+ <nuitonI18nVersion>3.0</nuitonI18nVersion>
+ <nuitonConfigVersion>3.0-alpha-2</nuitonConfigVersion>
+ <nuitonCsvVersion>3.0-alpha-3</nuitonCsvVersion>
+ <nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
+ <nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
+ <nuitonUtilsVersion>3.0-rc-2</nuitonUtilsVersion>
+ <nuitonValidatorVersion>3.0-alpha-3</nuitonValidatorVersion>
+ <nuitonWebVersion>1.15-alpha-3</nuitonWebVersion>
- <eugeneVersion>2.7.3</eugeneVersion>
- <topiaVersion>3.0-SNAPSHOT</topiaVersion>
+ <eugeneVersion>2.7.4</eugeneVersion>
+ <topiaVersion>3.0-alpha-10</topiaVersion>
<hibernateVersion>4.2.8.Final</hibernateVersion>
<h2Version>1.3.174</h2Version>
1
0
Build failed in Jenkins: faxtomail » FaxToMail :: UI #2
by admin+ci-codelutin.com@codelutin.com 05 Feb '14
by admin+ci-codelutin.com@codelutin.com 05 Feb '14
05 Feb '14
See <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
Changes:
[kmorin] start web admin part
------------------------------------------
[...truncated 72 lines...]
[INFO] >>> i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing >>>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:collect-i18n-artifacts (collect-i18n-artifacts) @ faxtomail-ui-swing ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/nui… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/nuiton/jaxx/2.8/jaxx-2.8.pom
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/nuiton/jaxx/2.8/jaxx-2.8.pom (0 B at 0.0 KB/sec)
[INFO] collected 11 i18n artifacts for locale fr_FR stored in <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] collected 11 i18n artifacts for locale en_GB stored in <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing <<<
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:bundle (make-bundle) @ faxtomail-ui-swing ---
[WARNING] bundle fr_FR contains 160/398 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 243/415 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- license-maven-plugin:1.5:update-project-license (attach-licenses) @ faxtomail-ui-swing ---
[INFO] Will create or update license file [gpl_v3] to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- license-maven-plugin:1.5:add-third-party (attach-licenses) @ faxtomail-ui-swing ---
[WARNING] No license name defined for org.hibernate.javax.persistence--hibernate-jpa-2.0-api--1.0.1.Final
[INFO] Load missing file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Missing file <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…> is up-to-date.
[INFO] Writing third-party file to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Writing bundled third-party file to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] Will attach third party file from <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 8 resources
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-ui-swing ---
[INFO] Compiling 47 source files to <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[40,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[30,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[29,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[34,1] cannot find symbol
symbol: static t
location: class
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[481,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[496,36] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[511,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[525,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[547,38] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[568,33] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[583,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[597,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[618,38] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[640,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[647,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[668,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[682,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[763,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[771,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[779,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.search.SearchUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[367,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[368,33] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[376,39] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[377,46] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[387,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[388,44] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[396,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[397,37] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[407,35] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[408,42] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[437,55] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[438,66] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[439,64] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[441,68] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[443,59] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[473,18] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.MainUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[352,32] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[623,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[637,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[653,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[682,36] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[702,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[723,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[743,30] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[762,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[773,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[787,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[801,31] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[816,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[823,28] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[837,29] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[852,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[859,32] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[971,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1003,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1008,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1013,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1018,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1028,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1033,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1038,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1043,27] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1049,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1054,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1059,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[ERROR] <http://ci-ng.codelutin.com/jenkins/job/faxtomail/com.franciaflex.faxtomail$…>:[1064,26] cannot find symbol
symbol: method t(java.lang.String)
location: class com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI
[INFO] 66 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
0