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
April 2014
- 3 participants
- 51 discussions
r53 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util faxtomail-ui-swing/src/main/resources/i18n
by kmorin@users.forge.codelutin.com 28 Apr '14
by kmorin@users.forge.codelutin.com 28 Apr '14
28 Apr '14
Author: kmorin
Date: 2014-04-28 19:59:52 +0200 (Mon, 28 Apr 2014)
New Revision: 53
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/53
Log:
refs #4659 [ECRAN] Recherche
possibilit?\195?\169 de rechercher plusieurs ?\195?\169tats attente, ou aucun (idem pour statut, gamme, type de demande)
Added:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxComboBoxModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailFilter.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx
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/SearchUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailFilter.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailFilter.java 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailFilter.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -25,6 +25,7 @@
*/
import java.util.Date;
+import java.util.List;
import org.jdesktop.beans.AbstractSerializableBean;
@@ -79,15 +80,15 @@
protected String body;
- protected EtatAttente etatAttente;
+ protected List<EtatAttente> etatAttente;
- protected Priority priority;
+ protected List<Priority> priority;
- protected DemandType demandType;
+ protected List<DemandType> demandType;
- protected DemandStatus demandStatus;
+ protected List<DemandStatus> demandStatus;
- protected Range gamme;
+ protected List<Range> gamme;
protected String ediCodeNumber;
@@ -159,14 +160,13 @@
firePropertyChange(PROPERTY_SUBJECT, oldValue, subject);
}
- public EtatAttente getEtatAttente() {
+ public List<EtatAttente> getEtatAttente() {
return etatAttente;
}
- public void setEtatAttente(EtatAttente etatAttente) {
- EtatAttente oldValue = this.etatAttente;
+ public void setEtatAttente(List<EtatAttente> etatAttente) {
this.etatAttente = etatAttente;
- firePropertyChange(PROPERTY_ETAT_ATTENTE, oldValue, etatAttente);
+ firePropertyChange(PROPERTY_ETAT_ATTENTE, null, etatAttente);
}
public FaxToMailUser getTakenBy() {
@@ -179,34 +179,31 @@
firePropertyChange(PROPERTY_TAKEN_BY, oldValue, takenBy);
}
- public Priority getPriority() {
+ public List<Priority> getPriority() {
return priority;
}
- public void setPriority(Priority priority) {
- Priority oldValue = this.priority;
+ public void setPriority(List<Priority> priority) {
this.priority = priority;
- firePropertyChange(PROPERTY_PRIORITY, oldValue, priority);
+ firePropertyChange(PROPERTY_PRIORITY, null, priority);
}
- public DemandType getDemandType() {
+ public List<DemandType> getDemandType() {
return demandType;
}
- public void setDemandType(DemandType demandType) {
- DemandType oldValue = this.demandType;
+ public void setDemandType(List<DemandType> demandType) {
this.demandType = demandType;
- firePropertyChange(PROPERTY_DEMAND_TYPE, oldValue, demandType);
+ firePropertyChange(PROPERTY_DEMAND_TYPE, null, demandType);
}
- public DemandStatus getDemandStatus() {
+ public List<DemandStatus> getDemandStatus() {
return demandStatus;
}
- public void setDemandStatus(DemandStatus demandStatus) {
- DemandStatus oldValue = this.demandStatus;
+ public void setDemandStatus(List<DemandStatus> demandStatus) {
this.demandStatus = demandStatus;
- firePropertyChange(PROPERTY_DEMAND_STATUS, oldValue, demandStatus);
+ firePropertyChange(PROPERTY_DEMAND_STATUS, null, demandStatus);
}
public String getEdiCodeNumber() {
@@ -329,14 +326,13 @@
firePropertyChange(PROPERTY_BODY, oldValue, body);
}
- public Range getGamme() {
+ public List<Range> getGamme() {
return gamme;
}
- public void setGamme(Range gamme) {
- Range oldValue = this.gamme;
+ public void setGamme(List<Range> gamme) {
this.gamme = gamme;
- firePropertyChange(PROPERTY_GAMME, oldValue, gamme);
+ firePropertyChange(PROPERTY_GAMME, null, gamme);
}
public String getCommandNumber() {
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-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
public class EmailTopiaDao extends AbstractEmailTopiaDao<Email> {
@@ -261,9 +262,15 @@
}
// email demand type
- if (emailFilter.getDemandType() != null) {
- query.append(" AND E." + Email.PROPERTY_DEMAND_TYPE + " = :" + EmailFilter.PROPERTY_DEMAND_TYPE);
- args.put(EmailFilter.PROPERTY_DEMAND_TYPE, emailFilter.getDemandType());
+ List<DemandType> demandType = emailFilter.getDemandType();
+ if (CollectionUtils.isNotEmpty(demandType)) {
+ query.append(" AND (E." + Email.PROPERTY_DEMAND_TYPE + " IN (:" + EmailFilter.PROPERTY_DEMAND_TYPE + ")");
+ args.put(EmailFilter.PROPERTY_DEMAND_TYPE, demandType);
+
+ if (demandType.contains(null)) {
+ query.append(" OR E." + Email.PROPERTY_DEMAND_TYPE + " IS NULL");
+ }
+ query.append(")");
}
// email ediCodeNumber
@@ -285,15 +292,27 @@
}
// email priority
- if (emailFilter.getPriority() != null) {
- query.append(" AND E." + Email.PROPERTY_PRIORITY + " = :" + EmailFilter.PROPERTY_PRIORITY);
- args.put(EmailFilter.PROPERTY_PRIORITY, emailFilter.getPriority());
+ List<Priority> priority = emailFilter.getPriority();
+ if (CollectionUtils.isNotEmpty(priority)) {
+ query.append(" AND (E." + Email.PROPERTY_PRIORITY + " IN (:" + EmailFilter.PROPERTY_PRIORITY + ")");
+ args.put(EmailFilter.PROPERTY_PRIORITY, priority);
+
+ if (priority.contains(null)) {
+ query.append(" OR E." + Email.PROPERTY_PRIORITY + " IS NULL");
+ }
+ query.append(")");
}
// email demand status
- if (emailFilter.getDemandStatus() != null) {
- query.append(" AND E." + Email.PROPERTY_DEMAND_STATUS + " = :" + EmailFilter.PROPERTY_DEMAND_STATUS);
- args.put(EmailFilter.PROPERTY_DEMAND_STATUS, emailFilter.getDemandStatus());
+ List<DemandStatus> demandStatus = emailFilter.getDemandStatus();
+ if (CollectionUtils.isNotEmpty(demandStatus)) {
+ query.append(" AND (E." + Email.PROPERTY_DEMAND_STATUS + " IN (:" + EmailFilter.PROPERTY_DEMAND_STATUS + ")");
+ args.put(EmailFilter.PROPERTY_DEMAND_STATUS, demandStatus);
+
+ if (demandStatus.contains(null)) {
+ query.append(" OR E." + Email.PROPERTY_DEMAND_STATUS + " IS NULL");
+ }
+ query.append(")");
}
// email recipient
@@ -303,9 +322,15 @@
}*/
// email etat attente
- if (emailFilter.getEtatAttente() != null) {
- query.append(" AND E." + Email.PROPERTY_ETAT_ATTENTE + " = :" + EmailFilter.PROPERTY_ETAT_ATTENTE);
- args.put(EmailFilter.PROPERTY_ETAT_ATTENTE, emailFilter.getEtatAttente());
+ List<EtatAttente> etatAttente = emailFilter.getEtatAttente();
+ if (CollectionUtils.isNotEmpty(etatAttente)) {
+ query.append(" AND (E." + Email.PROPERTY_ETAT_ATTENTE + " IN (:" + EmailFilter.PROPERTY_ETAT_ATTENTE + ")");
+ args.put(EmailFilter.PROPERTY_ETAT_ATTENTE, etatAttente);
+
+ if (etatAttente.contains(null)) {
+ query.append(" OR E." + Email.PROPERTY_ETAT_ATTENTE + " IS NULL");
+ }
+ query.append(")");
}
// email comment
@@ -315,11 +340,16 @@
}
// email gamme
- if (emailFilter.getGamme() != null) {
- query.append(" AND EXISTS (FROM " + RangeRow.class.getName() + " RR WHERE RR in elements(E." + Email.PROPERTY_RANGE_ROW + ")");
- query.append(" AND RR." + RangeRow.PROPERTY_RANGE + " = :" + EmailFilter.PROPERTY_GAMME);
- args.put(EmailFilter.PROPERTY_GAMME, emailFilter.getGamme());
- query.append(")");
+ List<Range> gamme = emailFilter.getGamme();
+ if (CollectionUtils.isNotEmpty(gamme)) {
+ query.append(" AND ((EXISTS (FROM " + RangeRow.class.getName() + " RR WHERE RR in elements(E." + Email.PROPERTY_RANGE_ROW + ")");
+ query.append(" AND RR." + RangeRow.PROPERTY_RANGE + " IN (:" + EmailFilter.PROPERTY_GAMME + "))");
+ args.put(EmailFilter.PROPERTY_GAMME, gamme);
+
+ if (gamme.contains(null)) {
+ query.append(" OR NOT EXISTS (FROM " + RangeRow.class.getName() + " RR WHERE RR in elements(E." + Email.PROPERTY_RANGE_ROW + "))");
+ }
+ query.append("))");
}
// email comment
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-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -24,6 +24,8 @@
* #L%
*/
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -97,11 +99,11 @@
filter.setSender("test");
filter.setBody("test");
- filter.setDemandStatus(DemandStatus.ARCHIVED);
- filter.setGamme(referentielService.getAllRange().get(0));
- filter.setPriority(referentielService.getAllPriority().get(0));
+ filter.setDemandStatus(Collections.singletonList(DemandStatus.ARCHIVED));
+ filter.setGamme(Collections.singletonList(referentielService.getAllRange().get(0)));
+ filter.setPriority(referentielService.getAllPriority());
filter.setCommandNumber("test");
- filter.setEtatAttente(referentielService.getAllEtatAttente().get(0));
+ filter.setEtatAttente(Collections.singletonList(referentielService.getAllEtatAttente().get(0)));
filter.setEdiCodeNumber("test");
filter.setLocalReference("test");
filter.setMessage("test");
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-04-28 17:59:52 UTC (rev 53)
@@ -85,7 +85,6 @@
<dependencies>
-
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>faxtomail-persistence</artifactId>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-04-28 17:59:52 UTC (rev 53)
@@ -172,11 +172,6 @@
text: "faxtomail.demande.docType.label";
}
-#docTypeComboBox {
- property: demandType;
- selectedItem: { model.getDemandType() };
-}
-
#ediCodeNumberLabel {
text: "faxtomail.demande.ediCodeNumber.label";
}
@@ -190,29 +185,14 @@
text: "faxtomail.demande.priority.label";
}
-#priorityComboBox {
- property: priority;
- selectedItem: { model.getPriority() };
-}
-
#statusLabel {
text: "faxtomail.demande.status.label";
}
-#statusComboBox {
- property: demandStatus;
- selectedItem: { model.getDemandStatus() };
-}
-
#etatAttenteLabel {
text: "faxtomail.demande.etatAttente.label";
}
-#etatAttenteComboBox {
- property: etatAttente;
- selectedItem: { model.getEtatAttente() };
-}
-
#projectReferenceLabel {
text: "faxtomail.demande.projectReference.label";
}
@@ -257,11 +237,6 @@
text: "faxtomail.demande.gamme.label";
}
-#gammeComboBox {
- property: gamme;
- selectedItem: { model.getGamme() };
-}
-
#searchButton {
text: "faxtomail.search.button.label";
_applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction.class };
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx 2014-04-28 17:59:52 UTC (rev 53)
@@ -223,9 +223,7 @@
<JLabel id='docTypeLabel'/>
</cell>
<cell columns='3' weightx='1'>
- <BeanFilterableComboBox id='docTypeComboBox'
- constructorParams='this'
- genericType="DemandType"/>
+ <JComboBox id='docTypeComboBox'/>
</cell>
</row>
@@ -260,27 +258,21 @@
<JLabel id='priorityLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='priorityComboBox'
- constructorParams='this'
- genericType="Priority"/>
+ <JComboBox id='priorityComboBox'/>
</cell>
<cell>
<JLabel id='statusLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='statusComboBox'
- constructorParams='this'
- genericType="DemandStatus"/>
+ <JComboBox id='statusComboBox'/>
</cell>
<cell>
<JLabel id='etatAttenteLabel'/>
</cell>
<cell columns='3' weightx='2'>
- <BeanFilterableComboBox id='etatAttenteComboBox'
- constructorParams='this'
- genericType="EtatAttente"/>
+ <JComboBox id='etatAttenteComboBox'/>
</cell>
</row>
@@ -297,9 +289,7 @@
<JLabel id='gammeLabel'/>
</cell>
<cell columns='3' weightx='1'>
- <BeanFilterableComboBox id='gammeComboBox'
- constructorParams='this'
- genericType="Range"/>
+ <JComboBox id='gammeComboBox'/>
</cell>
</row>
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-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -26,6 +26,7 @@
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
@@ -126,21 +127,31 @@
initBeanFilterableComboBox(ui.getPrintedByComboBox(),
getContext().getUserService().getAllUsers(),
model.getPrintingBy());
- initBeanFilterableComboBox(ui.getDocTypeComboBox(),
- referentielService.getAllDemandType(),
- model.getDemandType());
- initBeanFilterableComboBox(ui.getPriorityComboBox(),
- referentielService.getAllPriority(),
- model.getPriority());
- initBeanFilterableComboBox(ui.getEtatAttenteComboBox(),
- referentielService.getAllEtatAttente(),
- model.getEtatAttente());
- initBeanFilterableComboBox(ui.getStatusComboBox(),
- Arrays.asList(DemandStatus.values()),
- model.getDemandStatus());
- initBeanFilterableComboBox(ui.getGammeComboBox(),
- referentielService.getAllRange(),
- model.getGamme());
+ initCheckBoxComboBox(ui.getDocTypeComboBox(),
+ referentielService.getAllDemandType(),
+ model.getDemandType(),
+ EmailFilter.PROPERTY_DEMAND_TYPE,
+ true);
+ initCheckBoxComboBox(ui.getPriorityComboBox(),
+ referentielService.getAllPriority(),
+ model.getPriority(),
+ EmailFilter.PROPERTY_PRIORITY,
+ true);
+ initCheckBoxComboBox(ui.getEtatAttenteComboBox(),
+ referentielService.getAllEtatAttente(),
+ model.getEtatAttente(),
+ EmailFilter.PROPERTY_ETAT_ATTENTE,
+ true);
+ initCheckBoxComboBox(ui.getStatusComboBox(),
+ Arrays.asList(DemandStatus.values()),
+ model.getDemandStatus(),
+ EmailFilter.PROPERTY_DEMAND_STATUS,
+ false);
+ initCheckBoxComboBox(ui.getGammeComboBox(),
+ referentielService.getAllRange(),
+ model.getGamme(),
+ EmailFilter.PROPERTY_GAMME,
+ true);
final JXTable dataTable = getUI().getDataTable();
dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-04-28 17:59:52 UTC (rev 53)
@@ -177,10 +177,12 @@
text: "faxtomail.demande.docType.label";
}
+/*
#docTypeComboBox {
property: demandType;
selectedItem: { model.getDemandType() };
}
+*/
#ediCodeNumberLabel {
text: "faxtomail.demande.ediCodeNumber.label";
@@ -195,28 +197,30 @@
text: "faxtomail.demande.priority.label";
}
-#priorityComboBox {
+/*#priorityComboBox {
property: priority;
selectedItem: { model.getPriority() };
-}
+}*/
#statusLabel {
text: "faxtomail.demande.status.label";
}
+/*
#statusComboBox {
property: demandStatus;
selectedItem: { model.getDemandStatus() };
}
+*/
#etatAttenteLabel {
text: "faxtomail.demande.etatAttente.label";
}
-#etatAttenteComboBox {
+/*#etatAttenteComboBox {
property: etatAttente;
selectedItem: { model.getEtatAttente() };
-}
+}*/
#projectReferenceLabel {
text: "faxtomail.demande.projectReference.label";
@@ -262,10 +266,12 @@
text: "faxtomail.demande.gamme.label";
}
+/*
#gammeComboBox {
property: gamme;
selectedItem: { model.getGamme() };
}
+*/
#searchButton {
text: "faxtomail.search.button.label";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-04-28 17:59:52 UTC (rev 53)
@@ -234,9 +234,7 @@
<JLabel id='docTypeLabel'/>
</cell>
<cell columns='3' weightx='1'>
- <BeanFilterableComboBox id='docTypeComboBox'
- constructorParams='this'
- genericType="DemandType"/>
+ <JComboBox id='docTypeComboBox'/>
</cell>
</row>
@@ -271,27 +269,21 @@
<JLabel id='priorityLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='priorityComboBox'
- constructorParams='this'
- genericType="Priority"/>
+ <JComboBox id='priorityComboBox'/>
</cell>
<cell>
<JLabel id='statusLabel'/>
</cell>
<cell weightx='1'>
- <BeanFilterableComboBox id='statusComboBox'
- constructorParams='this'
- genericType="DemandStatus"/>
+ <JComboBox id='statusComboBox'/>
</cell>
<cell>
<JLabel id='etatAttenteLabel'/>
</cell>
<cell columns='3' weightx='2'>
- <BeanFilterableComboBox id='etatAttenteComboBox'
- constructorParams='this'
- genericType="EtatAttente"/>
+ <JComboBox id='etatAttenteComboBox'/>
</cell>
</row>
@@ -308,9 +300,7 @@
<JLabel id='gammeLabel'/>
</cell>
<cell columns='3' weightx='1'>
- <BeanFilterableComboBox id='gammeComboBox'
- constructorParams='this'
- genericType="Range"/>
+ <JComboBox id='gammeComboBox'/>
</cell>
</row>
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-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -24,26 +24,46 @@
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.SearchAction;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
+import com.franciaflex.faxtomail.ui.swing.util.CheckBoxListCellRenderer;
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import jaxx.runtime.swing.editor.bean.BeanUIUtil;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
+import javax.swing.event.ListDataListener;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import static org.nuiton.i18n.I18n.t;
@@ -89,7 +109,7 @@
initUI(ui);
- ReferentielService referentielService = getContext().getReferentielService();
+ final ReferentielService referentielService = getContext().getReferentielService();
SearchUIModel model = getModel();
initBeanFilterableComboBox(ui.getTakenByComboBox(),
@@ -107,22 +127,33 @@
initBeanFilterableComboBox(ui.getPrintedByComboBox(),
getContext().getUserService().getAllUsers(),
model.getPrintingBy());
- initBeanFilterableComboBox(ui.getDocTypeComboBox(),
- referentielService.getAllDemandType(),
- model.getDemandType());
- initBeanFilterableComboBox(ui.getPriorityComboBox(),
- referentielService.getAllPriority(),
- model.getPriority());
- initBeanFilterableComboBox(ui.getEtatAttenteComboBox(),
- referentielService.getAllEtatAttente(),
- model.getEtatAttente());
- initBeanFilterableComboBox(ui.getStatusComboBox(),
- Arrays.asList(DemandStatus.values()),
- model.getDemandStatus());
- initBeanFilterableComboBox(ui.getGammeComboBox(),
- referentielService.getAllRange(),
- model.getGamme());
+ initCheckBoxComboBox(ui.getDocTypeComboBox(),
+ referentielService.getAllDemandType(),
+ model.getDemandType(),
+ EmailFilter.PROPERTY_DEMAND_TYPE,
+ true);
+ initCheckBoxComboBox(ui.getPriorityComboBox(),
+ referentielService.getAllPriority(),
+ model.getPriority(),
+ EmailFilter.PROPERTY_PRIORITY,
+ true);
+ initCheckBoxComboBox(ui.getEtatAttenteComboBox(),
+ referentielService.getAllEtatAttente(),
+ model.getEtatAttente(),
+ EmailFilter.PROPERTY_ETAT_ATTENTE,
+ true);
+ initCheckBoxComboBox(ui.getStatusComboBox(),
+ Arrays.asList(DemandStatus.values()),
+ model.getDemandStatus(),
+ EmailFilter.PROPERTY_DEMAND_STATUS,
+ false);
+ initCheckBoxComboBox(ui.getGammeComboBox(),
+ referentielService.getAllRange(),
+ model.getGamme(),
+ EmailFilter.PROPERTY_GAMME,
+ true);
+
final JXTable dataTable = getUI().getDataTable();
dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@@ -156,6 +187,9 @@
}
}
}
+
+
+
}
@Override
@@ -213,4 +247,5 @@
protected String[] getEditableTableProperties() {
return new String[] { Email.PROPERTY_ATTACHMENT };
}
+
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -141,13 +141,12 @@
return editObject.getCommandNumber();
}
- public void setEtatAttente(EtatAttente etatAttente) {
- Object oldValue = getEtatAttente();
+ public void setEtatAttente(List<EtatAttente> etatAttente) {
editObject.setEtatAttente(etatAttente);
- firePropertyChanged(EmailFilter.PROPERTY_ETAT_ATTENTE, oldValue, etatAttente);
+ firePropertyChanged(EmailFilter.PROPERTY_ETAT_ATTENTE, null, etatAttente);
}
- public EtatAttente getEtatAttente() {
+ public List<EtatAttente> getEtatAttente() {
return editObject.getEtatAttente();
}
@@ -181,34 +180,31 @@
firePropertyChanged(EmailFilter.PROPERTY_ARCHIVED_BY, oldValue, faxToMailUser);
}
- public Priority getPriority() {
+ public List<Priority> getPriority() {
return editObject.getPriority();
}
- public void setPriority(Priority priority) {
- Object oldValue = getPriority();
+ public void setPriority(List<Priority> priority) {
editObject.setPriority(priority);
- firePropertyChanged(EmailFilter.PROPERTY_PRIORITY, oldValue, priority);
+ firePropertyChanged(EmailFilter.PROPERTY_PRIORITY, null, priority);
}
- public DemandType getDemandType() {
+ public List<DemandType> getDemandType() {
return editObject.getDemandType();
}
- public void setDemandType(DemandType demandType) {
- Object oldValue = getDemandType();
+ public void setDemandType(List<DemandType> demandType) {
editObject.setDemandType(demandType);
- firePropertyChanged(EmailFilter.PROPERTY_DEMAND_TYPE, oldValue, demandType);
+ firePropertyChanged(EmailFilter.PROPERTY_DEMAND_TYPE, null, demandType);
}
- public DemandStatus getDemandStatus() {
+ public List<DemandStatus> getDemandStatus() {
return editObject.getDemandStatus();
}
- public void setDemandStatus(DemandStatus demandStatus) {
- Object oldValue = getDemandStatus();
+ public void setDemandStatus(List<DemandStatus> demandStatus) {
editObject.setDemandStatus(demandStatus);
- firePropertyChanged(EmailFilter.PROPERTY_DEMAND_STATUS, oldValue, demandStatus);
+ firePropertyChanged(EmailFilter.PROPERTY_DEMAND_STATUS, null, demandStatus);
}
public void setEdiCodeNumber(String ediCodeNumber) {
@@ -362,14 +358,13 @@
firePropertyChanged(EmailFilter.PROPERTY_MAX_TRANSFER_DATE, oldValue, maxTransferDate);
}
- public Range getGamme() {
+ public List<Range> getGamme() {
return editObject.getGamme();
}
- public void setGamme(Range gamme) {
- Object oldValue = getGamme();
+ public void setGamme(List<Range> gamme) {
editObject.setGamme(gamme);
- firePropertyChanged(EmailFilter.PROPERTY_GAMME, oldValue, gamme);
+ firePropertyChanged(EmailFilter.PROPERTY_GAMME, null, gamme);
}
public List<DemandeUIModel> getResults() {
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-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -33,6 +33,7 @@
import com.google.common.collect.Sets;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.editor.bean.BeanUIUtil;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,14 +49,17 @@
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import java.awt.*;
+import java.awt.List;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
-import java.util.Set;
+import java.lang.reflect.Method;
+import java.util.*;
import static org.nuiton.i18n.I18n.t;
@@ -244,4 +248,40 @@
getParentContainer(JFrame.class).setVisible(false);
}
+ protected <HL extends HasLabel> void initCheckBoxComboBox(final JComboBox comboBox,
+ java.util.List<HL> values,
+ java.util.List<HL> selection,
+ String property,
+ boolean addNull) {
+
+ java.util.List<HL> universe = new ArrayList<HL>();
+ if (addNull) {
+ universe.add(null);
+ }
+ if (values != null) {
+ universe.addAll(values);
+ }
+ final ComboBoxModel comboModel = new CheckBoxComboBoxModel(universe, selection);
+ comboBox.setModel(comboModel);
+ comboBox.setRenderer(new CheckBoxListCellRenderer() {
+ @Override
+ protected boolean isCheckBoxSelected(Object value) {
+ return ((java.util.List<Object>) comboModel.getSelectedItem()).contains(value);
+ }
+ });
+ final Method mutator = BeanUIUtil.getMutator(getModel(), property);
+ comboBox.addItemListener(new ItemListener() {
+ @Override
+ public void itemStateChanged(ItemEvent e) {
+ comboBox.showPopup();
+
+ if (e.getStateChange() == ItemEvent.SELECTED) {
+ BeanUIUtil.invokeMethod(mutator,
+ getModel(),
+ e.getItem());
+ }
+ }
+ });
+ }
+
}
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxComboBoxModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxComboBoxModel.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxComboBoxModel.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -0,0 +1,55 @@
+package com.franciaflex.faxtomail.ui.swing.util;
+
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import com.google.common.collect.Iterables;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class CheckBoxComboBoxModel<HL extends HasLabel> extends AbstractListModel<HL> implements ComboBoxModel<HL> {
+
+ List<Object> selection;
+ List<HL> values;
+
+ public CheckBoxComboBoxModel(List<HL> values, List<HL> selection) {
+ this.values = new ArrayList<HL>();
+ if (values != null) {
+ this.values.addAll(values);
+ }
+
+ this.selection = new ArrayList<Object>();
+ if (selection != null) {
+ this.selection.addAll(selection);
+ }
+ }
+
+ @Override
+ public void setSelectedItem(Object anItem) {
+ selection = new ArrayList<Object>(selection);
+ if (selection.contains(anItem)) {
+ selection.remove(anItem);
+ } else {
+ selection.add(anItem);
+ }
+ }
+
+ @Override
+ public Object getSelectedItem() {
+ return selection;
+ }
+
+ @Override
+ public int getSize() {
+ return values.size();
+ }
+
+ @Override
+ public HL getElementAt(int index) {
+ return Iterables.get(values, index);
+ }
+}
\ No newline at end of file
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java 2014-04-28 17:59:52 UTC (rev 53)
@@ -0,0 +1,519 @@
+package com.franciaflex.faxtomail.ui.swing.util;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.border.*;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.text.JTextComponent;
+
+import java.awt.*;
+
+import java.awt.List;
+import java.io.Serializable;
+import java.util.*;
+
+import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import sun.swing.DefaultLookup;
+
+import static org.nuiton.i18n.I18n.t;
+
+
+/**
+ * Renders an item in a list.
+ * <p>
+ * <strong><a name="override">Implementation Note:</a></strong>
+ * This class overrides
+ * <code>invalidate</code>,
+ * <code>validate</code>,
+ * <code>revalidate</code>,
+ * <code>repaint</code>,
+ * <code>isOpaque</code>,
+ * and
+ * <code>firePropertyChange</code>
+ * solely to improve performance.
+ * If not overridden, these frequently called methods would execute code paths
+ * that are unnecessary for the default list cell renderer.
+ * If you write your own renderer,
+ * take care to weigh the benefits and
+ * drawbacks of overriding these methods.
+ *
+ * <p>
+ *
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases. The current serialization support is
+ * appropriate for short term storage or RMI between applications running
+ * the same version of Swing. As of 1.4, support for long term storage
+ * of all JavaBeans<sup><font size="-2">TM</font></sup>
+ * has been added to the <code>java.beans</code> package.
+ * Please see {@link java.beans.XMLEncoder}.
+ *
+ * @author Philip Milne
+ * @author Hans Muller
+ */
+public abstract class CheckBoxListCellRenderer<HL extends HasLabel>
+ implements ListCellRenderer<Object>, Serializable {
+
+ private static final Log log = LogFactory.getLog(CheckBoxListCellRenderer.class);
+ /**
+ * An empty <code>Border</code>. This field might not be used. To change the
+ * <code>Border</code> used by this renderer override the
+ * <code>getListCellRendererComponent</code> method and set the border
+ * of the returned component directly.
+ */
+ private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+ private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+ protected static Border noFocusBorder = DEFAULT_NO_FOCUS_BORDER;
+
+ protected CheckBoxListCellRendererLabel label = new CheckBoxListCellRendererLabel();
+ protected CheckBoxListCellRendererCheckBox checkbox = new CheckBoxListCellRendererCheckBox();
+
+ /**
+ * Constructs a default renderer object for an item
+ * in a list.
+ */
+ public CheckBoxListCellRenderer() {
+ super();
+ label.setText("");
+ label.setName("List.cellRenderer");
+ checkbox.setName("List.cellRenderer");
+ }
+
+ private Border getNoFocusBorder(JComponent component, ComponentUI ui) {
+ Border border = DefaultLookup.getBorder(component, ui, "List.cellNoFocusBorder");
+ if (System.getSecurityManager() != null) {
+ if (border != null) return border;
+ return SAFE_NO_FOCUS_BORDER;
+ } else {
+ if (border != null &&
+ (noFocusBorder == null ||
+ noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
+ return border;
+ }
+ return noFocusBorder;
+ }
+ }
+
+ protected abstract boolean isCheckBoxSelected(Object value);
+
+ public Component getListCellRendererComponent(
+ JList<?> list,
+ Object value,
+ final int index,
+ boolean isSelected,
+ boolean cellHasFocus) {
+
+ String decorate = "";
+ JComponent component = label;
+ ComponentUI ui = label.getUI();
+
+ final String noneLabel = t("faxtomail.common.none.label");
+ if (value == null || value != null && HasLabel.class.isAssignableFrom(value.getClass())) {
+ decorate = value != null ? ((HasLabel) value).getLabel() : noneLabel;
+ checkbox.setSelected(isCheckBoxSelected(value));
+ checkbox.setText(decorate);
+ component = checkbox;
+ ui = checkbox.getUI();
+
+
+ } else {
+ if (value != null && java.util.List.class.isAssignableFrom(value.getClass())) {
+ java.util.List<HL> etats = (java.util.List<HL>) value;
+ java.util.List<String> e = Lists.transform(etats, new Function<HL, String>() {
+ @Override
+ public String apply(HL input) {
+ return input != null ? input.getLabel() : noneLabel;
+ }
+ });
+ decorate = StringUtils.join(e, ", ");
+ label.setText(decorate);
+ }
+
+ Color bg = null;
+ Color fg = null;
+
+ JList.DropLocation dropLocation = list.getDropLocation();
+ if (dropLocation != null
+ && !dropLocation.isInsert()
+ && dropLocation.getIndex() == index) {
+
+ bg = DefaultLookup.getColor(component, ui, "List.dropCellBackground");
+ fg = DefaultLookup.getColor(component, ui, "List.dropCellForeground");
+
+ isSelected = true;
+ }
+
+ if (isSelected) {
+ component.setBackground(bg == null ? list.getSelectionBackground() : bg);
+ component.setForeground(fg == null ? list.getSelectionForeground() : fg);
+ } else {
+ component.setBackground(list.getBackground());
+ component.setForeground(list.getForeground());
+ }
+ }
+
+ component.setComponentOrientation(list.getComponentOrientation());
+
+ component.setEnabled(list.isEnabled());
+ component.setFont(list.getFont());
+
+ Border border = null;
+ if (cellHasFocus) {
+ if (isSelected) {
+ border = DefaultLookup.getBorder(component, ui, "List.focusSelectedCellHighlightBorder");
+ }
+ if (border == null) {
+ border = DefaultLookup.getBorder(component, ui, "List.focusCellHighlightBorder");
+ }
+ } else {
+ border = getNoFocusBorder(component, ui);
+ }
+ component.setBorder(border);
+
+ return component;
+ }
+
+ protected class CheckBoxListCellRendererLabel extends JLabel {
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ * @return <code>true</code> if the background is completely opaque
+ * and differs from the JList's background;
+ * <code>false</code> otherwise
+ */
+ @Override
+ public boolean isOpaque() {
+ Color back = getBackground();
+ Component p = getParent();
+ if (p != null) {
+ p = p.getParent();
+ }
+ // p should now be the JList.
+ boolean colorMatch = (back != null) && (p != null) &&
+ back.equals(p.getBackground()) &&
+ p.isOpaque();
+ return !colorMatch && super.isOpaque();
+ }
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void validate() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ */
+ @Override
+ public void invalidate() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ */
+ @Override
+ public void repaint() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void revalidate() {}
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void repaint(long tm, int x, int y, int width, int height) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void repaint(Rectangle r) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ // Strings get interned...
+ if (propertyName == "text"
+ || ((propertyName == "font" || propertyName == "foreground")
+ && oldValue != newValue
+ && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
+
+ super.firePropertyChange(propertyName, oldValue, newValue);
+ }
+ }
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, byte oldValue, byte newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, char oldValue, char newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, short oldValue, short newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, long oldValue, long newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, float oldValue, float newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, double oldValue, double newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
+
+ }
+
+ protected class CheckBoxListCellRendererCheckBox extends JCheckBox {
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ * @return <code>true</code> if the background is completely opaque
+ * and differs from the JList's background;
+ * <code>false</code> otherwise
+ */
+ @Override
+ public boolean isOpaque() {
+ Color back = getBackground();
+ Component p = getParent();
+ if (p != null) {
+ p = p.getParent();
+ }
+ // p should now be the JList.
+ boolean colorMatch = (back != null) && (p != null) &&
+ back.equals(p.getBackground()) &&
+ p.isOpaque();
+ return !colorMatch && super.isOpaque();
+ }
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void validate() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ */
+ @Override
+ public void invalidate() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ *
+ * @since 1.5
+ */
+ @Override
+ public void repaint() {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void revalidate() {}
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void repaint(long tm, int x, int y, int width, int height) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void repaint(Rectangle r) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ // Strings get interned...
+ if (propertyName == "text"
+ || ((propertyName == "font" || propertyName == "foreground")
+ && oldValue != newValue
+ && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) {
+
+ super.firePropertyChange(propertyName, oldValue, newValue);
+ }
+ }
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, byte oldValue, byte newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, char oldValue, char newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, short oldValue, short newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, long oldValue, long newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, float oldValue, float newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, double oldValue, double newValue) {}
+
+ /**
+ * Overridden for performance reasons.
+ * See the <a href="#override">Implementation Note</a>
+ * for more information.
+ */
+ @Override
+ public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
+
+ }
+
+ /**
+ * A subclass of DefaultListCellRenderer that implements UIResource.
+ * DefaultListCellRenderer doesn't implement UIResource
+ * directly so that applications can safely override the
+ * cellRenderer property with DefaultListCellRenderer subclasses.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases. The current serialization support is
+ * appropriate for short term storage or RMI between applications running
+ * the same version of Swing. As of 1.4, support for long term storage
+ * of all JavaBeans<sup><font size="-2">TM</font></sup>
+ * has been added to the <code>java.beans</code> package.
+ * Please see {@link java.beans.XMLEncoder}.
+ */
+ public static class UIResource extends DefaultListCellRenderer
+ implements javax.swing.plaf.UIResource
+ {
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-04-28 16:07:05 UTC (rev 52)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-04-28 17:59:52 UTC (rev 53)
@@ -46,6 +46,7 @@
faxtomail.chooseMailFolder.message=Choisissez le dossier où transférer l'élément \:
faxtomail.chooseMailFolder.title=Dossier de destination
faxtomail.common.by.label=par
+faxtomail.common.none.label=Aucun
faxtomail.common.on.label=le
faxtomail.config.application=
faxtomail.config.title=
@@ -243,3 +244,4 @@
faxtomail.validator.error.email.demandType.required=Type de demande requis
faxtomail.validator.error.email.projectReference.required=Référence chantier requise
swing.error.cannot.open.file=
+test=
1
0
r52 - in trunk: faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/resources/i18n
by echatellier@users.forge.codelutin.com 28 Apr '14
by echatellier@users.forge.codelutin.com 28 Apr '14
28 Apr '14
Author: echatellier
Date: 2014-04-28 18:07:05 +0200 (Mon, 28 Apr 2014)
New Revision: 52
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/52
Log:
Display user message when client code is not correct.
Added:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InvalidClientException.java
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/InitFaxToMailService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAndExitAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -52,6 +52,8 @@
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.Client;
+import com.franciaflex.faxtomail.persistence.entities.ClientTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
@@ -86,11 +88,17 @@
return email;
}
- public Email saveEmail(Email email, FaxToMailUser user, String... modifiedFields) {
+ public Email saveEmail(Email email, String clientCode, FaxToMailUser user, String... modifiedFields) throws InvalidClientException {
Date now = getNow();
+ ClientTopiaDao clientDao = getPersistenceContext().getClientDao();
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
+ Client client = clientDao.forCodeEquals(clientCode).findUniqueOrNull();
+ if (client == null) {
+ throw new InvalidClientException("Can't find client code " + clientCode);
+ }
+
if (email.getAttachment() != null) {
AttachmentTopiaDao attachmentDao = getPersistenceContext().getAttachmentDao();
for (Attachment attachment : email.getAttachment()) {
@@ -441,7 +449,7 @@
History.PROPERTY_MODIFICATION_DATE, now);
email.addHistory(history);
- email = saveEmail(email, user);
+ email = saveEmail(email, email.getClient().getCode(), user);
} catch (Exception e) {
if (log.isErrorEnabled()) {
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -351,7 +351,7 @@
protected void createEmails(Random random, HistoryTopiaDao historyDao, RangeRowTopiaDao rangeRowDao, EmailTopiaDao emailDao,
List<Range> ranges, List<Client> clients, List<DemandType> types, List<Priority> priorities,
- MailFolder folder, FaxToMailUser user) {
+ MailFolder folder, FaxToMailUser user) throws InvalidClientException {
int r = random.nextInt(10) + 5;
for (int i = 0 ; i < r ; i++) {
createEmail(random, historyDao, rangeRowDao, emailDao, ranges, clients, types, priorities, folder, user);
@@ -367,7 +367,7 @@
List<DemandType> types,
List<Priority> priorities,
MailFolder folder,
- FaxToMailUser user) {
+ FaxToMailUser user) throws InvalidClientException {
List<RangeRow> rangeRows = new ArrayList<>();
for (int j = 0 ; j < random.nextInt(4) + 1 ; j++) {
@@ -418,7 +418,8 @@
email.setDemandType(types.get(random.nextInt(types.size())));
email.setPriority(priorities.get(random.nextInt(priorities.size())));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
+ getEmailService().saveEmail(email, email.getClient().getCode(), user,
+ Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
}
Calendar cal = Calendar.getInstance();
@@ -451,7 +452,8 @@
email.setDemandType(types.get(random.nextInt(types.size())));
email.setPriority(priorities.get(random.nextInt(priorities.size())));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
+ getEmailService().saveEmail(email, email.getClient().getCode(), user,
+ Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
}
}
Added: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InvalidClientException.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InvalidClientException.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InvalidClientException.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -0,0 +1,39 @@
+package com.franciaflex.faxtomail.services.service;
+
+/*
+ * #%L
+ * FaxToMail :: Service
+ * $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%
+ */
+
+public class InvalidClientException extends Exception {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1926451364755356679L;
+
+ public InvalidClientException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InvalidClientException(String message) {
+ super(message);
+ }
+}
Property changes on: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InvalidClientException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -24,21 +24,21 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
+import com.franciaflex.faxtomail.services.service.InvalidClientException;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeTableModel;
import com.google.common.collect.Maps;
+
import org.apache.commons.lang3.StringUtils;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionException;
import org.nuiton.topia.persistence.TopiaEntities;
import org.nuiton.util.beans.BeanMonitor;
@@ -47,6 +47,10 @@
import java.util.List;
import java.util.Map;
+import javax.swing.JOptionPane;
+
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
@@ -92,15 +96,33 @@
FaxToMailUser currentUser = context.getCurrentUser();
Email email = model.toEntity(persistedEmail);
+ String clientCode = model.getClientCode();
BeanMonitor monitor = getHandler().getMonitor();
String[] modifiedProperties = monitor.getModifiedProperties();
- email = context.getEmailService().saveEmail(email, currentUser, modifiedProperties);
+ email = context.getEmailService().saveEmail(email, clientCode, currentUser, modifiedProperties);
+
model.fromEntity(email);
getModel().setModify(false);
monitor.clearModified();
}
+ public void postFailedAction(Throwable error) {
+
+ if (error instanceof InvalidClientException) {
+ DemandeUIModel model = getModel();
+ String clientCode = model.getClientCode();
+
+ JOptionPane.showMessageDialog(getUI(), t("faxtomail.demande.clientCode.error", clientCode),
+ t("faxtomail.demandeList.title"), JOptionPane.ERROR_MESSAGE);
+
+ // reset ui
+ model.setClientCode(null);
+ } else {
+ // FIXME echatellier 20140428 how to throw original exception ?
+ throw new RuntimeException(error);
+ }
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAndExitAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAndExitAction.java 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAndExitAction.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIHandler;
/**
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java 2014-04-28 16:07:05 UTC (rev 52)
@@ -60,7 +60,7 @@
FaxToMailUser currentUser = context.getCurrentUser();
Email email = model.toEntity(persistedEmail);
- email = context.getEmailService().saveEmail(email, currentUser, modifiedProperties);
+ email = context.getEmailService().saveEmail(email, email.getClient().getCode(), currentUser, modifiedProperties);
model.fromEntity(email);
}
}
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-04-28 13:47:02 UTC (rev 51)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-04-28 16:07:05 UTC (rev 52)
@@ -67,6 +67,7 @@
faxtomail.demande.body.label=Corps du mail
faxtomail.demande.client.label=Code client
faxtomail.demande.clientBrand.label=Marque
+faxtomail.demande.clientCode.error=Impossible de trouver le client %s \!
faxtomail.demande.clientCode.label=Client
faxtomail.demande.commandNumber.label=Numéro de commande
faxtomail.demande.comment.label=Message
1
0
Build failed in Jenkins: faxtomail-ci » FaxToMail :: UI #34
by admin+ci-codelutin.com@codelutin.com 28 Apr '14
by admin+ci-codelutin.com@codelutin.com 28 Apr '14
28 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
Changes:
[kmorin] refs #4654 [ECRAN] Liste des mails / fax
ajout du filtre
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: UI 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 19.1 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 16.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 32.7 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 33.6 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 37.9 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 25.6 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 29.4 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 28.7 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 34.6 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 34.6 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 26.4 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 20.8 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/ezw…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/com/ezware/oxbow/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/com/ezware/oxb…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/ezware/oxbow/swing-bits/0.5.0/swing…
[WARNING] The POM for com.ezware.oxbow:swing-bits:jar:0.5.0 is missing, no dependency information available
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/nuiton…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/ezw…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/com/ezware/oxbow/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/com/ezware/oxb…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/ezware/oxbow/swing-bits/0.5.0/swing…
[JENKINS] Archiving disabled
1
5
r51 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service
by echatellier@users.forge.codelutin.com 28 Apr '14
by echatellier@users.forge.codelutin.com 28 Apr '14
28 Apr '14
Author: echatellier
Date: 2014-04-28 15:47:02 +0200 (Mon, 28 Apr 2014)
New Revision: 51
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/51
Log:
fixes #4657: [TECH] Int?\195?\169gration EDI
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.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-04-28 08:52:27 UTC (rev 50)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-04-28 13:47:02 UTC (rev 51)
@@ -25,10 +25,7 @@
*/
import com.google.common.base.Charsets;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
@@ -47,7 +44,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@@ -301,6 +297,12 @@
return result;
}
+ /** @return {@link FaxToMailConfigurationOption#EDI_DIRECTORY} value */
+ public File getEdiDirectory() {
+ File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.EDI_DIRECTORY.getKey());
+ return result;
+ }
+
public File getTmpDirectory() {
File result = applicationConfig.getOptionAsFile(FaxToMailConfigurationOption.TMP_DIRECTORY.getKey());
return result;
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-04-28 08:52:27 UTC (rev 50)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-04-28 13:47:02 UTC (rev 51)
@@ -142,12 +142,17 @@
true),
// NOT TRANSIENT CONFIG
-
CSV_SEPARATOR(
"faxtomail.csv.separator",
n("faxtomail.config.option.csv.separator.description"),
";",
char.class),
+
+ EDI_DIRECTORY(
+ "faxtomail.edi.directory",
+ n("faxtomail.config.option.edi.directory.description"),
+ "${faxtomail.basedir}/edi",
+ File.class),
// UI
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-04-28 08:52:27 UTC (rev 50)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-04-28 13:47:02 UTC (rev 51)
@@ -24,6 +24,32 @@
* #L%
*/
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.mail.internet.MailDateFormat;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.mail.DefaultAuthenticator;
+import org.apache.commons.mail.EmailConstants;
+import org.apache.commons.mail.MultiPartEmail;
+
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
@@ -42,29 +68,11 @@
import com.franciaflex.faxtomail.persistence.entities.Reply;
import com.franciaflex.faxtomail.persistence.entities.ReplyTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.mail.DefaultAuthenticator;
-import org.apache.commons.mail.EmailConstants;
-import org.apache.commons.mail.MultiPartEmail;
-
-import javax.mail.internet.MailDateFormat;
-
-import java.io.File;
-import java.net.URL;
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.Set;
-
/**
* @author kmorin <kmorin(a)codelutin.com>
* @since x.x
@@ -120,7 +128,7 @@
Email.PROPERTY_DEMAND_TYPE,
Email.PROPERTY_PROJECT_REFERENCE))) {
email.setDemandStatus(DemandStatus.IN_PROGRESS);
- //TODO transmit to EDI
+ transmitDemandToEdi(email);
}
History history;
@@ -154,6 +162,98 @@
return result;
}
+ /**
+ * Generate txt file to send demand to EDI system.
+ *
+ * @param email email to send
+ */
+ protected void transmitDemandToEdi(Email email) {
+ Preconditions.checkArgument(email.getDemandStatus() == DemandStatus.IN_PROGRESS);
+
+ if (CollectionUtils.isEmpty(email.getRangeRow())) {
+ return;
+ }
+
+ // get output file with pattern name depending on date
+ Date now = serviceContext.getNow();
+ File ediDirectory = getApplicationConfig().getEdiDirectory();
+ ediDirectory.mkdirs();
+
+ String fileDate = DateFormatUtils.format(now, "yyMMddhhmmss");
+
+ // create a file for each commande
+ for (RangeRow rangeRow : email.getRangeRow()) {
+ String fileName = "ORD_FAX_" + fileDate + "_" + rangeRow.getTopiaId() + ".txt";
+
+ File ediFile = new File(ediDirectory, fileName);
+
+ // generate output content
+ String separator = ";";
+ try (Writer ediWriter = new BufferedWriter(new FileWriter(ediFile))) {
+
+ ediWriter.write("%BEGIN_ENTETE_QUOTE\n");
+
+ //N° Champ/Champ/Type/Longueur/Observation
+ //01/Id Enregistrement/Alpha/1/Cst : E (En-tête)
+ ediWriter.write("E" + separator);
+ //02/N° d’ordre achat/Numérique/6/Cst : OARFAX
+ ediWriter.write("OARFAX" + separator);
+ //03/Date traitement/Date/6/JJMMAA dte système
+ ediWriter.write(DateFormatUtils.format(now, "ddMMyy") + separator);
+ //04/Date livraison prévue/Date/6/JJMMAA dte système
+ ediWriter.write(DateFormatUtils.format(now, "ddMMyy") + separator);
+ //05/Commentaire/Alpha/70/Vide
+ ediWriter.write(separator);
+ //06/Commentaire/Alpha/70/Vide
+ ediWriter.write(separator);
+ //07/Commentaire/Alpha/70/Vide
+ ediWriter.write(separator);
+ //08/Commentaire/Alpha/70/Vide
+ ediWriter.write(separator);
+ //09//Référence client FX/Alpha/36/Référence Chantier
+ ediWriter.write(Strings.nullToEmpty(email.getProjectReference()) + separator);
+ //10/Nom du contact/Alpha/35/Vide
+ ediWriter.write(separator);
+ //11/Téléphone contact/Alpha/15/Vide
+ ediWriter.write(separator);
+ //12/Fax contact/Alpha/15/Vide
+ ediWriter.write(separator);
+ //13/Devise/Alpha/3/Cst : EUR
+ ediWriter.write("EUR" + separator);
+ //14/Condition de livraison/Alpha/3/Vide
+ ediWriter.write(separator);
+ //15/Type de commande/Alpha/Type de document
+ ediWriter.write(email.getDemandType().getLabel() + separator);
+ //16/Adresse livr : Nom/Alpha/35/Vide
+ ediWriter.write(separator);
+ //18/Adresse livr : adr1/Alpha/30/Vide
+ ediWriter.write(separator);
+ //19/Adresse livr : adr2/Alpha/30/Vide
+ ediWriter.write(separator);
+ //20/Adresse livr : cp ville/Alpha/30/Vide
+ ediWriter.write(separator);
+ //21/Adresse livr : compl./Alpha/30/Vide
+ ediWriter.write(separator);
+ //22/Adresse livr : Code postal/Alpha/10/Vide
+ ediWriter.write(separator);
+ //23/Adresse livr : Code Pays/Alpha/3/Vide
+ ediWriter.write(separator);
+ //24/Code Ean acheteur/Alpha/13/Code client
+ ediWriter.write(email.getClient().getCode() + separator);
+ //25/Code Ean facturé/Alpha/13/Code client
+ ediWriter.write(email.getClient().getCode() + separator);
+ //26/Code Ean fournisseur/Alpha/13/Gamme
+ ediWriter.write(rangeRow.getRange().getLabel() + separator);
+ //27/Identifiant Unique
+ ediWriter.write(rangeRow.getRange().getTopiaId() + "\n");
+
+ ediWriter.write("%END_ENTETE_QUOTE\n");
+ } catch (IOException ex) {
+ throw new RuntimeException("Can't generate EDI file");
+ }
+ }
+ }
+
public List<Email> getEmailForFolder(MailFolder folder) {
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
List<Email> result = new ArrayList<>(dao.forMailFolderEquals(folder)
1
0
r50 - in trunk: . faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies faxtomail-ui-swing/src/main/resources/icons faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web
by kmorin@users.forge.codelutin.com 28 Apr '14
by kmorin@users.forge.codelutin.com 28 Apr '14
28 Apr '14
Author: kmorin
Date: 2014-04-28 10:52:27 +0200 (Mon, 28 Apr 2014)
New Revision: 50
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/50
Log:
gestion de l'encoding et des pi?\195?\168ces jointes de type text
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java
trunk/faxtomail-ui-swing/src/main/resources/icons/action-cross.png
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/MailFilterJob.java
trunk/pom.xml
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-04-25 14:35:14 UTC (rev 49)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-04-28 08:52:27 UTC (rev 50)
@@ -49,6 +49,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.mail.DefaultAuthenticator;
+import org.apache.commons.mail.EmailConstants;
import org.apache.commons.mail.MultiPartEmail;
import javax.mail.internet.MailDateFormat;
@@ -308,6 +309,7 @@
message.setAuthenticator(new DefaultAuthenticator(smtpUser, password));
message.setSSLOnConnect(true);
+ message.setCharset(EmailConstants.UTF_8);
message.setFrom(from);
message.addTo(to);
message.setSubject(subject);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java 2014-04-25 14:35:14 UTC (rev 49)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java 2014-04-28 08:52:27 UTC (rev 50)
@@ -206,7 +206,8 @@
BodyPart bp = mimeMultipart.getBodyPart(j);
// if it is a text part, the,n this is the email content
- if (bp.isMimeType("text/*")) {
+ String disposition = bp.getDisposition();
+ if (bp.isMimeType("text/*") && Part.INLINE.equals(disposition)) {
String content = IOUtils.toString(bp.getInputStream());
reply.setMessage(content);
Modified: trunk/faxtomail-ui-swing/src/main/resources/icons/action-cross.png
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/MailFilterJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/MailFilterJob.java 2014-04-25 14:35:14 UTC (rev 49)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/MailFilterJob.java 2014-04-28 08:52:27 UTC (rev 50)
@@ -36,6 +36,7 @@
import com.franciaflex.faxtomail.services.service.CompanyService;
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
+import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
@@ -51,19 +52,23 @@
import javax.mail.BodyPart;
import javax.mail.Flags;
import javax.mail.Folder;
+import javax.mail.Header;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.URLName;
+import javax.mail.internet.ContentType;
import javax.mail.internet.MimeMultipart;
import java.io.File;
import java.io.FileOutputStream;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
+import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
@@ -106,7 +111,6 @@
properties.setProperty("mail.pop3.host", account.getHost());
properties.setProperty("mail.pop3.user", account.getUser());
-
Session session = Session.getInstance(properties);
Store store = null;
Folder defaultFolder = null;
@@ -170,6 +174,8 @@
int messageNumber = count - i;
Message message = folder.getMessage(messageNumber);
+ Charset charset = getCharset(message);
+
List<String> modifiedProperties = new ArrayList<>();
log.debug("Object: " + message.getSubject());
@@ -225,14 +231,14 @@
email.setDemandStatus(DemandStatus.UNTREATED);
modifiedProperties.add(Email.PROPERTY_DEMAND_STATUS);
- String originalContent = IOUtils.toString(message.getInputStream());
+ String originalContent = IOUtils.toString(message.getInputStream(), charset);
email.setOriginalEmail(originalContent);
if (message.isMimeType("multipart/*")) {
decomposeMultipartEmail(message, email);
} else {
- String content = IOUtils.toString(message.getInputStream());
+ String content = IOUtils.toString(message.getInputStream(), charset);
email.setPlainContent(content);
}
@@ -263,10 +269,12 @@
for (int j = 0; j < multiPartCount; j++) {
BodyPart bp = mimeMultipart.getBodyPart(j);
+ Charset charset = getCharset(bp);
// if it is a text part, the,n this is the email content
- if (bp.isMimeType("text/*")) {
- String content = IOUtils.toString(bp.getInputStream());
+ String disposition = bp.getDisposition();
+ if (bp.isMimeType("text/*") && !Part.ATTACHMENT.equals(disposition)) {
+ String content = IOUtils.toString(bp.getInputStream(), charset);
if (bp.isMimeType("text/plain")) {
email.setPlainContent(content);
} else {
@@ -309,4 +317,11 @@
}
}
+ protected Charset getCharset(Part part) throws MessagingException {
+ ContentType contentType = new ContentType(part.getContentType());
+ String charsetName = contentType.getParameter("charset");
+ Charset charset = Charsets.toCharset(charsetName);
+ return charset;
+ }
+
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-04-25 14:35:14 UTC (rev 49)
+++ trunk/pom.xml 2014-04-28 08:52:27 UTC (rev 50)
@@ -513,30 +513,6 @@
<version>1.1.1</version>
</dependency>
- <!--<dependency>-->
- <!--<groupId>net.atlanticbb.tantlinger</groupId>-->
- <!--<artifactId>shef</artifactId>-->
- <!--<version>2009-05-12</version>-->
- <!--</dependency>-->
-
- <!--<dependency>-->
- <!--<groupId>jtidy</groupId>-->
- <!--<artifactId>jtidy</artifactId>-->
- <!--<version>8.0</version>-->
- <!--</dependency>-->
-
- <!--<dependency>-->
- <!--<groupId>org.bushe</groupId>-->
- <!--<artifactId>sam</artifactId>-->
- <!--<version>1.0</version>-->
- <!--</dependency>-->
-
- <!--<dependency>-->
- <!--<groupId>novaworx</groupId>-->
- <!--<artifactId>novaworx-syntax</artifactId>-->
- <!--<version>0.0.7</version>-->
- <!--</dependency>-->
-
</dependencies>
</dependencyManagement>
1
0
Build failed in Jenkins: faxtomail-nightly » FaxToMail :: UI #22
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
25 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
Changes:
[echatellier] Fix project release
[kmorin] refs #4655 [ECRAN] Détail d'un mail / fax
la popup de transmission ou impression se cachait tout de suite si on sauvait une modification avant de l'ouvrir
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: UI 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 29.5 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 28.8 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 42.0 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 38.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 44.7 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 42.0 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 40.6 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 38.0 KB/sec)
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (2 KB at 47.5 KB/sec)
[INFO] Downloaded: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/nuiton/jax… (2 KB at 39.6 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/ezw…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/com/ezware/oxbow/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/com/ezware/oxb…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/ezware/oxbow/swing-bits/0.5.0/swing…
[WARNING] The POM for com.ezware.oxbow:swing-bits:jar:0.5.0 is missing, no dependency information available
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/nuiton…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/org/nuiton/jaxx/j…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/ezw…
[INFO] Downloading: http://repository.springsource.com/maven/bundles/external/com/ezware/oxbow/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/com/ezware/oxb…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/ezware/oxbow/swing-bits/0.5.0/swing…
[JENKINS] Archiving disabled
1
0
Jenkins build is back to normal : faxtomail-nightly » FaxToMail :: Persistence #22
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
25 Apr '14
Jenkins build is unstable: faxtomail-nightly » FaxToMail :: Service #22
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
25 Apr '14
Build failed in Jenkins: faxtomail-nightly » FaxToMail #20
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
by admin+ci-codelutin.com@codelutin.com 25 Apr '14
25 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex$faxto…>
Changes:
[echatellier] Update lib (topia/hibernate/h2)
[echatellier] refs #4659: [ECRAN] Recherche
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex$faxto…> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean install -DperformRelease -Dredmine.skipGenerateChanges
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] FaxToMail
[INFO] FaxToMail :: Persistence
[INFO] FaxToMail :: Service
[INFO] FaxToMail :: Web
[INFO] FaxToMail :: UI
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex$faxto…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ faxtomail ---
[JENKINS] Archiving disabled
1
2
r49 - in trunk/faxtomail-ui-web/src/main: resources webapp/WEB-INF
by echatellier@users.forge.codelutin.com 25 Apr '14
by echatellier@users.forge.codelutin.com 25 Apr '14
25 Apr '14
Author: echatellier
Date: 2014-04-25 16:35:14 +0200 (Fri, 25 Apr 2014)
New Revision: 49
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/49
Log:
Fix web ui start
Modified:
trunk/faxtomail-ui-web/src/main/resources/struts.xml
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml
Modified: trunk/faxtomail-ui-web/src/main/resources/struts.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/resources/struts.xml 2014-04-25 13:43:04 UTC (rev 48)
+++ trunk/faxtomail-ui-web/src/main/resources/struts.xml 2014-04-25 14:35:14 UTC (rev 49)
@@ -36,7 +36,7 @@
<constant name="struts.multipart.maxSize" value="10485760" />
- <package name="faxtomail" namespace="/" extends="json-default">
+ <package name="faxtomail" namespace="/" extends="struts-default">
<interceptors>
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml 2014-04-25 13:43:04 UTC (rev 48)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml 2014-04-25 14:35:14 UTC (rev 49)
@@ -36,7 +36,7 @@
<session-timeout>600</session-timeout>
</session-config>
- <!-- prevent excessive caching of js files -->
+ <!-- prevent excessive caching of js files
<filter>
<filter-name>ExpiresFilter</filter-name>
<filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
@@ -52,14 +52,9 @@
<param-name>ExpiresByType application/javascript</param-name>
<param-value>access plus 10 minutes</param-value>
</init-param>
- </filter>
+ </filter> -->
<filter>
- <filter-name>shiro</filter-name>
- <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
- </filter>
-
- <filter>
<filter-name>struts-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
@@ -75,15 +70,6 @@
</filter>
<filter-mapping>
- <filter-name>shiro</filter-name>
- <url-pattern>/*</url-pattern>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- <dispatcher>ERROR</dispatcher>
- </filter-mapping>
-
- <filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
@@ -103,14 +89,10 @@
<listener-class>com.franciaflex.faxtomail.web.FaxToMailApplicationListener</listener-class>
</listener>
- <listener>
- <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
- </listener>
-
- <filter-mapping>
+ <!-- <filter-mapping>
<filter-name>ExpiresFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
- </filter-mapping>
+ </filter-mapping> -->
</web-app>
1
0