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
August 2014
- 4 participants
- 141 discussions
r587 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 16:07:53 +0200 (Fri, 22 Aug 2014)
New Revision: 587
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/587
Log:
refs #5649: Ajout d'un test unitaire
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-22 13:33:51 UTC (rev 586)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-22 14:07:53 UTC (rev 587)
@@ -27,6 +27,7 @@
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -427,12 +428,13 @@
"INNER JOIN email." + Email.PROPERTY_RANGE_ROW + " AS rangeRow " +
"INNER JOIN rangeRow." + RangeRow.PROPERTY_RANGE + " AS range " +
"WHERE email." + Email.PROPERTY_MAIL_FOLDER + " IN :folders " +
- "GROUP BY range";
+ "GROUP BY range " +
+ "ORDER BY range.label";
Map<String, Object> args = new HashMap<>();
args.put("folders", folders);
- Map<Range, Long[]> result = new HashMap<>();
+ Map<Range, Long[]> result = new LinkedHashMap<>();
List<Object[]> queryResuts = findAll(query, args);
for (Object[] queryResut : queryResuts) {
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-22 13:33:51 UTC (rev 586)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-22 14:07:53 UTC (rev 587)
@@ -594,8 +594,10 @@
List<MailFolder> folders = new ArrayList<>();
folders.add(folder);
Collection<MailFolder> children = folder.getChildren();
- for (MailFolder child : children) {
- folders.addAll(getChildrenRecursively(child));
+ if (children != null) {
+ for (MailFolder child : children) {
+ folders.addAll(getChildrenRecursively(child));
+ }
}
return folders;
}
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java 2014-08-22 13:33:51 UTC (rev 586)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java 2014-08-22 14:07:53 UTC (rev 587)
@@ -28,6 +28,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.junit.Assert;
@@ -43,6 +45,7 @@
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Range;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
@@ -173,4 +176,24 @@
service.importArchive(is, attachmentBase);
}
}
+
+ /**
+ * Test le la fonction de calcul des quantités par gammes qui fesait une erreur de groupBy en
+ * 1.0.0-rc-3.
+ */
+ @Test
+ public void testComputeQuantititesByRange() {
+ MailFolderTopiaDao mailFolderDao = getServiceContext().getPersistenceContext().getMailFolderDao();
+ MailFolder cyril = mailFolderDao.forNameEquals("Cyril").findUnique();
+
+ Map<Range, Long[]> quantitiesByRange = service.computeQuantitiesByRange(cyril);
+ Assert.assertEquals(4, quantitiesByRange.size());
+
+ // recupere la premiere lignes
+ Entry<Range, Long[]> entry = quantitiesByRange.entrySet().iterator().next();
+ Assert.assertEquals("Bas de gamme", entry.getKey().getLabel());
+ Assert.assertEquals(500, entry.getValue()[0].longValue());
+ Assert.assertEquals(600, entry.getValue()[1].longValue());
+ // NPE : Assert.assertEquals(600, entry.getValue()[2].longValue());
+ }
}
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-08-22 13:33:51 UTC (rev 586)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-08-22 14:07:53 UTC (rev 587)
@@ -32,6 +32,7 @@
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
+import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -212,6 +213,9 @@
List<DemandType> types = null;
try (InputStream is = InitTestDataImpl.class.getResourceAsStream("/csv/demandtypes.csv")) {
types = referentielService.importDemandTypes(is);
+
+ // ajoute le champ GAMME en champ obligatoire pour tester les quantités par gammes
+ types.get(0).setRequiredFields(EnumSet.of(MailField.CLIENT, MailField.RANGE_ROW));
}
try (InputStream is = InitTestDataImpl.class.getResourceAsStream("/csv/email_filters.csv")) {
referentielService.importEmailFilters(is, foldersByName);
@@ -271,7 +275,7 @@
if (opened) {
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
- DemandType demandType = types.get(0);
+ DemandType demandType = types.get(0); // types.get(0) à des gammes obligatoires
if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < 4; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(j),
@@ -309,7 +313,7 @@
if (opened) {
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
- DemandType demandType = types.get(0);
+ DemandType demandType = types.get(0); // types.get(0) à des gammes obligatoires
if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < 4; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(j),
1
0
r586 - trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 15:33:51 +0200 (Fri, 22 Aug 2014)
New Revision: 586
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/586
Log:
Label 'type de demande'
Modified:
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-22 13:30:33 UTC (rev 585)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-22 13:33:51 UTC (rev 586)
@@ -195,7 +195,7 @@
<div class="row">
<div class="col-md-4">
- <h3>Type de document <input type="button" class="btn btn-success btn-xs pull-right" value="Nouveau" ng-click="newDemandType()" /></h3>
+ <h3>Type de demande <input type="button" class="btn btn-success btn-xs pull-right" value="Nouveau" ng-click="newDemandType()" /></h3>
<table class="table table-hover">
<tbody>
<tr ng-repeat="demandType in demandTypes"
@@ -208,8 +208,8 @@
</div>
<div class="col-md-8" ng-if="selectedDemandType">
- <h3>Édition du type de document {{selectedDemandType.label}}</h3>
- Champs obligatoires pour le type de document :
+ <h3>Édition du type de demande {{selectedDemandType.label}}</h3>
+ Champs obligatoires pour le type de demande :
<div class="checkbox" ng-repeat="(mailField,label) in canBeRequiredMailFields">
<label>
<input type="checkbox" ng-checked="selectedDemandType.requiredFields.indexOf(mailField) != -1"
@@ -223,7 +223,7 @@
</div>
</div>
<div class="col-md-8" ng-if="!selectedDemandType">
- <em>Sélectionnez un type de document.</em>
+ <em>Sélectionnez un type de demande.</em>
</div>
</div>
1
0
r585 - trunk/faxtomail-ui-web/src/main/webapp/WEB-INF
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 15:30:33 +0200 (Fri, 22 Aug 2014)
New Revision: 585
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/585
Log:
Update libs
Modified:
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/wro.xml
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/wro.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/wro.xml 2014-08-22 13:29:14 UTC (rev 584)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/wro.xml 2014-08-22 13:30:33 UTC (rev 585)
@@ -24,9 +24,9 @@
<groups xmlns="http://www.isdc.ro/wro">
<group name='webjar-select2' abstract="true">
- <css>classpath:META-INF/resources/webjars/select2/3.5.0/select2.css</css>
- <js>classpath:META-INF/resources/webjars/select2/3.5.0/select2.js</js>
- <js>classpath:META-INF/resources/webjars/select2/3.5.0/select2_locale_fr.js</js>
+ <css>classpath:META-INF/resources/webjars/select2/3.5.1/select2.css</css>
+ <js>classpath:META-INF/resources/webjars/select2/3.5.1/select2.js</js>
+ <js>classpath:META-INF/resources/webjars/select2/3.5.1/select2_locale_fr.js</js>
</group>
<group name='webjar-angular-ui-sortable' abstract="true">
1
0
r584 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 15:29:14 +0200 (Fri, 22 Aug 2014)
New Revision: 584
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/584
Log:
refs #5650: Readd exceptionable Desktop methods
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
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-08-22 13:22:28 UTC (rev 583)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-08-22 13:29:14 UTC (rev 584)
@@ -84,7 +84,6 @@
import org.nuiton.jaxx.application.ApplicationBusinessException;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
-import org.nuiton.util.DesktopUtil;
import org.nuiton.util.FileUtil;
import org.nuiton.util.StringUtil;
@@ -536,7 +535,17 @@
}
}
} else {
- DesktopUtil.open(file);
+
+ // version to use for xfce
+ // DesktopUtil.open(file);
+
+ try {
+ Desktop desktop = getDesktopForOpen();
+ desktop.open(file);
+ } catch (Exception ex) {
+ throw new ApplicationTechnicalException(
+ t("jaxx.application.error.cannot.mail"), ex);
+ }
}
}
@@ -550,8 +559,12 @@
try {
URI mailtoURI = new URI("mailto", null, null, "subject=" + subject + "&body=" + body, null);
- DesktopUtil.mail(mailtoURI);
+ Desktop desktop = getDesktopForMail();
+ desktop.mail(mailtoURI);
+ // version for xfce
+ // DesktopUtil.mail(mailtoURI);
+
} catch (Exception e) {
throw new ApplicationTechnicalException(
1
0
r583 - in trunk: faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-service/src/main/resources/db/migration/h2 faxtomail-service/src/main/resources/db/migration/postgres faxtomail-service/src/main/resources/db/migration/sqlserver faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 15:22:28 +0200 (Fri, 22 Aug 2014)
New Revision: 583
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/583
Log:
fixes #5654: Les transfert EDI doivent ?\195?\170tre configur?\195?\169s par type de document ET par soci?\195?\169t?\195?\169
Added:
trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql
trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-08-22 12:43:03 UTC (rev 582)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-08-22 13:22:28 UTC (rev 583)
@@ -30,7 +30,6 @@
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailLock;
import com.franciaflex.faxtomail.persistence.entities.Range;
@@ -52,7 +51,6 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* @author Kevin Morin (Code Lutin)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-22 12:43:03 UTC (rev 582)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-22 13:22:28 UTC (rev 583)
@@ -85,7 +85,6 @@
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
import com.franciaflex.faxtomail.services.service.imports.ArchiveImportBean;
import com.franciaflex.faxtomail.services.service.imports.ArchiveImportModel;
-import com.google.common.base.Enums;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
@@ -369,8 +368,11 @@
protected void handleEdiTransmission(Email email, HistoryTopiaDao historyDao, Set<String> fieldSet) {
History transmissionToEdi;
- if (FaxToMailServiceUtils.contains(email.getDemandType().getRequiredFields(), MailField.RANGE_ROW)) {
+ // le transfert EDI est configuré par type de demande ET par société
+ if (FaxToMailServiceUtils.contains(email.getDemandType().getRequiredFields(), MailField.RANGE_ROW)
+ && email.getDemandType().isEdiTransfer()) {
+
// si les gammes sont vides, la demande n'est pas valide, on ne fait rien dans ce cas
// sinon on transfer à edi
if (email.isRangeRowNotEmpty()) {
Added: trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql 2014-08-22 13:22:28 UTC (rev 583)
@@ -0,0 +1,4 @@
+
+-- demandtype
+alter table demandtype add editransfer boolean;
+update demandtype set editransfer = 'f';
Added: trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql 2014-08-22 13:22:28 UTC (rev 583)
@@ -0,0 +1,4 @@
+
+-- demandtype
+alter table demandtype add editransfer boolean;
+update demandtype set editransfer = 'f';
Added: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql 2014-08-22 13:22:28 UTC (rev 583)
@@ -0,0 +1,5 @@
+
+-- demandtype
+alter table demandtype add editransfer bit;
+GO
+update demandtype set editransfer = 0;
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-22 12:43:03 UTC (rev 582)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-22 13:22:28 UTC (rev 583)
@@ -215,6 +215,11 @@
<input type="checkbox" ng-checked="selectedDemandType.requiredFields.indexOf(mailField) != -1"
ng-click="changeDemandTypeField(mailField)"> {{label}}
</label>
+ <span ng-show="mailField == 'RANGE_ROW'">(<label>
+ <input type="checkbox" ng-model="selectedDemandType.ediTransfer"
+ ng-disabled="selectedDemandType.requiredFields.indexOf(mailField) == -1"/> Autoriser le transfert EDI
+ <i class="fa fa-info-circle" tooltip="Si cette case est cochée, les demandes valides seront transférées à l'EDI pour le traitement des numéros de commande des gammes, sinon les demandes passerons directement dans le statut 'en cours'. Cette configuration n'est utilisée que si la société autorise également le transfert EDI."></i>
+ </label>)</span>
</div>
</div>
<div class="col-md-8" ng-if="!selectedDemandType">
@@ -365,7 +370,7 @@
<hr />
<div class="form-group">
- <label class="control-label">Autoriser le transfert EDI ?</label><br />
+ <label class="control-label">Autoriser le transfert EDI ?</label> <i class="fa fa-info-circle" tooltip="Autorise le transfert des demandes à l'EDI si les demandes utilisent un type de demande qui autorise également le transfert EDI"></i><br />
<label class="radio-inline">
<input type="radio"
ng-model="selectedMailFolder.ediTransfer" ng-value="true"> oui
1
0
22 Aug '14
Author: echatellier
Date: 2014-08-22 14:43:03 +0200 (Fri, 22 Aug 2014)
New Revision: 582
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/582
Log:
Update libs
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/pom.xml
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-08-22 09:38:35 UTC (rev 581)
+++ trunk/faxtomail-persistence/pom.xml 2014-08-22 12:43:03 UTC (rev 582)
@@ -115,21 +115,6 @@
</dependencies>
<build>
- <pluginManagement>
- <plugins>
- <!--<plugin>-->
- <!--<artifactId>maven-surefire-plugin</artifactId>-->
- <!--<configuration>-->
- <!--<properties>-->
- <!--<property>-->
- <!--<name>listener</name>-->
- <!--<value>fr.ifremer.tutti.persistence.test.TuttiRunListener</value>-->
- <!--</property>-->
- <!--</properties>-->
- <!--</configuration>-->
- <!--</plugin>-->
- </plugins>
- </pluginManagement>
<plugins>
<plugin>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-22 09:38:35 UTC (rev 581)
+++ trunk/pom.xml 2014-08-22 12:43:03 UTC (rev 582)
@@ -97,7 +97,7 @@
<!-- libraries version -->
<nuitonI18nVersion>3.3</nuitonI18nVersion>
- <nuitonConfigVersion>3.0-alpha-4</nuitonConfigVersion>
+ <nuitonConfigVersion>3.0-rc-1</nuitonConfigVersion>
<nuitonCsvVersion>3.0-rc-4</nuitonCsvVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
@@ -118,7 +118,7 @@
<jqueryPluginVersion>3.7.1</jqueryPluginVersion>
<bootstrapPluginVersion>2.0.0</bootstrapPluginVersion>
<slf4jVersion>1.7.7</slf4jVersion>
- <log4jVersion>2.0.1</log4jVersion>
+ <log4jVersion>2.0.2</log4jVersion>
<postgresqlDriverVersion>9.3-1102-jdbc41</postgresqlDriverVersion>
<commonsEmailVersion>1.3.3</commonsEmailVersion>
@@ -536,7 +536,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>select2</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</version>
<scope>runtime</scope>
</dependency>
1
0
r581 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande
by echatellier@users.forge.codelutin.com 22 Aug '14
by echatellier@users.forge.codelutin.com 22 Aug '14
22 Aug '14
Author: echatellier
Date: 2014-08-22 11:38:35 +0200 (Fri, 22 Aug 2014)
New Revision: 581
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/581
Log:
fixes #5648: Erreur lors du clic droit dans une zone vide dans le tableau
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/DemandeListUIHandler.java
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-08-21 10:11:20 UTC (rev 580)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-08-22 09:38:35 UTC (rev 581)
@@ -97,6 +97,7 @@
actionIcon: print;
text: "faxtomail.demandeList.action.print";
toolTipText: "faxtomail.demandeList.action.print.tip";
+ enabled: { model.isPrintEnabled() };
}
#replyMenu {
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-08-21 10:11:20 UTC (rev 580)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-08-22 09:38:35 UTC (rev 581)
@@ -480,11 +480,10 @@
DemandeListUIModel model = getModel();
- DemandeUIModel firstDemandeUIModel = model.getSelectedEmails().get(0);
model.setReplyEnabled(selectedRowCount == 1
- && firstDemandeUIModel.isEditable()
- && isActionEnabled(firstDemandeUIModel, MailAction.REPLY, config));
+ && model.getSelectedEmails().get(0).isEditable()
+ && isActionEnabled(model.getSelectedEmails().get(0), MailAction.REPLY, config));
model.setArchiveEnabled(selectedRowCount > 0);
model.setTransmitEnabled(selectedRowCount > 0);
1
0
21 Aug '14
Author: echatellier
Date: 2014-08-21 12:11:20 +0200 (Thu, 21 Aug 2014)
New Revision: 580
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/580
Log:
fixes #5647: Remplacer les relations avec des enums par un stockage en String
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumListUserType.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumSetUserType.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailActionEnumSetUserType.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumListUserType.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumSetUserType.java
trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql
trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java
trunk/faxtomail-service/src/test/resources/log4j2.xml
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/SearchToGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.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/FaxToMailUIUtil.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -367,7 +367,7 @@
String hqlForFetchStep1 = "select E." + TopiaEntity.PROPERTY_TOPIA_ID + " FROM " + Email.class.getName() + " E " + query.toString();
String hqlForFetchStep2 = "select distinct E FROM " + Email.class.getName() + " E " + addAllFecthes(
Email.PROPERTY_PRIORITY,
- Email.PROPERTY_DEMAND_TYPE + "." + DemandType.PROPERTY_FIELDS,
+ Email.PROPERTY_DEMAND_TYPE,
Email.PROPERTY_CLIENT,
Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
Email.PROPERTY_ETAT_ATTENTE,
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumListUserType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumListUserType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumListUserType.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,155 @@
+package com.franciaflex.faxtomail.persistence.hibernate;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.HibernateException;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.usertype.UserType;
+
+/**
+ * See https://community.jboss.org/wiki/Java5EnumUserType.
+ * and inspired by http://2lips.pl/blog/usertype-enumset-mysql-set-column.
+ *
+ * @author Eric Chatellier
+ *
+ * @param <T>
+ */
+public abstract class EnumListUserType<T extends Enum<T>> implements UserType {
+
+ private Class<T> typeClazz = null;
+ private Class<? extends List> returnedType = null;
+
+ public EnumListUserType(Class<T> typeClazz) {
+ this.typeClazz = typeClazz;
+ returnedType = ArrayList.class;
+ }
+
+ public Class returnedClass() {
+ return returnedType;
+ }
+
+ public int[] sqlTypes() {
+ return new int[] { Types.LONGVARCHAR };
+ }
+
+ public boolean isMutable() {
+ return false;
+ }
+
+ /**
+ * Retrieve an instance of the mapped class from a JDBC resultset.
+ * Implementors should handle possibility of null values.
+ *
+ * @param rs a JDBC result set
+ * @param names the column names
+ * @param owner the containing entity
+ * @return Object
+ * @throws HibernateException
+ * @throws SQLException
+ */
+ @Override
+ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
+ String name = rs.getString(names[0]);
+ List<T> result = null;
+ if (!rs.wasNull()) {
+ String[] values = name.split(",");
+ result = new ArrayList<T>();
+ for (String value : values) {
+ if (!value.isEmpty()) {
+ result.add(Enum.valueOf(typeClazz, value));
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Write an instance of the mapped class to a prepared statement.
+ * Implementors should handle possibility of null values. A multi-column
+ * type should be written to parameters starting from <tt>index</tt>.
+ *
+ * @param st a JDBC prepared statement
+ * @param value the object to write
+ * @param index statement parameter index
+ * @param session session
+ * @throws HibernateException
+ * @throws SQLException
+ */
+ @Override
+ public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException {
+ if (null == value) {
+ st.setNull(index, Types.VARCHAR);
+ } else {
+ List<T> values = (List<T>)value;
+ String sqlValue = "";
+ if (!values.isEmpty()) {
+ StringBuilder buf = new StringBuilder();
+ for(T val : values) {
+ buf.append(val.name()).append(",");
+ }
+ sqlValue = buf.substring(0, buf.length() - 1);
+ }
+ st.setString(index, sqlValue);
+ }
+ }
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ return cached;
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ return (Enum<?>) value;
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ return value;
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ if (x == y) {
+ return true;
+ }
+ if (null == x || null == y) {
+ return false;
+ }
+ return x.equals(y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return x.hashCode();
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumListUserType.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumSetUserType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumSetUserType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumSetUserType.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,161 @@
+package com.franciaflex.faxtomail.persistence.hibernate;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.EnumSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.hibernate.HibernateException;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.usertype.UserType;
+
+/**
+ * See https://community.jboss.org/wiki/Java5EnumUserType.
+ * and inspired by http://2lips.pl/blog/usertype-enumset-mysql-set-column.
+ *
+ * @author Eric Chatellier
+ *
+ * @param <T>
+ */
+public abstract class EnumSetUserType<T extends Enum<T>> implements UserType {
+
+ private Class<T> typeClazz = null;
+ private Class<? extends EnumSet> returnedType = null;
+
+ public EnumSetUserType(Class<T> typeClazz) {
+ this.typeClazz = typeClazz;
+ returnedType = EnumSet.noneOf(typeClazz).getClass();
+ }
+
+ public Class returnedClass() {
+ return returnedType;
+ }
+
+ public int[] sqlTypes() {
+ return new int[] { Types.LONGVARCHAR };
+ }
+
+ public boolean isMutable() {
+ return false;
+ }
+
+ /**
+ * Retrieve an instance of the mapped class from a JDBC resultset.
+ * Implementors should handle possibility of null values.
+ *
+ * @param rs a JDBC result set
+ * @param names the column names
+ * @param owner the containing entity
+ * @return Object
+ * @throws HibernateException
+ * @throws SQLException
+ */
+ @Override
+ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException {
+ String name = rs.getString(names[0]);
+ EnumSet<T> result = null;
+ if (!rs.wasNull()) {
+ String[] values = name.split(",");
+ Set<T> enumList = new LinkedHashSet<T>();
+ for (String value : values) {
+ if (!value.isEmpty()) {
+ enumList.add(Enum.valueOf(typeClazz, value));
+ }
+ }
+ if (enumList.isEmpty()) {
+ result = EnumSet.noneOf(typeClazz);
+ } else {
+ result = EnumSet.copyOf(enumList);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Write an instance of the mapped class to a prepared statement.
+ * Implementors should handle possibility of null values. A multi-column
+ * type should be written to parameters starting from <tt>index</tt>.
+ *
+ * @param st a JDBC prepared statement
+ * @param value the object to write
+ * @param index statement parameter index
+ * @param session session
+ * @throws HibernateException
+ * @throws SQLException
+ */
+ @Override
+ public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException {
+ if (null == value) {
+ st.setNull(index, Types.VARCHAR);
+ } else {
+ Set<T> values = (Set<T>)value;
+ String sqlValue = "";
+ if (!values.isEmpty()) {
+ StringBuilder buf = new StringBuilder();
+ for (T val : values) {
+ buf.append(val.name()).append(",");
+ }
+ sqlValue = buf.substring(0, buf.length() - 1);
+ }
+ st.setString(index, sqlValue);
+ }
+ }
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ return cached;
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ return (Enum<?>) value;
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ return value;
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ if (x == y) {
+ return true;
+ }
+ if (null == x || null == y) {
+ return false;
+ }
+ return x.equals(y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return x.hashCode();
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/EnumSetUserType.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailActionEnumSetUserType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailActionEnumSetUserType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailActionEnumSetUserType.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,35 @@
+package com.franciaflex.faxtomail.persistence.hibernate;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.persistence.entities.MailAction;
+
+public class MailActionEnumSetUserType extends EnumSetUserType<MailAction> {
+
+ public MailActionEnumSetUserType() {
+ super(MailAction.class);
+ }
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailActionEnumSetUserType.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumListUserType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumListUserType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumListUserType.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,35 @@
+package com.franciaflex.faxtomail.persistence.hibernate;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.persistence.entities.MailField;
+
+public class MailFieldEnumListUserType extends EnumListUserType<MailField>{
+
+ public MailFieldEnumListUserType() {
+ super(MailField.class);
+ }
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumListUserType.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumSetUserType.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumSetUserType.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumSetUserType.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,35 @@
+package com.franciaflex.faxtomail.persistence.hibernate;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.franciaflex.faxtomail.persistence.entities.MailField;
+
+public class MailFieldEnumSetUserType extends EnumSetUserType<MailField>{
+
+ public MailFieldEnumSetUserType() {
+ super(MailField.class);
+ }
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/hibernate/MailFieldEnumSetUserType.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-08-21 10:11:20 UTC (rev 580)
@@ -28,8 +28,8 @@
# EtatAttente
com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.label.tagvalue.naturalId=true
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.validFormDisabledActions.stereotype=unique
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.invalidFormDisabledActions.stereotype=unique
+com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.invalidFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
+com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.validFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
# Priority
com.franciaflex.faxtomail.persistence.entities.Priority.attribute.label.tagvalue.naturalId=true
@@ -39,7 +39,7 @@
# DemandType
com.franciaflex.faxtomail.persistence.entities.DemandType.attribute.label.tagvalue.naturalId=true
-com.franciaflex.faxtomail.persistence.entities.DemandType.attribute.fields.stereotype=unique
+com.franciaflex.faxtomail.persistence.entities.DemandType.attribute.requiredFields.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailFieldEnumSetUserType
# Client
com.franciaflex.faxtomail.persistence.entities.Client.attribute.brand.tagvalue.naturalId=true
@@ -58,6 +58,11 @@
com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.host.tagvalue.naturalId=true
com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.login.tagvalue.naturalId=true
+
+#�Configuration
+com.franciaflex.faxtomail.persistence.entities.Configuration.attribute.searchDisplayColumns.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailFieldEnumListUserType
+com.franciaflex.faxtomail.persistence.entities.Configuration.attribute.invalidFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
+
# ExtensionCommand
com.franciaflex.faxtomail.persistence.entities.ExtensionCommand.attribute.extension.tagvalue.naturalId=true
@@ -78,6 +83,7 @@
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.parent.tagvalue.naturalId=true
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.parent.tagvalue.notNull=false
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.name.tagvalue.naturalId=true
+com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.folderTableColumns.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailFieldEnumListUserType
# MailFilter
com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.expression.tagvalue.naturalId=true
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceUtils.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -24,14 +24,17 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-import org.apache.commons.io.Charsets;
+import java.nio.charset.Charset;
+import java.util.Collection;
import javax.mail.MessagingException;
import javax.mail.Part;
import javax.mail.internet.ContentType;
-import java.nio.charset.Charset;
+import org.apache.commons.io.Charsets;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+
/**
* @author Kevin Morin (Code Lutin)
*/
@@ -56,4 +59,19 @@
Charset charset = Charsets.toCharset(charsetName);
return charset;
}
+
+ /**
+ * Return true if given collection is not null and contains requested value.
+ *
+ * @param coll collection
+ * @param value value
+ * @return true if set contains value
+ */
+ public static <T extends Enum<T>> boolean contains(Collection<T> coll, T value) {
+ boolean result = false;
+ if (coll != null) {
+ result = coll.contains(value);
+ }
+ return result;
+ }
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -24,6 +24,12 @@
* #L%
*/
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
@@ -35,11 +41,6 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailService;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* @author Kevin Morin (Code Lutin)
*/
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -38,7 +38,6 @@
import javax.mail.Session;
import javax.mail.Store;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -67,6 +66,7 @@
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.GroupChef;
import com.franciaflex.faxtomail.persistence.entities.GroupChefTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -100,14 +100,10 @@
@Override
public Configuration getConfiguration() {
ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
- Configuration config = dao.forAll().addAllFetches(
- Configuration.PROPERTY_SEARCH_DISPLAY_COLUMNS,
- Configuration.PROPERTY_INVALID_FORM_DISABLED_ACTIONS
- ).findUniqueOrNull();
+ Configuration config = dao.forAll().findUniqueOrNull();
if (config == null) {
config = new ConfigurationImpl();
}
- Hibernate.initialize(config.getInvalidFormDisabledActions());
return config;
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -50,6 +50,7 @@
import javax.mail.MessagingException;
import com.franciaflex.faxtomail.services.service.exceptions.FolderNotReadableException;
+
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.io.FileUtils;
@@ -79,10 +80,12 @@
import com.franciaflex.faxtomail.persistence.entities.*;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.services.service.exceptions.AlreadyLockedMailException;
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
import com.franciaflex.faxtomail.services.service.imports.ArchiveImportBean;
import com.franciaflex.faxtomail.services.service.imports.ArchiveImportModel;
+import com.google.common.base.Enums;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
@@ -118,7 +121,6 @@
Email email = getPersistenceContext().getEmailDao()
.forTopiaIdEquals(id)
.addAllFetches(Email.PROPERTY_DEMAND_TYPE,
- Email.PROPERTY_DEMAND_TYPE + "." + DemandType.PROPERTY_FIELDS,
Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
Email.PROPERTY_HISTORY,
Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
@@ -131,8 +133,6 @@
Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL,
Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL +"." + Email.PROPERTY_MAIL_FOLDER,
Email.PROPERTY_ETAT_ATTENTE,
- Email.PROPERTY_ETAT_ATTENTE + "." + EtatAttente.PROPERTY_INVALID_FORM_DISABLED_ACTIONS,
- Email.PROPERTY_ETAT_ATTENTE + "." + EtatAttente.PROPERTY_VALID_FORM_DISABLED_ACTIONS,
Email.PROPERTY_PRIORITY).findUnique();
return email;
@@ -369,7 +369,7 @@
protected void handleEdiTransmission(Email email, HistoryTopiaDao historyDao, Set<String> fieldSet) {
History transmissionToEdi;
- if (email.getDemandType().containsFields(MailField.RANGE_ROW)) {
+ if (FaxToMailServiceUtils.contains(email.getDemandType().getRequiredFields(), MailField.RANGE_ROW)) {
// si les gammes sont vides, la demande n'est pas valide, on ne fait rien dans ce cas
// sinon on transfer à edi
@@ -569,7 +569,7 @@
.addNull(Email.PROPERTY_ARCHIVE_DATE)
.addNotEquals(Email.PROPERTY_DEMAND_STATUS, DemandStatus.ARCHIVED)
.addAllFetches(Email.PROPERTY_PRIORITY,
- Email.PROPERTY_DEMAND_TYPE + "." + DemandType.PROPERTY_FIELDS,
+ Email.PROPERTY_DEMAND_TYPE,
Email.PROPERTY_CLIENT,
Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
Email.PROPERTY_ETAT_ATTENTE,
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -33,6 +33,7 @@
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
+import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -70,6 +71,7 @@
import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -110,7 +112,8 @@
if (count == 0) {
List<DemandType> types = Lists.newArrayList(
- demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande", DemandType.PROPERTY_FIELDS, Sets.newHashSet(MailField.RANGE_ROW)),
+ demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande",
+ DemandType.PROPERTY_REQUIRED_FIELDS, EnumSet.of(MailField.RANGE_ROW)),
demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Réponse"),
demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Annulation/Modification"),
demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Diffus"),
@@ -381,7 +384,7 @@
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
DemandType demandType = types.get(random.nextInt(types.size()));
- if (demandType.containsFields(MailField.RANGE_ROW)) {
+ if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < random.nextInt(4) + 1; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(random.nextInt(ranges.size())),
RangeRow.PROPERTY_COMMAND_NUMBER, RandomStringUtils.randomNumeric(6),
@@ -428,7 +431,7 @@
if (opened) {
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
DemandType demandType = types.get(random.nextInt(types.size()));
- if (demandType.containsFields(MailField.RANGE_ROW)) {
+ if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < random.nextInt(4) + 1; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(random.nextInt(ranges.size())),
RangeRow.PROPERTY_COMMAND_NUMBER, RandomStringUtils.randomNumeric(6),
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -71,7 +71,7 @@
@Override
public List<DemandType> getAllDemandType() {
DemandTypeTopiaDao dao = getPersistenceContext().getDemandTypeDao();
- return dao.forAll().addAllFetches(DemandType.PROPERTY_FIELDS).findAll();
+ return dao.findAll();
}
@Override
@@ -89,10 +89,7 @@
@Override
public List<EtatAttente> getAllEtatAttente() {
EtatAttenteTopiaDao dao = getPersistenceContext().getEtatAttenteDao();
- return dao.forAll()
- .addAllFetches(EtatAttente.PROPERTY_INVALID_FORM_DISABLED_ACTIONS,
- EtatAttente.PROPERTY_VALID_FORM_DISABLED_ACTIONS)
- .findAll();
+ return dao.findAll();
}
@Override
Added: trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,25 @@
+-- configuration
+alter table configuration_invalidFormDisabledActions drop constraint FK_fj3yycjetl6acpiybfsg4v0yq;
+alter table configuration_searchDisplayColumns drop constraint FK_9ffmpp0utfad26oxe70efo1da;
+drop table configuration_invalidFormDisabledActions;
+drop table configuration_searchDisplayColumns;
+alter table configuration add searchDisplayColumns longvarchar;
+alter table configuration add invalidFormDisabledActions longvarchar;
+
+-- demande type
+alter table demandType_fields drop constraint FK_c44wglsh0xpua19f1ps9vn24i;
+drop table demandType_fields;
+alter table demandType add requiredFields longvarchar;
+
+-- etat attente
+alter table etatAttente_invalidFormDisabledActions drop constraint FK_221gjt0dyjtbndk8v7tr85ta6 ;
+alter table etatAttente_validFormDisabledActions drop constraint FK_86hqc0dxhqyca7rbx7b3bfydr;
+drop table etatAttente_invalidFormDisabledActions;
+drop table etatAttente_validFormDisabledActions;
+alter table etatAttente add invalidFormDisabledActions longvarchar;
+alter table etatAttente add validFormDisabledActions longvarchar;
+
+-- mail folder
+alter table mailFolder_folderTableColumns drop constraint FK_ap7lwii8to9wlxefnu3pn0goe;
+drop table mailFolder_folderTableColumns;
+alter table mailFolder add folderTableColumns longvarchar;
Added: trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,25 @@
+-- configuration
+alter table configuration_invalidFormDisabledActions drop constraint FK_fj3yycjetl6acpiybfsg4v0yq;
+alter table configuration_searchDisplayColumns drop constraint FK_9ffmpp0utfad26oxe70efo1da;
+drop table configuration_invalidFormDisabledActions;
+drop table configuration_searchDisplayColumns;
+alter table configuration add searchDisplayColumns text;
+alter table configuration add invalidFormDisabledActions text;
+
+-- demande type
+alter table demandType_fields drop constraint FK_c44wglsh0xpua19f1ps9vn24i;
+drop table demandType_fields;
+alter table demandType add requiredFields text;
+
+-- etat attente
+alter table etatAttente_invalidFormDisabledActions drop constraint FK_221gjt0dyjtbndk8v7tr85ta6 ;
+alter table etatAttente_validFormDisabledActions drop constraint FK_86hqc0dxhqyca7rbx7b3bfydr;
+drop table etatAttente_invalidFormDisabledActions;
+drop table etatAttente_validFormDisabledActions;
+alter table etatAttente add invalidFormDisabledActions text;
+alter table etatAttente add validFormDisabledActions text;
+
+-- mail folder
+alter table mailFolder_folderTableColumns drop constraint FK_ap7lwii8to9wlxefnu3pn0goe;
+drop table mailFolder_folderTableColumns;
+alter table mailFolder add folderTableColumns text;
Added: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql 2014-08-21 10:11:20 UTC (rev 580)
@@ -0,0 +1,33 @@
+-- configuration
+alter table configuration_invalidFormDisabledActions drop constraint FK_fj3yycjetl6acpiybfsg4v0yq;
+alter table configuration_searchDisplayColumns drop constraint FK_9ffmpp0utfad26oxe70efo1da;
+GO
+drop table configuration_invalidFormDisabledActions;
+drop table configuration_searchDisplayColumns;
+alter table configuration add searchDisplayColumns varchar(MAX);
+alter table configuration add invalidFormDisabledActions varchar(MAX);
+GO
+
+-- demande type
+alter table demandType_fields drop constraint FK_c44wglsh0xpua19f1ps9vn24i;
+GO
+drop table demandType_fields;
+alter table demandType add requiredFields varchar(MAX);
+GO
+
+-- etat attente
+alter table etatAttente_invalidFormDisabledActions drop constraint FK_221gjt0dyjtbndk8v7tr85ta6 ;
+alter table etatAttente_validFormDisabledActions drop constraint FK_86hqc0dxhqyca7rbx7b3bfydr;
+GO
+drop table etatAttente_invalidFormDisabledActions;
+drop table etatAttente_validFormDisabledActions;
+alter table etatAttente add invalidFormDisabledActions varchar(MAX);
+alter table etatAttente add validFormDisabledActions varchar(MAX);
+GO
+
+-- mail folder
+alter table mailFolder_folderTableColumns drop constraint FK_ap7lwii8to9wlxefnu3pn0goe;
+GO
+drop table mailFolder_folderTableColumns;
+alter table mailFolder add folderTableColumns varchar(MAX);
+GO
\ No newline at end of file
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -64,6 +64,7 @@
import com.franciaflex.faxtomail.persistence.entities.RangeRowTopiaDao;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -271,7 +272,7 @@
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
DemandType demandType = types.get(0);
- if (demandType.containsFields(MailField.RANGE_ROW)) {
+ if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < 4; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(j),
RangeRow.PROPERTY_COMMAND_NUMBER, RandomStringUtils.randomNumeric(6), RangeRow.PROPERTY_PRODUCT_QUANTITY,
@@ -309,7 +310,7 @@
if (opened) {
getEmailService().addToHistory(email.getTopiaId(), HistoryType.OPENING, user, now);
DemandType demandType = types.get(0);
- if (demandType.containsFields(MailField.RANGE_ROW)) {
+ if (FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)) {
for (int j = 0; j < 4; j++) {
RangeRow rangeRow = rangeRowDao.create(RangeRow.PROPERTY_RANGE, ranges.get(j),
RangeRow.PROPERTY_COMMAND_NUMBER, RandomStringUtils.randomNumeric(6), RangeRow.PROPERTY_PRODUCT_QUANTITY,
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -36,7 +36,6 @@
*
* @author Eric Chatellier
*/
-@Ignore
public class MiscTest extends AbstractFaxToMailServiceTest {
@Override
Modified: trunk/faxtomail-service/src/test/resources/log4j2.xml
===================================================================
--- trunk/faxtomail-service/src/test/resources/log4j2.xml 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-service/src/test/resources/log4j2.xml 2014-08-21 10:11:20 UTC (rev 580)
@@ -33,6 +33,7 @@
<Loggers>
<Logger name="com.franciaflex.faxtomail.services.service" level="info"/>
+ <Logger name="org.hibernate.tool.hbm2ddl.SchemaExport" level="fatal"/>
<Root level="error">
<AppenderRef ref="Console" />
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-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -47,7 +47,6 @@
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableCellEditor;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections4.CollectionUtils;
@@ -65,6 +64,7 @@
import org.nuiton.jaxx.application.swing.table.MoveToNextEditableRowAction;
import org.nuiton.jaxx.application.swing.table.MoveToPreviousEditableCellAction;
import org.nuiton.jaxx.application.swing.table.MoveToPreviousEditableRowAction;
+import org.nuiton.jaxx.application.swing.util.CloseableUI;
import org.nuiton.util.beans.BeanMonitor;
import com.franciaflex.faxtomail.persistence.entities.Attachment;
@@ -77,11 +77,11 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.Range;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
-import com.franciaflex.faxtomail.services.service.ReferentielService;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAction;
import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentEditorUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import org.nuiton.jaxx.application.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
/**
@@ -117,11 +117,11 @@
DemandType oldType = (DemandType) evt.getOldValue();
if (newType != null && (oldType == null
- || !Objects.equals(oldType.containsFields(MailField.RANGE_ROW),
- newType.containsFields(MailField.RANGE_ROW)))) {
+ || !Objects.equals(FaxToMailServiceUtils.contains(oldType.getRequiredFields(), MailField.RANGE_ROW),
+ FaxToMailServiceUtils.contains(newType.getRequiredFields(), MailField.RANGE_ROW)))) {
JSplitPane leftVerticalSplitPanel = getUI().getLeftVerticalSplitPanel();
- if (Boolean.TRUE.equals(newType.containsFields(MailField.RANGE_ROW))) {
+ if (FaxToMailServiceUtils.contains(newType.getRequiredFields(), MailField.RANGE_ROW)) {
if (dividerLocation < 0) {
dividerLocation = leftVerticalSplitPanel.getLeftComponent().getPreferredSize().height + 10;
}
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-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -883,35 +883,35 @@
boolean result = demandType == null;
if (!result) {
if (PROPERTY_CLIENT_CODE.equals(field)) {
- result = !demandType.containsFields(MailField.CLIENT)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.CLIENT)
|| StringUtils.isNotBlank(getClientCode());
} else if (PROPERTY_VALID_RANGE_ROW_MODELS.equals(field)) {
- result = !demandType.containsFields(MailField.RANGE_ROW)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW)
|| CollectionUtils.isNotEmpty(getValidRangeRowModels());
} else if (Email.PROPERTY_PROJECT_REFERENCE.equals(field)) {
- result = !demandType.containsFields(MailField.PROJECT_REFERENCE)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.PROJECT_REFERENCE)
|| StringUtils.isNotBlank(getProjectReference());
} else if (Email.PROPERTY_OBJECT.equals(field)) {
- result = !demandType.containsFields(MailField.OBJECT)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.OBJECT)
|| StringUtils.isNotBlank(getObject());
} else if (Email.PROPERTY_COMMENT.equals(field)) {
- result = !demandType.containsFields(MailField.COMMENT)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.COMMENT)
|| StringUtils.isNotBlank(getComment());
} else if (Email.PROPERTY_COMPANY_REFERENCE.equals(field)) {
- result = !demandType.containsFields(MailField.COMPANY_REFERENCE)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.COMPANY_REFERENCE)
|| StringUtils.isNotBlank(getCompanyReference());
} else if (Email.PROPERTY_PRIORITY.equals(field)) {
- result = !demandType.containsFields(MailField.PRIORITY)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.PRIORITY)
|| getPriority() != null;
} else if (Email.PROPERTY_ETAT_ATTENTE.equals(field)) {
- result = !demandType.containsFields(MailField.ETAT_ATTENTE)
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.ETAT_ATTENTE)
|| getEtatAttente() != null;
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -24,33 +24,10 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
-import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
-import com.franciaflex.faxtomail.ui.swing.actions.GroupAction;
-import com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
-import com.franciaflex.faxtomail.ui.swing.util.PaginationComboModel;
+import static org.nuiton.i18n.I18n.t;
-import org.nuiton.jaxx.application.swing.util.Cancelable;
-
-import jaxx.runtime.validator.swing.SwingValidator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
-import org.jdesktop.swingx.decorator.ColorHighlighter;
-import org.jdesktop.swingx.decorator.ComponentAdapter;
-import org.jdesktop.swingx.decorator.HighlightPredicate;
-import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
-
-import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
@@ -62,10 +39,36 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
+import java.util.EnumSet;
import java.util.List;
-import static org.nuiton.i18n.I18n.t;
+import javax.swing.JComponent;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import jaxx.runtime.validator.swing.SwingValidator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
+import org.nuiton.jaxx.application.swing.util.Cancelable;
+
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
+import com.franciaflex.faxtomail.ui.swing.actions.GroupAction;
+import com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction;
+import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
+import com.franciaflex.faxtomail.ui.swing.util.PaginationComboModel;
+
/**
* @author Kevin Morin (Code Lutin)
*
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-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -31,6 +31,7 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
+import java.util.EnumSet;
import java.util.List;
import javax.swing.JComponent;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -24,27 +24,26 @@
* #L%
*/
-import com.ezware.oxbow.swingbits.table.filter.TableRowFilterSupport;
-import com.franciaflex.faxtomail.persistence.entities.Attachment;
-import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
-import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.HasLabel;
-import com.franciaflex.faxtomail.persistence.entities.HistoryType;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
-import com.franciaflex.faxtomail.persistence.entities.Priority;
-import com.franciaflex.faxtomail.persistence.entities.RangeRow;
-import com.franciaflex.faxtomail.persistence.entities.Reply;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentCellEditor;
-import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentCellRenderer;
-import com.franciaflex.faxtomail.ui.swing.content.demande.replies.RepliesCellEditor;
-import com.franciaflex.faxtomail.ui.swing.content.demande.replies.RepliesCellRenderer;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
+import java.awt.Point;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.List;
+
+import javax.swing.JPopupMenu;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.event.ChangeListener;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
@@ -63,18 +62,24 @@
import org.nuiton.validator.NuitonValidatorFactory;
import org.nuiton.validator.NuitonValidatorResult;
-import javax.swing.*;
-import javax.swing.event.ChangeListener;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.TableCellRenderer;
-import java.awt.*;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
+import com.franciaflex.faxtomail.persistence.entities.Attachment;
+import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
+import com.franciaflex.faxtomail.persistence.entities.Priority;
+import com.franciaflex.faxtomail.persistence.entities.RangeRow;
+import com.franciaflex.faxtomail.persistence.entities.Reply;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
+import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentCellEditor;
+import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentCellRenderer;
+import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
+import com.franciaflex.faxtomail.ui.swing.content.demande.replies.RepliesCellEditor;
+import com.franciaflex.faxtomail.ui.swing.content.demande.replies.RepliesCellRenderer;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
/**
* @author Kevin Morin (Code Lutin)
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-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -26,9 +26,7 @@
import java.awt.Component;
import java.awt.Container;
-import java.awt.Dialog;
import java.awt.Dimension;
-import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@@ -46,7 +44,6 @@
import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JComponent;
-import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
@@ -56,15 +53,10 @@
import javax.swing.event.TableModelListener;
import javax.swing.text.JTextComponent;
-import com.franciaflex.faxtomail.persistence.entities.Configuration;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.MailAction;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.editor.bean.BeanUIUtil;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.nuiton.jaxx.application.swing.util.CloseableUI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -74,15 +66,21 @@
import org.nuiton.jaxx.application.swing.ApplicationUI;
import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
import org.nuiton.jaxx.application.swing.util.Cancelable;
+import org.nuiton.jaxx.application.swing.util.CloseableUI;
import org.nuiton.validator.bean.simple.SimpleBeanValidator;
import com.franciaflex.faxtomail.FaxToMailConfiguration;
+import com.franciaflex.faxtomail.persistence.entities.Configuration;
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import com.franciaflex.faxtomail.persistence.entities.MailAction;
import com.franciaflex.faxtomail.services.DecoratorService;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
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.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
@@ -447,10 +445,10 @@
boolean valid = model.isValid();
boolean enabled =
- etatAttente == null && (valid || !config.containsInvalidFormDisabledActions(action))
+ etatAttente == null && (valid || !FaxToMailServiceUtils.contains(config.getInvalidFormDisabledActions(), action))
|| etatAttente != null &&
- (valid && !etatAttente.containsValidFormDisabledActions(action)
- || !valid && !etatAttente.containsInvalidFormDisabledActions(action));
+ (valid && !FaxToMailServiceUtils.contains(etatAttente.getValidFormDisabledActions(), action)
+ || !valid && !FaxToMailServiceUtils.contains(etatAttente.getInvalidFormDisabledActions(), action));
return enabled;
}
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-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-08-21 10:11:20 UTC (rev 580)
@@ -67,8 +67,10 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
+import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.google.common.base.Function;
import com.google.common.collect.Ordering;
+
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXUtil;
@@ -558,7 +560,7 @@
}
public static boolean isRangePanelVisible(DemandType demandType) {
- return demandType != null && demandType.containsFields(MailField.RANGE_ROW);
+ return demandType != null && FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.RANGE_ROW);
}
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-21 10:11:20 UTC (rev 580)
@@ -212,7 +212,7 @@
Champs obligatoires pour le type de document :
<div class="checkbox" ng-repeat="(mailField,label) in canBeRequiredMailFields">
<label>
- <input type="checkbox" ng-checked="selectedDemandType.fields.indexOf(mailField) != -1"
+ <input type="checkbox" ng-checked="selectedDemandType.requiredFields.indexOf(mailField) != -1"
ng-click="changeDemandTypeField(mailField)"> {{label}}
</label>
</div>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-08-21 10:11:20 UTC (rev 580)
@@ -301,8 +301,8 @@
$scope.selectedDemandType = demandType;
// initialize le tableau d'action si vide
- if (!$scope.selectedDemandType.fields) {
- $scope.selectedDemandType.fields = [];
+ if (!$scope.selectedDemandType.requiredFields) {
+ $scope.selectedDemandType.requiredFields = [];
}
};
@@ -331,17 +331,11 @@
// selection/deselection d'un champ
$scope.changeDemandTypeField = function(mailField) {
- var index = $scope.selectedDemandType.fields.indexOf(mailField);
+ var index = $scope.selectedDemandType.requiredFields.indexOf(mailField);
if (index != -1) {
- $scope.selectedDemandType.fields.splice(index, 1);
+ $scope.selectedDemandType.requiredFields.splice(index, 1);
} else {
-
- // cas particulier des gammes
- if (mailField == 'RANGE_ROW') {
- $scope.selectedDemandType.ediTransfer = true;
- }
-
- $scope.selectedDemandType.fields.push(mailField);
+ $scope.selectedDemandType.requiredFields.push(mailField);
}
};
}]);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-20 14:10:00 UTC (rev 579)
+++ trunk/pom.xml 2014-08-21 10:11:20 UTC (rev 580)
@@ -106,7 +106,7 @@
<nuitonWebVersion>1.16</nuitonWebVersion>
<eugeneVersion>2.13</eugeneVersion>
- <topiaVersion>3.0-beta-12</topiaVersion>
+ <topiaVersion>3.0-SNAPSHOT</topiaVersion>
<hibernateVersion>4.3.6.Final</hibernateVersion>
<h2Version>1.3.176</h2Version>
1
0
r579 - trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail
by echatellier@users.forge.codelutin.com 20 Aug '14
by echatellier@users.forge.codelutin.com 20 Aug '14
20 Aug '14
Author: echatellier
Date: 2014-08-20 16:10:00 +0200 (Wed, 20 Aug 2014)
New Revision: 579
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/579
Log:
Remove non working delete folder on windows
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-08-18 15:32:24 UTC (rev 578)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-08-20 14:10:00 UTC (rev 579)
@@ -145,17 +145,6 @@
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() {
@@ -354,15 +343,6 @@
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);
@@ -429,10 +409,6 @@
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());
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-08-18 15:32:24 UTC (rev 578)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-08-20 14:10:00 UTC (rev 579)
@@ -194,13 +194,6 @@
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",
1
0
r578 - in trunk: . faxtomail-persistence faxtomail-service faxtomail-ui-swing faxtomail-ui-web
by maven-release@users.forge.codelutin.com 18 Aug '14
by maven-release@users.forge.codelutin.com 18 Aug '14
18 Aug '14
Author: maven-release
Date: 2014-08-18 17:32:24 +0200 (Mon, 18 Aug 2014)
New Revision: 578
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/578
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/faxtomail-persistence/pom.xml
trunk/faxtomail-service/pom.xml
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-web/pom.xml
trunk/pom.xml
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-08-18 15:32:17 UTC (rev 577)
+++ trunk/faxtomail-persistence/pom.xml 2014-08-18 15:32:24 UTC (rev 578)
@@ -25,7 +25,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>1.0-rc-3</version>
+ <version>1.0-rc-4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-08-18 15:32:17 UTC (rev 577)
+++ trunk/faxtomail-service/pom.xml 2014-08-18 15:32:24 UTC (rev 578)
@@ -27,7 +27,7 @@
<parent>
<artifactId>faxtomail</artifactId>
<groupId>com.franciaflex</groupId>
- <version>1.0-rc-3</version>
+ <version>1.0-rc-4-SNAPSHOT</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-08-18 15:32:17 UTC (rev 577)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-08-18 15:32:24 UTC (rev 578)
@@ -28,7 +28,7 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>1.0-rc-3</version>
+ <version>1.0-rc-4-SNAPSHOT</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-08-18 15:32:17 UTC (rev 577)
+++ trunk/faxtomail-ui-web/pom.xml 2014-08-18 15:32:24 UTC (rev 578)
@@ -27,7 +27,7 @@
<parent>
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>1.0-rc-3</version>
+ <version>1.0-rc-4-SNAPSHOT</version>
</parent>
<groupId>com.franciaflex.faxtomail</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-08-18 15:32:17 UTC (rev 577)
+++ trunk/pom.xml 2014-08-18 15:32:24 UTC (rev 578)
@@ -32,7 +32,7 @@
<groupId>com.franciaflex</groupId>
<artifactId>faxtomail</artifactId>
- <version>1.0-rc-3</version>
+ <version>1.0-rc-4-SNAPSHOT</version>
<packaging>pom</packaging>
<name>FaxToMail</name>
@@ -71,9 +71,9 @@
</modules>
<scm>
- <url>https://svn.codelutin.com/faxtomail/tags/faxtomail-1.0-rc-3</url>
- <connection>scm:svn:https://svn.codelutin.com/faxtomail/tags/faxtomail-1.0-rc-3</connection>
- <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/tags/faxtomail-1.0-rc-3</developerConnection>
+ <url>https://svn.codelutin.com/faxtomail/trunk</url>
+ <connection>scm:svn:https://svn.codelutin.com/faxtomail/trunk</connection>
+ <developerConnection>scm:svn:http://svn.codelutin.com/faxtomail/trunk</developerConnection>
</scm>
<distributionManagement>
<site>
1
0