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
September 2014
- 2 participants
- 59 discussions
r606 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment
by echatellier@users.forge.codelutin.com 04 Sep '14
by echatellier@users.forge.codelutin.com 04 Sep '14
04 Sep '14
Author: echatellier
Date: 2014-09-04 11:55:29 +0200 (Thu, 04 Sep 2014)
New Revision: 606
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/606
Log:
Fix lazy exception (with comment)
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java 2014-09-04 08:37:09 UTC (rev 605)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java 2014-09-04 09:55:29 UTC (rev 606)
@@ -122,7 +122,11 @@
context.getCurrentUser(),
new Date(),
filename);
- model.fromEntity(email);
+
+ // different cas:
+ // depuis la liste, on doit mettre à jour Email.PROPERTY_LAST_ATTACHMENT_OPENER
+ // depuis l'edition d'une demande, Email.PROPERTY_HISTORY
+ model.fromEntityIncluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY, Email.PROPERTY_LAST_ATTACHMENT_OPENER));
}
}
@@ -135,7 +139,11 @@
context.getCurrentUser(),
new Date(),
FaxToMailUIUtil.getEditedFileName(attachment.getOriginalFileName()));
- model.fromEntity(email);
+
+ // different cas:
+ // depuis la liste, on doit mettre à jour Email.PROPERTY_LAST_ATTACHMENT_OPENER
+ // depuis l'edition d'une demande, Email.PROPERTY_HISTORY
+ model.fromEntityIncluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY, Email.PROPERTY_LAST_ATTACHMENT_OPENER));
}
};
1
0
r605 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by echatellier@users.forge.codelutin.com 04 Sep '14
by echatellier@users.forge.codelutin.com 04 Sep '14
04 Sep '14
Author: echatellier
Date: 2014-09-04 10:37:09 +0200 (Thu, 04 Sep 2014)
New Revision: 605
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/605
Log:
fix generic
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
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-09-04 08:25:52 UTC (rev 604)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-04 08:37:09 UTC (rev 605)
@@ -129,7 +129,7 @@
Preconditions.checkNotNull(type);
- Decorator decorator = decoratorService.getDecoratorByType(type, name);
+ Decorator<O> decorator = decoratorService.getDecoratorByType(type, name);
Preconditions.checkNotNull(decorator);
return decorator;
}
1
0
r604 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by echatellier@users.forge.codelutin.com 04 Sep '14
by echatellier@users.forge.codelutin.com 04 Sep '14
04 Sep '14
Author: echatellier
Date: 2014-09-04 10:25:52 +0200 (Thu, 04 Sep 2014)
New Revision: 604
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/604
Log:
fix compilation (with comment)
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
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-09-03 16:26:16 UTC (rev 603)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-04 08:25:52 UTC (rev 604)
@@ -134,6 +134,12 @@
return decorator;
}
+ // sonar signale cette methode comme inutile, mais elle augmente la visibilité en fait
+ // il ne faut pas la supprimer
+ public String decorate(Serializable s) {
+ return super.decorate(s);
+ }
+
public String decorateUser(FaxToMailUser user, boolean systemIfNull) {
if (user == null && systemIfNull) {
return t("faxtomail.systemUser");
1
0
r603 - in trunk: faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 03 Sep '14
by echatellier@users.forge.codelutin.com 03 Sep '14
03 Sep '14
Author: echatellier
Date: 2014-09-03 18:26:16 +0200 (Wed, 03 Sep 2014)
New Revision: 603
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/603
Log:
Fix somes sonar errors
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java
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/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-09-03 16:26:16 UTC (rev 603)
@@ -49,10 +49,6 @@
return handler.getContext();
}
- public void setProgressionModel(ProgressionModel progressionModel) {
- super.setProgressionModel(progressionModel);
- }
-
@Override
protected ProgressionModel getProgressionModel() {
return (ProgressionModel) getContext().getActionUI().getModel().getProgressionModel();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java 2014-09-03 16:26:16 UTC (rev 603)
@@ -180,13 +180,5 @@
public Object getCellEditorValue() {
return demandGroupItem.getDemande();
}
-
- public boolean stopCellEditing() {
- return super.stopCellEditing();
- }
-
- protected void fireEditingStopped() {
- super.fireEditingStopped();
- }
}
}
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-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java 2014-09-03 16:26:16 UTC (rev 603)
@@ -369,13 +369,5 @@
public Object getCellEditorValue() {
return demandReplyItem.getReply();
}
-
- public boolean stopCellEditing() {
- return super.stopCellEditing();
- }
-
- protected void fireEditingStopped() {
- super.fireEditingStopped();
- }
}
}
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-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-03 16:26:16 UTC (rev 603)
@@ -134,10 +134,6 @@
return decorator;
}
- public String decorate(Serializable s) {
- return super.decorate(s);
- }
-
public String decorateUser(FaxToMailUser user, boolean systemIfNull) {
if (user == null && systemIfNull) {
return t("faxtomail.systemUser");
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 16:26:16 UTC (rev 603)
@@ -190,9 +190,4 @@
public DemandeUIModel createNewRow() {
return new DemandeUIModel();
}
-
- @Override
- protected void onRowsChanged(List<DemandeUIModel> data) {
- super.onRowsChanged(data);
- }
}
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-09-03 16:03:33 UTC (rev 602)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-09-03 16:26:16 UTC (rev 603)
@@ -143,7 +143,7 @@
return function(item) {
return coll && !coll.containsByTopiaId(item);
}
- }
+ };
}]);
/**
@@ -240,17 +240,6 @@
}
};
- // suppression d'un etat d'attente non utilisé
- $scope.deleteWaitingState = function(waitingState, index) {
- if ($window.confirm("Êtes-vous sûr de vouloir supprimer cet état d'attente ?")) {
- $scope.waitingStates.splice(index, 1);
-
- // suppression de cet etat d'attente dans les mail folder (sinon, ca fait
- // un resauvegarde d'un etat d'attente supprimé et donc un bug)
- removeWaitingStateFromMailFolder(waitingState, $scope.mailFolders);
- }
- };
-
// suppression de cet etat d'attente dans les mail folder (sinon, ca fait
// un resauvegarde d'un etat d'attente supprimé et donc un bug)
var removeWaitingStateFromMailFolder = function(waitingState, mailFolders) {
@@ -266,6 +255,17 @@
}
};
+ // suppression d'un etat d'attente non utilisé
+ $scope.deleteWaitingState = function(waitingState, index) {
+ if ($window.confirm("Êtes-vous sûr de vouloir supprimer cet état d'attente ?")) {
+ $scope.waitingStates.splice(index, 1);
+
+ // suppression de cet etat d'attente dans les mail folder (sinon, ca fait
+ // un resauvegarde d'un etat d'attente supprimé et donc un bug)
+ removeWaitingStateFromMailFolder(waitingState, $scope.mailFolders);
+ }
+ };
+
// selection/deselection d'une action
$scope.changeWaitingStateValidAction = function(action) {
var index = $scope.selectedWaitingState.validFormDisabledActions.indexOf(action);
@@ -1321,4 +1321,4 @@
$('#tabs a[href="' + current + '"]').tab('show');
}
}
-})
\ No newline at end of file
+});
1
0
03 Sep '14
Author: echatellier
Date: 2014-09-03 18:03:33 +0200 (Wed, 03 Sep 2014)
New Revision: 602
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/602
Log:
Fix somes sonar errors
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/migration/FlywayMigrationTest.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/EditAttachmentAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenAttachmentAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReplyAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenChooseAttachmentToPrintAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenMailFolderChooserAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenReplyFormAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenSearchToGroupAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/ButtonHistory.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/ButtonDemandReplies.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LogoutAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceSupport.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -27,15 +27,10 @@
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaPersistenceContext;
import com.franciaflex.faxtomail.services.service.ClientService;
-import com.franciaflex.faxtomail.services.service.ClientServiceImpl;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
-import com.franciaflex.faxtomail.services.service.ConfigurationServiceImpl;
import com.franciaflex.faxtomail.services.service.EmailService;
-import com.franciaflex.faxtomail.services.service.EmailServiceImpl;
import com.franciaflex.faxtomail.services.service.MailFolderService;
-import com.franciaflex.faxtomail.services.service.MailFolderServiceImpl;
import com.franciaflex.faxtomail.services.service.ReferentielService;
-import com.franciaflex.faxtomail.services.service.ReferentielServiceImpl;
import java.util.Date;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -29,11 +29,13 @@
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -534,7 +536,7 @@
// generate output content
String separator = ";";
- try (Writer ediWriter = new BufferedWriter(new FileWriter(ediFile))) {
+ try (Writer ediWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(ediFile), StandardCharsets.UTF_8))) {
ediWriter.write("%BEGIN_ENTETE_QUOTE\n");
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -33,12 +33,9 @@
import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hibernate.Hibernate;
import org.nuiton.util.pagination.PaginationParameter;
-import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
@@ -53,8 +50,6 @@
*/
public class MailFolderServiceImpl extends FaxToMailServiceSupport implements MailFolderService {
- private static final Log log = LogFactory.getLog(MailFolderServiceImpl.class);
-
@Override
public MailFolder getFolderForRecipient(String recipient) {
MailFilterTopiaDao filterTopiaDao = getPersistenceContext().getMailFilterDao();
@@ -265,8 +260,7 @@
List<MailFolder> roots = dao.forParentEquals(null).findAll();
for (MailFolder root : roots) {
- Collection<MailFolder> mailFolders = getFoldersWithWaitingState(root, new HashSet<WaitingState>(),
- new HashSet<DemandType>(), requiredWaitingStates);
+ Collection<MailFolder> mailFolders = getFoldersWithWaitingState(root, new HashSet<WaitingState>(), requiredWaitingStates);
result.addAll(mailFolders);
}
@@ -275,7 +269,6 @@
protected Collection<MailFolder> getFoldersWithWaitingState(MailFolder folder,
Collection<WaitingState> parentWaitingState,
- Collection<DemandType> parentDemandType,
Set<WaitingState> requiredWaitingStates) {
Collection<WaitingState> waitingStates = folder.getWaitingStates();
if (CollectionUtils.isEmpty(waitingStates)) {
@@ -283,12 +276,6 @@
} else {
parentWaitingState = waitingStates;
}
- Collection<DemandType> demandTypes = folder.getDemandTypes();
- if (CollectionUtils.isEmpty(demandTypes)) {
- demandTypes = parentDemandType;
- } else {
- parentDemandType = demandTypes;
- }
// resursion
Collection<MailFolder> result = new HashSet<>();
@@ -296,7 +283,7 @@
if (children != null) {
for (MailFolder child : children) {
Collection<MailFolder> subMailFolders = getFoldersWithWaitingState(child,
- parentWaitingState, parentDemandType, requiredWaitingStates);
+ parentWaitingState, requiredWaitingStates);
result.addAll(subMailFolders);
}
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -54,7 +54,6 @@
import com.franciaflex.faxtomail.persistence.entities.Range;
import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.WaitingState;
-import com.franciaflex.faxtomail.persistence.entities.WaitingStateTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.franciaflex.faxtomail.services.service.imports.ClientImportModel;
import com.franciaflex.faxtomail.services.service.imports.DemandTypeImportModel;
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/validators/FaxToMailEmailValidator.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -33,7 +33,7 @@
// see XW-371
public static final String EMAIL_ADDRESS_PATTERN =
- "\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|fax)$\\b";
+ "\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|fax)$\\b";
public FaxToMailEmailValidator() {
setRegex(EMAIL_ADDRESS_PATTERN);
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MailFolderServiceTest.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -28,9 +28,6 @@
import java.util.List;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/migration/FlywayMigrationTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/migration/FlywayMigrationTest.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/migration/FlywayMigrationTest.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,7 +26,6 @@
import java.io.File;
import java.io.IOException;
-import java.math.BigInteger;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/AbstractFaxToMailAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -30,9 +30,6 @@
import org.jdesktop.beans.AbstractBean;
import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
-import javax.swing.*;
-import java.awt.*;
-
/**
* FaxToMail base action.
*
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -31,8 +31,6 @@
import com.franciaflex.faxtomail.ui.swing.content.demande.QuantitiesByRangeUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.QuantitiesByRangeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.awt.*;
import java.util.ArrayList;
@@ -47,8 +45,6 @@
*/
public class ComputeQuantitiesByRangeAction extends AbstractFaxToMailAction<QuantitiesByRangeUIModel, QuantitiesByRangeUI, QuantitiesByRangeUIHandler> {
- private static final Log log = LogFactory.getLog(ComputeQuantitiesByRangeAction.class);
-
public ComputeQuantitiesByRangeAction(QuantitiesByRangeUIHandler handler) {
super(handler, false);
setActionDescription(t("faxtomail.action.computeQuantitiesByRange.tip"));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/EditAttachmentAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/EditAttachmentAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/EditAttachmentAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -32,8 +32,6 @@
import com.franciaflex.faxtomail.ui.swing.content.pdfeditor.PDFEditorUI;
import com.franciaflex.faxtomail.ui.swing.content.pdfeditor.PDFEditorUIModel;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -46,8 +44,6 @@
*/
public class EditAttachmentAction extends AbstractFaxToMailAction<AttachmentEditorUIModel, AttachmentEditorUI, AttachmentEditorUIHandler> {
- private static final Log log = LogFactory.getLog(EditAttachmentAction.class);
-
protected Attachment attachment;
protected PDFEditorUI dialogContent;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -62,8 +62,6 @@
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import com.itextpdf.text.pdf.PdfWriter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n.t;
@@ -73,8 +71,6 @@
*/
public class GenerateAnnotatedAttachmentAction extends AbstractFaxToMailAction<PDFEditorUIModel, PDFEditorUI, PDFEditorUIHandler> {
- private static final Log log = LogFactory.getLog(GenerateAnnotatedAttachmentAction.class);
-
public GenerateAnnotatedAttachmentAction(PDFEditorUIHandler handler) {
super(handler, true);
setActionDescription(t("faxtomail.action.generateAnnotatedAttachment.tip"));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenAttachmentAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenAttachmentAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenAttachmentAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -29,9 +29,6 @@
import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentEditorUIModel;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import static org.nuiton.i18n.I18n.t;
/**
@@ -40,8 +37,6 @@
*/
public class OpenAttachmentAction extends AbstractFaxToMailAction<AttachmentEditorUIModel, AttachmentEditorUI, AttachmentEditorUIHandler> {
- private static final Log log = LogFactory.getLog(OpenAttachmentAction.class);
-
protected Attachment attachment;
protected boolean original;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -31,8 +31,6 @@
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.exceptions.AlreadyLockedMailException;
import com.franciaflex.faxtomail.services.service.exceptions.FolderNotReadableException;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUI;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -32,7 +32,6 @@
import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUI;
import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUIModel;
-import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -39,8 +39,6 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import org.apache.commons.io.Charsets;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -57,8 +55,6 @@
*/
public class PrintOnDefaultPrinterAction extends AbstractFaxToMailAction {
- private static final Log log = LogFactory.getLog(PrintOnDefaultPrinterAction.class);
-
protected Multimap<DemandeUIModel, AttachmentFile> attachmentsToPrintByDemand;
protected boolean take;
protected boolean printDemandDetails;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReplyAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReplyAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ReplyAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -50,7 +50,6 @@
public class ReplyAction extends AbstractFaxToMailAction<ReplyFormUIModel, ReplyFormUI, ReplyFormUIHandler> {
private static final Log log = LogFactory.getLog(ReplyAction.class);
- private EmailService emailService;
public ReplyAction(ReplyFormUIHandler handler) {
super(handler, false);
@@ -63,7 +62,7 @@
ReplyFormUIModel model = getModel();
FaxToMailServiceContext serviceContext = getContext().newServiceContext();
- emailService = serviceContext.getEmailService();
+ EmailService emailService = serviceContext.getEmailService();
DemandeUIModel originalDemand = getModel().getOriginalDemand();
Collection<AttachmentFile> attachmentFiles = Collections2.transform(model.getAttachments(), new Function<ReplyAttachmentModel, AttachmentFile>() {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenChooseAttachmentToPrintAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenChooseAttachmentToPrintAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenChooseAttachmentToPrintAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -25,10 +25,8 @@
*/
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.print.AttachmentToPrintChooserUI;
-import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUI;
import java.awt.*;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenMailFolderChooserAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenMailFolderChooserAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenMailFolderChooserAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,8 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.MailAction;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUI;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenReplyFormAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenReplyFormAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenReplyFormAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,8 +26,6 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
-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.DemandesUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenSearchToGroupAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenSearchToGroupAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveAndOpenSearchToGroupAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.search.SearchToGroupUI;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,7 +24,6 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.service.EmailService;
@@ -34,14 +33,11 @@
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
import javax.swing.*;
-import java.util.Date;
-
import static org.nuiton.i18n.I18n.t;
/**
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -45,7 +45,6 @@
import javax.swing.*;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
/**
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -35,8 +35,6 @@
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.HighlighterFactory;
@@ -69,8 +67,6 @@
*/
public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<AttachmentEditorUIModel, AttachmentEditorUI> {
- private static final Log log = LogFactory.getLog(AttachmentEditorUIHandler.class);
-
protected OpenAttachmentAction openAttachmentAction = new OpenAttachmentAction(this);
protected EditAttachmentAction editAttachmentAction = new EditAttachmentAction(this);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -30,7 +30,6 @@
import org.nuiton.util.beans.BinderFactory;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
/**
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -28,6 +28,7 @@
import java.beans.PropertyChangeListener;
import java.io.ByteArrayInputStream;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -977,7 +978,7 @@
protected void decomposeEmail() {
try {
// ce code peut provoquer une NPE avec les données de test
- Message message = new MimeMessage(null, new ByteArrayInputStream(getOriginalEmail().getBytes()));
+ Message message = new MimeMessage(null, new ByteArrayInputStream(getOriginalEmail().getBytes(StandardCharsets.UTF_8)));
subject = message.getSubject();
toRecipients = new ArrayList<String>();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -39,8 +39,6 @@
import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAction;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
import org.nuiton.jaxx.application.swing.ApplicationUI;
import org.nuiton.jaxx.application.swing.action.AbstractApplicationAction;
@@ -64,8 +62,6 @@
*/
public class DemandesUIHandler extends AbstractFaxToMailUIHandler<DemandesUIModel, DemandesUI> implements TabContainerHandler, CloseableUI {
- private static final Log log = LogFactory.getLog(DemandesUIHandler.class);
-
protected DelegateTabContainerHandler delegateTabHandler;
protected Configuration config;
protected SaveDemandeAction saveDemandeAction;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,8 +24,6 @@
* #L%
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.beans.AbstractBean;
import java.util.ArrayList;
@@ -37,8 +35,6 @@
*/
public class DemandesUIModel extends AbstractBean {
- private static final Log log = LogFactory.getLog(DemandesUIModel.class);
-
public static final String PROPERTY_CURRENT_DEMAND = "currentDemand";
public static final String PROPERTY_TRANSMIT_ENABLED = "transmitEnabled";
public static final String PROPERTY_ARCHIVE_ENABLED = "archiveEnabled";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/DemandGroupUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,25 +24,15 @@
* #L%
*/
-import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
-import com.franciaflex.faxtomail.services.service.exceptions.AlreadyLockedMailException;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.actions.OpenGroupedDemandAction;
-import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUI;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler;
import com.google.common.collect.Iterables;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.HighlighterFactory;
-import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
import javax.swing.*;
import javax.swing.event.TableModelEvent;
@@ -59,16 +49,12 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import static org.nuiton.i18n.I18n.t;
-
/**
* @author Kevin Morin (Code Lutin)
*
*/
public class DemandGroupUIHandler extends AbstractToolbarPopupHandler<DemandeUIModel, DemandGroupUI> {
- private final static Log log = LogFactory.getLog(DemandGroupUIHandler.class);
-
@Override
public void beforeInit(DemandGroupUI ui) {
super.beforeInit(ui);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/ButtonHistory.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/ButtonHistory.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/ButtonHistory.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,7 +26,6 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.History;
-import com.franciaflex.faxtomail.persistence.entities.Reply;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupButton;
@@ -36,7 +35,6 @@
import java.beans.PropertyChangeListener;
import java.util.Collection;
-import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
/**
@@ -71,7 +69,7 @@
popup.setModel(model);
if (model != null) {
popup.getModel().addPropertyChangeListener(Email.PROPERTY_HISTORY, listener);
- setText(getButtonText(model != null ? model.getHistory() : null));
+ setText(getButtonText(model.getHistory()));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -37,8 +37,6 @@
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXList;
import org.jdesktop.swingx.decorator.HighlighterFactory;
import org.nuiton.i18n.I18n;
@@ -60,8 +58,6 @@
*/
public class HistoryListUIHandler extends AbstractToolbarPopupHandler<DemandeUIModel, HistoryListUI> {
- private final static Log log = LogFactory.getLog(HistoryListUIHandler.class);
-
static {
n("faxtomail.demande.receptionDate.label");
n("faxtomail.demande.ediCodeNumber.label");
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/ButtonDemandReplies.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/ButtonDemandReplies.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/ButtonDemandReplies.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -77,7 +77,7 @@
popup.setModel(model);
if (model != null) {
popup.getModel().addPropertyChangeListener(Email.PROPERTY_REPLIES, listener);
- setText(getButtonText(model != null ? model.getReplies() : null));
+ setText(getButtonText(model.getReplies()));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,12 +26,15 @@
import static org.nuiton.i18n.I18n.t;
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Rectangle;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
import java.awt.geom.Rectangle2D;
import java.awt.image.RenderedImage;
import java.beans.PropertyChangeEvent;
@@ -40,12 +43,13 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
+import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
@@ -53,28 +57,27 @@
import javax.swing.JComponent;
import javax.swing.JPanel;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import jaxx.runtime.swing.ComponentMover;
import jaxx.runtime.swing.ComponentResizer;
import jaxx.runtime.swing.JAXXButtonGroup;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.swing.util.Cancelable;
+import org.nuiton.jaxx.application.swing.util.CloseableUI;
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentFile;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.ui.swing.actions.GenerateAnnotatedAttachmentAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
-import org.nuiton.jaxx.application.swing.util.Cancelable;
-import org.nuiton.jaxx.application.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.JImagePanel;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.Multimap;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
@@ -199,20 +202,23 @@
}
}
if (FaxToMailUIUtil.isFileAPDF(attachmentFile)) {
+ RandomAccessFile raf = null;
try {
- RandomAccessFile raf = new RandomAccessFile(file, "r");
+ raf = new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
pdf = new PDFFile(buf);
model.setPageNumber(pdf.getNumPages());
model.setCurrentPageIndex(1);
-
+ raf.close();
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("", e);
}
getContext().getErrorHelper().showErrorDialog(t("faxtomail.pdfEditor.readPdf.error"));
+ } finally {
+ IOUtils.closeQuietly(raf);
}
}
getUI().setCursor(Cursor.getDefaultCursor());
@@ -535,31 +541,42 @@
document.open();
if (FaxToMailUIUtil.isFileATxt(attachmentFile)) {
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- StringBuilder text = new StringBuilder();
- while (br.readLine() != null) {
- text.append(br.readLine()).append("\n");
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
+ StringBuilder text = new StringBuilder();
+ while (br.readLine() != null) {
+ text.append(br.readLine()).append("\n");
+ }
+ document.add(new Paragraph(text.toString()));
+ br.close();
+ } finally {
+ IOUtils.closeQuietly(br);
}
- document.add(new Paragraph(text.toString()));
} else if (FaxToMailUIUtil.isFileATif(attachmentFile)) {
- FileInputStream fis = new FileInputStream(file);
- FileChannel channel = fis.getChannel();
- ByteBuffer buffer = ByteBuffer.allocate((int) channel.size());
- channel.read(buffer);
- SeekableStream stream = new ByteArraySeekableStream(buffer.array());
- String[] names = ImageCodec.getDecoderNames(stream);
- ImageDecoder tifImageDecoder = ImageCodec.createImageDecoder(names[0], stream, null);
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(file);
+ FileChannel channel = fis.getChannel();
+ ByteBuffer buffer = ByteBuffer.allocate((int) channel.size());
+ channel.read(buffer);
+ SeekableStream stream = new ByteArraySeekableStream(buffer.array());
+ String[] names = ImageCodec.getDecoderNames(stream);
+ ImageDecoder tifImageDecoder = ImageCodec.createImageDecoder(names[0], stream, null);
- for (int i = 0 ; i < tifImageDecoder.getNumPages() ; i++) {
- RenderedImage renderedImage = tifImageDecoder.decodeAsRenderedImage(i);
- java.awt.Image awtImage = PlanarImage.wrapRenderedImage(renderedImage).getAsBufferedImage();
- document.newPage();
- com.itextpdf.text.Image image = com.itextpdf.text.Image.getInstance(writer, awtImage, 1.0f);
- image.scaleToFit(PageSize.A4.getWidth() - document.leftMargin() - document.rightMargin(),
- PageSize.A4.getHeight() - document.topMargin() - document.bottomMargin());
- document.add(image);
+ for (int i = 0 ; i < tifImageDecoder.getNumPages() ; i++) {
+ RenderedImage renderedImage = tifImageDecoder.decodeAsRenderedImage(i);
+ java.awt.Image awtImage = PlanarImage.wrapRenderedImage(renderedImage).getAsBufferedImage();
+ document.newPage();
+ com.itextpdf.text.Image image = com.itextpdf.text.Image.getInstance(writer, awtImage, 1.0f);
+ image.scaleToFit(PageSize.A4.getWidth() - document.leftMargin() - document.rightMargin(),
+ PageSize.A4.getHeight() - document.topMargin() - document.bottomMargin());
+ document.add(image);
+ }
+ fis.close();
+ } finally {
+ IOUtils.closeQuietly(fis);
}
} else {
@@ -606,7 +623,6 @@
}
public void print() {
- Multimap<DemandeUIModel, AttachmentFile> attachmentsToPrint = HashMultimap.create();
PDFEditorUIModel model = getModel();
AttachmentFile attachmentFile = model.getNotNullFile();
boolean print = FaxToMailUIUtil.print(attachmentFile, false);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,8 +24,6 @@
* #L%
*/
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,8 +26,6 @@
import com.franciaflex.faxtomail.persistence.entities.AttachmentFile;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.beans.AbstractBean;
import java.util.Collection;
@@ -39,8 +37,6 @@
*/
public class AttachmentToPrintChooserUIModel extends AbstractBean {
- private static final Log log = LogFactory.getLog(AttachmentToPrintChooserUIModel.class);
-
public static final String PROPERTY_ATTACHEMENTS_TO_PRINT = "attachmentsToPrint";
protected DemandeUIModel demand;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -32,8 +32,6 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.beans.AbstractSerializableBean;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -47,8 +45,6 @@
*/
public class ReplyFormUIModel extends AbstractSerializableBean {
- private static final Log log = LogFactory.getLog(ReplyFormUIModel.class);
-
public static final String PROPERTY_TO = "to";
public static final String PROPERTY_CC = "cc";
public static final String PROPERTY_CCI = "cci";
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-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -39,7 +39,6 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
-import java.util.EnumSet;
import java.util.List;
import javax.swing.JComponent;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -31,7 +31,6 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
-import java.util.EnumSet;
import java.util.List;
import javax.swing.JComponent;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -25,8 +25,6 @@
import java.util.Date;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import org.nuiton.util.pagination.PaginationParameter;
@@ -49,8 +47,6 @@
*/
public class SearchUIModel extends AbstractFaxToMailBeanUIModel<EmailFilter, SearchUIModel> {
- private static final Log log = LogFactory.getLog(SearchUIModel.class);
-
public static final String PROPERTY_RESULTS = "results";
public static final String PROPERTY_MENU_ENABLED = "menuEnabled";
public static final String PROPERTY_GROUP_ENABLED = "groupEnabled";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -37,8 +37,6 @@
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.swing.util.Cancelable;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -55,8 +53,6 @@
*/
public class MailFolderChooserUIHandler extends AbstractFaxToMailUIHandler<MailFolderChooserUIModel, MailFolderChooserUI> implements Cancelable {
- private static final Log log = LogFactory.getLog(MailFolderChooserUIHandler.class);
-
@Override
public void afterInit(MailFolderChooserUI mailFolderChooserUI) {
initUI(mailFolderChooserUI);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailBeanUIModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,12 +24,8 @@
import org.jdesktop.beans.AbstractSerializableBean;
import org.nuiton.jaxx.application.listener.PropagatePropertyChangeListener;
-import org.nuiton.util.CollectionUtil;
import org.nuiton.util.beans.Binder;
-import java.util.Collection;
-import java.util.List;
-
/**
* Abstract UI model to edit a bean.
*
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -34,7 +34,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
-import java.util.EnumSet;
import java.util.List;
import javax.swing.JPopupMenu;
@@ -47,8 +46,6 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
@@ -87,8 +84,6 @@
*/
public abstract class AbstractFaxToMailDemandListHandler<M, UI extends FaxToMailUI<M, ?>> extends AbstractFaxToMailUIHandler<M, UI> {
- private static final Log log = LogFactory.getLog(AbstractFaxToMailDemandListHandler.class);
-
protected NuitonValidator<DemandeUIModel> demandeUIModelNuitonValidator = NuitonValidatorFactory.newValidator(DemandeUIModel.class);;
public void initDemandeTable(final JXTable table, boolean sortable) {
Modified: 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 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/CheckBoxListCellRenderer.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,7 +26,6 @@
import javax.swing.*;
import javax.swing.border.*;
-import javax.swing.plaf.ComponentUI;
import java.awt.*;
@@ -36,8 +35,6 @@
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 static org.nuiton.i18n.I18n.t;
@@ -77,8 +74,6 @@
*/
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
@@ -129,15 +124,15 @@
String decorate = "";
JComponent component = label;
- ComponentUI ui = label.getUI();
+ //ComponentUI ui = label.getUI();
final String noneLabel = t("faxtomail.common.none.label");
- if (value == null || value != null && HasLabel.class.isAssignableFrom(value.getClass())) {
+ if (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();
+ //ui = checkbox.getUI();
} else {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -25,8 +25,6 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
@@ -44,8 +42,6 @@
*/
public class DemandeTableModel extends AbstractApplicationTableModel<DemandeUIModel> {
- private static final Log log = LogFactory.getLog(DemandeTableModel.class);
-
public static final Map<MailField, ColumnIdentifier<Email>> COLUMN_IDENTIFIERS = new HashMap<MailField, ColumnIdentifier<Email>>() {{
put(MailField.SENDER,
ColumnIdentifier.<Email>newReadOnlyId(
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -29,7 +29,6 @@
import java.util.Map;
import java.util.Set;
-import com.franciaflex.faxtomail.services.service.LdapServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -26,8 +26,6 @@
import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
@@ -38,8 +36,6 @@
})
public class IndexAction extends FaxToMailActionSupport {
- private static final Log log = LogFactory.getLog(IndexAction.class);
-
@Override
public String execute() {
return SUCCESS;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LoginAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,8 +24,6 @@
* #L%
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
@@ -36,8 +34,6 @@
public class LoginAction extends FaxToMailActionSupport {
- private static final Log log = LogFactory.getLog(LoginAction.class);
-
protected LdapService ldapService;
protected String login;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LogoutAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LogoutAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/LogoutAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,8 +24,6 @@
* #L%
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
@@ -33,8 +31,6 @@
public class LogoutAction extends FaxToMailActionSupport {
- private static final Log log = LogFactory.getLog(LogoutAction.class);
-
@Override
@Action(results = {
@Result(type = "redirectAction", params = {"actionName", "index", "namespace", "/"})})
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -29,8 +29,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
@@ -67,8 +65,6 @@
})
public class ConfigurationAction extends FaxToMailActionSupport implements Preparable {
- private static final Log log = LogFactory.getLog(ConfigurationAction.class);
-
protected ConfigurationService configurationService;
protected UserService userService;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -28,8 +28,6 @@
import java.io.FileInputStream;
import java.io.InputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
@@ -46,8 +44,6 @@
})
public class ImportAction extends FaxToMailActionSupport implements Preparable {
- private static final Log log = LogFactory.getLog(ImportAction.class);
-
protected ReferentielService referentielService;
protected File clientFile;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/LdapAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -24,9 +24,6 @@
* #L%
*/
-import com.franciaflex.faxtomail.services.service.LdapServiceImpl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
@@ -49,8 +46,6 @@
})
public class LdapAction extends FaxToMailActionSupport implements Preparable {
- private static final Log log = LogFactory.getLog(LdapAction.class);
-
protected UserService userService;
protected long userCount;
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-09-03 15:00:34 UTC (rev 601)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-09-03 16:03:33 UTC (rev 602)
@@ -32,8 +32,6 @@
import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
@@ -53,8 +51,6 @@
})
public class UserFolderAction extends FaxToMailActionSupport {
- private static final Log log = LogFactory.getLog(UserFolderAction.class);
-
protected ConfigurationService configurationService;
protected MailFolderService mailFolderService;
1
0
r601 - trunk/faxtomail-service/src/main/resources/db/migration/sqlserver
by echatellier@users.forge.codelutin.com 03 Sep '14
by echatellier@users.forge.codelutin.com 03 Sep '14
03 Sep '14
Author: echatellier
Date: 2014-09-03 17:00:34 +0200 (Wed, 03 Sep 2014)
New Revision: 601
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/601
Log:
Correction du script de migration pour sql server
Modified:
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql
Modified: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 14:24:11 UTC (rev 600)
+++ trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 15:00:34 UTC (rev 601)
@@ -1,20 +1,22 @@
-- remove contraints
alter table email drop constraint FK_4q69gdpfr96aqig9ephikqxxr;
-alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9;
+--sql serveur n'utilise pas le nom donne :(
+--alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9;
alter table etatattentes_mailfolder drop constraint FK_3gi1yi1o932oe5t8ikcnsd3ef;
alter table etatattentes_mailfolder drop constraint FK_hsynjnyke7heuntkxkks9voxy;
alter table history_fields drop constraint FK_qoup2jo9smmju8hgou9sq5108;
-DROP INDEX idx_MailFolder_etatAttentes;
-DROP INDEX email_etatAttente_idx;
+DROP INDEX etatattentes_mailfolder.idx_MailFolder_etatAttentes;
+DROP INDEX email.email_etatAttente_idx;
GO
-- renommage etat attente
-ALTER TABLE email RENAME etatAttente TO waitingState;
-ALTER TABLE etatAttente RENAME TO waitingState;
-ALTER TABLE etatattentes_mailfolder RENAME TO mailfolder_waitingstates;
-ALTER TABLE mailfolder_waitingstates RENAME etatAttentes TO waitingStates;
-ALTER TABLE mailFolder RENAME useCurrentLevelEtatAttente TO useCurrentLevelWaitingState;
+EXEC sp_rename 'etatAttente', 'waitingState';
+EXEC sp_rename 'etatattentes_mailfolder', 'mailfolder_waitingstates';
GO
+EXEC sp_rename 'email.etatAttente', 'waitingState', 'COLUMN';
+EXEC sp_rename 'mailfolder_waitingstates.etatAttentes', 'waitingStates', 'COLUMN';
+EXEC sp_rename 'mailFolder.useCurrentLevelEtatAttente', 'useCurrentLevelWaitingState', 'COLUMN';
+GO
-- migration des topia id
update waitingState set topiaId = replace(topiaId, 'EtatAttente', 'WaitingState');
@@ -27,7 +29,8 @@
update DemandType set requiredFields = replace(requiredFields, 'ETAT_ATTENTE', 'WAITING_STATE') where requiredFields is not null;
-- restore constraints
-alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label);
+--sql serveur n'utilise pas le nom donne :(
+--alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label);
alter table email
add constraint FK_nfplqi5mxyfuxgkpe3rb83put
foreign key (waitingState)
@@ -46,8 +49,8 @@
-- Reply
delete from reply;
-ALTER TABLE reply ALTER sentDate SET NOT NULL;
-ALTER TABLE reply ALTER subject SET NOT NULL;
+ALTER TABLE reply ALTER COLUMN sentDate datetime2 NOT NULL;
+ALTER TABLE reply ALTER COLUMN subject varchar(MAX) NOT NULL;
ALTER TABLE reply ADD sender varchar(MAX) not null;
ALTER TABLE reply ADD recipient varchar(MAX) not null;
ALTER TABLE reply ADD replyContent varchar(255) not null;
1
0
r600 - in trunk: faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by echatellier@users.forge.codelutin.com 03 Sep '14
by echatellier@users.forge.codelutin.com 03 Sep '14
03 Sep '14
Author: echatellier
Date: 2014-09-03 16:24:11 +0200 (Wed, 03 Sep 2014)
New Revision: 600
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/600
Log:
Retrait du chargement de l'historique pour la liste.
Utilisation du champ lastAttachmentOpener pour afficher le nom dans le tableau.
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-03 14:02:15 UTC (rev 599)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-03 14:24:11 UTC (rev 600)
@@ -637,8 +637,8 @@
Email.PROPERTY_WAITING_STATE,
Email.PROPERTY_TAKEN_BY,
Email.PROPERTY_REPLIES,
- Email.PROPERTY_ATTACHMENT,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER
+ Email.PROPERTY_ATTACHMENT
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER
).findPage(page);
} else {
result = dao.forMailFolderEquals(folder)
@@ -652,7 +652,7 @@
Email.PROPERTY_TAKEN_BY
//Email.PROPERTY_REPLIES,
//Email.PROPERTY_ATTACHMENT,
- //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER*/
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER
).findPage(page);
@@ -671,12 +671,12 @@
//Hibernate.initialize(email.getTakenBy());
Hibernate.initialize(email.getReplies());
Hibernate.initialize(email.getAttachment());
- List<History> histories = email.getHistory();
+ /*List<History> histories = email.getHistory();
if (histories != null) {
for (History history : histories) {
Hibernate.initialize(history.getFaxToMailUser());
}
- }
+ }*/
}
}
@@ -737,6 +737,12 @@
email.addHistory(history);
+ // pour eviter de charger tout l'historique dans la liste, on duplique l'information de
+ // dernier ouvreur de PJ directement dans l'email
+ if (type == HistoryType.ATTACHMENT_OPENING) {
+ email.setLastAttachmentOpener(user);
+ }
+
email = emailDao.update(email);
getPersistenceContext().commit();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-09-03 14:02:15 UTC (rev 599)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-09-03 14:24:11 UTC (rev 600)
@@ -117,7 +117,7 @@
List<DemandeUIModel> demands = new ArrayList<DemandeUIModel>();
for (Email email : emails) {
DemandeUIModel demand = new DemandeUIModel();
- demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_EMAIL_GROUP));
+ demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_EMAIL_GROUP, Email.PROPERTY_HISTORY));
// on ajoute toutes les lignes de rangeRow,
// qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java 2014-09-03 14:02:15 UTC (rev 599)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentCellEditor.java 2014-09-03 14:24:11 UTC (rev 600)
@@ -122,7 +122,7 @@
context.getCurrentUser(),
new Date(),
filename);
- model.fromEntityIncluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY));
+ model.fromEntity(email);
}
}
@@ -135,7 +135,7 @@
context.getCurrentUser(),
new Date(),
FaxToMailUIUtil.getEditedFileName(attachment.getOriginalFileName()));
- model.fromEntityIncluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY));
+ model.fromEntity(email);
}
};
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-03 14:02:15 UTC (rev 599)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-03 14:24:11 UTC (rev 600)
@@ -636,6 +636,22 @@
return lastAttachmentOpeningInThisFolderHistory;
}
+ /**
+ * Utilisé depuis la liste des mails seulement pour des raisons de performances sans charger
+ * l'historique.
+ *
+ * Contient la même information que {@code #lastAttachmentOpeningInThisFolderHistory} normalement.
+ *
+ * @return lastAttachmentOpener
+ */
+ public FaxToMailUser getLastAttachmentOpener() {
+ return editObject.getLastAttachmentOpener();
+ }
+
+ public void setLastAttachmentOpener(FaxToMailUser lastAttachmentOpener) {
+ editObject.setLastAttachmentOpener(lastAttachmentOpener);
+ }
+
public FaxToMailUser getLastAttachmentOpeningInThisFolderUser() {
History history = getLastAttachmentOpeningInThisFolderHistory();
return history != null ? history.getFaxToMailUser() : null;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 14:02:15 UTC (rev 599)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 14:24:11 UTC (rev 600)
@@ -169,7 +169,7 @@
put(MailField.LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
ColumnIdentifier.<Email>newId(
- DemandeUIModel.PROPERTY_LAST_ATTACHMENT_OPENING_IN_THIS_FOLDER_USER,
+ Email.PROPERTY_LAST_ATTACHMENT_OPENER,
n("faxtomail.demandeList.table.header.lastAttachmentOpeningUser"),
n("faxtomail.demandeList.table.header.lastAttachmentOpeningUser.tip")));
1
0
r599 - trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job
by echatellier@users.forge.codelutin.com 03 Sep '14
by echatellier@users.forge.codelutin.com 03 Sep '14
03 Sep '14
Author: echatellier
Date: 2014-09-03 16:02:15 +0200 (Wed, 03 Sep 2014)
New Revision: 599
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/599
Log:
Fix compile error
Modified:
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-09-03 13:58:29 UTC (rev 598)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-09-03 14:02:15 UTC (rev 599)
@@ -449,6 +449,7 @@
emailService.saveEmail(email,
attachments,
+ null,
email.getClient() != null ? email.getClient().getCode() : null,
null,
modifiedProperties.toArray(new String[modifiedProperties.size()]));
1
0
03 Sep '14
Author: echatellier
Date: 2014-09-03 15:58:29 +0200 (Wed, 03 Sep 2014)
New Revision: 598
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/598
Log:
Extraction de la source des r?\195?\169ponses dans une entit?\195?\169 lazy
Modification des fields de l'history en json
Ajout de champs dans les r?\195?\169ponses
Renommage de EtatAttente en WaitingState
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryImpl.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/WaitingStateTopiaDao.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/WaitingStateImportModel.java
trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_597__mise_a_jour_performances.sql
trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_597__mise_a_jour_performances.sql
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql
Removed:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EtatAttenteTopiaDao.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EtatAttenteImportModel.java
Modified:
trunk/faxtomail-persistence/pom.xml
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-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ArchiveImportModel.java
trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql
trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql
trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql
trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql
trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql
trunk/faxtomail-service/src/main/resources/pdf/demande.odt
trunk/faxtomail-service/src/main/resources/pdf/demande.pdf
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryItemModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
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/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/content/transmit/MailFolderChooserUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
trunk/faxtomail-ui-swing/src/main/resources/icons/action-folder_edit.png
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified: trunk/faxtomail-persistence/pom.xml
===================================================================
--- trunk/faxtomail-persistence/pom.xml 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/pom.xml 2014-09-03 13:58:29 UTC (rev 598)
@@ -112,6 +112,11 @@
<groupId>org.swinglabs.swingx</groupId>
<artifactId>swingx-common</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
</dependencies>
<build>
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailFilter.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -29,22 +29,16 @@
import org.jdesktop.beans.AbstractSerializableBean;
-import com.franciaflex.faxtomail.persistence.entities.DemandType;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
-import com.franciaflex.faxtomail.persistence.entities.Priority;
-
public class EmailFilter extends AbstractSerializableBean {
/** serialVersionUID. */
private static final long serialVersionUID = 7039570396201559352L;
public static final String PROPERTY_SENDER = "sender";
- //public static final String PROPERTY_RECIPIENT = "recipient";
public static final String PROPERTY_DEMAND_OBJECT = "demandObject";
public static final String PROPERTY_MESSAGE = "message";
public static final String PROPERTY_BODY = "body";
- public static final String PROPERTY_ETAT_ATTENTE = "etatAttente";
+ public static final String PROPERTY_WAITING_STATES = "WaitingStates";
public static final String PROPERTY_GAMME = "gamme";
public static final String PROPERTY_TAKEN_BY = "takenBy";
public static final String PROPERTY_PRIORITY = "priority";
@@ -53,7 +47,6 @@
public static final String PROPERTY_EDI_CODE_NUMBER = "ediCodeNumber";
public static final String PROPERTY_PROJECT_REFERENCE = "projectReference";
public static final String PROPERTY_LOCAL_REFERENCE = "localReference";
-// public static final String PROPERTY_COMMAND_NUMBER = "commandNumber";
public static final String PROPERTY_MODIFIED_BY = "modifiedBy";
public static final String PROPERTY_PRINTING_BY = "printingBy";
public static final String PROPERTY_ARCHIVED_BY = "archivedBy";
@@ -75,15 +68,13 @@
protected String sender;
- //protected String recipient;
-
protected String demandObject;
protected String message;
protected String body;
- protected List<EtatAttente> etatAttente;
+ protected List<WaitingState> waitingStates;
protected List<Priority> priority;
@@ -94,8 +85,6 @@
protected List<Range> gamme;
protected String ediCodeNumber;
-
-// protected String commandNumber;
protected String projectReference;
@@ -149,16 +138,6 @@
firePropertyChange(PROPERTY_SENDER, oldValue, sender);
}
- /*public String getRecipient() {
- return recipient;
- }
-
- public void setRecipient(String recipient) {
- String oldValue = this.recipient;
- this.recipient = recipient;
- firePropertyChange(PROPERTY_RECIPIENT, oldValue, recipient);
- }*/
-
public String getDemandObject() {
return demandObject;
}
@@ -169,13 +148,13 @@
firePropertyChange(PROPERTY_DEMAND_OBJECT, oldValue, demandObject);
}
- public List<EtatAttente> getEtatAttente() {
- return etatAttente;
+ public List<WaitingState> getWaitingStates() {
+ return waitingStates;
}
- public void setEtatAttente(List<EtatAttente> etatAttente) {
- this.etatAttente = etatAttente;
- firePropertyChange(PROPERTY_ETAT_ATTENTE, null, etatAttente);
+ public void setWaitingStates(List<WaitingState> waitingStates) {
+ this.waitingStates = waitingStates;
+ firePropertyChange(PROPERTY_WAITING_STATES, null, waitingStates);
}
public FaxToMailUser getTakenBy() {
@@ -344,16 +323,6 @@
firePropertyChange(PROPERTY_GAMME, null, gamme);
}
-// public String getCommandNumber() {
-// return commandNumber;
-// }
-//
-// public void setCommandNumber(String commandNumber) {
-// String oldValue = this.commandNumber;
-// this.commandNumber = commandNumber;
-// firePropertyChange(PROPERTY_COMMAND_NUMBER, oldValue, commandNumber);
-// }
-
public String getLocalReference() {
return localReference;
}
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -61,8 +61,8 @@
*/
public PaginationResult<Email> search(EmailFilter emailFilter, Set<MailFolder> readMailFolders, PaginationParameter pagination) {
- StringBuilder query = new StringBuilder("FROM " + Email.class.getName() + " E");
- //StringBuilder query = new StringBuilder();
+ //StringBuilder query = new StringBuilder("FROM " + Email.class.getName() + " E");
+ StringBuilder query = new StringBuilder();
Map<String, Object> args = new HashMap<>();
// apply security
@@ -326,13 +326,13 @@
}
// email etat attente
- 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);
+ List<WaitingState> waitingStates = emailFilter.getWaitingStates();
+ if (CollectionUtils.isNotEmpty(waitingStates)) {
+ query.append(" AND (E." + Email.PROPERTY_WAITING_STATE + " IN (:" + EmailFilter.PROPERTY_WAITING_STATES + ")");
+ args.put(EmailFilter.PROPERTY_WAITING_STATES, waitingStates);
- if (etatAttente.contains(null)) {
- query.append(" OR E." + Email.PROPERTY_ETAT_ATTENTE + " IS NULL");
+ if (waitingStates.contains(null)) {
+ query.append(" OR E." + Email.PROPERTY_WAITING_STATE + " IS NULL");
}
query.append(")");
}
@@ -366,20 +366,20 @@
}
// add same fecth liste as emailService#getEmailForFolder()
- /*String hqlForFetchStep1 = "select E." + TopiaEntity.PROPERTY_TOPIA_ID + " FROM " + Email.class.getName() + " E " + query.toString();
+ String hqlForFetchStep1 = "select E." + TopiaEntity.PROPERTY_TOPIA_ID + " FROM " + Email.class.getName() + " E " + query.toString();
String hqlForFetchStep2 = "select distinct E FROM " + Email.class.getName() + " E " + addAllFecthes(
Email.PROPERTY_PRIORITY,
Email.PROPERTY_DEMAND_TYPE,
Email.PROPERTY_CLIENT,
- Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
- Email.PROPERTY_ETAT_ATTENTE,
- Email.PROPERTY_TAKEN_BY,
- Email.PROPERTY_REPLIES,
- Email.PROPERTY_ATTACHMENT,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS,
- Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL)
- + " WHERE E." + TopiaEntity.PROPERTY_TOPIA_ID + " in ( :topiaIdsForFetch_ )";
+ //Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
+ Email.PROPERTY_WAITING_STATE,
+ Email.PROPERTY_TAKEN_BY
+ //Email.PROPERTY_REPLIES,
+ //Email.PROPERTY_ATTACHMENT,
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS,
+ //Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL
+ ) + " WHERE E." + TopiaEntity.PROPERTY_TOPIA_ID + " in ( :topiaIdsForFetch_ )";
// code copied from topia to perform search
PaginationResult<String> pageResult = findPage(hqlForFetchStep1, args, pagination);
@@ -397,9 +397,9 @@
}
PaginationResult<Email> result = PaginationResult.of(sortedEntities, pageResult.getCount(), pageResult.getCurrentPage());
- PaginationResult<Email> result = findPage(query.toString(), args, pagination);*/
- PaginationResult<Email> result = findPage(query.toString(), args, pagination);
+ //PaginationResult<Email> result = findPage(query.toString(), args, pagination);
+
// manual fetch
// Email.PROPERTY_PRIORITY,
// Email.PROPERTY_DEMAND_TYPE,
@@ -413,17 +413,17 @@
// Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS,
// Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL)
for (Email email : result.getElements()) {
- Hibernate.initialize(email.getPriority());
- Hibernate.initialize(email.getDemandType());
- Hibernate.initialize(email.getClient());
+ //Hibernate.initialize(email.getPriority());
+ //Hibernate.initialize(email.getDemandType());
+ //Hibernate.initialize(email.getClient());
List<RangeRow> rangeRows = email.getRangeRow();
if (rangeRows != null) {
for (RangeRow rangeRow : rangeRows) {
Hibernate.initialize(rangeRow.getRange());
}
}
- Hibernate.initialize(email.getEtatAttente());
- Hibernate.initialize(email.getTakenBy());
+ //Hibernate.initialize(email.getWaitingState());
+ //Hibernate.initialize(email.getTakenBy());
Hibernate.initialize(email.getReplies());
Hibernate.initialize(email.getAttachment());
List<History> histories = email.getHistory();
@@ -497,24 +497,9 @@
return result;
}
-// public Map<String, FaxToMailUser> getLastForEmails(List<String> emailIds) {
-//// récupérer l'utilisateur de l'historique max date pour type = ouverture pj
-// String query = "SELECT topiaId, " +
-// "FROM " + Email.class.getName() + " AS email " +
-// "INNER JOIN email." + Email.PROPERTY_HISTORY + " AS history " +
-// "INNER JOIN rangeRow." + RangeRow.PROPERTY_RANGE + " AS range " +
-// "WHERE email." + Email.PROPERTY_TOPIA_ID + " IN :emailIds " +
-// "AND history"
-// "GROUP BY topiaId";
-//
-// Map<String, Object> params = new HashMap<>();
-// params.put("emailIds", emailIds);
-// List<Pair<String, FaxToMailUser>> result = findAll(query, params);
-// }
-
/*
- * @deprecated beacause this need to be supported by topia (see http://forge.nuiton.org/issues/3427)
- *
+ * @deprecated because this need to be supported by topia (see http://forge.nuiton.org/issues/3427)
+ */
@Deprecated
protected String addAllFecthes(String... fetchProperties) {
StringBuilder hqlFromClauseBuilder = new StringBuilder();
@@ -563,7 +548,7 @@
/*
* @deprecated beacause this need to be supported by topia (see http://forge.nuiton.org/issues/3427)
- *
+ */
@Deprecated
protected <O extends TopiaEntity> List<O> sortAccordingToIds(List<O> entities, final List<String> idsList) {
@@ -578,5 +563,5 @@
List<O> result = Lists.newArrayList(transformed);
return result;
- }*/
+ }
}
Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EtatAttenteTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EtatAttenteTopiaDao.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EtatAttenteTopiaDao.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -1,87 +0,0 @@
-package com.franciaflex.faxtomail.persistence.entities;
-
-/*
- * #%L
- * FaxToMail :: Persistence
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2014 Franciaflex
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class EtatAttenteTopiaDao extends AbstractEtatAttenteTopiaDao<EtatAttente> {
-
-
- @Override
- public void delete(EtatAttente entity) {
-
- // code from AbstractTopiaDao
- topiaJpaSupport.delete(entity);
- entity.notifyDeleted();
- topiaFiresSupport.notifyEntityDeleted(entity);
-
-// do nothing just to disable strange topia code
-// org.postgresql.util.PSQLException: Le nom de colonne topiaVersion n'a pas été trouvé dans ce ResultSet.
-// org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2728)
-// org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2594)
-// com.mchange.v2.c3p0.impl.NewProxyResultSet.getLong(NewProxyResultSet.java:2625)
-// org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$2.doExtract(BigIntTypeDescriptor.java:74)
-// org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
-// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
-// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
-// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
-// org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
-// org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)
-// org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
-// org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
-// org.hibernate.loader.Loader.getRow(Loader.java:1514)
-// org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725)
-// org.hibernate.loader.Loader.processResultSet(Loader.java:952)
-// org.hibernate.loader.Loader.doQuery(Loader.java:920)
-// org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
-// org.hibernate.loader.Loader.doList(Loader.java:2553)
-// org.hibernate.loader.Loader.doList(Loader.java:2539)
-// org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
-// org.hibernate.loader.Loader.list(Loader.java:2364)
-// org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:353)
-// org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1873)
-// org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:311)
-// org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:141)
-// com.franciaflex.faxtomail.persistence.entities.GeneratedEtatAttenteTopiaDao.delete(GeneratedEtatAttenteTopiaDao.java:65)
-// com.franciaflex.faxtomail.persistence.entities.GeneratedEtatAttenteTopiaDao.delete(GeneratedEtatAttenteTopiaDao.java:1)
-
- }
-
- public Map<String, Long> getEtatAttenteCountByFolder() {
- String query = "SELECT etatAttente.topiaId, count(*) FROM " + Email.class.getName() + " group by etatAttente.topiaId";
-
- Map<String, Long> result = new HashMap<>();
-
- List<Object[]> queryResuts = findAll(query);
- for (Object[] queryResut : queryResuts) {
- String etatAttente = (String)queryResut[0];
- Long count = (Long)queryResut[1];
- result.put(etatAttente, count);
- }
- return result;
- }
-} //EtatAttenteTopiaDao
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryImpl.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryImpl.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,52 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+public class HistoryImpl extends HistoryAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 7357010358014312848L;
+
+ @Override
+ public void setFields(Set<String> field) {
+ String fieldsAsString = new Gson().toJson(field);
+ setFieldsJson(fieldsAsString);
+ }
+
+ @Override
+ public Set<String> getFields() {
+ String fieldsAsString = getFieldsJson();
+ Type type = new TypeToken<Set<String>>() {}.getType();
+ Set<String> fields = new Gson().fromJson(fieldsAsString, type);
+ return fields;
+ }
+
+}
Property changes on: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailField.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -25,7 +25,7 @@
*/
/**
- * Required email fields for specific {@link EtatAttente}.
+ * Required email fields for specific {@link WaitingState}.
*
* @author Eric Chatellier
*/
@@ -36,7 +36,7 @@
PRIORITY,
RANGE_ROW,
CLIENT,
- ETAT_ATTENTE,
+ WAITING_STATE,
COMPANY_REFERENCE,
COMMENT,
DEMAND_TYPE,
@@ -63,7 +63,7 @@
PRIORITY,
RANGE_ROW,
CLIENT,
- ETAT_ATTENTE,
+ WAITING_STATE,
COMPANY_REFERENCE,
COMMENT
};
@@ -83,7 +83,7 @@
RECEPTION_DATE,
RECIPIENT,
DEMAND_STATUS,
- ETAT_ATTENTE,
+ WAITING_STATE,
PF_NB,
SAV_NB,
QUOTATION_NB,
Copied: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/WaitingStateTopiaDao.java (from rev 592, trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EtatAttenteTopiaDao.java)
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/WaitingStateTopiaDao.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/WaitingStateTopiaDao.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,87 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class WaitingStateTopiaDao extends AbstractWaitingStateTopiaDao<WaitingState> {
+
+
+ @Override
+ public void delete(WaitingState entity) {
+
+ // code from AbstractTopiaDao
+ topiaJpaSupport.delete(entity);
+ entity.notifyDeleted();
+ topiaFiresSupport.notifyEntityDeleted(entity);
+
+// do nothing just to disable strange topia code
+// org.postgresql.util.PSQLException: Le nom de colonne topiaVersion n'a pas été trouvé dans ce ResultSet.
+// org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2728)
+// org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2594)
+// com.mchange.v2.c3p0.impl.NewProxyResultSet.getLong(NewProxyResultSet.java:2625)
+// org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$2.doExtract(BigIntTypeDescriptor.java:74)
+// org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
+// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
+// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
+// org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
+// org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
+// org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)
+// org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
+// org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
+// org.hibernate.loader.Loader.getRow(Loader.java:1514)
+// org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725)
+// org.hibernate.loader.Loader.processResultSet(Loader.java:952)
+// org.hibernate.loader.Loader.doQuery(Loader.java:920)
+// org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
+// org.hibernate.loader.Loader.doList(Loader.java:2553)
+// org.hibernate.loader.Loader.doList(Loader.java:2539)
+// org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
+// org.hibernate.loader.Loader.list(Loader.java:2364)
+// org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:353)
+// org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1873)
+// org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:311)
+// org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:141)
+// com.franciaflex.faxtomail.persistence.entities.GeneratedWaitingStateTopiaDao.delete(GeneratedEtatAttenteTopiaDao.java:65)
+// com.franciaflex.faxtomail.persistence.entities.GeneratedWaitingStateTopiaDao.delete(GeneratedEtatAttenteTopiaDao.java:1)
+
+ }
+
+ public Map<String, Long> getWaitingStateCountByFolder() {
+ String query = "SELECT waitingState.topiaId, count(*) FROM " + Email.class.getName() + " group by waitingState.topiaId";
+
+ Map<String, Long> result = new HashMap<>();
+
+ List<Object[]> queryResuts = findAll(query);
+ for (Object[] queryResut : queryResuts) {
+ String etatAttente = (String)queryResut[0];
+ Long count = (Long)queryResut[1];
+ result.put(etatAttente, count);
+ }
+ return result;
+ }
+} //EtatAttenteTopiaDao
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-09-03 13:58:29 UTC (rev 598)
@@ -26,10 +26,10 @@
model.tagValue.hibernateAttributeType.java.lang.String=text
model.tagValue.useEnumerationName=true
-# EtatAttente
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.label.tagvalue.naturalId=true
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.invalidFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.validFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
+# WaitingState
+com.franciaflex.faxtomail.persistence.entities.WaitingState.attribute.label.tagvalue.naturalId=true
+com.franciaflex.faxtomail.persistence.entities.WaitingState.attribute.invalidFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
+com.franciaflex.faxtomail.persistence.entities.WaitingState.attribute.validFormDisabledActions.tagvalue.hibernateAttributeType=com.franciaflex.faxtomail.persistence.hibernate.MailActionEnumSetUserType
# Priority
com.franciaflex.faxtomail.persistence.entities.Priority.attribute.label.tagvalue.naturalId=true
@@ -74,7 +74,7 @@
# AttachmentFile
com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.filename.tagvalue.notNull=true
com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagvalue.notNull=true
-# il faut mettre une valeur > \u00e0 8000 pour que la mapping g\u00e9n\u00e8re un type varbinary(max)
+# il faut mettre une valeur > a 8000 pour que la mapping genere un type varbinary(max)
com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagValue.hibernateAttributeType=binary
com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagvalue.length=9999999
@@ -94,6 +94,21 @@
com.franciaflex.faxtomail.persistence.entities.Email.attribute.mailFolder.tagvalue.notNull=true
com.franciaflex.faxtomail.persistence.entities.Email.attribute.originalEmail.tagvalue.notNull=true
+# Reply
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.sentDate.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.subject.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.sender.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.recipient.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.sentBy.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.replyContent.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.Reply.attribute.replyContent.tagvalue.notNull=true
+
+# ReplyContent
+com.franciaflex.faxtomail.persistence.entities.ReplyContent.attribute.source.tagvalue.notNull=true
+# il faut mettre une valeur > a 8000 pour que la mapping genere un type varbinary(max)
+com.franciaflex.faxtomail.persistence.entities.ReplyContent.attribute.source.tagValue.hibernateAttributeType=binary
+com.franciaflex.faxtomail.persistence.entities.ReplyContent.attribute.source.tagvalue.length=9999999
+
# EmailGroup
com.franciaflex.faxtomail.persistence.entities.EmailGroup.attribute.email.stereotype=unique
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/FaxToMailServiceContext.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -117,10 +117,6 @@
}
}
-// public FaxToMailTopiaApplicationContext getTopiaApplicationContext() {
-// return topiaApplicationContext;
-// }
-
public void setApplicationConfig(FaxToMailConfiguration applicationConfig) {
if (delegateServiceContext != null) {
delegateServiceContext.setApplicationConfig(applicationConfig);
@@ -252,6 +248,11 @@
@Override
public void close() throws IOException {
if (persistenceContext != null) {
+
+ if (Boolean.getBoolean("hibernate.generate_statistics") && log.isInfoEnabled()) {
+ log.info(persistenceContext.getHibernateSupport().getHibernateFactory().getStatistics());
+ }
+
persistenceContext.close();
persistenceContext = null;
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -25,7 +25,6 @@
*/
import java.util.Collection;
-import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -33,12 +32,12 @@
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.ExtensionCommand;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailService;
/**
@@ -49,7 +48,7 @@
List<MailFilter> getMailFilters();
- void save(Configuration configuration, List<DemandType> demandTypes, List<EtatAttente> etatAttentes, List<MailFolder> mailFolders,
+ void save(Configuration configuration, List<DemandType> demandTypes, List<WaitingState> waitingStates, List<MailFolder> mailFolders,
List<MailFilter> mailFilters, List<EmailAccount> emailAccounts);
List<EmailAccount> getEmailAccountsWithoutPasswords();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -41,7 +41,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.hibernate.Hibernate;
import org.nuiton.topia.persistence.TopiaEntities;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -56,9 +55,6 @@
import com.franciaflex.faxtomail.persistence.entities.EmailAccountImpl;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.EmailProtocol;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttenteImpl;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttenteTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.ExtensionCommand;
import com.franciaflex.faxtomail.persistence.entities.ExtensionCommandTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
@@ -72,6 +68,9 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderImpl;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateImpl;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
@@ -138,13 +137,13 @@
*
* @param configuration configuration
* @param demandTypes types de demande
- * @param etatAttentes etat d'attentes
+ * @param waitingStates etat d'attentes
* @param mailFolders mail folder
* @param mailFilters mail filters
* @param emailAccounts mail accounts
*/
@Override
- public void save(Configuration configuration, List<DemandType> demandTypes, List<EtatAttente> etatAttentes, List<MailFolder> mailFolders,
+ public void save(Configuration configuration, List<DemandType> demandTypes, List<WaitingState> waitingStates, List<MailFolder> mailFolders,
List<MailFilter> mailFilters, List<EmailAccount> emailAccounts) {
Collection<MailFolder> toDeleteMailFolder = new ArrayList<>();
@@ -152,8 +151,8 @@
// sauvegarde
saveConfiguration(configuration);
saveDemandTypes(demandTypes);
- Map<String, EtatAttente> etatAttenteCache = saveEtatAttente(etatAttentes);
- Map<String, MailFolder> mailFolderCache = saveMailFolders(etatAttenteCache, mailFolders, toDeleteMailFolder);
+ Map<String, WaitingState> waitingStateCache = saveWaitingStates(waitingStates);
+ Map<String, MailFolder> mailFolderCache = saveMailFolders(waitingStateCache, mailFolders, toDeleteMailFolder);
saveMailFilters(mailFolderCache, mailFilters);
saveEmailAccounts(emailAccounts);
@@ -182,9 +181,9 @@
// copy
binderDemandType.copyExcluding(demandType, currentDemandType,
- EtatAttente.PROPERTY_TOPIA_ID,
- EtatAttente.PROPERTY_TOPIA_CREATE_DATE,
- EtatAttente.PROPERTY_TOPIA_VERSION);
+ DemandType.PROPERTY_TOPIA_ID,
+ DemandType.PROPERTY_TOPIA_CREATE_DATE,
+ DemandType.PROPERTY_TOPIA_VERSION);
// persist
if (currentDemandType.isPersisted()) {
@@ -197,44 +196,44 @@
/**
*
- * @param etatAttentes
+ * @param waitingStates
*/
- protected Map<String, EtatAttente> saveEtatAttente(Collection<EtatAttente> etatAttentes) {
+ protected Map<String, WaitingState> saveWaitingStates(Collection<WaitingState> waitingStates) {
- Map<String, EtatAttente> cache = new HashMap<>();
- Binder<EtatAttente, EtatAttente> binderEtatAttente = BinderFactory.newBinder(EtatAttente.class);
- EtatAttenteTopiaDao etatAttenteDAO = getPersistenceContext().getEtatAttenteDao();
+ Map<String, WaitingState> cache = new HashMap<>();
+ Binder<WaitingState, WaitingState> binderEtatAttente = BinderFactory.newBinder(WaitingState.class);
+ WaitingStateTopiaDao waitingStateDAO = getPersistenceContext().getWaitingStateDao();
- List<EtatAttente> allEtatAttente = etatAttenteDAO.findAll();
- Map<String, EtatAttente> allEtatAttenteIndex = new HashMap<>(Maps.uniqueIndex(allEtatAttente, TopiaEntities.getTopiaIdFunction()));
- for (EtatAttente etatAttente : etatAttentes) {
+ List<WaitingState> allWaitingStates = waitingStateDAO.findAll();
+ Map<String, WaitingState> allWaitingStateIndex = new HashMap<>(Maps.uniqueIndex(allWaitingStates, TopiaEntities.getTopiaIdFunction()));
+ for (WaitingState waitingState : waitingStates) {
// get current etat attente
- EtatAttente currentEtatAttente;
- if (StringUtils.isBlank(etatAttente.getTopiaId()) || etatAttente.getTopiaId().startsWith("new_")) {
- currentEtatAttente = new EtatAttenteImpl();
+ WaitingState currentWaitingState;
+ if (StringUtils.isBlank(waitingState.getTopiaId()) || waitingState.getTopiaId().startsWith("new_")) {
+ currentWaitingState = new WaitingStateImpl();
} else {
- currentEtatAttente = allEtatAttenteIndex.remove(etatAttente.getTopiaId());
+ currentWaitingState = allWaitingStateIndex.remove(waitingState.getTopiaId());
}
// copy
- binderEtatAttente.copyExcluding(etatAttente, currentEtatAttente,
- EtatAttente.PROPERTY_TOPIA_ID,
- EtatAttente.PROPERTY_TOPIA_CREATE_DATE,
- EtatAttente.PROPERTY_TOPIA_VERSION);
+ binderEtatAttente.copyExcluding(waitingState, currentWaitingState,
+ WaitingState.PROPERTY_TOPIA_ID,
+ WaitingState.PROPERTY_TOPIA_CREATE_DATE,
+ WaitingState.PROPERTY_TOPIA_VERSION);
// persist
- if (currentEtatAttente.isPersisted()) {
- etatAttenteDAO.update(currentEtatAttente);
+ if (currentWaitingState.isPersisted()) {
+ waitingStateDAO.update(currentWaitingState);
} else {
- etatAttenteDAO.create(currentEtatAttente);
+ waitingStateDAO.create(currentWaitingState);
}
// cache
- cache.put(etatAttente.getTopiaId(), currentEtatAttente);
+ cache.put(waitingState.getTopiaId(), currentWaitingState);
}
// delete remaining (not done here, done after reference cleaning)
- etatAttenteDAO.deleteAll(allEtatAttenteIndex.values());
+ waitingStateDAO.deleteAll(allWaitingStateIndex.values());
return cache;
}
@@ -242,11 +241,11 @@
/**
* Save mail folder without commit.
*
- * @param etatAttenteCache cache etat attente
+ * @param waitingStateCache cache etat attente
* @param newMailFolders mail folders
* @return mail folder cache with input ids
*/
- protected Map<String, MailFolder> saveMailFolders(Map<String, EtatAttente> etatAttenteCache, Collection<MailFolder> newMailFolders, Collection<MailFolder> toDeleteMailFolder) {
+ protected Map<String, MailFolder> saveMailFolders(Map<String, WaitingState> waitingStateCache, Collection<MailFolder> newMailFolders, Collection<MailFolder> toDeleteMailFolder) {
// get current folders
MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
List<MailFolder> mailFolders = dao.findAll();
@@ -254,7 +253,7 @@
// recursive update
Map<String, MailFolder> mailFolderCache = new HashMap<>();
- saveMailFolders(dao, etatAttenteCache, mailFolderMap, null, newMailFolders, mailFolderCache);
+ saveMailFolders(dao, waitingStateCache, mailFolderMap, null, newMailFolders, mailFolderCache);
// if map is not empty after recursive iteration, remaining folder must be deleted
toDeleteMailFolder.addAll(mailFolderMap.values());
@@ -266,14 +265,14 @@
* Save mail folder without commit.
*
* @param dao
- * @param etatAttenteCache
+ * @param waitingStateCache
* @param mailFolderMap
* @param parent
* @param mailFolders
* @param mailFolderCache
* @return
*/
- protected Collection<MailFolder> saveMailFolders(MailFolderTopiaDao dao, Map<String, EtatAttente> etatAttenteCache,
+ protected Collection<MailFolder> saveMailFolders(MailFolderTopiaDao dao, Map<String, WaitingState> waitingStateCache,
Map<String, MailFolder> mailFolderMap, MailFolder parent, Collection<MailFolder> mailFolders, Map<String, MailFolder> mailFolderCache) {
Collection<MailFolder> result = Lists.newArrayList();
@@ -296,15 +295,15 @@
MailFolder.PROPERTY_TOPIA_CREATE_DATE,
MailFolder.PROPERTY_TOPIA_VERSION,
MailFolder.PROPERTY_CHILDREN,
- MailFolder.PROPERTY_ETAT_ATTENTES,
+ MailFolder.PROPERTY_WAITING_STATES,
MailFolder.PROPERTY_PARENT);
// gestion des bonnes références des états d'attente (surtout le cas "new_")
- currentMailFolder.clearEtatAttentes();
- if (mailFolder.getEtatAttentes() != null) {
- for (EtatAttente etatAttente : mailFolder.getEtatAttentes()) {
+ currentMailFolder.clearWaitingStates();
+ if (mailFolder.getWaitingStates() != null) {
+ for (WaitingState waitingState : mailFolder.getWaitingStates()) {
// etatAttente.getTopiaId() peut retourner un id qui commence par new_
- currentMailFolder.addEtatAttentes(etatAttenteCache.get(etatAttente.getTopiaId()));
+ currentMailFolder.addWaitingStates(waitingStateCache.get(waitingState.getTopiaId()));
}
}
@@ -314,7 +313,8 @@
currentMailFolder = dao.create(currentMailFolder);
}
- Collection<MailFolder> children = saveMailFolders(dao, etatAttenteCache, mailFolderMap, currentMailFolder, mailFolder.getChildren(), mailFolderCache);
+ Collection<MailFolder> children = saveMailFolders(dao, waitingStateCache, mailFolderMap,
+ currentMailFolder, mailFolder.getChildren(), mailFolderCache);
currentMailFolder.setChildren(children);
dao.update(currentMailFolder);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -24,6 +24,20 @@
* #L%
*/
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.mail.MessagingException;
+
+import org.apache.commons.mail.EmailException;
+import org.nuiton.util.pagination.PaginationParameter;
+import org.nuiton.util.pagination.PaginationResult;
+
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentFile;
import com.franciaflex.faxtomail.persistence.entities.Email;
@@ -33,25 +47,13 @@
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailLock;
import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.Reply;
+import com.franciaflex.faxtomail.persistence.entities.ReplyContent;
import com.franciaflex.faxtomail.services.FaxToMailService;
import com.franciaflex.faxtomail.services.service.exceptions.AlreadyLockedMailException;
import com.franciaflex.faxtomail.services.service.exceptions.FolderNotReadableException;
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
-import org.apache.commons.mail.EmailException;
-import org.nuiton.util.pagination.PaginationParameter;
-import org.nuiton.util.pagination.PaginationResult;
-
-import javax.mail.MessagingException;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
/**
* @author Kevin Morin (Code Lutin)
*/
@@ -64,7 +66,8 @@
Email saveEmail(Email email, FaxToMailUser user, String... modifiedFields) throws InvalidClientException;
- Email saveEmail(Email email, Collection<Attachment> attachments, String clientCode, FaxToMailUser user, String... modifiedFields) throws InvalidClientException;
+ Email saveEmail(Email email, Collection<Attachment> attachments, Collection<Reply> replies, String clientCode,
+ FaxToMailUser user, String... modifiedFields) throws InvalidClientException;
void transmitPendingDemandsToEdi();
@@ -78,8 +81,6 @@
Email openEmail(String emailId, FaxToMailUser user, boolean takeEmail) throws FolderNotReadableException;
- Email takeEmail(String emailId, FaxToMailUser user);
-
Email lockEmail(String emailId, FaxToMailUser currentUser) throws AlreadyLockedMailException, FolderNotReadableException;
void unlockEmail(String emailId);
@@ -92,6 +93,14 @@
String content, Collection<AttachmentFile> attachments,
String originalEmailId, FaxToMailUser user) throws EmailException, MessagingException, IOException;
+ /**
+ * Get reply content on demand for lazy loading.
+ *
+ * @param replyId reply topia id
+ * @return reply content for reply id.
+ */
+ ReplyContent getReplyContent(String replyId);
+
void transmit(Collection<String> emailIds, MailFolder newFolder, FaxToMailUser currentUser);
AttachmentFile getAttachmentFileFromStream(InputStream contentStream);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -119,40 +119,39 @@
@Override
public Email getFullEmailById(String id) {
+
Email email = getPersistenceContext().getEmailDao()
.forTopiaIdEquals(id)
- /*.addAllFetches(Email.PROPERTY_DEMAND_TYPE,
- Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS,
- Email.PROPERTY_REPLIES,
- Email.PROPERTY_ATTACHMENT,
+ .addAllFetches(Email.PROPERTY_DEMAND_TYPE,
+ //Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
+ //Email.PROPERTY_REPLIES,
+ //Email.PROPERTY_ATTACHMENT,
Email.PROPERTY_TAKEN_BY,
Email.PROPERTY_CLIENT,
- Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL,
- Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL + "." + Email.PROPERTY_MAIL_FOLDER,
- Email.PROPERTY_ETAT_ATTENTE,
- Email.PROPERTY_PRIORITY)*/.findUnique();
+ //Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL,
+ //Email.PROPERTY_EMAIL_GROUP + "." + EmailGroup.PROPERTY_EMAIL + "." + Email.PROPERTY_MAIL_FOLDER,
+ Email.PROPERTY_WAITING_STATE,
+ Email.PROPERTY_PRIORITY).findUnique();
// manual fetch
- Hibernate.initialize(email.getPriority());
- Hibernate.initialize(email.getDemandType());
- Hibernate.initialize(email.getClient());
+ //Hibernate.initialize(email.getPriority());
+ //Hibernate.initialize(email.getDemandType());
+ //Hibernate.initialize(email.getClient());
List<RangeRow> rangeRows = email.getRangeRow();
if (rangeRows != null) {
for (RangeRow rangeRow : rangeRows) {
Hibernate.initialize(rangeRow.getRange());
}
}
- Hibernate.initialize(email.getEtatAttente());
- Hibernate.initialize(email.getTakenBy());
+ //Hibernate.initialize(email.getWaitingState()));
+ //Hibernate.initialize(email.getTakenBy());
Hibernate.initialize(email.getReplies());
Hibernate.initialize(email.getAttachment());
List<History> histories = email.getHistory();
if (histories != null) {
for (History history : histories) {
Hibernate.initialize(history.getFaxToMailUser());
- Hibernate.initialize(history.getFields());
}
}
EmailGroup emailGroup = email.getEmailGroup();
@@ -215,11 +214,12 @@
@Override
public Email saveEmail(Email email, FaxToMailUser user, String... modifiedFields) throws InvalidClientException {
Client client = email.getClient();
- return saveEmail(email, null, client != null ? client.getCode() : null, user, modifiedFields);
+ return saveEmail(email, null, null, client != null ? client.getCode() : null, user, modifiedFields);
}
@Override
- public Email saveEmail(Email email, Collection<Attachment> attachments, String clientCode, FaxToMailUser user, String... modifiedFields) throws InvalidClientException {
+ public Email saveEmail(Email email, Collection<Attachment> attachments, Collection<Reply> replies, String clientCode,
+ FaxToMailUser user, String... modifiedFields) throws InvalidClientException {
Date now = getNow();
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
@@ -238,6 +238,9 @@
if (attachments != null) {
updateAttachments(email, attachments);
}
+ if (replies != null) {
+ updateReplies(email);
+ }
if (email.getRangeRow() != null) {
RangeRowTopiaDao rangeRowDao = getPersistenceContext().getRangeRowDao();
@@ -300,8 +303,8 @@
if (historyEmpty || !fieldSet.isEmpty()) {
history = historyDao.create(History.PROPERTY_TYPE, historyEmpty ? HistoryType.CREATION : HistoryType.MODIFICATION,
History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, fieldSet,
History.PROPERTY_MODIFICATION_DATE, now);
+ history.setFields(fieldSet);
}
}
if (history != null) {
@@ -314,6 +317,32 @@
return result;
}
+ /**
+ * Les réponses sont modifiées par l'ui pour ne pas charger le contenu binaire, pour la sauvegarde,
+ * il faut bien rétablir les replyContent avec ceux en base.
+ *
+ * @param email
+ */
+ protected void updateReplies(Email email) {
+ ReplyTopiaDao replyTopiaDao = getPersistenceContext().getReplyDao();
+
+ List<Reply> currentReplies = new ArrayList<Reply>(email.getReplies());
+ email.clearReplies();
+ for (Reply reply : currentReplies) {
+ // normalement elle sont toutes persistée et non modifiées par l'ui
+ // donc reprendre la version en base avec un replyContent non null est suffisant dans ce cas
+ Reply newReply = replyTopiaDao.forTopiaIdEquals(reply.getTopiaId()).findUnique();
+ email.addReplies(newReply);
+ }
+ }
+
+ /**
+ * Les attachment sont copiés dans l'UI sans la valorisation des champs "originalFile" et "editedFile".
+ * Ici ont revalorise ces champs pour la sauvegarde.
+ *
+ * @param email
+ * @param attachments
+ */
protected void updateAttachments(Email email, Collection<Attachment> attachments) {
AttachmentTopiaDao attachmentTopiaDao = getPersistenceContext().getAttachmentDao();
@@ -596,42 +625,57 @@
PaginationResult<Email> result;
if (folder.isFolderReadable()) {
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
- result = dao.forMailFolderEquals(folder)
- .addNull(Email.PROPERTY_ARCHIVE_DATE)
- .addNotEquals(Email.PROPERTY_DEMAND_STATUS, DemandStatus.ARCHIVED)
- /*.addAllFetches(Email.PROPERTY_PRIORITY,
- Email.PROPERTY_DEMAND_TYPE,
- Email.PROPERTY_CLIENT,
- Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
- Email.PROPERTY_ETAT_ATTENTE,
- Email.PROPERTY_TAKEN_BY,
- Email.PROPERTY_REPLIES,
- Email.PROPERTY_ATTACHMENT,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS)*/
- .findPage(page);
-
- // manual fetch
- for (Email email : result.getElements()) {
- Hibernate.initialize(email.getPriority());
- Hibernate.initialize(email.getDemandType());
- Hibernate.initialize(email.getClient());
- List<RangeRow> rangeRows = email.getRangeRow();
- if (rangeRows != null) {
- for (RangeRow rangeRow : rangeRows) {
- Hibernate.initialize(rangeRow.getRange());
+ if (Boolean.getBoolean("faxtomail.fullfetch")) {
+ result = dao.forMailFolderEquals(folder)
+ .addNull(Email.PROPERTY_ARCHIVE_DATE)
+ .addNotEquals(Email.PROPERTY_DEMAND_STATUS, DemandStatus.ARCHIVED)
+ .addAllFetches(Email.PROPERTY_PRIORITY,
+ Email.PROPERTY_DEMAND_TYPE,
+ Email.PROPERTY_CLIENT,
+ Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
+ Email.PROPERTY_WAITING_STATE,
+ Email.PROPERTY_TAKEN_BY,
+ Email.PROPERTY_REPLIES,
+ Email.PROPERTY_ATTACHMENT,
+ Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER
+ ).findPage(page);
+ } else {
+ result = dao.forMailFolderEquals(folder)
+ .addNull(Email.PROPERTY_ARCHIVE_DATE)
+ .addNotEquals(Email.PROPERTY_DEMAND_STATUS, DemandStatus.ARCHIVED)
+ .addAllFetches(Email.PROPERTY_PRIORITY,
+ Email.PROPERTY_DEMAND_TYPE,
+ Email.PROPERTY_CLIENT,
+ //Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE,
+ Email.PROPERTY_WAITING_STATE,
+ Email.PROPERTY_TAKEN_BY
+ //Email.PROPERTY_REPLIES,
+ //Email.PROPERTY_ATTACHMENT,
+ //Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER*/
+ ).findPage(page);
+
+
+ // manual fetch
+ for (Email email : result.getElements()) {
+ //Hibernate.initialize(email.getPriority());
+ //Hibernate.initialize(email.getDemandType());
+ //Hibernate.initialize(email.getClient());
+ List<RangeRow> rangeRows = email.getRangeRow();
+ if (rangeRows != null) {
+ for (RangeRow rangeRow : rangeRows) {
+ Hibernate.initialize(rangeRow.getRange());
+ }
}
- }
- Hibernate.initialize(email.getEtatAttente());
- Hibernate.initialize(email.getTakenBy());
- Hibernate.initialize(email.getReplies());
- Hibernate.initialize(email.getAttachment());
- List<History> histories = email.getHistory();
- if (histories != null) {
- for (History history : histories) {
- Hibernate.initialize(history.getFaxToMailUser());
- Hibernate.initialize(history.getFields());
+ //Hibernate.initialize(email.getWaitingState());
+ //Hibernate.initialize(email.getTakenBy());
+ Hibernate.initialize(email.getReplies());
+ Hibernate.initialize(email.getAttachment());
+ List<History> histories = email.getHistory();
+ if (histories != null) {
+ for (History history : histories) {
+ Hibernate.initialize(history.getFaxToMailUser());
+ }
}
}
}
@@ -683,14 +727,13 @@
public Email addToHistory(String emailId, HistoryType type, FaxToMailUser user, Date date, String... fields) {
EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
Email email = getEmailById(emailId,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS);
+ Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER);
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
History history = historyDao.create(History.PROPERTY_TYPE, type,
History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, Sets.newHashSet(fields),
History.PROPERTY_MODIFICATION_DATE, date);
+ history.setFields(Sets.newHashSet(fields));
email.addHistory(history);
@@ -721,8 +764,8 @@
if (takeEmail) {
history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_TAKEN_BY),
History.PROPERTY_MODIFICATION_DATE, new Date());
+ history.setFields(Sets.newHashSet(Email.PROPERTY_TAKEN_BY));
email.addHistory(history);
email.setTakenBy(user);
}
@@ -733,31 +776,6 @@
}
/**
- * Take email (takenBy).
- *
- * @param emailId
- * @param user
- * @return
- */
- @Override
- public Email takeEmail(String emailId, FaxToMailUser user) {
- EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
- Email email = getEmailById(emailId);
- email.setTakenBy(user);
-
- HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
- History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
- History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_TAKEN_BY),
- History.PROPERTY_MODIFICATION_DATE, new Date());
- email.addHistory(history);
-
- email = emailDao.update(email);
- getPersistenceContext().commit();
- return email;
- }
-
- /**
* Vérrouille une demande par un utilisateur empechant les autres de l'ouvrir.
*
* @param emailId topiaId de la demande à vérouiller
@@ -933,16 +951,19 @@
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
Date now = new Date();
- email1.addHistory(historyDao.create(History.PROPERTY_TYPE, HistoryType.GROUP,
- History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, Sets.newHashSet(email2.getObject()),
- History.PROPERTY_MODIFICATION_DATE, now));
+ History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.GROUP,
+ History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_MODIFICATION_DATE, now);
+ history.setFields(Sets.newHashSet(email2.getObject()));
+ email1.addHistory(history);
+
Email result = emailDao.update(email1);
- email2.addHistory(historyDao.create(History.PROPERTY_TYPE, HistoryType.GROUP,
- History.PROPERTY_FAX_TO_MAIL_USER, user,
- History.PROPERTY_FIELDS, Sets.newHashSet(email1.getObject()),
- History.PROPERTY_MODIFICATION_DATE, now));
+ History history2 = historyDao.create(History.PROPERTY_TYPE, HistoryType.GROUP,
+ History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_MODIFICATION_DATE, now);
+ history2.setFields(Sets.newHashSet(email1.getObject()));
+ email2.addHistory(history2);
emailDao.update(email2);
getPersistenceContext().commit();
@@ -974,7 +995,6 @@
Email email = getEmailById(originalEmailId,
Email.PROPERTY_HISTORY + "." + History.PROPERTY_FAX_TO_MAIL_USER,
- Email.PROPERTY_HISTORY + "." + History.PROPERTY_FIELDS,
Email.PROPERTY_REPLIES);
final String smtpUser = getApplicationConfig().getSmtpUser();
@@ -1011,20 +1031,31 @@
message.send();
ReplyTopiaDao replyTopiaDao = getPersistenceContext().getReplyDao();
+ ReplyContentTopiaDao replyContentTopiaDao = getPersistenceContext().getReplyContentDao();
Date now = new Date();
- StringBuilder emailSource = new StringBuilder();
+ // build mail header part
+ StringBuilder emailHeaders = new StringBuilder();
Enumeration<String> headerLines = message.getMimeMessage().getAllHeaderLines();
while (headerLines.hasMoreElements()) {
String headerLine = headerLines.nextElement();
- emailSource.append(headerLine).append("\n");
+ emailHeaders.append(headerLine).append("\n");
}
- // TODO echatellier 20140804 : est volontaire et sûr de stocker l'email sous forme textuelle ?
- emailSource.append("\n").append(IOUtils.toString(message.getMimeMessage().getInputStream()));
+ emailHeaders.append("\n"); // blank line (IMPORTANT)
+
+ // build mail serialization part
+ ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+ IOUtils.write(emailHeaders, byteOut);
+ IOUtils.copy(message.getMimeMessage().getInputStream(), byteOut);
- Reply reply = replyTopiaDao.create(Reply.PROPERTY_EMAIL_SOURCE, emailSource.toString(),
+ ReplyContent replyContent = replyContentTopiaDao.createByNotNull(byteOut.toByteArray());
+
+ Reply reply = replyTopiaDao.create(Reply.PROPERTY_REPLY_CONTENT, replyContent,
Reply.PROPERTY_SENT_DATE, now,
- Reply.PROPERTY_SUBJECT, subject);
+ Reply.PROPERTY_SUBJECT, subject,
+ Reply.PROPERTY_SENDER, from,
+ Reply.PROPERTY_RECIPIENT, to,
+ Reply.PROPERTY_SENT_BY, user);
email.addReplies(reply);
@@ -1087,11 +1118,21 @@
Attachment attachment = dao.forTopiaIdEquals(attachmentId).findUnique();
AttachmentFile result = original ? attachment.getOriginalFile() : attachment.getEditedFile();
if (result != null) {
- result.getFilename();
+ // force lazy initialize
+ Hibernate.initialize(result);
}
return result;
}
+ @Override
+ public ReplyContent getReplyContent(String replyId) {
+ ReplyTopiaDao dao = getPersistenceContext().getReplyDao();
+ Reply reply = dao.forTopiaIdEquals(replyId).findUnique();
+ ReplyContent result = reply.getReplyContent();
+ // force lazy initialize
+ Hibernate.initialize(result);
+ return result;
+ }
/**
* Retourne la liste des vérrouillages actifs.
@@ -1256,7 +1297,7 @@
setField(pdfFieldValues, "priority", email.getPriority() == null ? "" : email.getPriority().getLabel());
setField(pdfFieldValues, "projectReference", email.getProjectReference());
setField(pdfFieldValues, "companyReference", email.getCompanyReference());
- setField(pdfFieldValues, "etatAttente", email.getEtatAttente() == null ? "" : email.getEtatAttente().getLabel());
+ setField(pdfFieldValues, "waitingState", email.getWaitingState() == null ? "" : email.getWaitingState().getLabel());
setField(pdfFieldValues, "status", email.getDemandStatus() == null ? "" : email.getDemandStatus().getLabel());
setField(pdfFieldValues, "takenBy", email.getTakenBy() == null ? "" : (email.getTakenBy().getLogin() + " " + email.getTakenBy().getFirstName() + " " + email.getTakenBy().getLastName()));
}
@@ -1304,7 +1345,7 @@
EmailTopiaDao emailDao = getPersistenceContext().getEmailDao();
DemandTypeTopiaDao demandTypedao = getPersistenceContext().getDemandTypeDao();
PriorityTopiaDao priorityDao = getPersistenceContext().getPriorityDao();
- EtatAttenteTopiaDao etatAttenteDao = getPersistenceContext().getEtatAttenteDao();
+ WaitingStateTopiaDao waitingStateDao = getPersistenceContext().getWaitingStateDao();
MailFolderTopiaDao mailFolderDao = getPersistenceContext().getMailFolderDao();
AttachmentTopiaDao attachmentDao = getPersistenceContext().getAttachmentDao();
AttachmentFileTopiaDao attachmentFileDao = getPersistenceContext().getAttachmentFileDao();
@@ -1322,9 +1363,9 @@
return input.getLabel();
}
});
- Map<String, EtatAttente> allEtatAttentes = Maps.uniqueIndex(etatAttenteDao, new Function<EtatAttente, String>() {
+ Map<String, WaitingState> allWaitingStates = Maps.uniqueIndex(waitingStateDao, new Function<WaitingState, String>() {
@Override
- public String apply(EtatAttente input) {
+ public String apply(WaitingState input) {
return input.getLabel();
}
});
@@ -1338,7 +1379,7 @@
});
// run import
- ArchiveImportModel archiveImportModel = new ArchiveImportModel(';', allEtatAttentes, allDemandTypes, allPriority, mailFolderMap);
+ ArchiveImportModel archiveImportModel = new ArchiveImportModel(';', allWaitingStates, allDemandTypes, allPriority, mailFolderMap);
Binder<ArchiveImportBean, Email> emailBinder = BinderFactory.newBinder(ArchiveImportBean.class, Email.class);
Import<ArchiveImportBean> importer = null;
try {
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailServiceImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -39,8 +39,6 @@
import java.util.Map;
import java.util.Random;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
-
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -52,8 +50,6 @@
import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttenteTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
@@ -61,6 +57,7 @@
import com.franciaflex.faxtomail.persistence.entities.History;
import com.franciaflex.faxtomail.persistence.entities.HistoryTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Priority;
@@ -69,6 +66,8 @@
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.persistence.entities.RangeRowTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateTopiaDao;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
@@ -124,23 +123,23 @@
demandTypeDao.create(DemandType.PROPERTY_LABEL, "Autres")
);
- EtatAttenteTopiaDao etatAttenteDao = getPersistenceContext().getEtatAttenteDao();
- List<EtatAttente> etatAttentes = Lists.newArrayList(
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "BAT attente retour BAT lettrage-logo"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "CLT attente réponse client"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "DAC attente pour assistance chantier"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "DAV attente analyse avoir"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "EXP attente expertise"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "GAB attente reception gabarit"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "GRA attente accord gratuit"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "ODC attente Ouverture de Compte"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PPC attente chiffrage BEI PPC"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PROFORMA attente paiement proforma"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PROTO attente accord proto"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "REM Attente Remise-accord expo"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "RET attente retour materiel"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "SIGN attente réponse BEI signature"),
- etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "SPAM")
+ WaitingStateTopiaDao waitingStateDao = getPersistenceContext().getWaitingStateDao();
+ List<WaitingState> waitingStates = Lists.newArrayList(
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "BAT attente retour BAT lettrage-logo"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "CLT attente réponse client"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "DAC attente pour assistance chantier"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "DAV attente analyse avoir"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "EXP attente expertise"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "GAB attente reception gabarit"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "GRA attente accord gratuit"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "ODC attente Ouverture de Compte"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "PPC attente chiffrage BEI PPC"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "PROFORMA attente paiement proforma"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "PROTO attente accord proto"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "REM Attente Remise-accord expo"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "RET attente retour materiel"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "SIGN attente réponse BEI signature"),
+ waitingStateDao.create(WaitingState.PROPERTY_LABEL, "SPAM")
);
PriorityTopiaDao priorityDao = getPersistenceContext().getPriorityDao();
@@ -213,7 +212,7 @@
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
RangeRowTopiaDao rangeRowDao = getPersistenceContext().getRangeRowDao();
- int etatAttenteSize = etatAttentes.size();
+ int waitingStateSize = waitingStates.size();
// root folders (~companies)
MailFolder franciaflex = folderDao.create(MailFolder.PROPERTY_NAME, "Franciaflex",
@@ -229,20 +228,20 @@
franciaflex.addChildren(chargesClientelle);
folders.put("Chargés de clientèle", chargesClientelle);
- Collections.shuffle(etatAttentes);
+ Collections.shuffle(waitingStates);
MailFolder sav = folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
MailFolder.PROPERTY_PARENT, franciaflex,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
- MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(0, random.nextInt(waitingStateSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_WAITING_STATE, true);
franciaflex.addChildren(sav);
folders.put("SAV", sav);
// user folders
- Collections.shuffle(etatAttentes);
+ Collections.shuffle(waitingStates);
MailFolder cyrilFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
- MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(0, random.nextInt(waitingStateSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_WAITING_STATE, true);
chargesClientelle.addChildren(cyrilFolder);
folders.put("Cyril", cyrilFolder);
@@ -251,11 +250,11 @@
chargesClientelle.addChildren(claireFolder);
folders.put("Claire", claireFolder);
- Collections.shuffle(etatAttentes);
+ Collections.shuffle(waitingStates);
MailFolder agatheFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, random.nextInt(etatAttenteSize - 8) + 2),
- MailFolder.PROPERTY_USE_CURRENT_LEVEL_ETAT_ATTENTE, true);
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(0, random.nextInt(waitingStateSize - 8) + 2),
+ MailFolder.PROPERTY_USE_CURRENT_LEVEL_WAITING_STATE, true);
chargesClientelle.addChildren(agatheFolder);
folders.put("Agathe", agatheFolder);
@@ -358,14 +357,14 @@
Date now = new Date();
History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION,
- History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER,
- Email.PROPERTY_CLIENT,
- Email.PROPERTY_PROJECT_REFERENCE,
- Email.PROPERTY_OBJECT,
- Email.PROPERTY_RECEPTION_DATE,
- Email.PROPERTY_MAIL_FOLDER,
- Email.PROPERTY_DEMAND_STATUS),
History.PROPERTY_MODIFICATION_DATE, now);
+ history.setFields(Sets.newHashSet(Email.PROPERTY_SENDER,
+ Email.PROPERTY_CLIENT,
+ Email.PROPERTY_PROJECT_REFERENCE,
+ Email.PROPERTY_OBJECT,
+ Email.PROPERTY_RECEPTION_DATE,
+ Email.PROPERTY_MAIL_FOLDER,
+ Email.PROPERTY_DEMAND_STATUS));
String projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(now));
Email email = emailDao.create(Email.PROPERTY_SENDER, sender,
@@ -406,14 +405,14 @@
cal.add(Calendar.DAY_OF_MONTH, -1);
Date yesterday = cal.getTime();
history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION,
- History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER,
- Email.PROPERTY_CLIENT,
- Email.PROPERTY_PROJECT_REFERENCE,
- Email.PROPERTY_OBJECT,
- Email.PROPERTY_RECEPTION_DATE,
- Email.PROPERTY_MAIL_FOLDER,
- Email.PROPERTY_DEMAND_STATUS),
History.PROPERTY_MODIFICATION_DATE, yesterday);
+ history.setFields(Sets.newHashSet(Email.PROPERTY_SENDER,
+ Email.PROPERTY_CLIENT,
+ Email.PROPERTY_PROJECT_REFERENCE,
+ Email.PROPERTY_OBJECT,
+ Email.PROPERTY_RECEPTION_DATE,
+ Email.PROPERTY_MAIL_FOLDER,
+ Email.PROPERTY_DEMAND_STATUS));
projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(yesterday));
email = emailDao.create(Email.PROPERTY_SENDER, sender,
@@ -448,7 +447,7 @@
email.setDemandType(demandType);
email.setPriority(priorities.get(random.nextInt(priorities.size())));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, null, email.getClient().getCode(), user,
+ getEmailService().saveEmail(email, null, null, email.getClient().getCode(), user,
Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
}
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -29,10 +29,10 @@
import java.util.Map;
import java.util.Set;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailService;
/**
@@ -55,7 +55,7 @@
List<MailFolder> getMailFolders(Collection<String> ids);
- Collection<MailFolder> getFoldersWithEtatAttente(Set<EtatAttente> etatAttentes);
+ Collection<MailFolder> getFoldersWithWaitingState(Set<WaitingState> waitingStates);
Map<String, Long> getMailFoldersUsage();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -41,14 +40,13 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
-import com.google.common.collect.Collections2;
/**
* @author kmorin - kmorin(a)codelutin.com
@@ -240,10 +238,10 @@
Hibernate.initialize(folder.getReplyAddresses());
Hibernate.initialize(folder.getReplyDomains());
- if (folder.sizeEtatAttentes() > 0) {
- for (EtatAttente etatAttente : folder.getEtatAttentes()) {
- Hibernate.initialize(etatAttente.getInvalidFormDisabledActions());
- Hibernate.initialize(etatAttente.getValidFormDisabledActions());
+ if (folder.sizeWaitingStates() > 0) {
+ for (WaitingState waitingState : folder.getWaitingStates()) {
+ Hibernate.initialize(waitingState.getInvalidFormDisabledActions());
+ Hibernate.initialize(waitingState.getValidFormDisabledActions());
}
}
@@ -260,30 +258,30 @@
* Retourne les dossiers qui ont l'ensemble des etats d'attente compatible avec ceux en argument.
*/
@Override
- public Set<MailFolder> getFoldersWithEtatAttente(Set<EtatAttente> requiredEtatAttentes) {
+ public Set<MailFolder> getFoldersWithWaitingState(Set<WaitingState> requiredWaitingStates) {
Set<MailFolder> result = new HashSet<>();
MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao();
List<MailFolder> roots = dao.forParentEquals(null).findAll();
for (MailFolder root : roots) {
- Collection<MailFolder> mailFolders = getFoldersWithEtatAttente(root, new HashSet<EtatAttente>(),
- new HashSet<DemandType>(), requiredEtatAttentes);
+ Collection<MailFolder> mailFolders = getFoldersWithWaitingState(root, new HashSet<WaitingState>(),
+ new HashSet<DemandType>(), requiredWaitingStates);
result.addAll(mailFolders);
}
return result;
}
- protected Collection<MailFolder> getFoldersWithEtatAttente(MailFolder folder,
- Collection<EtatAttente> parentEtatAttente,
+ protected Collection<MailFolder> getFoldersWithWaitingState(MailFolder folder,
+ Collection<WaitingState> parentWaitingState,
Collection<DemandType> parentDemandType,
- Set<EtatAttente> requiredEtatAttentes) {
- Collection<EtatAttente> etatAttentes = folder.getEtatAttentes();
- if (CollectionUtils.isEmpty(etatAttentes)) {
- etatAttentes = parentEtatAttente;
+ Set<WaitingState> requiredWaitingStates) {
+ Collection<WaitingState> waitingStates = folder.getWaitingStates();
+ if (CollectionUtils.isEmpty(waitingStates)) {
+ waitingStates = parentWaitingState;
} else {
- parentEtatAttente = etatAttentes;
+ parentWaitingState = waitingStates;
}
Collection<DemandType> demandTypes = folder.getDemandTypes();
if (CollectionUtils.isEmpty(demandTypes)) {
@@ -297,17 +295,17 @@
Collection<MailFolder> children = folder.getChildren();
if (children != null) {
for (MailFolder child : children) {
- Collection<MailFolder> subMailFolders = getFoldersWithEtatAttente(child,
- parentEtatAttente, parentDemandType, requiredEtatAttentes);
+ Collection<MailFolder> subMailFolders = getFoldersWithWaitingState(child,
+ parentWaitingState, parentDemandType, requiredWaitingStates);
result.addAll(subMailFolders);
}
}
// pour qu'un dossier soit sélectionné il faut que les dossiers ait des etat d'attentes (ou ses parents)
// que les etats d'attente requis ne soit pas vide
- if ((CollectionUtils.isEmpty(etatAttentes) ||
- CollectionUtils.isEmpty(requiredEtatAttentes) ||
- etatAttentes.containsAll(requiredEtatAttentes))) {
+ if ((CollectionUtils.isEmpty(waitingStates) ||
+ CollectionUtils.isEmpty(requiredWaitingStates) ||
+ waitingStates.containsAll(requiredWaitingStates))) {
result.add(folder);
}
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielService.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -24,20 +24,20 @@
* #L%
*/
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
import com.franciaflex.faxtomail.persistence.entities.Client;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailService;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
/**
* @author Kevin Morin (Code Lutin)
*/
@@ -48,9 +48,9 @@
List<Range> getAllRange();
- List<EtatAttente> getAllEtatAttente();
+ List<WaitingState> getAllWaitingState();
- Map<String, Long> getEtatAttentesUsage();
+ Map<String, Long> getWaitingStatesUsage();
List<Client> importClients(InputStream inputStream);
@@ -58,7 +58,7 @@
List<MailFilter> importEmailFilters(InputStream inputStream, Map<String, MailFolder> foldersByName);
- List<EtatAttente> importEtatAttentes(InputStream inputStream);
+ List<WaitingState> importWaitingStates(InputStream inputStream);
List<Priority> importPriorities(InputStream inputStream);
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ReferentielServiceImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -45,8 +45,7 @@
import com.franciaflex.faxtomail.persistence.entities.DemandTypeTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailAccountTopiaDao;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttenteTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
@@ -54,14 +53,16 @@
import com.franciaflex.faxtomail.persistence.entities.PriorityTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Range;
import com.franciaflex.faxtomail.persistence.entities.RangeTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.franciaflex.faxtomail.services.service.imports.ClientImportModel;
import com.franciaflex.faxtomail.services.service.imports.DemandTypeImportModel;
import com.franciaflex.faxtomail.services.service.imports.EmailAccountImportModel;
import com.franciaflex.faxtomail.services.service.imports.EmailFilterImportModel;
-import com.franciaflex.faxtomail.services.service.imports.EtatAttenteImportModel;
import com.franciaflex.faxtomail.services.service.imports.PriorityImportModel;
import com.franciaflex.faxtomail.services.service.imports.RangeImportModel;
+import com.franciaflex.faxtomail.services.service.imports.WaitingStateImportModel;
/**
* @author kmorin - kmorin(a)codelutin.com
@@ -87,15 +88,15 @@
}
@Override
- public List<EtatAttente> getAllEtatAttente() {
- EtatAttenteTopiaDao dao = getPersistenceContext().getEtatAttenteDao();
+ public List<WaitingState> getAllWaitingState() {
+ WaitingStateTopiaDao dao = getPersistenceContext().getWaitingStateDao();
return dao.findAll();
}
@Override
- public Map<String, Long> getEtatAttentesUsage() {
- EtatAttenteTopiaDao dao = getPersistenceContext().getEtatAttenteDao();
- Map<String, Long> result = dao.getEtatAttenteCountByFolder();
+ public Map<String, Long> getWaitingStatesUsage() {
+ WaitingStateTopiaDao dao = getPersistenceContext().getWaitingStateDao();
+ Map<String, Long> result = dao.getWaitingStateCountByFolder();
return result;
}
@@ -199,22 +200,22 @@
}
@Override
- public List<EtatAttente> importEtatAttentes(InputStream inputStream) {
+ public List<WaitingState> importWaitingStates(InputStream inputStream) {
- List<EtatAttente> result = new ArrayList<>();
- EtatAttenteTopiaDao etatAttenteTopiaDao = getPersistenceContext().getEtatAttenteDao();
+ List<WaitingState> result = new ArrayList<>();
+ WaitingStateTopiaDao waitingStateTopiaDao = getPersistenceContext().getWaitingStateDao();
- EtatAttenteImportModel importModel = new EtatAttenteImportModel(';');
- try (Import<EtatAttente> importer = Import.newImport(importModel, new InputStreamReader(inputStream, getApplicationConfig().getImportFileEncoding()))) {
- for (EtatAttente etatAttente : importer) {
+ WaitingStateImportModel importModel = new WaitingStateImportModel(';');
+ try (Import<WaitingState> importer = Import.newImport(importModel, new InputStreamReader(inputStream, getApplicationConfig().getImportFileEncoding()))) {
+ for (WaitingState waitingState : importer) {
- EtatAttente currentEtatAttente = etatAttenteTopiaDao.forLabelEquals(etatAttente.getLabel()).findAnyOrNull();
- if (currentEtatAttente == null) {
- currentEtatAttente = etatAttenteTopiaDao.create(etatAttente);
+ WaitingState currentWaitingState = waitingStateTopiaDao.forLabelEquals(waitingState.getLabel()).findAnyOrNull();
+ if (currentWaitingState == null) {
+ currentWaitingState = waitingStateTopiaDao.create(waitingState);
}
// else maybe update current ?
- result.add(currentEtatAttente);
+ result.add(currentWaitingState);
}
getPersistenceContext().commit();
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ArchiveImportModel.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ArchiveImportModel.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ArchiveImportModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -35,7 +35,7 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.Priority;
@@ -71,7 +71,7 @@
};
public ArchiveImportModel(char separator,
- final Map<String, EtatAttente> etatAttentes, final Map<String, DemandType> demandTypes,
+ final Map<String, WaitingState> waitingStates, final Map<String, DemandType> demandTypes,
final Map<String, Priority> priorities, final Map<String, MailFolder> mailFolderMap) {
super(separator);
@@ -85,10 +85,10 @@
newMandatoryColumn("companyReference", Email.PROPERTY_COMPANY_REFERENCE);
newMandatoryColumn("originalEmail", Email.PROPERTY_ORIGINAL_EMAIL);
newMandatoryColumn("comment", Email.PROPERTY_COMMENT);
- newMandatoryColumn("etatAttente", Email.PROPERTY_ETAT_ATTENTE, new ValueParser<EtatAttente>() {
+ newMandatoryColumn("etatAttente", Email.PROPERTY_WAITING_STATE, new ValueParser<WaitingState>() {
@Override
- public EtatAttente parse(String value) throws ParseException {
- return etatAttentes.get(value);
+ public WaitingState parse(String value) throws ParseException {
+ return waitingStates.get(value);
}
});
newMandatoryColumn("demandType", Email.PROPERTY_DEMAND_TYPE, new ValueParser<DemandType>() {
Deleted: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EtatAttenteImportModel.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EtatAttenteImportModel.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EtatAttenteImportModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -1,47 +0,0 @@
-package com.franciaflex.faxtomail.services.service.imports;
-
-/*
- * #%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%
- */
-
-import org.nuiton.csv.ext.AbstractImportModel;
-
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttenteImpl;
-
-/**
- * Modèle d'import des etat d'attente.
- */
-public class EtatAttenteImportModel extends AbstractImportModel<EtatAttente> {
-
- public EtatAttenteImportModel(char separator) {
- super(separator);
-
- newMandatoryColumn("etatattente", EtatAttente.PROPERTY_LABEL);
- }
-
- @Override
- public EtatAttente newEmptyInstance() {
- return new EtatAttenteImpl();
- }
-}
Copied: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/WaitingStateImportModel.java (from rev 592, trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/EtatAttenteImportModel.java)
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/WaitingStateImportModel.java (rev 0)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/WaitingStateImportModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,47 @@
+package com.franciaflex.faxtomail.services.service.imports;
+
+/*
+ * #%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%
+ */
+
+import org.nuiton.csv.ext.AbstractImportModel;
+
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
+import com.franciaflex.faxtomail.persistence.entities.WaitingStateImpl;
+
+/**
+ * Modèle d'import des etat d'attente.
+ */
+public class WaitingStateImportModel extends AbstractImportModel<WaitingState> {
+
+ public WaitingStateImportModel(char separator) {
+ super(separator);
+
+ newMandatoryColumn("etatattente", WaitingState.PROPERTY_LABEL);
+ }
+
+ @Override
+ public WaitingState newEmptyInstance() {
+ return new WaitingStateImpl();
+ }
+}
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_580__transform_enum_set_to_lists.sql
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_583__readd_editranfer_on_demandtype.sql
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_597__mise_a_jour_performances.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_597__mise_a_jour_performances.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/h2/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,81 @@
+-- remove contraints
+alter table email drop constraint FK_4q69gdpfr96aqig9ephikqxxr;
+alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9;
+alter table etatattentes_mailfolder drop constraint FK_3gi1yi1o932oe5t8ikcnsd3ef;
+alter table etatattentes_mailfolder drop constraint FK_hsynjnyke7heuntkxkks9voxy;
+alter table history_fields drop constraint FK_qoup2jo9smmju8hgou9sq5108;
+DROP INDEX idx_MailFolder_etatAttentes;
+DROP INDEX email_etatAttente_idx;
+
+-- renommage etat attente
+ALTER TABLE email ALTER COLUMN etatAttente RENAME TO waitingState;
+ALTER TABLE etatAttente RENAME TO waitingState;
+ALTER TABLE etatattentes_mailfolder RENAME TO mailfolder_waitingstates;
+ALTER TABLE mailfolder_waitingstates ALTER COLUMN etatAttentes RENAME TO waitingStates;
+ALTER TABLE mailFolder ALTER COLUMN useCurrentLevelEtatAttente RENAME TO useCurrentLevelWaitingState;
+
+-- migration des topia id
+update waitingState set topiaId = replace(topiaId, 'EtatAttente', 'WaitingState');
+update email set waitingState = replace(waitingState, 'EtatAttente', 'WaitingState');
+update mailfolder_waitingstates set waitingStates = replace(waitingStates, 'EtatAttente', 'WaitingState') where waitingStates is not null;
+
+-- migration des champs obligatoire (enum)
+update configuration set searchDisplayColumns = replace(searchDisplayColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where searchDisplayColumns is not null;
+update mailfolder set folderTableColumns = replace(folderTableColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where folderTableColumns is not null;
+update DemandType set requiredFields = replace(requiredFields, 'ETAT_ATTENTE', 'WAITING_STATE') where requiredFields is not null;
+
+-- restore constraints
+alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label);
+alter table email
+ add constraint FK_nfplqi5mxyfuxgkpe3rb83put
+ foreign key (waitingState)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_tb0qx61jwbtopp4xjv089syt2
+ foreign key (waitingStates)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_3ucrlum12s7ivskvvdgykxq7d
+ foreign key (mailFolder)
+ references mailFolder;
+CREATE INDEX idx_MailFolder_waitingStates ON mailfolder_waitingstates(mailFolder);
+CREATE INDEX email_waitingState_idx ON email(waitingState);
+
+-- Reply
+delete from reply;
+ALTER TABLE reply ALTER sentDate SET NOT NULL;
+ALTER TABLE reply ALTER subject SET NOT NULL;
+ALTER TABLE reply ADD sender longvarchar not null;
+ALTER TABLE reply ADD recipient longvarchar not null;
+ALTER TABLE reply ADD replyContent varchar(255) not null;
+ALTER TABLE reply ADD sentBy varchar(255) not null;
+
+create table replyContent (
+ topiaId varchar(255) not null,
+ topiaVersion bigint not null,
+ topiaCreateDate timestamp,
+ source binary(9999999) not null,
+ primary key (topiaId)
+);
+
+alter table reply add constraint UK_7xjte6c6h2lltfpu6ot1bel8k unique (replyContent);
+alter table reply
+ add constraint FK_7xjte6c6h2lltfpu6ot1bel8k
+ foreign key (replyContent)
+ references replyContent;
+
+alter table reply
+ add constraint FK_9m87oooqhsbf1wbad9h4jcwm3
+ foreign key (sentBy)
+ references faxToMailUser;
+
+-- Last opener
+ALTER TABLE email ADD lastAttachmentOpener varchar(255);
+alter table email
+ add constraint FK_pu5j5vh83354jhoikyvb22jru
+ foreign key (lastAttachmentOpener)
+ references faxToMailUser;
+
+-- Champs hitory fields en json
+DROP TABLE history_fields;
+ALTER TABLE history ADD fieldsJson longvarchar;
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_580__transform_enum_set_to_lists.sql
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_583__readd_editranfer_on_demandtype.sql
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_597__mise_a_jour_performances.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_597__mise_a_jour_performances.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/postgres/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,81 @@
+-- remove contraints
+alter table email drop constraint FK_4q69gdpfr96aqig9ephikqxxr;
+alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9;
+alter table etatattentes_mailfolder drop constraint FK_3gi1yi1o932oe5t8ikcnsd3ef;
+alter table etatattentes_mailfolder drop constraint FK_hsynjnyke7heuntkxkks9voxy;
+alter table history_fields drop constraint FK_qoup2jo9smmju8hgou9sq5108;
+DROP INDEX idx_MailFolder_etatAttentes;
+DROP INDEX email_etatAttente_idx;
+
+-- renommage etat attente
+ALTER TABLE email RENAME etatAttente TO waitingState;
+ALTER TABLE etatAttente RENAME TO waitingState;
+ALTER TABLE etatattentes_mailfolder RENAME TO mailfolder_waitingstates;
+ALTER TABLE mailfolder_waitingstates RENAME etatAttentes TO waitingStates;
+ALTER TABLE mailFolder RENAME useCurrentLevelEtatAttente TO useCurrentLevelWaitingState;
+
+-- migration des topia id
+update waitingState set topiaId = replace(topiaId, 'EtatAttente', 'WaitingState');
+update email set waitingState = replace(waitingState, 'EtatAttente', 'WaitingState');
+update mailfolder_waitingstates set waitingStates = replace(waitingStates, 'EtatAttente', 'WaitingState') where waitingStates is not null;
+
+-- migration des champs obligatoire (enum)
+update configuration set searchDisplayColumns = replace(searchDisplayColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where searchDisplayColumns is not null;
+update mailfolder set folderTableColumns = replace(folderTableColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where folderTableColumns is not null;
+update DemandType set requiredFields = replace(requiredFields, 'ETAT_ATTENTE', 'WAITING_STATE') where requiredFields is not null;
+
+-- restore constraints
+alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label);
+alter table email
+ add constraint FK_nfplqi5mxyfuxgkpe3rb83put
+ foreign key (waitingState)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_tb0qx61jwbtopp4xjv089syt2
+ foreign key (waitingStates)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_3ucrlum12s7ivskvvdgykxq7d
+ foreign key (mailFolder)
+ references mailFolder;
+CREATE INDEX idx_MailFolder_waitingStates ON mailfolder_waitingstates(mailFolder);
+CREATE INDEX email_waitingState_idx ON email(waitingState);
+
+-- Reply
+delete from reply;
+ALTER TABLE reply ALTER sentDate SET NOT NULL;
+ALTER TABLE reply ALTER subject SET NOT NULL;
+ALTER TABLE reply ADD sender text not null;
+ALTER TABLE reply ADD recipient text not null;
+ALTER TABLE reply ADD replyContent varchar(255) not null;
+ALTER TABLE reply ADD sentBy varchar(255) not null;
+
+create table replyContent (
+ topiaId varchar(255) not null,
+ topiaVersion int8 not null,
+ topiaCreateDate timestamp,
+ source bytea not null,
+ primary key (topiaId)
+);
+
+alter table reply add constraint UK_7xjte6c6h2lltfpu6ot1bel8k unique (replyContent);
+alter table reply
+ add constraint FK_7xjte6c6h2lltfpu6ot1bel8k
+ foreign key (replyContent)
+ references replyContent;
+
+alter table reply
+ add constraint FK_9m87oooqhsbf1wbad9h4jcwm3
+ foreign key (sentBy)
+ references faxToMailUser;
+
+-- Last opener
+ALTER TABLE email ADD lastAttachmentOpener varchar(255);
+alter table email
+ add constraint FK_pu5j5vh83354jhoikyvb22jru
+ foreign key (lastAttachmentOpener)
+ references faxToMailUser;
+
+-- Champs hitory fields en json
+DROP TABLE history_fields;
+ALTER TABLE history ADD fieldsJson text;
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_580__transform_enum_set_to_lists.sql
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_583__readd_editranfer_on_demandtype.sql
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql
===================================================================
--- trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql (rev 0)
+++ trunk/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_0_0_597__mise_a_jour_performances.sql 2014-09-03 13:58:29 UTC (rev 598)
@@ -0,0 +1,87 @@
+-- remove contraints
+alter table email drop constraint FK_4q69gdpfr96aqig9ephikqxxr;
+alter table etatAttente drop constraint UK_e1mte18x0rh5akvjfbi5ljse9;
+alter table etatattentes_mailfolder drop constraint FK_3gi1yi1o932oe5t8ikcnsd3ef;
+alter table etatattentes_mailfolder drop constraint FK_hsynjnyke7heuntkxkks9voxy;
+alter table history_fields drop constraint FK_qoup2jo9smmju8hgou9sq5108;
+DROP INDEX idx_MailFolder_etatAttentes;
+DROP INDEX email_etatAttente_idx;
+GO
+
+-- renommage etat attente
+ALTER TABLE email RENAME etatAttente TO waitingState;
+ALTER TABLE etatAttente RENAME TO waitingState;
+ALTER TABLE etatattentes_mailfolder RENAME TO mailfolder_waitingstates;
+ALTER TABLE mailfolder_waitingstates RENAME etatAttentes TO waitingStates;
+ALTER TABLE mailFolder RENAME useCurrentLevelEtatAttente TO useCurrentLevelWaitingState;
+GO
+
+-- migration des topia id
+update waitingState set topiaId = replace(topiaId, 'EtatAttente', 'WaitingState');
+update email set waitingState = replace(waitingState, 'EtatAttente', 'WaitingState');
+update mailfolder_waitingstates set waitingStates = replace(waitingStates, 'EtatAttente', 'WaitingState') where waitingStates is not null;
+
+-- migration des champs obligatoire (enum)
+update configuration set searchDisplayColumns = replace(searchDisplayColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where searchDisplayColumns is not null;
+update mailfolder set folderTableColumns = replace(folderTableColumns, 'ETAT_ATTENTE', 'WAITING_STATE') where folderTableColumns is not null;
+update DemandType set requiredFields = replace(requiredFields, 'ETAT_ATTENTE', 'WAITING_STATE') where requiredFields is not null;
+
+-- restore constraints
+alter table waitingState add constraint UK_ccllv66h9tle79mgklh1kpicn unique (label);
+alter table email
+ add constraint FK_nfplqi5mxyfuxgkpe3rb83put
+ foreign key (waitingState)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_tb0qx61jwbtopp4xjv089syt2
+ foreign key (waitingStates)
+ references waitingState;
+alter table mailfolder_waitingstates
+ add constraint FK_3ucrlum12s7ivskvvdgykxq7d
+ foreign key (mailFolder)
+ references mailFolder;
+CREATE INDEX idx_MailFolder_waitingStates ON mailfolder_waitingstates(mailFolder);
+CREATE INDEX email_waitingState_idx ON email(waitingState);
+GO
+
+-- Reply
+delete from reply;
+ALTER TABLE reply ALTER sentDate SET NOT NULL;
+ALTER TABLE reply ALTER subject SET NOT NULL;
+ALTER TABLE reply ADD sender varchar(MAX) not null;
+ALTER TABLE reply ADD recipient varchar(MAX) not null;
+ALTER TABLE reply ADD replyContent varchar(255) not null;
+ALTER TABLE reply ADD sentBy varchar(255) not null;
+
+create table replyContent (
+ topiaId varchar(255) not null,
+ topiaVersion bigint not null,
+ topiaCreateDate datetime2,
+ source varbinary(MAX) not null,
+ primary key (topiaId)
+);
+
+alter table reply add constraint UK_7xjte6c6h2lltfpu6ot1bel8k unique (replyContent);
+alter table reply
+ add constraint FK_7xjte6c6h2lltfpu6ot1bel8k
+ foreign key (replyContent)
+ references replyContent;
+
+alter table reply
+ add constraint FK_9m87oooqhsbf1wbad9h4jcwm3
+ foreign key (sentBy)
+ references faxToMailUser;
+GO
+
+-- Last opener
+ALTER TABLE email ADD lastAttachmentOpener varchar(255);
+alter table email
+ add constraint FK_pu5j5vh83354jhoikyvb22jru
+ foreign key (lastAttachmentOpener)
+ references faxToMailUser;
+GO
+
+-- Champs hitory fields en json
+DROP TABLE history_fields;
+ALTER TABLE history ADD fieldsJson varchar(MAX);
+GO
Modified: trunk/faxtomail-service/src/main/resources/pdf/demande.odt
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/resources/pdf/demande.pdf
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/EmailServiceTest.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -112,7 +112,7 @@
filter.setDemandStatus(Collections.singletonList(DemandStatus.ARCHIVED));
filter.setGamme(Collections.singletonList(referentielService.getAllRange().get(0)));
filter.setPriority(referentielService.getAllPriority());
- filter.setEtatAttente(Collections.singletonList(referentielService.getAllEtatAttente().get(0)));
+ filter.setWaitingStates(Collections.singletonList(referentielService.getAllWaitingState().get(0)));
filter.setEdiCodeNumber("test");
filter.setLocalReference("test");
filter.setMessage("test");
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/InitTestDataImpl.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -37,10 +37,6 @@
import java.util.List;
import java.util.Map;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
-import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
-import com.franciaflex.faxtomail.persistence.entities.MailField;
-
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -51,18 +47,21 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
+import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroupTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.History;
import com.franciaflex.faxtomail.persistence.entities.HistoryTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
+import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.MailFolderTopiaDao;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.Range;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.persistence.entities.RangeRowTopiaDao;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
@@ -92,9 +91,9 @@
ReferentielService referentielService = newService(ReferentielService.class);
// import etat attentes
- List<EtatAttente> etatAttentes = null;
+ List<WaitingState> waitingStates = null;
try (InputStream is = InitTestDataImpl.class.getResourceAsStream("/csv/etatattentes.csv")) {
- etatAttentes = referentielService.importEtatAttentes(is);
+ waitingStates = referentielService.importWaitingStates(is);
}
// create test groups and users
@@ -151,7 +150,7 @@
MailFolder sav = folderDao.create(MailFolder.PROPERTY_NAME, "SAV",
MailFolder.PROPERTY_PARENT, franciaflex,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(0, 1),
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(0, 1),
MailFolder.PROPERTY_READ_RIGHT_GROUPS, groups23);
franciaflex.addChildren(sav);
foldersByName.put(sav.getName(), sav);
@@ -159,7 +158,7 @@
// user folders
MailFolder cyrilFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Cyril",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(1, 2),
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(1, 2),
MailFolder.PROPERTY_READ_RIGHT_USERS, Lists.newArrayList(cyril));
chargesClientelle.addChildren(cyrilFolder);
foldersByName.put(cyrilFolder.getName(), cyrilFolder);
@@ -171,7 +170,7 @@
MailFolder agatheFolder = folderDao.create(MailFolder.PROPERTY_NAME, "Agathe",
MailFolder.PROPERTY_PARENT, chargesClientelle,
- MailFolder.PROPERTY_ETAT_ATTENTES, etatAttentes.subList(2, 3));
+ MailFolder.PROPERTY_WAITING_STATES, waitingStates.subList(2, 3));
chargesClientelle.addChildren(agatheFolder);
foldersByName.put(agatheFolder.getName(), agatheFolder);
@@ -255,9 +254,14 @@
Decorator<Date> dateDecorator = getDecoratorService().getDecoratorByType(Date.class, DecoratorService.DATE);
Date now = new Date();
- History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION, History.PROPERTY_FIELDS, Sets.newHashSet(
- Email.PROPERTY_SENDER, Email.PROPERTY_CLIENT, Email.PROPERTY_PROJECT_REFERENCE, Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE,
- Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_DEMAND_STATUS), History.PROPERTY_MODIFICATION_DATE, now);
+ History history = historyDao.create(
+ History.PROPERTY_TYPE, HistoryType.CREATION,
+ History.PROPERTY_MODIFICATION_DATE, now);
+ history.setFields(Sets.newHashSet(
+ Email.PROPERTY_SENDER, Email.PROPERTY_CLIENT,
+ Email.PROPERTY_PROJECT_REFERENCE, Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE,
+ Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_DEMAND_STATUS));
+
String projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(now));
Email email = emailDao.create(Email.PROPERTY_SENDER, sender,
@@ -295,9 +299,11 @@
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -1);
Date yesterday = cal.getTime();
- history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION, History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER,
+ history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION,
+ History.PROPERTY_MODIFICATION_DATE, yesterday);
+ history.setFields(Sets.newHashSet(Email.PROPERTY_SENDER,
Email.PROPERTY_CLIENT, Email.PROPERTY_PROJECT_REFERENCE, Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE,
- Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_DEMAND_STATUS), History.PROPERTY_MODIFICATION_DATE, yesterday);
+ Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_DEMAND_STATUS));
projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(yesterday));
email = emailDao.create(Email.PROPERTY_SENDER, sender,
@@ -326,7 +332,7 @@
email.setDemandType(demandType);
email.setPriority(priorities.get(0));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, null, email.getClient().getCode(), user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY,
+ getEmailService().saveEmail(email, null, null, email.getClient().getCode(), user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY,
Email.PROPERTY_RANGE_ROW);
}
}
Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java
===================================================================
--- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -36,6 +36,7 @@
*
* @author Eric Chatellier
*/
+@Ignore
public class MiscTest extends AbstractFaxToMailServiceTest {
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -70,12 +70,12 @@
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailTopiaApplicationContext;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
@@ -191,8 +191,8 @@
/** Active user cache. */
protected List<FaxToMailUser> faxtomailUserCache;
- /** Etat attente cache. */
- protected List<EtatAttente> etatAttenteCache;
+ /** Waiting state cache. */
+ protected List<WaitingState> waitingStateCache;
/** Demand type cache. */
protected List<DemandType> demandTypeCache;
/** Priority cache. */
@@ -381,7 +381,7 @@
ReferentielService referentielService = serviceContext.getReferentielService();
setRangeCache(referentielService.getAllRange());
setDemandTypeCache(referentielService.getAllDemandType());
- setEtatAttenteCache(referentielService.getAllEtatAttente());
+ setWaitingStateCache(referentielService.getAllWaitingState());
setPriorityCache(referentielService.getAllPriority());
// users
UserService userService = serviceContext.getUserService();
@@ -704,12 +704,12 @@
this.faxtomailUserCache = faxtomailUserCache;
}
- public List<EtatAttente> getEtatAttenteCache() {
- return etatAttenteCache;
+ public List<WaitingState> getWaitingStateCache() {
+ return waitingStateCache;
}
- public void setEtatAttenteCache(List<EtatAttente> etatAttenteCache) {
- this.etatAttenteCache = etatAttenteCache;
+ public void setWaitingStateCache(List<WaitingState> waitingStateCache) {
+ this.waitingStateCache = waitingStateCache;
}
public List<DemandType> getDemandTypeCache() {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -33,7 +33,7 @@
import java.util.Map;
import com.ezware.oxbow.swingbits.table.filter.TableRowFilterSupport;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -112,7 +112,7 @@
log.debug(emails.size() + " emails in folder " + folder.getName());
}
- Map<String, EtatAttente> etatAttenteById = Maps.uniqueIndex(getContext().getEtatAttenteCache(), TopiaEntities.getTopiaIdFunction());
+ Map<String, WaitingState> waitingStateById = Maps.uniqueIndex(getContext().getWaitingStateCache(), TopiaEntities.getTopiaIdFunction());
List<DemandeUIModel> demands = new ArrayList<DemandeUIModel>();
for (Email email : emails) {
@@ -137,9 +137,9 @@
demand.setValid(handler.isDemandeValid(demand));
demand.setMailFolder(folder);
demand.setEditable(folder.isFolderWritable());
- EtatAttente etatAttente = email.getEtatAttente();
- if (etatAttente != null) {
- demand.setEtatAttente(etatAttenteById.get(etatAttente.getTopiaId()));
+ WaitingState waitingState = email.getWaitingState();
+ if (waitingState != null) {
+ demand.setWaitingState(waitingStateById.get(waitingState.getTopiaId()));
}
demands.add(demand);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -3,8 +3,8 @@
/*
* #%L
* FaxToMail :: UI
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2014 Franciaflex, Code Lutin
* %%
Property changes on: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenMailFolderChooserFromListAction.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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -24,11 +24,12 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
-import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntities;
import org.nuiton.util.beans.BeanMonitor;
@@ -38,6 +39,8 @@
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.persistence.entities.Reply;
+import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.service.exceptions.InvalidClientException;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI;
@@ -46,8 +49,6 @@
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
import com.google.common.collect.Maps;
-import static org.nuiton.i18n.I18n.t;
-
/**
* @author Kevin Morin (Code Lutin)
*
@@ -118,11 +119,12 @@
Email email = model.toEntity(persistedEmail);
Collection<Attachment> attachments = model.getAttachment();
+ Collection<Reply> replies = model.getReplies();
String clientCode = model.getClientCode();
BeanMonitor monitor = getHandler().getMonitor();
String[] modifiedProperties = monitor.getModifiedProperties();
- email = serviceContext.getEmailService().saveEmail(email, attachments, clientCode, currentUser, modifiedProperties);
+ email = serviceContext.getEmailService().saveEmail(email, attachments, replies, clientCode, currentUser, modifiedProperties);
model.fromEntity(email);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -32,8 +32,6 @@
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -41,7 +39,6 @@
import java.util.List;
import java.util.Map;
-import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.JTable;
@@ -60,7 +57,6 @@
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
import com.franciaflex.faxtomail.ui.swing.actions.OpenMailFolderChooserFromListAction;
-import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.validator.swing.SwingValidator;
@@ -96,8 +92,6 @@
import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeFromListAction;
import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI;
import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel;
-import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUI;
-import com.franciaflex.faxtomail.ui.swing.content.transmit.MailFolderChooserUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.FolderTreeNode;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-09-03 13:58:29 UTC (rev 598)
@@ -129,15 +129,15 @@
visible: { model.getTopiaId() == null };
}
-#etatAttenteLabel {
- text: "faxtomail.demande.etatAttente.label";
+#waitingStateLabel {
+ text: "faxtomail.demande.waitingState.label";
}
-#etatAttenteComboBox {
- property: etatAttente;
- selectedItem: { model.getEtatAttente() };
+#waitingStateComboBox {
+ property: waitingState;
+ selectedItem: { model.getWaitingState() };
showReset: true;
- _validatorLabel: { t("faxtomail.demande.etatAttente.label") };
+ _validatorLabel: { t("faxtomail.demande.waitingState.label") };
}
#projectReferenceLabel {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-09-03 13:58:29 UTC (rev 598)
@@ -36,7 +36,7 @@
com.franciaflex.faxtomail.persistence.entities.DemandStatus
com.franciaflex.faxtomail.persistence.entities.Range
com.franciaflex.faxtomail.persistence.entities.Priority
- com.franciaflex.faxtomail.persistence.entities.EtatAttente
+ com.franciaflex.faxtomail.persistence.entities.WaitingState
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -73,7 +73,7 @@
<field name='projectReference' component='projectReferenceField'/>
<field name='validRangeRowModels' component='rangePanel'/>
<field name="priority" component="priorityComboBox"/>
- <field name="etatAttente" component="etatAttenteComboBox"/>
+ <field name="waitingState" component="waitingStateComboBox"/>
<field name="companyReference" component="companyReferenceField"/>
<field name="comment" component="commentPane"/>
</BeanValidator>
@@ -178,12 +178,12 @@
</row>
<row>
<cell>
- <JLabel id='etatAttenteLabel'/>
+ <JLabel id='waitingStateLabel'/>
</cell>
<cell weightx='1' columns="3">
- <BeanFilterableComboBox id='etatAttenteComboBox'
+ <BeanFilterableComboBox id='waitingStateComboBox'
constructorParams='this'
- genericType="EtatAttente"/>
+ genericType="WaitingState"/>
</cell>
</row>
<row>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -71,12 +71,12 @@
import com.franciaflex.faxtomail.persistence.entities.DemandStatus;
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.persistence.entities.Range;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAction;
@@ -150,14 +150,14 @@
initBeanFilterableComboBox(ui.getDocTypeComboBox(), demandTypes, model.getDemandType());
// utilisation des etats d'attente défini pour le dossier (si défini)
- List<EtatAttente> etatAttentes = new ArrayList<EtatAttente>();
- Collection<EtatAttente> folderEtatAttentes = getEtatAttenteForFolder(folder);
- if (CollectionUtils.isEmpty(folderEtatAttentes)) {
- etatAttentes.addAll(getContext().getEtatAttenteCache());
+ List<WaitingState> waitingStates = new ArrayList<WaitingState>();
+ Collection<WaitingState> folderWaitingStates = getWaitingStateForFolder(folder);
+ if (CollectionUtils.isEmpty(folderWaitingStates)) {
+ waitingStates.addAll(getContext().getWaitingStateCache());
} else {
- etatAttentes.addAll(folderEtatAttentes);
+ waitingStates.addAll(folderWaitingStates);
}
- initBeanFilterableComboBox(ui.getEtatAttenteComboBox(), etatAttentes, model.getEtatAttente());
+ initBeanFilterableComboBox(ui.getWaitingStateComboBox(), waitingStates, model.getWaitingState());
JTextPane editor = ui.getMailBodyField();
FaxToMailUIUtil.setEmailContentInTextPane(this, editor, model);
@@ -470,10 +470,10 @@
* @param folder base folder
* @return etat d'attente to use
*/
- protected Collection<EtatAttente> getEtatAttenteForFolder(MailFolder folder) {
- Collection<EtatAttente> result = null;
+ protected Collection<WaitingState> getWaitingStateForFolder(MailFolder folder) {
+ Collection<WaitingState> result = null;
while (CollectionUtils.isEmpty(result) && folder != null) {
- result = folder.getEtatAttentes();
+ result = folder.getWaitingStates();
folder = folder.getParent();
}
return result;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -22,6 +22,35 @@
* #L%
*/
+import static org.nuiton.i18n.I18n.t;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.ByteArrayInputStream;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.activation.DataSource;
+import javax.mail.Address;
+import javax.mail.BodyPart;
+import javax.mail.Message;
+import javax.mail.Part;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.application.swing.tab.TabContentModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl;
import com.franciaflex.faxtomail.persistence.entities.Client;
@@ -30,7 +59,6 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailGroup;
import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.History;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
@@ -39,43 +67,16 @@
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.persistence.entities.Reply;
+import com.franciaflex.faxtomail.persistence.entities.ReplyImpl;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
+import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentModelAware;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
-import com.franciaflex.faxtomail.ui.swing.content.attachment.AttachmentModelAware;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.jaxx.application.swing.tab.TabContentModel;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
-
-import javax.activation.DataSource;
-import javax.mail.Address;
-import javax.mail.BodyPart;
-import javax.mail.Message;
-import javax.mail.Part;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.ByteArrayInputStream;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import static org.nuiton.i18n.I18n.t;
-
/**
* @author kmorin - kmorin(a)codelutin.com
*
@@ -99,6 +100,8 @@
protected final List<Attachment> attachments = new ArrayList<Attachment>();
+ protected final List<Reply> replies = new ArrayList<Reply>();
+
protected final List<DemandeUIModel> groupedDemandes = new ArrayList<DemandeUIModel>();
protected final List<RangeRowModel> validRangeRowModels = new ArrayList<RangeRowModel>();
@@ -141,7 +144,9 @@
BinderFactory.newBinder(Email.class, DemandeUIModel.class);
protected static Binder<Attachment, Attachment> fromAttachmentBinder =
- BinderFactory.newBinder(Attachment.class, Attachment.class);
+ BinderFactory.newBinder(Attachment.class);
+
+ protected static Binder<Reply, Reply> fromReplyBinder = BinderFactory.newBinder(Reply.class);
public DemandeUIModel() {
super(fromBeanBinder, toBeanBinder);
@@ -194,14 +199,19 @@
*/
@Override
public void fromEntity(Email entity) {
- fromBeanBinder.copyExcluding(entity, this, Email.PROPERTY_ATTACHMENT);
+ fromBeanBinder.copyExcluding(entity, this, Email.PROPERTY_ATTACHMENT, Email.PROPERTY_REPLIES);
loadAttachments(entity);
setGroupedDemandes(entity.getEmailGroup());
+ loadReplies(entity);
}
public void fromEntityExcluding(Email entity, Set<String> properties) {
+ // on ajoute les exclusions par defaut
+ // si les exclusions étaient déjà exclue par l'appelant les boolean seront faux
+ // et on a pas besoin de faire un chargement specifique de ces entités.
boolean includeAttachment = properties.add(Email.PROPERTY_ATTACHMENT);
boolean includeDemandGroup = properties.add(Email.PROPERTY_EMAIL_GROUP);
+ boolean includeReply = properties.add(Email.PROPERTY_REPLIES);
fromBeanBinder.copyExcluding(entity, this, properties.toArray(new String[properties.size()]));
if (includeAttachment) {
loadAttachments(entity);
@@ -209,6 +219,9 @@
if (includeDemandGroup) {
setGroupedDemandes(entity.getEmailGroup());
}
+ if (includeReply) {
+ loadReplies(entity);
+ }
}
public void fromEntityIncluding(Email entity, Set<String> properties) {
@@ -219,6 +232,9 @@
if (properties.isEmpty() || properties.contains(Email.PROPERTY_EMAIL_GROUP)) {
setGroupedDemandes(entity.getEmailGroup());
}
+ if (properties.isEmpty() || properties.contains(Email.PROPERTY_REPLIES)) {
+ loadReplies(entity);
+ }
}
protected void loadAttachments(Email entity) {
@@ -234,6 +250,24 @@
setAttachment(attachmentCopy);
}
+ /**
+ * On ne copie pas entierrement les réponses pour ne pas forcer le chargement du contenu binaire du fichier en mémoire.
+ *
+ * @param entity entity
+ */
+ protected void loadReplies(Email entity) {
+
+ List<Reply> replyCopy = new ArrayList<Reply>();
+ if (entity.getReplies() != null) {
+ for (Reply reply : entity.getReplies()) {
+ Reply clone = new ReplyImpl();
+ fromReplyBinder.copyExcluding(reply, clone, Reply.PROPERTY_REPLY_CONTENT);
+ replyCopy.add(clone);
+ }
+ }
+ setReplies(replyCopy);
+ }
+
@Override
public Email toEntity() {
Email result = newEntity();
@@ -376,14 +410,14 @@
return clientBrand;
}
- public void setEtatAttente(EtatAttente etatAttente) {
- Object oldValue = getEtatAttente();
- editObject.setEtatAttente(etatAttente);
- firePropertyChanged(Email.PROPERTY_ETAT_ATTENTE, oldValue, etatAttente);
+ public void setWaitingState(WaitingState waitingState) {
+ Object oldValue = getWaitingState();
+ editObject.setWaitingState(waitingState);
+ firePropertyChanged(Email.PROPERTY_WAITING_STATE, oldValue, waitingState);
}
- public EtatAttente getEtatAttente() {
- return editObject.getEtatAttente();
+ public WaitingState getWaitingState() {
+ return editObject.getWaitingState();
}
public void setTakenBy(FaxToMailUser faxToMailUser) {
@@ -813,10 +847,6 @@
}
public void addReplies(Reply reply) {
- Object oldValue = null;
- if (getReplies() != null) {
- oldValue = new ArrayList<Reply>(getReplies());
- }
editObject.addReplies(reply);
firePropertyChange(Email.PROPERTY_REPLIES, null, getReplies());
}
@@ -828,10 +858,6 @@
}
public void setReplies(List<Reply> replies) {
- Object oldValue = null;
- if (getReplies() != null) {
- oldValue = new ArrayList<Reply>(getReplies());
- }
editObject.setReplies(replies);
firePropertyChange(Email.PROPERTY_REPLIES, null, getReplies());
}
@@ -910,9 +936,9 @@
result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.PRIORITY)
|| getPriority() != null;
- } else if (Email.PROPERTY_ETAT_ATTENTE.equals(field)) {
- result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.ETAT_ATTENTE)
- || getEtatAttente() != null;
+ } else if (Email.PROPERTY_WAITING_STATE.equals(field)) {
+ result = !FaxToMailServiceUtils.contains(demandType.getRequiredFields(), MailField.WAITING_STATE)
+ || getWaitingState() != null;
}
}
return result;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -24,8 +24,6 @@
* #L%
*/
-import static org.nuiton.i18n.I18n.t;
-
import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -55,11 +53,9 @@
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.Email;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
import com.franciaflex.faxtomail.ui.swing.actions.ArchiveAction;
import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAndExitAction;
-import com.franciaflex.faxtomail.ui.swing.content.search.SearchToGroupUI;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
/**
@@ -114,7 +110,7 @@
if (evt.getPropertyName().equals(DemandeUIModel.PROPERTY_VALID)
|| evt.getPropertyName().equals(DemandeUIModel.PROPERTY_EDITABLE)
- || evt.getPropertyName().equals(Email.PROPERTY_ETAT_ATTENTE)) {
+ || evt.getPropertyName().equals(Email.PROPERTY_WAITING_STATE)) {
updateButtonEnability();
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryItemModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryItemModel.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryItemModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -42,6 +42,8 @@
*/
public class HistoryItemModel extends AbstractFaxToMailBeanUIModel<History, HistoryItemModel> {
+ public static final String PROPERTY_FIELDS = "fields";
+
protected static Binder<HistoryItemModel, History> toBeanBinder =
BinderFactory.newBinder(HistoryItemModel.class,
History.class);
@@ -67,7 +69,7 @@
public void setFields(Set<String> fields) {
editObject.setFields(fields != null ? Sets.newLinkedHashSet(fields) : null);
- firePropertyChanged(History.PROPERTY_FIELDS, null, fields);
+ firePropertyChanged(PROPERTY_FIELDS, null, fields);
}
public Set<String> getFields() {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -76,7 +76,7 @@
n("faxtomail.demande.demandStatus.label");
n("faxtomail.demande.demandType.label");
n("faxtomail.demande.priority.label");
- n("faxtomail.demande.etatAttente.label");
+ n("faxtomail.demande.waitingState.label");
n("faxtomail.demande.takenBy.label");
n("faxtomail.demande.rangeRow.label");
}
@@ -89,7 +89,7 @@
final JXList list = ui.getHistories();
list.setCellRenderer(new HistoryListCellRenderer());
- JaxxDefaultListModel listModel = new JaxxDefaultListModel<History>();
+ JaxxDefaultListModel<History> listModel = new JaxxDefaultListModel<History>();
List<History> histories = new ArrayList<History>();
listModel.setAllElements(histories);
list.setModel(listModel);
@@ -197,12 +197,12 @@
}
protected class HistoryListCellRenderer extends HistoryItem
- implements ListCellRenderer {
+ implements ListCellRenderer<History> {
public HistoryListCellRenderer() {
super(HistoryListUIHandler.this);
- getModel().addPropertyChangeListener(History.PROPERTY_FIELDS, new PropertyChangeListener() {
+ getModel().addPropertyChangeListener(HistoryItemModel.PROPERTY_FIELDS, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getNewValue() != null) {
@@ -215,8 +215,7 @@
}
@Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- History history = (History) value;
+ public Component getListCellRendererComponent(JList<? extends History> list, History history, int index, boolean isSelected, boolean cellHasFocus) {
getModel().fromEntity(history);
if (CollectionUtils.isEmpty(getModel().getFields())) {
remove(getFields());
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -72,10 +72,12 @@
import com.franciaflex.faxtomail.persistence.entities.AttachmentFileImpl;
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.Reply;
+import com.franciaflex.faxtomail.persistence.entities.ReplyContent;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI;
import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.google.common.collect.Iterables;
/**
@@ -187,12 +189,14 @@
closeEditor();
Reply reply = item.getReply();
+ FaxToMailUIUtil.forceReplyContentLoading(getContext(), reply);
boolean editable = item.isEditable();
try {
ReplyFormUI dialogContent = new ReplyFormUI(ui);
// TODO echatellier 20140804 : c'est très technique et très bas niveau, ca devrait se trouver dans les services
- Message message = new MimeMessage(null, new ByteArrayInputStream(reply.getEmailSource().getBytes()));
+ ReplyContent replyContent = reply.getReplyContent();
+ Message message = new MimeMessage(null, new ByteArrayInputStream(replyContent.getSource()));
ReplyFormUIModel replyModel = dialogContent.getModel();
replyModel.setEditable(editable);
replyModel.setReadonly(true);
@@ -228,12 +232,14 @@
closeEditor();
Reply reply = item.getReply();
+ FaxToMailUIUtil.forceReplyContentLoading(getContext(), reply);
boolean editable = item.isEditable();
try {
ReplyFormUI dialogContent = new ReplyFormUI(ui);
// TODO echatellier 20140804 : c'est très technique et très bas niveau, ca devrait se trouver dans les services
- Message message = new MimeMessage(null, new ByteArrayInputStream(reply.getEmailSource().getBytes()));
+ ReplyContent replyContent = reply.getReplyContent();
+ Message message = new MimeMessage(null, new ByteArrayInputStream(replyContent.getSource()));
ReplyFormUIModel replyModel = dialogContent.getModel();
replyModel.setEditable(editable);
replyModel.setOriginalDemand(ui.getModel());
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-09-03 13:58:29 UTC (rev 598)
@@ -216,8 +216,8 @@
text: "faxtomail.demande.status.label";
}
-#etatAttenteLabel {
- text: "faxtomail.demande.etatAttente.label";
+#waitingStateLabel {
+ text: "faxtomail.demande.waitingState.label";
}
#projectReferenceLabel {
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx 2014-09-03 13:58:29 UTC (rev 598)
@@ -33,7 +33,7 @@
com.franciaflex.faxtomail.persistence.entities.DemandStatus
com.franciaflex.faxtomail.persistence.entities.Range
com.franciaflex.faxtomail.persistence.entities.Priority
- com.franciaflex.faxtomail.persistence.entities.EtatAttente
+ com.franciaflex.faxtomail.persistence.entities.WaitingState
com.franciaflex.faxtomail.persistence.entities.FaxToMailUser
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -288,10 +288,10 @@
</cell>
<cell>
- <JLabel id='etatAttenteLabel'/>
+ <JLabel id='waitingStateLabel'/>
</cell>
<cell columns='3' weightx='2'>
- <JComboBox id='etatAttenteComboBox' genericType="EtatAttente"/>
+ <JComboBox id='waitingStateComboBox' genericType="WaitingState"/>
</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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -147,10 +147,10 @@
model.getPriority(),
EmailFilter.PROPERTY_PRIORITY,
true);
- initCheckBoxComboBox(ui.getEtatAttenteComboBox(),
- getContext().getEtatAttenteCache(),
- model.getEtatAttente(),
- EmailFilter.PROPERTY_ETAT_ATTENTE,
+ initCheckBoxComboBox(ui.getWaitingStateComboBox(),
+ getContext().getWaitingStateCache(),
+ model.getWaitingStates(),
+ EmailFilter.PROPERTY_WAITING_STATES,
true);
initCheckBoxComboBox(ui.getStatusComboBox(),
Arrays.asList(DemandStatus.values()),
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-09-03 13:58:29 UTC (rev 598)
@@ -197,21 +197,10 @@
text: "faxtomail.demande.client.label";
}
-/*#clientField {
- text: {model.getClientCode()};
-}*/
-
#docTypeLabel {
text: "faxtomail.demande.docType.label";
}
-/*
-#docTypeComboBox {
- property: demandType;
- selectedItem: { model.getDemandType() };
-}
-*/
-
#ediCodeNumberLabel {
text: "faxtomail.demande.ediCodeNumber.label";
}
@@ -224,31 +213,14 @@
text: "faxtomail.demande.priority.label";
}
-/*#priorityComboBox {
- property: priority;
- selectedItem: { model.getPriority() };
-}*/
-
#statusLabel {
text: "faxtomail.demande.status.label";
}
-/*
-#statusComboBox {
- property: demandStatus;
- selectedItem: { model.getDemandStatus() };
+#waitingStateLabel {
+ text: "faxtomail.demande.waitingState.label";
}
-*/
-#etatAttenteLabel {
- text: "faxtomail.demande.etatAttente.label";
-}
-
-/*#etatAttenteComboBox {
- property: etatAttente;
- selectedItem: { model.getEtatAttente() };
-}*/
-
#projectReferenceLabel {
text: "faxtomail.demande.projectReference.label";
}
@@ -293,20 +265,12 @@
text: "faxtomail.demande.gamme.label";
}
-/*
-#gammeComboBox {
- property: gamme;
- selectedItem: { model.getGamme() };
-}
-*/
-
#addGroupedElementCheckbox {
text: "faxtomail.search.addGroupedElement.label";
}
#searchButton {
text: "faxtomail.search.button.label";
- /* _applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.SearchAction.class }; */
}
#dataTable {
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-09-03 13:58:29 UTC (rev 598)
@@ -33,7 +33,7 @@
com.franciaflex.faxtomail.persistence.entities.DemandStatus
com.franciaflex.faxtomail.persistence.entities.Range
com.franciaflex.faxtomail.persistence.entities.Priority
- com.franciaflex.faxtomail.persistence.entities.EtatAttente
+ com.franciaflex.faxtomail.persistence.entities.WaitingState
com.franciaflex.faxtomail.persistence.entities.FaxToMailUser
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -299,10 +299,10 @@
</cell>
<cell>
- <JLabel id='etatAttenteLabel'/>
+ <JLabel id='waitingStateLabel'/>
</cell>
<cell columns='3' weightx='2'>
- <JComboBox id='etatAttenteComboBox' genericType="EtatAttente"/>
+ <JComboBox id='waitingStateComboBox' genericType="WaitingState"/>
</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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -132,10 +132,10 @@
model.getPriority(),
EmailFilter.PROPERTY_PRIORITY,
true);
- initCheckBoxComboBox(ui.getEtatAttenteComboBox(),
- getContext().getEtatAttenteCache(),
- model.getEtatAttente(),
- EmailFilter.PROPERTY_ETAT_ATTENTE,
+ initCheckBoxComboBox(ui.getWaitingStateComboBox(),
+ getContext().getWaitingStateCache(),
+ model.getWaitingStates(),
+ EmailFilter.PROPERTY_WAITING_STATES,
true);
initCheckBoxComboBox(ui.getStatusComboBox(),
Arrays.asList(DemandStatus.values()),
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -36,10 +36,10 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
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.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.Range;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
@@ -131,13 +131,13 @@
return editObject.getBody();
}
- public void setEtatAttente(List<EtatAttente> etatAttente) {
- editObject.setEtatAttente(etatAttente);
- firePropertyChanged(EmailFilter.PROPERTY_ETAT_ATTENTE, null, etatAttente);
+ public void setWaitingState(List<WaitingState> waitingStates) {
+ editObject.setWaitingStates(waitingStates);
+ firePropertyChanged(EmailFilter.PROPERTY_WAITING_STATES, null, waitingStates);
}
- public List<EtatAttente> getEtatAttente() {
- return editObject.getEtatAttente();
+ public List<WaitingState> getWaitingStates() {
+ return editObject.getWaitingStates();
}
public void setTakenBy(FaxToMailUser faxToMailUser) {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -37,14 +37,12 @@
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.swing.util.Cancelable;
-import com.franciaflex.faxtomail.persistence.entities.DemandType;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
@@ -67,19 +65,19 @@
MailFolder currentMailFolder = model.getDemandeUIModels().get(0).getMailFolder();
// on recupere seulement les dossiers qui accepte l'ensemble des états d'attentes de l'ensemble des demandes
- Set<EtatAttente> allEtatsAttentes = new HashSet<EtatAttente>();
+ Set<WaitingState> allWaitingStates = new HashSet<WaitingState>();
for (DemandeUIModel demande : model.getDemandeUIModels()) {
- if (demande.getEtatAttente() != null) {
- allEtatsAttentes.add(demande.getEtatAttente());
+ if (demande.getWaitingState() != null) {
+ allWaitingStates.add(demande.getWaitingState());
}
}
FaxToMailServiceContext serviceContext = getContext().newServiceContext();
- Collection<MailFolder> foldersWithEtatAttente = null;
- // foldersWithEtatAttente reste à null dans le cas ou l'arbre ne doit pas être filtré
+ Collection<MailFolder> foldersWithWaitingState = null;
+ // foldersWithWaitingState reste à null dans le cas ou l'arbre ne doit pas être filtré
// sinon l'appel peut renvoyer une liste de vide dans le cas où aucun dossier n'est selectionnable
- if (!allEtatsAttentes.isEmpty()) {
- foldersWithEtatAttente = serviceContext.getMailFolderService().getFoldersWithEtatAttente(allEtatsAttentes);
+ if (!allWaitingStates.isEmpty()) {
+ foldersWithWaitingState = serviceContext.getMailFolderService().getFoldersWithWaitingState(allWaitingStates);
}
// init tree
@@ -103,7 +101,7 @@
// - le dossier cible à les mêmes etatAttente/typeDemande que toutes les demandes à bouger
folderTreeNode.setCanSelect(!currentMailFolder.equals(folder) &&
folderWithAllowMoveDemandIntoFolder.isFolderMoveable() &&
- (foldersWithEtatAttente == null || foldersWithEtatAttente.contains(folder)));
+ (foldersWithWaitingState == null || foldersWithWaitingState.contains(folder)));
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -209,7 +209,7 @@
break;
case DEMAND_TYPE:
- case ETAT_ATTENTE:
+ case WAITING_STATE:
tableCellRenderer = newTableCellRender(HasLabel.class);
break;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -71,7 +71,7 @@
import com.franciaflex.faxtomail.FaxToMailConfiguration;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
@@ -441,14 +441,14 @@
public boolean isActionEnabled(DemandeUIModel model, MailAction action, Configuration config) {
- EtatAttente etatAttente = model.getEtatAttente();
+ WaitingState waitingState = model.getWaitingState();
boolean valid = model.isValid();
boolean enabled =
- etatAttente == null && (valid || !FaxToMailServiceUtils.contains(config.getInvalidFormDisabledActions(), action))
- || etatAttente != null &&
- (valid && !FaxToMailServiceUtils.contains(etatAttente.getValidFormDisabledActions(), action)
- || !valid && !FaxToMailServiceUtils.contains(etatAttente.getInvalidFormDisabledActions(), action));
+ waitingState == null && (valid || !FaxToMailServiceUtils.contains(config.getInvalidFormDisabledActions(), action))
+ || waitingState != null &&
+ (valid && !FaxToMailServiceUtils.contains(waitingState.getValidFormDisabledActions(), action)
+ || !valid && !FaxToMailServiceUtils.contains(waitingState.getInvalidFormDisabledActions(), action));
return enabled;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -101,9 +101,9 @@
n("faxtomail.demandeList.table.header.ediCodeNumber"),
n("faxtomail.demandeList.table.header.ediCodeNumber.tip")));
- put(MailField.ETAT_ATTENTE,
+ put(MailField.WAITING_STATE,
ColumnIdentifier.<Email>newReadOnlyId(
- Email.PROPERTY_ETAT_ATTENTE,
+ Email.PROPERTY_WAITING_STATE,
n("faxtomail.demandeList.table.header.waitingState"),
n("faxtomail.demandeList.table.header.waitingState.tip")));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -86,6 +86,8 @@
import com.franciaflex.faxtomail.persistence.entities.ExtensionCommand;
import com.franciaflex.faxtomail.persistence.entities.MailField;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.persistence.entities.Reply;
+import com.franciaflex.faxtomail.persistence.entities.ReplyContent;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.services.FaxToMailServiceUtils;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
@@ -381,6 +383,24 @@
}
}
}
+
+ /**
+ * Force le chargement des contenu source binaire des réponses.
+ *
+ * @param context context
+ * @param reply reply
+ */
+ public static void forceReplyContentLoading(FaxToMailUIContext context, Reply reply) {
+ if (log.isDebugEnabled()) {
+ log.debug("Force source loading " + reply.getSubject());
+ }
+ if (reply.isPersisted() && reply.getReplyContent() == null) {
+ FaxToMailServiceContext serviceContext = context.newServiceContext();
+ EmailService service = serviceContext.getEmailService();
+ ReplyContent replyContent = service.getReplyContent(reply.getTopiaId());
+ reply.setReplyContent(replyContent);
+ }
+ }
public static Desktop getDesktopForPrint() {
Modified: trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel-error-validation.xml 2014-09-03 13:58:29 UTC (rev 598)
@@ -81,12 +81,12 @@
</field-validator>
</field>
- <field name="etatAttente">
+ <field name="waitingState">
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[ isValid("etatAttente") ]]>
+ <![CDATA[ isValid("waitingState") ]]>
</param>
- <message>faxtomail.validator.error.email.etatAttente.required</message>
+ <message>faxtomail.validator.error.email.waitingState.required</message>
</field-validator>
</field>
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-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-09-03 13:58:29 UTC (rev 598)
@@ -108,7 +108,6 @@
faxtomail.demande.docType.label=Type
faxtomail.demande.ediCodeNumber.label=Code EDI
faxtomail.demande.ediError.label=Retour EDI
-faxtomail.demande.etatAttente.label=État attente
faxtomail.demande.fax.label=Fax
faxtomail.demande.firstOpened.label=Première ouverture
faxtomail.demande.gamme.label=Gamme
@@ -140,6 +139,7 @@
faxtomail.demande.toRecipients.label=À \:
faxtomail.demande.transferBy.label=Déplacé par
faxtomail.demande.transmit.button.label=Déplacer
+faxtomail.demande.waitingState.label=État attente
faxtomail.demandeList.action.archive=Archiver
faxtomail.demandeList.action.archive.tip=Archiver l'élément
faxtomail.demandeList.action.computeQuantitiesByRange=Calculer les quantités par gamme
@@ -289,11 +289,11 @@
faxtomail.validator.error.email.comment.required=Message requis
faxtomail.validator.error.email.companyReference.required=Notre référence requis
faxtomail.validator.error.email.demandType.required=Type de demande requis
-faxtomail.validator.error.email.etatAttente.required=État d'attente requis
faxtomail.validator.error.email.object.required=Objet requis
faxtomail.validator.error.email.priority.required=Priorité requise
faxtomail.validator.error.email.projectReference.required=Référence chantier requise
faxtomail.validator.error.email.rangeRow.required=Tableau des gammes requis
+faxtomail.validator.error.email.waitingState.required=État d'attente requis
faxtomail.validator.error.reply.cc.email=Le champ 'Copie\:' doit être une adresse email valide \!
faxtomail.validator.error.reply.cci.email=Le champ 'opie cachée\:' doit être une adresse email valide \!
faxtomail.validator.error.reply.from.email=
Property changes on: trunk/faxtomail-ui-swing/src/main/resources/icons/action-folder_edit.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -40,7 +40,7 @@
import com.franciaflex.faxtomail.persistence.entities.DemandType;
import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EmailProtocol;
-import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
+import com.franciaflex.faxtomail.persistence.entities.WaitingState;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup;
import com.franciaflex.faxtomail.persistence.entities.MailAction;
@@ -79,9 +79,9 @@
protected Configuration configuration;
- protected List<EtatAttente> etatAttentes;
+ protected List<WaitingState> waitingStates;
- protected Map<String, Long> etatAttentesUsage;
+ protected Map<String, Long> waitingStatesUsage;
protected List<DemandType> demandTypes;
@@ -110,8 +110,8 @@
@Override
@Action("configuration-input")
public String input() throws Exception {
- etatAttentes = referentielService.getAllEtatAttente();
- etatAttentesUsage = referentielService.getEtatAttentesUsage();
+ waitingStates = referentielService.getAllWaitingState();
+ waitingStatesUsage = referentielService.getWaitingStatesUsage();
demandTypes = referentielService.getAllDemandType();
ranges = referentielService.getAllRange();
mailFolders = mailFolderService.getRootMailFolders();
@@ -129,7 +129,7 @@
public String execute() throws Exception {
String result = super.execute();
- configurationService.save(configuration, demandTypes, etatAttentes, mailFolders, mailFilters, emailAccounts);
+ configurationService.save(configuration, demandTypes, waitingStates, mailFolders, mailFilters, emailAccounts);
return result;
}
@@ -158,17 +158,17 @@
this.configuration = getGson().fromJson(json, Configuration.class);
}
- public List<EtatAttente> getEtatAttentes() {
- return etatAttentes;
+ public List<WaitingState> getWaitingStates() {
+ return waitingStates;
}
- public void setEtatAttentesJson(String json) {
- Type type = new TypeToken<List<EtatAttente>>() {}.getType();
- this.etatAttentes = getGson().fromJson(json, type);
+ public void setWaitingStatesJson(String json) {
+ Type type = new TypeToken<List<WaitingState>>() {}.getType();
+ this.waitingStates = getGson().fromJson(json, type);
}
- public Map<String, Long> getEtatAttentesUsage() {
- return etatAttentesUsage;
+ public Map<String, Long> getWaitingStatesUsage() {
+ return waitingStatesUsage;
}
public List<DemandType> getDemandTypes() {
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportAction.java 2014-09-03 13:58:29 UTC (rev 598)
@@ -54,7 +54,7 @@
protected File demandTypeFile;
protected File rangeFile;
protected File priorityFile;
- protected File etatAttenteFile;
+ protected File waitingStateFile;
public void setReferentielService(ReferentielService referentielService) {
this.referentielService = referentielService;
@@ -76,8 +76,8 @@
this.priorityFile = priorityFile;
}
- public void setEtatAttenteFile(File etatAttenteFile) {
- this.etatAttenteFile = etatAttenteFile;
+ public void setWaitingStateFile(File waitingStateFile) {
+ this.waitingStateFile = waitingStateFile;
}
@Override
@@ -138,10 +138,10 @@
}
}
- // etatAttenteFile
- if (etatAttenteFile != null) {
- try (InputStream is = new FileInputStream(etatAttenteFile)) {
- referentielService.importEtatAttentes(is);
+ // waitingStateFile
+ if (waitingStateFile != null) {
+ try (InputStream is = new FileInputStream(waitingStateFile)) {
+ referentielService.importWaitingStates(is);
getSession().addMessage("Fichier état attente importé avec succes");
} catch (Exception ex) {
addActionError(ex.getMessage());
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-09-03 13:58:29 UTC (rev 598)
@@ -41,8 +41,8 @@
'emailProtocolPorts': <s:property value="toJson(emailProtocolPorts)" escapeHtml="false"/>,
// datas
'configuration': <s:property value="toJson(configuration)" escapeHtml="false"/>,
- 'etatAttentes': <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
- 'etatAttentesUsage': <s:property value="toJson(etatAttentesUsage)" escapeHtml="false"/>,
+ 'waitingStates': <s:property value="toJson(waitingStates)" escapeHtml="false"/>,
+ 'waitingStatesUsage': <s:property value="toJson(waitingStatesUsage)" escapeHtml="false"/>,
'demandTypes': <s:property value="toJson(demandTypes)" escapeHtml="false"/>,
'ranges': <s:property value="toJson(ranges)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
@@ -72,7 +72,7 @@
<ul id="tabs" class="nav nav-tabs">
<li class="active"><a href="#tabs-general" data-toggle="tab">Général</a></li>
- <li><a href="#tabs-etatAttente" data-toggle="tab">États d'attente</a></li>
+ <li><a href="#tabs-waitingState" data-toggle="tab">États d'attente</a></li>
<li><a href="#tabs-demandType" data-toggle="tab">Types de demandes</a></li>
<li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
<li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
@@ -142,22 +142,22 @@
</table>
</div>
- <div id="tabs-etatAttente" class="tab-pane" ng-controller="ConfigurationEtatAttenteController">
- <input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" />
+ <div id="tabs-waitingState" class="tab-pane" ng-controller="ConfigurationWaitingStateController">
+ <input type="hidden" name="waitingStatesJson" value="{{waitingStates}}" />
<div class="row">
<div class="col-md-4">
- <h3>États d'attente <input type="button" class="btn btn-success btn-xs pull-right" value="Nouveau" ng-click="newEtatAttente()" /></h3>
+ <h3>États d'attente <input type="button" class="btn btn-success btn-xs pull-right" value="Nouveau" ng-click="newWaitingState()" /></h3>
<table class="table table-hover">
<tbody>
- <tr ng-repeat="etatAttente in etatAttentes"
- ng-class="{'info' : etatAttente == selectedEtatAttente}"
- ng-click="editEtatAttente(etatAttente)">
- <td>{{etatAttente.label}}
+ <tr ng-repeat="waitingState in waitingStates"
+ ng-class="{'info' : waitingState == selectedWaitingState}"
+ ng-click="editWaitingState(waitingState)">
+ <td>{{waitingState.label}}
- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteEtatAttente(etatAttente, $index)"
- ng-disabled="etatAttentesUsage[etatAttente.topiaId] > 0"
- tooltip="{{etatAttentesUsage[etatAttente.topiaId] > 0 && 'Cet état d\'attente est utilisé et ne peut pas être supprimé'|| 'Supprimer cet état d\'attente'}}">
+ <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteWaitingState(waitingState, $index)"
+ ng-disabled="waitingStatesUsage[waitingState.topiaId] > 0"
+ tooltip="{{waitingStatesUsage[waitingState.topiaId] > 0 && 'Cet état d\'attente est utilisé et ne peut pas être supprimé'|| 'Supprimer cet état d\'attente'}}">
<span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
@@ -165,25 +165,25 @@
</table>
</div>
- <div class="col-md-8" ng-if="selectedEtatAttente">
- <h3>Édition de l'état d'attente {{selectedEtatAttente.label}}</h3>
+ <div class="col-md-8" ng-if="selectedWaitingState">
+ <h3>Édition de l'état d'attente {{selectedWaitingState.label}}</h3>
Actions autorisées lorsque la demande est <strong>valide</strong> :
<div class="checkbox" ng-repeat="(mailAction,label) in mailActions">
<label>
- <input type="checkbox" ng-checked="selectedEtatAttente.validFormDisabledActions.indexOf(mailAction) == -1"
- ng-click="changeEtatAttenteValidAction(mailAction)"> {{label}}
+ <input type="checkbox" ng-checked="selectedWaitingState.validFormDisabledActions.indexOf(mailAction) == -1"
+ ng-click="changeWaitingStateValidAction(mailAction)"> {{label}}
</label>
</div>
Actions autorisées lorsque la demande est <strong>invalide</strong> :
<div class="checkbox" ng-repeat="(mailAction,label) in mailActions">
<label>
- <input type="checkbox" ng-checked="selectedEtatAttente.invalidFormDisabledActions.indexOf(mailAction) == -1"
- ng-click="changeEtatAttenteInvalidAction(mailAction)"> {{label}}
+ <input type="checkbox" ng-checked="selectedWaitingState.invalidFormDisabledActions.indexOf(mailAction) == -1"
+ ng-click="changeWaitingStateInvalidAction(mailAction)"> {{label}}
</label>
</div>
</div>
- <div class="col-md-8" ng-if="!selectedEtatAttente">
+ <div class="col-md-8" ng-if="!selectedWaitingState">
<em>Sélectionnez un état d'attente.</em>
</div>
</div>
@@ -587,25 +587,25 @@
<div id="collapse3" class="panel-collapse collapse">
<div class="panel-body">
<label ng-if="selectedMailFolder.$parent">
- <input type="radio" ng-model="selectedMailFolder.useCurrentLevelEtatAttente"
- ng-value="false" ng-change="initFolderEtatAttente()" />
+ <input type="radio" ng-model="selectedMailFolder.useCurrentLevelWaitingState"
+ ng-value="false" ng-change="initFolderWaitingState()" />
Hériter des états d'attente déclarés sur les dossiers parent :
</label>
- <div class="checkbox" ng-repeat="etatAttente in etatAttentes" ng-if="selectedMailFolder.$parent && !selectedMailFolder.useCurrentLevelEtatAttente">
+ <div class="checkbox" ng-repeat="waitingState in waitingStates" ng-if="selectedMailFolder.$parent && !selectedMailFolder.useCurrentLevelWaitingState">
<label>
- <input type="checkbox" ng-checked="parentScopeValues.etatAttentes.containsByTopiaId(etatAttente)"
- disabled> {{etatAttente.label}}
+ <input type="checkbox" ng-checked="parentScopeValues.waitingStates.containsByTopiaId(waitingState)"
+ disabled> {{waitingState.label}}
</label>
</div>
<label>
- <input type="radio" ng-model="selectedMailFolder.useCurrentLevelEtatAttente" ng-value="true"
- ng-change="initFolderEtatAttente()" ng-if="selectedMailFolder.$parent" />
+ <input type="radio" ng-model="selectedMailFolder.useCurrentLevelWaitingState" ng-value="true"
+ ng-change="initFolderWaitingState()" ng-if="selectedMailFolder.$parent" />
Définir les états d'attente pour ce dossier :
</label>
- <div class="checkbox" ng-repeat="etatAttente in etatAttentes" ng-if="selectedMailFolder.useCurrentLevelEtatAttente || !selectedMailFolder.$parent">
+ <div class="checkbox" ng-repeat="waitingState in waitingStates" ng-if="selectedMailFolder.useCurrentLevelWaitingState || !selectedMailFolder.$parent">
<label>
- <input type="checkbox" ng-checked="selectedMailFolder.etatAttentes.containsByTopiaId(etatAttente)"
- ng-click="changeFolderEtatAttente(etatAttente)"> {{etatAttente.label}}
+ <input type="checkbox" ng-checked="selectedMailFolder.waitingStates.containsByTopiaId(waitingState)"
+ ng-click="changeFolderWaitingState(waitingState)"> {{waitingState.label}}
</label>
</div>
</div>
@@ -1042,7 +1042,7 @@
<caption>Aperçu</caption>
<thead>
<tr>
- <th ng-repeat="etatAttenteField in searchDisplayColumns">{{tableMailFields[etatAttenteField.id]}}</th>
+ <th ng-repeat="mailField in searchDisplayColumns">{{tableMailFields[mailField.id]}}</th>
</tr>
</thead>
</table>
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-09-03 13:58:29 UTC (rev 598)
@@ -51,8 +51,8 @@
<hr />
<div class="form-group">
- <label for="etatAttenteField" class="control-label">Fichier état d'attente :</label>
- <input type="file" id="etatAttenteField" name="etatAttenteFile" class="form-control">
+ <label for="waitingStateField" class="control-label">Fichier état d'attente :</label>
+ <input type="file" id="waitingStateField" name="waitingStateFile" class="form-control">
<p class="help-block">Format du fichier csv : <code>etatattente</code><br />
Encodage du fichier csv : <code>${applicationConfig.importFileEncoding}</code></p>
</div>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-08-28 14:42:30 UTC (rev 597)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-09-03 13:58:29 UTC (rev 598)
@@ -38,7 +38,7 @@
//{Map} les champs possibles du tableau
$scope.tableMailFields = ConfigurationData.tableMailFields;
//{Array} les etats d'attentes disponibles
- $scope.etatAttentes = ConfigurationData.etatAttentes;
+ $scope.waitingStates = ConfigurationData.waitingStates;
//{Array} les gammes disponibles
$scope.ranges = ConfigurationData.ranges;
//{Array} les types de documents
@@ -198,91 +198,91 @@
/**
* Etat attente tab controller.
*/
-ConfigurationModule.controller('ConfigurationEtatAttenteController', ['$scope', '$window', 'ConfigurationData',
+ConfigurationModule.controller('ConfigurationWaitingStateController', ['$scope', '$window', 'ConfigurationData',
function($scope, $window, ConfigurationData) {
//{Map} Usage des états d'attente
- $scope.etatAttentesUsage = ConfigurationData.etatAttentesUsage;
+ $scope.waitingStatesUsage = ConfigurationData.waitingStatesUsage;
//{Object} etat d'attente selectionné
- $scope.selectedEtatAttente;
+ $scope.selectedWaitingState;
// edition de l'etat d'attent cliqué
- $scope.editEtatAttente = function(etatAttente) {
- $scope.selectedEtatAttente = etatAttente;
+ $scope.editWaitingState = function(waitingState) {
+ $scope.selectedWaitingState = waitingState;
// initialize le tableau d'action si vide
- if (!$scope.selectedEtatAttente.invalidFormDisabledActions) {
- $scope.selectedEtatAttente.invalidFormDisabledActions = [];
+ if (!$scope.selectedWaitingState.invalidFormDisabledActions) {
+ $scope.selectedWaitingState.invalidFormDisabledActions = [];
}
- if (!$scope.selectedEtatAttente.validFormDisabledActions) {
- $scope.selectedEtatAttente.validFormDisabledActions = [];
+ if (!$scope.selectedWaitingState.validFormDisabledActions) {
+ $scope.selectedWaitingState.validFormDisabledActions = [];
}
};
// ajout d'un nouvel etat d'attente
- $scope.newEtatAttente = function() {
+ $scope.newWaitingState = function() {
var label = $window.prompt("Nom du nouvel état d'attente ?");
if (label) {
// auto select new etat
- var newEtatAttente = {
+ var newWaitingState = {
topiaId : "new_" + guid(),
label: label
};
// check if already exists
- if ($scope.etatAttentes.indexOfBy('label', newEtatAttente) != -1) {
+ if ($scope.waitingStates.indexOfBy('label', newWaitingState) != -1) {
$window.alert("Cet état d'attente existe déjà !");
} else {
- $scope.etatAttentes.push(newEtatAttente);
+ $scope.waitingStates.push(newWaitingState);
// auto select
- $scope.editEtatAttente(newEtatAttente);
+ $scope.editWaitingState(newWaitingState);
}
}
};
// suppression d'un etat d'attente non utilisé
- $scope.deleteEtatAttente = function(etatAttente, index) {
+ $scope.deleteWaitingState = function(waitingState, index) {
if ($window.confirm("Êtes-vous sûr de vouloir supprimer cet état d'attente ?")) {
- $scope.etatAttentes.splice(index, 1);
+ $scope.waitingStates.splice(index, 1);
// suppression de cet etat d'attente dans les mail folder (sinon, ca fait
// un resauvegarde d'un etat d'attente supprimé et donc un bug)
- removeEtatAttenteFromMailFolder(etatAttente, $scope.mailFolders);
+ removeWaitingStateFromMailFolder(waitingState, $scope.mailFolders);
}
};
// suppression de cet etat d'attente dans les mail folder (sinon, ca fait
// un resauvegarde d'un etat d'attente supprimé et donc un bug)
- var removeEtatAttenteFromMailFolder = function(etatAttente, mailFolders) {
+ var removeWaitingStateFromMailFolder = function(waitingState, mailFolders) {
if (mailFolders) {
angular.forEach(mailFolders, function(mailFolder) {
- var index = mailFolder.etatAttentes.indexOfByTopiaId(etatAttente);
+ var index = mailFolder.waitingStates.indexOfByTopiaId(waitingState);
if (index != -1) {
console.log("Remove etat from " + mailFolder.name);
- mailFolder.etatAttentes.splice(index, 1);
+ mailFolder.waitingStates.splice(index, 1);
}
- removeEtatAttenteFromMailFolder(etatAttente, mailFolder.children);
+ removeWaitingStateFromMailFolder(waitingState, mailFolder.children);
});
}
};
// selection/deselection d'une action
- $scope.changeEtatAttenteValidAction = function(action) {
- var index = $scope.selectedEtatAttente.validFormDisabledActions.indexOf(action);
+ $scope.changeWaitingStateValidAction = function(action) {
+ var index = $scope.selectedWaitingState.validFormDisabledActions.indexOf(action);
if (index != -1) {
- $scope.selectedEtatAttente.validFormDisabledActions.splice(index, 1);
+ $scope.selectedWaitingState.validFormDisabledActions.splice(index, 1);
} else {
- $scope.selectedEtatAttente.validFormDisabledActions.push(action);
+ $scope.selectedWaitingState.validFormDisabledActions.push(action);
}
};
// selection/deselection d'une action
- $scope.changeEtatAttenteInvalidAction = function(action) {
- var index = $scope.selectedEtatAttente.invalidFormDisabledActions.indexOf(action);
+ $scope.changeWaitingStateInvalidAction = function(action) {
+ var index = $scope.selectedWaitingState.invalidFormDisabledActions.indexOf(action);
if (index != -1) {
- $scope.selectedEtatAttente.invalidFormDisabledActions.splice(index, 1);
+ $scope.selectedWaitingState.invalidFormDisabledActions.splice(index, 1);
} else {
- $scope.selectedEtatAttente.invalidFormDisabledActions.push(action);
+ $scope.selectedWaitingState.invalidFormDisabledActions.push(action);
}
};
}]);
@@ -369,7 +369,7 @@
topiaId: "new_" + guid(),
name: name,
children: [],
- useCurrentLevelEtatAttente: true,
+ useCurrentLevelWaitingState: true,
useCurrentLevelTableColumns: true,
useCurrentLevelFaxDomain: true,
useCurrentLevelEdiFolder: true,
@@ -401,7 +401,7 @@
topiaId: "new_" + guid(),
name: name,
children: [],
- useCurrentLevelEtatAttente: false,
+ useCurrentLevelWaitingState: false,
useCurrentLevelTableColumns: false,
useCurrentLevelFaxDomain: false,
useCurrentLevelEdiFolder: false,
@@ -436,7 +436,7 @@
topiaId: "new_" + guid(),
name: name,
children: [],
- useCurrentLevelEtatAttente: false,
+ useCurrentLevelWaitingState: false,
useCurrentLevelTableColumns: false,
useCurrentLevelFaxDomain: false,
useCurrentLevelEdiFolder: false,
@@ -516,8 +516,8 @@
if (!$scope.selectedMailFolder.folderTableColumns) {
$scope.selectedMailFolder.folderTableColumns = [];
}
- if (!$scope.selectedMailFolder.etatAttentes) {
- $scope.selectedMailFolder.etatAttentes = [];
+ if (!$scope.selectedMailFolder.waitingStates) {
+ $scope.selectedMailFolder.waitingStates = [];
}
if (!$scope.selectedMailFolder.demandTypes) {
$scope.selectedMailFolder.demandTypes = [];
@@ -608,7 +608,7 @@
replyAddresses: [],
replyDomains: [],
folderTableColumns: [],
- etatAttentes: [],
+ waitingStates: [],
demandTypes: [],
ranges: [],
//rigths
@@ -704,8 +704,8 @@
if ((!$scope.parentScopeValues.folderTableColumns || $scope.parentScopeValues.folderTableColumns.length == 0) && folder.folderTableColumns) {
$scope.parentScopeValues.folderTableColumns = folder.folderTableColumns;
}
- if ((!$scope.parentScopeValues.etatAttentes || $scope.parentScopeValues.etatAttentes.length == 0) && folder.etatAttentes) {
- $scope.parentScopeValues.etatAttentes = folder.etatAttentes;
+ if ((!$scope.parentScopeValues.waitingStates || $scope.parentScopeValues.waitingStates.length == 0) && folder.waitingStates) {
+ $scope.parentScopeValues.waitingStates = folder.waitingStates;
}
if ((!$scope.parentScopeValues.demandTypes || $scope.parentScopeValues.demandTypes.length == 0) && folder.demandTypes) {
$scope.parentScopeValues.demandTypes = folder.demandTypes;
@@ -876,23 +876,23 @@
};
// initialise la liste des etats d'attente avec celle des niveaux supérieurs
- $scope.initFolderEtatAttente = function() {
- if ($scope.selectedMailFolder.useCurrentLevelEtatAttente) {
- if ($scope.parentScopeValues.etatAttentes) {
- $scope.selectedMailFolder.etatAttentes = $scope.parentScopeValues.etatAttentes.slice(); // soft copy
+ $scope.initFolderWaitingState = function() {
+ if ($scope.selectedMailFolder.useCurrentLevelWaitingState) {
+ if ($scope.parentScopeValues.waitingStates) {
+ $scope.selectedMailFolder.waitingStates = $scope.parentScopeValues.waitingStates.slice(); // soft copy
}
} else {
- delete $scope.selectedMailFolder.etatAttentes;
+ delete $scope.selectedMailFolder.waitingStates;
}
};
// selection/deselection d'un état d'attente possible pour ce dossier
- $scope.changeFolderEtatAttente = function(etatAttente) {
- var index = $scope.selectedMailFolder.etatAttentes.indexOfByTopiaId(etatAttente);
+ $scope.changeFolderWaitingState = function(waitingState) {
+ var index = $scope.selectedMailFolder.waitingStates.indexOfByTopiaId(waitingState);
if (index != -1) {
- $scope.selectedMailFolder.etatAttentes.splice(index, 1);
+ $scope.selectedMailFolder.waitingStates.splice(index, 1);
} else {
- $scope.selectedMailFolder.etatAttentes.push(etatAttente);
+ $scope.selectedMailFolder.waitingStates.push(waitingState);
}
};
1
0