Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 1934 discussions
r114 - in trunk/faxtomail-ui-web/src/main: java/com/franciaflex/faxtomail/web webapp/WEB-INF/content/admin webapp/css webapp/js
by echatellier@users.forge.codelutin.com 30 May '14
by echatellier@users.forge.codelutin.com 30 May '14
30 May '14
Author: echatellier
Date: 2014-05-30 17:20:22 +0200 (Fri, 30 May 2014)
New Revision: 114
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/114
Log:
refs #4662: Amelioration de l'interface (ajout/suppression/fioritures)
Modified:
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-05-30 13:52:41 UTC (rev 113)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java 2014-05-30 15:20:22 UTC (rev 114)
@@ -130,7 +130,6 @@
// exclusion
final Multimap<Class<?>, String> gsonExclusions = HashMultimap.create();
gsonExclusions.put(MailFolderAbstract.class, MailFolder.PROPERTY_PARENT);
- gsonExclusions.put(MailFilterAbstract.class, MailFilter.PROPERTY_MAIL_FOLDER);
builder.addSerializationExclusionStrategy(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
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-05-30 13:52:41 UTC (rev 113)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 15:20:22 UTC (rev 114)
@@ -82,20 +82,17 @@
<div id="tabs-general" class="tab-pane active">
<!-- Général -->
- <s:checkbox name="configuration.sendAknowledgement"
- label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/>
-
- <s:checkbox name="configuration.rejectUnknownSender"
- label="Refuser les mails dont l'email est inconnu de la base client"
- cssClass="margin-bottom25"/>
-
<s:textfield name="configuration.convertToPdfCommand"
- label="Ligne de commande de conversion de fichier X en pdf"
- cssClass="span12"/>
+ label="Ligne de commande de conversion de fichier X en pdf"/>
<s:textfield name="configuration.openAttachmentCommand"
- label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF"
- cssClass="span12"/>
+ label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF"/>
+
+ <s:textfield name="configuration.emailMaxSize"
+ label="Taille maximale des email (en bits)"/>
+
+ <s:checkbox name="configuration.rejectUnknownSender"
+ label="Refuser les mails dont l'email est inconnu de la base client"/>
<!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...).
Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)-->
@@ -107,12 +104,8 @@
<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>
<table class="table table-hover">
- <thead>
- <tr>
- <th>État d'attente</th>
- </tr>
- </thead>
<tbody>
<tr ng-repeat="etatAttente in etatAttentes"
ng-class="{'info' : etatAttente == selectedEtatAttente}"
@@ -124,12 +117,13 @@
</div>
<div class="col-md-7" ng-if="selectedEtatAttente">
- Champs obligatoires pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
+ <h3>Édition de l'état d'attente {{selectedEtatAttente.label}}</h3>
+ Champs obligatoires pour l'état d'attente :
<label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields">
<input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1"
ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}}
</label>
- Actions autorisées pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
+ Actions autorisées pour l'état d'attente :
<label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions">
<input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1"
ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}}
@@ -147,8 +141,9 @@
<div class="row">
<div class="col-md-4">
+ <h3>Dossiers <a class="btn btn-xs btn-success pull-right" ng-click="newRoot()">Nouveau</a></h3>
<script type="text/ng-template" id="nodes_renderer.html">
- <div ui-tree-handle ng-click="editMailFolder(mailFolder)" ng-class="{'bg-warning' : mailFolder == selectedMailFolder}">
+ <div ui-tree-handle ng-click="editMailFolder(mailFolder)" ng-class="{'bg-success' : mailFolder == selectedMailFolder}">
<a class="btn btn-success btn-xs" data-nodrag ng-click="toggle(this)" ng-disabled="!mailFolder.children || mailFolder.children.length == 0">
<span class="glyphicon" ng-class="{'glyphicon-chevron-right': !collapsed, 'glyphicon-chevron-down': collapsed}"></span>
</a>
@@ -169,6 +164,7 @@
</div>
<div class="col-md-8" ng-show="selectedMailFolder">
+ <h3>Édition du dossier {{selectedMailFolder.name}}</h3>
<div class="panel-group" id="accordion">
<!-- Liste des chargés de clientèle -->
@@ -216,7 +212,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse2">
- liste des emails expéditeur
+ Liste des emails expéditeur
</a>
</h4>
</div>
@@ -256,7 +252,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse3">
- sélection des états d'attentes possibles pour ce dossier
+ Sélection des états d'attentes possibles pour ce dossier
</a>
</h4>
</div>
@@ -275,7 +271,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse4">
- groupes/personnes ayant droit d'écriture sur le dossier
+ Groupes/personnes ayant droit d'écriture sur le dossier
</a>
</h4>
</div>
@@ -319,7 +315,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse5">
- actions possibles du menu contextuel pour ce dossier
+ Actions possibles du menu contextuel pour ce dossier
</a>
</h4>
</div>
@@ -338,7 +334,7 @@
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse6">
- configuration des colonnes a afficher
+ Configuration des colonnes a afficher
</a>
</h4>
</div>
@@ -366,19 +362,41 @@
</div>
</div>
</div>
-
- <div class="checkbox">
- <label for="printActionEqualTakeActionField">action imprimer est-elle équivalente à "prendre"</label>
- <input type="checkbox" id="printActionEqualTakeActionField" ng-model="selectedMailFolder.printActionEqualTakeAction">
+
+ <div class="form-group">
+ <label class="control-label">L'action imprimer est-elle équivalente à "prendre"</label><br />
+ <label class="radio-inline">
+ <input type="radio" name="printActionEqualTakeActionField"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="printActionEqualTakeActionField"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="printActionEqualTakeActionField"
+ ng-model="selectedMailFolder.printActionEqualTakeAction" ng-value="undefined"> valeur du noeud parent
+ </label>
</div>
- <div class="checkbox">
- <label for="openAttachmentReportNoTakenField">ouvrir une pièce jointe sans prendre, met-il la ligne en orange ou non</label>
- <input type="checkbox" id="openAttachmentReportNoTakenField" ng-model="selectedMailFolder.openAttachmentReportNoTaken">
+ <div class="form-group">
+ <label class="control-label">Ouvrir une pièce jointe sans prendre, met-il la ligne en orange ?</label><br />
+ <label class="radio-inline">
+ <input type="radio" name="openAttachmentReportNoTakenField"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="true"> oui
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="openAttachmentReportNoTakenField"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="false"> non
+ </label>
+ <label class="radio-inline">
+ <input type="radio" name="openAttachmentReportNoTakenField"
+ ng-model="selectedMailFolder.openAttachmentReportNoTaken" ng-value="undefined"> valeur du noeud parent
+ </label>
</div>
<div class="form-group">
- <label for="ediFolderField">dossier (FS) de dépôt des demandes EDI</label>
+ <label for="ediFolderField">Dossier (FS) de dépôt des demandes EDI</label>
<input type="text" class="form-control" id="ediFolderField" ng-model="selectedMailFolder.ediFolder">
</div>
</div>
@@ -393,12 +411,16 @@
<tr>
<th>Filtre</th>
<th>Dossier</th>
+ <th/>
</tr>
</thead>
<tbody ui-sortable ng-model="mailFilters">
<tr ng-repeat="mailFilter in mailFilters">
<td>{{mailFilter.expression}}</td>
<td>{{mailFilter.mailFolder.name}}</td>
+ <td><a class="btn btn-danger btn-xs" ng-click="removeFilter($index)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a></td>
</tr>
</tbody>
</table>
@@ -406,15 +428,15 @@
<div role="form">
<div class="form-group">
<label for="filterField">Filtre</label>
- <input type="text" class="form-control" id="folderField" ng-model="selectedFilter">
+ <input type="text" class="form-control" id="folderField" ng-model="newFilter.expression">
</div>
<div class="form-group">
<label for="folderField">Dossier</label>
- <select class="form-control" ng-model="selectedFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select>
+ <select class="form-control" ng-model="newFilter.mailFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select>
</div>
</div>
- <button type="button" class="btn btn-success" ng-disabled="!selectedFilter || !selectedFolder" ng-click="addNewFilter()">
- <i class="glyphicon glyphicon-plus"></i>Ajouter
+ <button type="button" class="btn btn-success" ng-disabled="!newFilter.expression || !newFilter.mailFolder" ng-click="addNewFilter()">
+ <i class="glyphicon glyphicon-plus"></i> Ajouter
</button>
</div>
@@ -449,15 +471,46 @@
<th>Serveur</th>
<th>Utilisateur</th>
<th>Mot de passe</th>
+ <th/>
</tr>
</thead>
- <tbody ng-repeat="emailAccount in emailAccounts">
- <td>{{emailAccount.protocol}}</td>
- <td>{{emailAccount.host}}</td>
- <td>{{emailAccount.login}}</td>
- <td>{{emailAccount.password}}</td>
+ <tbody>
+ <tr ng-repeat="emailAccount in emailAccounts">
+ <td>{{emailAccount.protocol}}</td>
+ <td>{{emailAccount.host}}</td>
+ <td>{{emailAccount.login}}</td>
+ <td>{{emailAccount.password}}</td>
+ <td>
+ <a class="btn btn-danger btn-xs" ng-click="removeEmailAccount($index)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a></td>
+ </tr>
</tbody>
</table>
+
+ <div class="form" role="form">
+ <div class="form-group">
+ <label>Protocole:
+ <input type="text" class="form-control" ng-model="newAccount.protocol"></label>
+ </div>
+ <div class="form-group">
+ <label>Serveur:
+ <input type="text" class="form-control" ng-model="newAccount.host"></label>
+ </div>
+ <div class="form-group">
+ <label>Utilisateur:
+ <input type="text" class="form-control" ng-model="newAccount.login"></label>
+ </div>
+ <div class="form-group">
+ <label>Mot de passe:
+ <input type="text" class="form-control" ng-model="newAccount.password"></label>
+ </div>
+ <div class="form-group">
+ <button type="button" class="btn btn-success" ng-disabled="!newAccount.protocol || !newAccount.host" ng-click="addEmailAccount()">
+ <i class="glyphicon glyphicon-plus"></i> Ajouter
+ </button>
+ </div>
+ </div>
</div>
</div>
<nav class="navbar navbar-default navbar-fixed-bottom">
Modified: trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-05-30 13:52:41 UTC (rev 113)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-05-30 15:20:22 UTC (rev 114)
@@ -46,18 +46,17 @@
width: 100%;
}
-.angular-ui-tree-handle.bg-warning {
- background: #fcf8e3;
-}
-
.angular-ui-tree-handle:hover {
color: #438eb9;
background: #f4f6f7;
border-color: #dce2e8;
}
-.angular-ui-tree-handle.bg-warning:hover {
- background: #fcf8e3;
+.angular-ui-tree-handle.bg-success {
+ background-color: #dff0d8;
}
+.angular-ui-tree-handle.bg-success:hover {
+ background-color: #dff0d8;
+}
.ui-sortable {
cursor:move;
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 13:52:41 UTC (rev 113)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 15:20:22 UTC (rev 114)
@@ -67,8 +67,8 @@
/**
* Etat attente tab controller.
*/
-FaxToMailModule.controller('ConfigurationWaitController', ['$scope', '$http', 'ConfigurationData',
- function($scope, $http, ConfigurationData) {
+FaxToMailModule.controller('ConfigurationWaitController', ['$scope', '$http', '$window', 'ConfigurationData',
+ function($scope, $http, $window, ConfigurationData) {
//{Object} etat d'attente selectionné
$scope.selectedEtatAttente;
@@ -86,6 +86,22 @@
}
};
+ // ajout d'un nouvel etat d'attente
+ $scope.newEtatAttente = function() {
+ var label = $window.prompt("Nom du nouvel état d'attente ?");
+ if (label) {
+ // auto select new etat
+ var newEtatAttente = {
+ topiaId : "new_" + guid(),
+ label: label
+ };
+ $scope.etatAttentes.push(newEtatAttente);
+
+ // auto select
+ $scope.editEtatAttente(newEtatAttente);
+ }
+ };
+
// selection/deselection d'une action
$scope.changeEtatAttenteAction = function(etatAttenteAction) {
@@ -123,16 +139,21 @@
// {Array} Colonnes selectionnées pour le dossier courant
$scope.folderTableColumns;
- // collapse all subnodes (called by init)
- $scope.collapseAll = function(scope) {
- scope.collapseAll();
+ // creation d'un nouveau noeud racine
+ $scope.newRoot = function() {
+ var name = $window.prompt("Nom du nouveau dossier racine ?");
+ if (name) {
+ var newRoot = {
+ topiaId: "new_" + guid(),
+ name: name
+ };
+ $scope.mailFolders.push(newRoot);
+
+ // edition automatique
+ $scope.editMailFolder(newRoot);
+ };
};
- // toggle node (expand or collapse)
- $scope.toggle = function(scope) {
- scope.toggle();
- };
-
// edit mail folder
$scope.editMailFolder = function(mailFolder) {
$scope.selectedMailFolder = mailFolder;
@@ -245,23 +266,21 @@
function($scope, $http, ConfigurationData) {
//{Array} Current mail filter list
$scope.mailFilters = ConfigurationData.mailFilters;
- //{String} input filter in add form
- $scope.selectedFilter;
- //{Object} selected folder in add form
- $scope.selectedFolder;
+ //{Object} New accout empty filter
+ $scope.newFilter = {};
// add new filter action
$scope.addNewFilter = function() {
- var filter = {
- expression: $scope.selectedFilter,
- mailFolder: $scope.selectedFolder
- };
- $scope.mailFilters.push(filter);
+ $scope.mailFilters.push($scope.newFilter);
// clear form
- delete $scope.selectedFilter;
- delete $scope.selectedFolder;
+ $scope.newFilter = {};
};
+
+ // remove filter
+ $scope.removeFilter = function(index) {
+ $scope.mailFilters.splice(index, 1);
+ };
}]);
@@ -300,4 +319,17 @@
function($scope, $http, ConfigurationData) {
//{Array} Email accounts
$scope.emailAccounts = ConfigurationData.emailAccounts;
+ //{Object} New accout empty object
+ $scope.newAccount = {};
+
+ // ajout d'un nouveau compte
+ $scope.addEmailAccount = function() {
+ $scope.emailAccounts.push($scope.newAccount);
+ $scope.newAccount = {};
+ };
+
+ // suppression d'un compte
+ $scope.removeEmailAccount = function(index) {
+ $scope.emailAccounts.splice(index, 1);
+ };
}]);
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js 2014-05-30 13:52:41 UTC (rev 113)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/faxtomail.js 2014-05-30 15:20:22 UTC (rev 114)
@@ -22,4 +22,20 @@
* #L%
*/
+/**
+ * Generates a GUID string, according to RFC4122 standards.
+ * @returns {String} The generated GUID.
+ * @example af8a8416-6e18-a307-bd9c-f2c947bbb3aa
+ * @author Slavik Meltser (slavik(a)meltser.info)
+ * @link http://slavik.meltser.info/?p=142
+ */
+function guid() {
+ function _p8(s) {
+ var p = (Math.random().toString(16)+"000000000").substr(2,8);
+ return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ;
+ }
+ return _p8() + _p8(true) + _p8(true) + _p8();
+}
+
+/** Mail faxtomail application module. */
var FaxToMailModule = angular.module('FaxToMail', []);
1
0
r113 - trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service
by echatellier@users.forge.codelutin.com 30 May '14
by echatellier@users.forge.codelutin.com 30 May '14
30 May '14
Author: echatellier
Date: 2014-05-30 15:52:41 +0200 (Fri, 30 May 2014)
New Revision: 113
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/113
Log:
Disable ldap if not configured
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
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-05-30 11:07:02 UTC (rev 112)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-05-30 13:52:41 UTC (rev 113)
@@ -28,6 +28,7 @@
import java.util.Collection;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -160,17 +161,19 @@
public List<String> getAllGroups() throws LDAPException {
List<String> results = new ArrayList<>();
- // ldapsearch -h ldap.codelutin.home -b "ou=Group,DC=codelutin,DC=home" "objectClass=posixGroup"
- String baseDN = "ou=Group,DC=codelutin,DC=home";
- String filter = "(objectClass=posixGroup)";
-
- LDAPConnection connection = getLDAPConnection();
- if (connection.isConnected()) {
- SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
-
- List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
- for (SearchResultEntry searchEntry : searchEntries) {
- results.add(searchEntry.getAttributeValue("cn"));
+ if (StringUtils.isNotBlank(getApplicationConfig().getLdapHost())) {
+ // ldapsearch -h ldap.codelutin.home -b "ou=Group,DC=codelutin,DC=home" "objectClass=posixGroup"
+ String baseDN = "ou=Group,DC=codelutin,DC=home";
+ String filter = "(objectClass=posixGroup)";
+
+ LDAPConnection connection = getLDAPConnection();
+ if (connection.isConnected()) {
+ SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
+
+ List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
+ for (SearchResultEntry searchEntry : searchEntries) {
+ results.add(searchEntry.getAttributeValue("cn"));
+ }
}
}
1
0
r112 - in trunk/faxtomail-ui-web/src/main: java/com/franciaflex/faxtomail/web/action/admin webapp/WEB-INF/content/admin webapp/WEB-INF/decorators webapp/css webapp/js
by echatellier@users.forge.codelutin.com 30 May '14
by echatellier@users.forge.codelutin.com 30 May '14
30 May '14
Author: echatellier
Date: 2014-05-30 13:07:02 +0200 (Fri, 30 May 2014)
New Revision: 112
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/112
Log:
Refactoring de l'interface de configuration/folder/input
Added:
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css
trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
Removed:
trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
Modified:
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
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-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-05-30 11:07:02 UTC (rev 112)
@@ -98,6 +98,7 @@
configurationService.saveConfiguration(configuration);
referentielService.saveEtatAttente(etatAttentes);
mailFolderService.saveMailFolders(mailFolders);
+ configurationService.saveMailFilters(mailFilters);
return result;
}
@@ -150,4 +151,22 @@
public List<String> getGroupNames() {
return groupNames;
}
+
+ public List<MailFilter> getMailFilters() {
+ return mailFilters;
+ }
+
+ public void setMailFiltersJson(String json) {
+ Type type = new TypeToken<List<MailFilter>>() {}.getType();
+ this.mailFilters = getGson().fromJson(json, type);
+ }
+
+ public List<EmailAccount> getEmailAccounts() {
+ return emailAccounts;
+ }
+
+ public void setEmailAccounts(String json) {
+ Type type = new TypeToken<List<EmailAccount>>() {}.getType();
+ this.emailAccounts = getGson().fromJson(json, type);
+ }
}
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java 2014-05-30 11:07:02 UTC (rev 112)
@@ -0,0 +1,86 @@
+package com.franciaflex.faxtomail.web.action.admin;
+
+/*
+ * #%L
+ * FaxToMail :: Web
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.convention.annotation.Result;
+
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
+import com.franciaflex.faxtomail.services.service.ConfigurationService;
+import com.franciaflex.faxtomail.services.service.MailFolderService;
+import com.franciaflex.faxtomail.services.service.ReferentielService;
+import com.franciaflex.faxtomail.web.FaxToMailActionSupport;
+
+public class UserFolderAction extends FaxToMailActionSupport {
+
+ private static final Log log = LogFactory.getLog(UserFolderAction.class);
+
+ protected ConfigurationService configurationService;
+
+ protected MailFolderService mailFolderService;
+
+ protected List<MailFolder> mailFolders;
+
+ protected List<String> groupNames;
+
+ public void setConfigurationService(ConfigurationService configurationService) {
+ this.configurationService = configurationService;
+ }
+
+ public void setMailFolderService(MailFolderService mailFolderService) {
+ this.mailFolderService = mailFolderService;
+ }
+
+ @Override
+ @org.apache.struts2.convention.annotation.Action("user-folder-input")
+ public String input() throws Exception {
+ mailFolders = mailFolderService.getAllMailFolders();
+ groupNames = configurationService.getAllGroups();
+ return INPUT;
+ }
+
+ @Override
+ @org.apache.struts2.convention.annotation.Action(results = {
+ @Result(type = "redirectAction", params = {"actionName", "user-folder-input"})})
+ public String execute() throws Exception {
+ String result = super.execute();
+
+ return result;
+ }
+
+ public List<MailFolder> getMailFolders() {
+ return mailFolders;
+ }
+
+ public List<String> getGroupNames() {
+ return groupNames;
+ }
+}
Property changes on: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/UserFolderAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 11:07:02 UTC (rev 112)
@@ -30,18 +30,21 @@
<title>Configuration</title>
<link rel="stylesheet" type="text/css" href="<s:url value='/webjars/select2/3.4.8/select2.css' />" />
<link rel="stylesheet" type="text/css" href="<s:url value='/nuiton-js-angular-ui-tree/angular-ui-tree.css' />" />
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
+
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/select2/3.4.8/select2_locale_fr.js' />"></script>
<script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/select2sortable.js' />"></script>
<script type="text/javascript" src="<s:url value='/nuiton-js-angular-ui-tree/angular-ui-tree.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/webjars/angular-ui-sortable/0.12.2/sortable.min.js' />"></script>
+
<script type="text/javascript" src="<s:url value='/js/faxtomail.js' />"></script>
<script type="text/javascript" src="<s:url value='/js/configuration.js' />"></script>
<script type="text/javascript">
- angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.select2.sortable'])
+ angular.module('ConfigurationModule', ['FaxToMail', 'ui.tree', 'ui.sortable', 'ui.select2.sortable'])
.value('ConfigurationData', {
'etatAttentes' : <s:property value="toJson(etatAttentes)" escapeHtml="false"/>,
'etatAttenteActions': <s:property value="toJson(etatAttenteActions)" escapeHtml="false"/>,
@@ -49,118 +52,102 @@
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>,
'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>,
+ 'mailFilters': <s:property value="toJson(mailFilters)" escapeHtml="false"/>,
'emailAccounts': <s:property value="toJson(emailAccounts)" escapeHtml="false"/>
});
</script>
</head>
<body>
- <div ng-app="ConfigurationModule">
- <!-- navbar -->
- <header class="navbar navbar-inverse navbar-static-top" role="banner">
- <div class="container">
- <div class="navbar-header">
- <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a>
- </div>
- <nav class="collapse navbar-collapse" role="navigation">
- <ul class="nav navbar-nav">
- <li class="active"><a href="<s:url action='configuration-input' />">
- <span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
- <li><a href="<s:url action='import-input' />">
- <span class="glyphicon glyphicon-upload"></span> Import</a></li>
- </ul>
- </nav>
- </div>
- </header>
- <div id="main-container" class="container">
-
- <h1 class="page-header">Configuration</h1>
-
- <s:form id="main_form" action="configuration" ng-controller="ConfigurationController">
+ <div id="main-container" class="container" ng-app="ConfigurationModule">
- <s:hidden name="activeTab"/>
+ <h1 class="page-header">Configuration</h1>
- <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-wait" data-toggle="tab">États d'attente</a></li>
- <li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
- <li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
- <li><a href="#tabs-search" data-toggle="tab">Recherche</a></li>
- <li><a href="#tabs-ldap" data-toggle="tab">Groupes lDAP</a></li>
- </ul>
-
- <div class="tab-content active" ng-controller="ConfigurationMiscController">
-
- <div id="tabs-general" class="tab-pane active">
- <!-- Général -->
-
- <s:checkbox name="configuration.sendAknowledgement"
- label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/>
-
- <s:checkbox name="configuration.rejectUnknownSender"
- label="Refuser les mails dont l'email est inconnu de la base client"
- cssClass="margin-bottom25"/>
-
- <s:textfield name="configuration.convertToPdfCommand"
- label="Ligne de commande de conversion de fichier X en pdf"
- cssClass="span12"/>
-
- <s:textfield name="configuration.openAttachmentCommand"
- label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF"
- cssClass="span12"/>
-
- <!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...).
- Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)-->
-
- </div>
-
- <div id="tabs-wait" class="tab-pane" ng-controller="ConfigurationWaitController">
- <input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" />
+ <s:form id="main_form" action="configuration" ng-controller="ConfigurationController">
- <div class="row">
- <div class="col-md-4">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>État d'attente</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="etatAttente in etatAttentes"
- ng-class="{'info' : etatAttente == selectedEtatAttente}"
- ng-click="editEtatAttente(etatAttente)">
- <td>{{etatAttente.label}}</td>
- </tr>
- </tbody>
- </table>
- </div>
+ <s:hidden name="activeTab"/>
- <div class="col-md-7" ng-if="selectedEtatAttente">
- Champs obligatoires pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
- <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields">
- <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1"
- ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}}
- </label>
- Actions autorisées pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
- <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions">
- <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1"
- ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}}
- </label>
- </div>
- <div class="col-md-7" ng-if="!selectedEtatAttente">
- <em>Sélectionnez un état d'attente.</em>
- </div>
+ <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-wait" data-toggle="tab">États d'attente</a></li>
+ <li><a href="#tabs-tree" data-toggle="tab">Arborescence</a></li>
+ <li><a href="#tabs-filters" data-toggle="tab">Filtres de mail</a></li>
+ <li><a href="#tabs-search" data-toggle="tab">Recherche</a></li>
+ <li><a href="#tabs-mailaccounts" data-toggle="tab">Comptes mail</a></li>
+ </ul>
+
+ <div class="tab-content active" ng-controller="ConfigurationMiscController">
+
+ <div id="tabs-general" class="tab-pane active">
+ <!-- Général -->
+
+ <s:checkbox name="configuration.sendAknowledgement"
+ label="Envoyer directement l'accusé de réception si demandé par l'expéditeur"/>
+
+ <s:checkbox name="configuration.rejectUnknownSender"
+ label="Refuser les mails dont l'email est inconnu de la base client"
+ cssClass="margin-bottom25"/>
+
+ <s:textfield name="configuration.convertToPdfCommand"
+ label="Ligne de commande de conversion de fichier X en pdf"
+ cssClass="span12"/>
+
+ <s:textfield name="configuration.openAttachmentCommand"
+ label="Ligne de commande d'ouverture de fichier non TXT, TIFF, JPEG, PDF"
+ cssClass="span12"/>
+
+ <!-- Il faut pouvoir configurer le dossier par défaut de déplacement en fonction des champs saisis sur la fiche (configuration sur statut, type de fiche, ...).
+ Ce dossier n'est qu'une proposition que l'utilisateur peut modifier)-->
+
+ </div>
+
+ <div id="tabs-wait" class="tab-pane" ng-controller="ConfigurationWaitController">
+ <input type="hidden" name="etatAttentesJson" value="{{etatAttentes}}" />
+
+ <div class="row">
+ <div class="col-md-4">
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th>État d'attente</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="etatAttente in etatAttentes"
+ ng-class="{'info' : etatAttente == selectedEtatAttente}"
+ ng-click="editEtatAttente(etatAttente)">
+ <td>{{etatAttente.label}}</td>
+ </tr>
+ </tbody>
+ </table>
</div>
-
+
+ <div class="col-md-7" ng-if="selectedEtatAttente">
+ Champs obligatoires pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
+ <label class="checkbox" ng-repeat="(etatAttenteField,label) in etatAttenteFields">
+ <input type="checkbox" ng-checked="selectedEtatAttente.fields.indexOf(etatAttenteField) != -1"
+ ng-click="changeEtatAttenteField(etatAttenteField)"> {{label}}
+ </label>
+ Actions autorisées pour l'état d'attente <strong>{{selectedEtatAttente.label}}</strong>:
+ <label class="checkbox" ng-repeat="(etatAttenteAction,label) in etatAttenteActions">
+ <input type="checkbox" ng-checked="selectedEtatAttente.actions.indexOf(etatAttenteAction) != -1"
+ ng-click="changeEtatAttenteAction(etatAttenteAction)"> {{label}}
+ </label>
+ </div>
+ <div class="col-md-7" ng-if="!selectedEtatAttente">
+ <em>Sélectionnez un état d'attente.</em>
+ </div>
</div>
-
- <div id="tabs-tree" class="tab-pane" ng-controller="ConfigurationTreeController">
- <input type="hidden" name="mailFoldersJson" value="{{mailFolders}}" />
- <div class="row">
- <div class="col-md-4">
- <script type="text/ng-template" id="nodes_renderer.html">
+ </div>
+
+ <div id="tabs-tree" class="tab-pane" ng-controller="ConfigurationTreeController">
+ <input type="hidden" name="mailFoldersJson" value="{{mailFolders}}" />
+
+ <div class="row">
+ <div class="col-md-4">
+ <script type="text/ng-template" id="nodes_renderer.html">
<div ui-tree-handle ng-click="editMailFolder(mailFolder)" ng-class="{'bg-warning' : mailFolder == selectedMailFolder}">
<a class="btn btn-success btn-xs" data-nodrag ng-click="toggle(this)" ng-disabled="!mailFolder.children || mailFolder.children.length == 0">
<span class="glyphicon" ng-class="{'glyphicon-chevron-right': !collapsed, 'glyphicon-chevron-down': collapsed}"></span>
@@ -174,13 +161,13 @@
</li>
</ol>
</script>
- <div ui-tree="options" data-drag-enabled="false">
- <ol ui-tree-nodes="" ng-model="mailFolders" id="tree-root">
- <li ng-repeat="mailFolder in mailFolders" ui-tree-node ng-include="'nodes_renderer.html'"></li>
- </ol>
- </div>
+ <div ui-tree="options" data-drag-enabled="false">
+ <ol ui-tree-nodes="" ng-model="mailFolders" id="tree-root">
+ <li ng-repeat="mailFolder in mailFolders" ui-tree-node ng-include="'nodes_renderer.html'"></li>
+ </ol>
</div>
-
+ </div>
+
<div class="col-md-8" ng-show="selectedMailFolder">
<div class="panel-group" id="accordion">
@@ -397,87 +384,88 @@
</div>
</div>
</div>
- </div>
+ </div>
- <div id="tabs-filters" class="tab-pane" ng-controller="ConfigurationFilterController">
- <table class="table table-hover table-bordered">
- <thead>
- <tr>
- <th>Filtre</th>
- <th>Dossier</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="mailFilter in allMailFilters()">
- <td>{{mailFilter.expression}}</td>
- <td>{{mailFilter.fmMailFolder.name}}</td>
- </tr>
- </tbody>
- </table>
-
- <div role="form">
- <div class="form-group">
- <label for="filterField">Filtre</label>
- <input type="text" class="form-control" id="folderField" ng-model="selectedFilter">
- </div>
- <div class="form-group">
- <label for="folderField">Dossier</label>
- <select class="form-control" ng-model="selectedFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select>
- </div>
+ <div id="tabs-filters" class="tab-pane" ng-controller="ConfigurationFilterController">
+ <input type="hidden" name="mailFiltersJson" value="{{mailFilters}}" />
+ <table class="table table-hover table-bordered">
+ <thead>
+ <tr>
+ <th>Filtre</th>
+ <th>Dossier</th>
+ </tr>
+ </thead>
+ <tbody ui-sortable ng-model="mailFilters">
+ <tr ng-repeat="mailFilter in mailFilters">
+ <td>{{mailFilter.expression}}</td>
+ <td>{{mailFilter.mailFolder.name}}</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div role="form">
+ <div class="form-group">
+ <label for="filterField">Filtre</label>
+ <input type="text" class="form-control" id="folderField" ng-model="selectedFilter">
</div>
- <button type="button" class="btn btn-success" ng-disabled="!selectedFilter || !selectedFolder" ng-click="addNewFilter()">
- <i class="glyphicon glyphicon-plus"></i>Ajouter
- </button>
+ <div class="form-group">
+ <label for="folderField">Dossier</label>
+ <select class="form-control" ng-model="selectedFolder" ng-options="mailFolder.name for mailFolder in flatMailFolders()"></select>
+ </div>
</div>
+ <button type="button" class="btn btn-success" ng-disabled="!selectedFilter || !selectedFolder" ng-click="addNewFilter()">
+ <i class="glyphicon glyphicon-plus"></i>Ajouter
+ </button>
+ </div>
- <div id="tabs-search" class="tab-pane" ng-controller="ConfigurationSearchController">
- <input type="hidden" name="configuration.searchDisplayColumns" value="{{searchDisplayColumn.id}}" ng-repeat="searchDisplayColumn in searchDisplayColumns"/>
+ <div id="tabs-search" class="tab-pane" ng-controller="ConfigurationSearchController">
+ <input type="hidden" name="configuration.searchDisplayColumns" value="{{searchDisplayColumn.id}}" ng-repeat="searchDisplayColumn in searchDisplayColumns"/>
- <div class="control-group">
- <label class="control-label" for="tableColumns">Champs à afficher dans le tableau (l'ordre peut être changé en faisant un glisser/déposer sur les champs)</label>
+ <div class="control-group">
+ <label class="control-label" for="tableColumns">Champs à afficher dans le tableau (l'ordre peut être changé en faisant un glisser/déposer sur les champs)</label>
- <div class="controls">
- <input type="hidden" ui-select2-sortable ng-model="searchDisplayColumns" simple-query="getObjectsData" multiple sortable>
- </div>
+ <div class="controls">
+ <input type="hidden" ui-select2-sortable ng-model="searchDisplayColumns" simple-query="getObjectsData" multiple sortable>
+ </div>
- <div>
- <table id='table-snapshot' class="table table-bordered">
- <caption>Aperçu</caption>
- <thead>
- <tr>
- <th ng-repeat="etatAttenteField in searchDisplayColumns">{{etatAttenteFields[etatAttenteField.id]}}</th>
- </tr>
- </thead>
- </table>
- </div>
+ <div>
+ <table id='table-snapshot' class="table table-bordered">
+ <caption>Aperçu</caption>
+ <thead>
+ <tr>
+ <th ng-repeat="etatAttenteField in searchDisplayColumns">{{etatAttenteFields[etatAttenteField.id]}}</th>
+ </tr>
+ </thead>
+ </table>
</div>
- </div>
-
- <div id="tabs-ldap" class="tab-pane" ng-controller="ConfigurationLdapController">
- <table id='table-snapshot' class="table table-bordered">
- <caption>Dossiers mis en avant</caption>
- <thead>
- <tr>
- <th>Dossier</th>
- <th ng-repeat="groupName in groupNames">{{groupName}}</th>
- </tr>
- </thead>
- <tbody ng-repeat="mailFolder in flatMailFolders()">
- <th>{{mailFolder.name}}</th>
- <td ng-repeat="groupName in groupNames">
- <input type="checkbox" />
- </td>
- </tbody>
- </table>
- </div>
+ </div>
</div>
- <nav class="navbar navbar-default navbar-fixed-bottom">
- <div class="container">
- <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
- </div>
- </nav>
- </s:form>
- </div>
- </div>
+
+ <div id="tabs-mailaccounts" class="tab-pane" ng-controller="ConfigurationEmailAccountsController">
+ <table id='table-snapshot' class="table table-bordered">
+ <thead>
+ <tr>
+ <th>Protocole</th>
+ <th>Serveur</th>
+ <th>Utilisateur</th>
+ <th>Mot de passe</th>
+ </tr>
+ </thead>
+ <tbody ng-repeat="emailAccount in emailAccounts">
+ <td>{{emailAccount.protocol}}</td>
+ <td>{{emailAccount.host}}</td>
+ <td>{{emailAccount.login}}</td>
+ <td>{{emailAccount.password}}</td>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <nav class="navbar navbar-default navbar-fixed-bottom">
+ <div class="container">
+ <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
+ </div>
+ </nav>
+ </s:form>
+ </div>
</body>
</html>
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-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-05-30 11:07:02 UTC (rev 112)
@@ -28,71 +28,53 @@
<html>
<head>
<title>Import</title>
- <link rel="stylesheet" type="text/css" href="<s:url value='/css/configuration.css' />" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
</head>
<body>
- <div>
- <!-- navbar -->
- <header class="navbar navbar-inverse navbar-static-top" role="banner">
- <div class="container">
- <div class="navbar-header">
- <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a>
- </div>
- <nav class="collapse navbar-collapse" role="navigation">
- <ul class="nav navbar-nav">
- <li><a href="<s:url action='configuration-input' />">
- <span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
- <li class="active"><a href="<s:url action='import-input' />">
- <span class="glyphicon glyphicon-upload"></span> Import</a></li>
- </ul>
- </nav>
- </div>
- </header>
- <div id="main-container" class="container">
-
- <h1 class="page-header">Import</h1>
-
- <s:form id="main_form" action="import" method="post" enctype="multipart/form-data">
+ <div id="main-container" class="container">
- <div class="form-group">
- <label for="clientField">Fichier client</label>
- <input type="file" id="clientField" name="clientFile">
- <p class="help-block">Format du fichier csv : <code>Id_Correspondance;Societe;Nom;Caracteristique1;Caracteristique2;Caracteristique3;Client_Top;Numero_Fax;Adresse_Mail;Code_Client;Objet_Message;Destination</code></p>
+ <h1 class="page-header">Import</h1>
+
+ <s:form id="main_form" action="import" method="post" enctype="multipart/form-data">
+
+ <div class="form-group">
+ <label for="clientField">Fichier client</label>
+ <input type="file" id="clientField" name="clientFile">
+ <p class="help-block">Format du fichier csv : <code>Id_Correspondance;Societe;Nom;Caracteristique1;Caracteristique2;Caracteristique3;Client_Top;Numero_Fax;Adresse_Mail;Code_Client;Objet_Message;Destination</code></p>
+ </div>
+
+ <div class="form-group">
+ <label for="etatAttenteField">Fichier état d'attente</label>
+ <input type="file" id="etatAttenteField" name="etatAttenteFile">
+ <p class="help-block">Format du fichier csv : <code>etatattente</code></p>
+ </div>
+
+ <div class="form-group">
+ <label for="demandTypeField">Fichier types de demande</label>
+ <input type="file" id="demandTypeField" name="demandTypeFile">
+ <p class="help-block">Format du fichier csv : <code>demandetype</code></p>
+ </div>
+
+ <div class="form-group">
+ <label for="rangeField">Fichier gamme</label>
+ <input type="file" id="rangeField" name="rangeFile">
+ <p class="help-block">Format du fichier csv : <code>gamme</code></p>
+ </div>
+
+ <div class="form-group">
+ <label for="priorityField">Fichier priorite</label>
+ <input type="file" id="priorityField" name="priorityFile">
+ <p class="help-block">Format du fichier csv : <code>priorite</code></p>
+ </div>
+
+ <nav class="navbar navbar-default navbar-fixed-bottom">
+ <div class="container">
+ <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
</div>
-
- <div class="form-group">
- <label for="etatAttenteField">Fichier état d'attente</label>
- <input type="file" id="etatAttenteField" name="etatAttenteFile">
- <p class="help-block">Format du fichier csv : <code>etatattente</code></p>
- </div>
-
- <div class="form-group">
- <label for="demandTypeField">Fichier types de demande</label>
- <input type="file" id="demandTypeField" name="demandTypeFile">
- <p class="help-block">Format du fichier csv : <code>demandetype</code></p>
- </div>
-
- <div class="form-group">
- <label for="rangeField">Fichier gamme</label>
- <input type="file" id="rangeField" name="rangeFile">
- <p class="help-block">Format du fichier csv : <code>gamme</code></p>
- </div>
-
- <div class="form-group">
- <label for="priorityField">Fichier priorite</label>
- <input type="file" id="priorityField" name="priorityFile">
- <p class="help-block">Format du fichier csv : <code>priorite</code></p>
- </div>
-
- <nav class="navbar navbar-default navbar-fixed-bottom">
- <div class="container">
- <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
- </div>
- </nav>
- </s:form>
- </div>
+ </nav>
+ </s:form>
</div>
</body>
</html>
Added: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp 2014-05-30 11:07:02 UTC (rev 112)
@@ -0,0 +1,81 @@
+<%--
+ #%L
+ FaxToMail :: Web
+ $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%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html>
+ <head>
+ <title>Import</title>
+ <link rel="stylesheet" type="text/css" href="<s:url value='/css/faxtomail.css' />" />
+
+ <script type="text/javascript" src="<s:url value='/webjars/angularjs/1.2.16/angular.min.js' />"></script>
+
+ <script type="text/javascript" src="<s:url value='/js/faxtomail.js' />"></script>
+ <script type="text/javascript" src="<s:url value='/js/user-folder.js' />"></script>
+
+ <script type="text/javascript">
+ angular.module('UserFolderModule', ['FaxToMail'])
+ .value('UserFolderData', {
+ 'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
+ 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>
+ });
+ </script>
+ </head>
+
+ <body>
+
+ <div id="main-container" class="container" ng-app="UserFolderModule">
+
+ <h1 class="page-header">Import</h1>
+
+ <s:form id="main_form" action="import" method="post" enctype="multipart/form-data" ng-controller="UserFolderController">
+
+ <table id='table-snapshot' class="table table-bordered">
+ <caption>Dossiers mis en avant par utilisateur</caption>
+ <thead>
+ <tr>
+ <th>Utilisateur</th>
+ <th>Dossiers</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="groupName in groupNames">
+ <th>{{groupName}}</th>
+ <td>
+ <input type="text" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <nav class="navbar navbar-default navbar-fixed-bottom">
+ <div class="container">
+ <button type="submit" class="btn btn-primary navbar-btn pull-right">Valider</button>
+ </div>
+ </nav>
+ </s:form>
+ </div>
+ </body>
+</html>
Property changes on: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/user-folder-input.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-05-30 11:07:02 UTC (rev 112)
@@ -43,6 +43,26 @@
<s:actionerror theme="bootstrap"/>
<s:actionmessage theme="bootstrap"/>
<s:fielderror theme="bootstrap"/>
+
+ <!-- navbar -->
+ <header class="navbar navbar-inverse navbar-static-top" role="banner">
+ <div class="container">
+ <div class="navbar-header">
+ <a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a>
+ </div>
+ <nav class="collapse navbar-collapse" role="navigation">
+ <ul class="nav navbar-nav">
+ <li><a href="<s:url action='configuration-input' />">
+ <span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
+ <li><a href="<s:url action='import-input' />">
+ <span class="glyphicon glyphicon-upload"></span> Import</a></li>
+ <li><a href="<s:url action='user-folder-input' />">
+ <span class="glyphicon glyphicon-th-list"></span> Dossiers utilisateur</a></li>
+ </ul>
+ </nav>
+ </div>
+ </header>
+
<decorator:body/>
</div>
</div>
Deleted: trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css 2014-05-30 11:07:02 UTC (rev 112)
@@ -1,60 +0,0 @@
-/*
- * #%L
- * FaxToMail :: Web
- * $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%
- */
-
-.full-width {
- width: 100%;
-}
-
-.tab-content {
- padding-bottom: 70px;
-}
-
-.page-header {
- margin-bottom: 25px;
-}
-
-.angular-ui-tree-handle {
- background: #f8faff;
- border: 1px solid #dae2ea;
- color: #7c9eb2;
- padding: 10px 10px;
- cursor:default;
-}
-
-.select2-container {
- width: 100%;
-}
-
-.angular-ui-tree-handle.bg-warning {
- background: #fcf8e3;
-}
-
-.angular-ui-tree-handle:hover {
- color: #438eb9;
- background: #f4f6f7;
- border-color: #dce2e8;
-}
-.angular-ui-tree-handle.bg-warning:hover {
- background: #fcf8e3;
-}
\ No newline at end of file
Copied: trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css (from rev 111, trunk/faxtomail-ui-web/src/main/webapp/css/configuration.css)
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/css/faxtomail.css 2014-05-30 11:07:02 UTC (rev 112)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ * FaxToMail :: Web
+ * $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%
+ */
+
+.full-width {
+ width: 100%;
+}
+
+.tab-content {
+ padding-bottom: 70px;
+}
+
+.page-header {
+ margin-bottom: 25px;
+}
+
+.angular-ui-tree-handle {
+ background: #f8faff;
+ border: 1px solid #dae2ea;
+ color: #7c9eb2;
+ padding: 10px 10px;
+ cursor:default;
+}
+
+.select2-container {
+ width: 100%;
+}
+
+.angular-ui-tree-handle.bg-warning {
+ background: #fcf8e3;
+}
+
+.angular-ui-tree-handle:hover {
+ color: #438eb9;
+ background: #f4f6f7;
+ border-color: #dce2e8;
+}
+.angular-ui-tree-handle.bg-warning:hover {
+ background: #fcf8e3;
+}
+
+.ui-sortable {
+ cursor:move;
+}
\ No newline at end of file
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 10:02:38 UTC (rev 111)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 11:07:02 UTC (rev 112)
@@ -243,40 +243,20 @@
*/
FaxToMailModule.controller('ConfigurationFilterController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
+ //{Array} Current mail filter list
+ $scope.mailFilters = ConfigurationData.mailFilters;
//{String} input filter in add form
$scope.selectedFilter;
//{Object} selected folder in add form
$scope.selectedFolder;
-
- // FIXME in binding sur une methode c'est pas terrible
- $scope.allMailFilters = function() {
- var mailFilters = [];
- angular.forEach($scope.flatMailFolders(), function(mailFolder) {
- if (mailFolder.filters) {
- //mailFilters = mailFilters.concat(mailFolder.filters);
- angular.forEach(mailFolder.filters, function(mailFilter) {
-
- // ca c'est pas propre, on modifie l'object original pour affichage
- mailFilter.fmMailFolder = {name:mailFolder.name};
- mailFilters.push(mailFilter);
- });
- } else {
- mailFolder.filters = [];
- }
- });
- return mailFilters;
- };
-
// add new filter action
$scope.addNewFilter = function() {
var filter = {
expression: $scope.selectedFilter,
- fmMailFolder: {
- name: $scope.selectedFolder.name
- }
+ mailFolder: $scope.selectedFolder
};
- $scope.selectedFolder.filters.push(filter);
+ $scope.mailFilters.push(filter);
// clear form
delete $scope.selectedFilter;
@@ -314,9 +294,10 @@
/**
- * Ldap tab controller.
+ * Email accounts controller.
*/
-FaxToMailModule.controller('ConfigurationLdapController', ['$scope', '$http', 'ConfigurationData',
+FaxToMailModule.controller('ConfigurationEmailAccountsController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
-
+ //{Array} Email accounts
+ $scope.emailAccounts = ConfigurationData.emailAccounts;
}]);
Added: trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js (rev 0)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/user-folder.js 2014-05-30 11:07:02 UTC (rev 112)
@@ -0,0 +1,51 @@
+/*
+ * #%L
+ * FaxToMail :: Web
+ * $Id: configuration.js 107 2014-05-30 08:55:55Z echatellier $
+ * $HeadURL: https://svn.codelutin.com/faxtomail/trunk/faxtomail-ui-web/src/main/webapp/… $
+ * %%
+ * 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%
+ */
+
+/**
+ * Global configuration controller.
+ */
+FaxToMailModule.controller('UserFolderController', ['$scope', '$http', 'UserFolderData',
+ function($scope, $http, UserFolderData) {
+ //{Array} mail folders
+ $scope.mailFolders = UserFolderData.mailFolders;
+ // {Array} Liste des groupes ldap
+ $scope.groupNames = UserFolderData.groupNames;
+
+ // method privée recursive pour retourner l'ensemble des dossiers
+ var recursiveAddMailFolder = function(result, mailFolders) {
+ if (mailFolders) {
+ angular.forEach(mailFolders, function(mailFolder) {
+ result.push(mailFolder);
+ recursiveAddMailFolder(result, mailFolder.children);
+ });
+ }
+ };
+
+ // Retourne l'ensemble de l'arbre des dossiers "à plat"
+ $scope.flatMailFolders = function() {
+ var flatMailFolders = [];
+ recursiveAddMailFolder(flatMailFolders, $scope.mailFolders);
+ return flatMailFolders;
+ };
+}]);
1
0
r111 - in trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing: . content/demande content/reply content/search content/transmit
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 12:02:38 +0200 (Fri, 30 May 2014)
New Revision: 111
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/111
Log:
use configuration for the email max size and search columns
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/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java
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-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -31,6 +31,7 @@
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceContext;
import com.franciaflex.faxtomail.persistence.RessourceClassLoader;
+import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.InitFaxToMailService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
@@ -456,6 +457,9 @@
FaxToMailUser currentUser = getUserService().getUserByLogin("cbaillet");
setCurrentUser(currentUser);
+ Configuration config = getConfigurationService().getConfiguration();
+ setFaxToMailConfiguration(config);
+
// //--------------------------------------------------------------------//
// // init action UI
// //--------------------------------------------------------------------//
@@ -543,6 +547,10 @@
return serviceContext.newService(ReferentielService.class);
}
+ public ConfigurationService getConfigurationService() {
+ return serviceContext.newService(ConfigurationService.class);
+ }
+
//------------------------------------------------------------------------//
//-- DataContext methods --//
//------------------------------------------------------------------------//
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-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -285,9 +285,9 @@
Collection<String> columns = null;
MailFolder selectedFolder = getModel().getSelectedFolder();
if (selectedFolder != null) {
- List<Field> folderTableColumns = selectedFolder.getFolderTableColumns();
- if (folderTableColumns != null) {
- Collections2.transform(selectedFolder.getFolderTableColumns(), new Function<Field, String>() {
+ List<Field> tableColumns = selectedFolder.getFolderTableColumns();
+ if (tableColumns != null) {
+ Collections2.transform(tableColumns, new Function<Field, String>() {
@Override
public String apply(Field field) {
return field.toString();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -82,8 +82,8 @@
super.beforeInit(ui);
ReplyFormUIModel model = new ReplyFormUIModel();
- // TODO kmorin 20140512 make it configurable
- model.setMaxAttachmentLength(10485760);
+ long maxSize = getContext().getFaxToMailConfiguration().getEmailMaxSize();
+ model.setMaxAttachmentLength(maxSize);
this.ui.setContextValue(model);
}
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-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -28,6 +28,8 @@
import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.EmailFilter;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
+import com.franciaflex.faxtomail.persistence.entities.Field;
+import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.service.EmailService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.GroupAction;
@@ -38,6 +40,8 @@
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
import com.franciaflex.faxtomail.ui.swing.util.Cancelable;
import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.logging.Log;
@@ -225,8 +229,17 @@
@Override
protected Collection<String> getColumns() {
- //TODO kmorin 20140521 get the real search columns
- return null;
+ Collection<String> columns = null;
+ List<Field> tableColumns = getContext().getFaxToMailConfiguration().getSearchDisplayColumns();
+ if (tableColumns != null) {
+ Collections2.transform(tableColumns, new Function<Field, String>() {
+ @Override
+ public String apply(Field field) {
+ return field.toString();
+ }
+ });
+ }
+ return columns;
}
protected boolean isDemandSelectable(DemandeUIModel demand) {
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-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -26,6 +26,7 @@
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.Field;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.SearchAction;
@@ -36,6 +37,7 @@
import com.franciaflex.faxtomail.ui.swing.util.CloseableUI;
import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import jaxx.runtime.swing.editor.bean.BeanUIUtil;
@@ -198,8 +200,17 @@
@Override
protected Collection<String> getColumns() {
- //TODO kmorin 20140521 get the real search columns
- return null;
+ Collection<String> columns = null;
+ List<Field> tableColumns = getContext().getFaxToMailConfiguration().getSearchDisplayColumns();
+ if (tableColumns != null) {
+ Collections2.transform(tableColumns, new Function<Field, String>() {
+ @Override
+ public String apply(Field field) {
+ return field.toString();
+ }
+ });
+ }
+ return columns;
}
@Override
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-05-30 09:39:12 UTC (rev 110)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-05-30 10:02:38 UTC (rev 111)
@@ -32,6 +32,7 @@
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.FolderTreeNode;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -81,9 +82,7 @@
if (node.getClass().isAssignableFrom(FolderTreeNode.class)) {
FolderTreeNode folderTreeNode = (FolderTreeNode) node;
folderTreeNode.setCanSelect(!currentFolder.equals(folder) &&
- //TODO condition moche
- (foldersWithEtatAttente == null ||
- foldersWithEtatAttente.isEmpty()
+ (CollectionUtils.isNotEmpty(foldersWithEtatAttente)
|| foldersWithEtatAttente.contains(folder)));
}
}
1
0
r110 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 11:39:12 +0200 (Fri, 30 May 2014)
New Revision: 110
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/110
Log:
fix bug of search to group when there is a search in the context
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
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-05-30 09:36:13 UTC (rev 109)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-05-30 09:39:12 UTC (rev 110)
@@ -32,6 +32,7 @@
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.ui.swing.actions.GroupAction;
import com.franciaflex.faxtomail.ui.swing.actions.SearchAction;
+import com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeListAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
@@ -183,7 +184,7 @@
if (getContext().getSearch() != null) {
try {
- SearchAction searchAction = getContext().getActionFactory().createLogicAction(this, SearchAction.class);
+ SearchToGroupAction searchAction = getContext().getActionFactory().createLogicAction(this, SearchToGroupAction.class);
searchAction.doAction();
} catch (Exception e) {
1
0
r109 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 11:36:13 +0200 (Fri, 30 May 2014)
New Revision: 109
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/109
Log:
fixes #5154 Bug ?\195?\160 l'ajout d'une pi?\195?\168ce jointe dans une r?\195?\169ponse ?\195?\160 un message
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-05-30 09:17:12 UTC (rev 108)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java 2014-05-30 09:36:13 UTC (rev 109)
@@ -25,6 +25,10 @@
*/
import static org.nuiton.i18n.I18n.t;
+
+import com.franciaflex.faxtomail.persistence.entities.AttachmentFileImpl;
+import org.apache.commons.io.FileUtils;
+import org.nuiton.util.FileUtil;
import org.nuiton.validator.bean.simple.SimpleBeanValidator;
import java.awt.Component;
@@ -207,13 +211,30 @@
public void addAttachment() {
JComboBox addAttachmentFile = ui.getAddAttachmentFile();
- AttachmentFile file = (AttachmentFile) addAttachmentFile.getSelectedItem();
- if (file != null) {
+ AttachmentFile attachmentFile = null;
+ Object selectedItem = addAttachmentFile.getSelectedItem();
+ if (AttachmentFile.class.isAssignableFrom(selectedItem.getClass())) {
+ attachmentFile = (AttachmentFile) selectedItem;
+
+ } else if (File.class.isAssignableFrom(selectedItem.getClass())) {
+ File file = (File) selectedItem;
+ attachmentFile = new AttachmentFileImpl();
+ attachmentFile.setFilename(file.getName());
+ try {
+ attachmentFile.setContent(FileUtils.readFileToByteArray(file));
+
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Error while converting the file " + file.getName() + " into a byte[]", e);
+ }
+ }
+ }
+ if (attachmentFile != null) {
ReplyFormUIModel model = getModel();
- model.addAttachment(file);
+ model.addAttachment(attachmentFile);
- model.removeAvailableAttachment(file);
- ui.getAddAttachmentFile().removeItem(file);
+ model.removeAvailableAttachment(attachmentFile);
+ ui.getAddAttachmentFile().removeItem(attachmentFile);
addAttachmentFile.setSelectedItem(null);
}
@@ -282,13 +303,22 @@
@Override
public void setItem(Object anObject) {
String text;
- //FIXME kmorin 20140523 if set from the filechooser, classcastexception
- AttachmentFile file = (AttachmentFile) anObject;
+ AttachmentFile attachmentFile = null;
+ if (anObject != null) {
+ if (AttachmentFile.class.isAssignableFrom(anObject.getClass())) {
+ attachmentFile = (AttachmentFile) anObject;
- if ( anObject != null ) {
- text = decorate(file);
- oldValue = file;
+ } else if (File.class.isAssignableFrom(anObject.getClass())) {
+ File file = (File) anObject;
+ attachmentFile = new AttachmentFileImpl();
+ attachmentFile.setFilename(file.getName());
+ }
+ }
+ if (attachmentFile != null) {
+ text = decorate(attachmentFile);
+ oldValue = attachmentFile;
+
} else {
text = "";
}
1
0
r108 - in trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing: content/demande util
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 11:17:12 +0200 (Fri, 30 May 2014)
New Revision: 108
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/108
Log:
fixes #5157 Dans l'arborescence des ?\195?\169l?\195?\169ments, le clic sur une partie vide de la liste des messages entraine une exception
fixes #5158 Un message archiv?\195?\169 peut ?\195?\170tre d?\195?\169plac?\195?\169
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/util/AbstractFaxToMailDemandListHandler.java
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-05-30 08:55:55 UTC (rev 107)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-05-30 09:17:12 UTC (rev 108)
@@ -84,6 +84,24 @@
DemandesUIModel model = getModel();
// setCustomTab(0, getModel().getDemands().get(0));
+
+ final PropertyChangeListener demandEnabledAndValidListener = new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getPropertyName().equals(DemandeUIModel.PROPERTY_VALID)
+ || evt.getPropertyName().equals(DemandeUIModel.PROPERTY_EDITABLE)
+ || evt.getPropertyName().equals(Email.PROPERTY_ARCHIVE_DATE)) {
+
+ DemandesUI ui = getUI();
+ ui.processDataBinding(DemandesUI.BINDING_ARCHIVE_BUTTON_ENABLED);
+ ui.processDataBinding(DemandesUI.BINDING_GROUP_BUTTON_ENABLED);
+ ui.processDataBinding(DemandesUI.BINDING_REPLY_BUTTON_ENABLED);
+ ui.processDataBinding(DemandesUI.BINDING_SAVE_BUTTON_ENABLED);
+ ui.processDataBinding(DemandesUI.BINDING_TRANSMIT_BUTTON_ENABLED);
+ }
+ }
+ };
+
model.addDemandsListener(new DemandesUIModel.DemandsListener() {
@Override
public void onDemandAdded(DemandeUIModel demand, int index, boolean added) {
@@ -91,6 +109,7 @@
JTabbedPane tabPanel = getTabPanel();
if (added) {
DemandeUI demandeUI = new DemandeUI(getUI(), demand);
+ demand.addPropertyChangeListener(demandEnabledAndValidListener);
tabPanel.add(demandeUI);
setCustomTab(index, demand);
}
@@ -100,6 +119,7 @@
@Override
public void onDemandRemoved(DemandeUIModel demand, int index) {
+ demand.removePropertyChangeListener(demandEnabledAndValidListener);
}
});
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-05-30 08:55:55 UTC (rev 107)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-05-30 09:17:12 UTC (rev 108)
@@ -264,6 +264,9 @@
if (evt.getClickCount() == 2) {
JXTable table = (JXTable) evt.getSource();
int rowIndex = table.getSelectedRow();
+ if (rowIndex < 0 || rowIndex >= table.getRowCount()) {
+ return;
+ }
rowIndex = table.convertRowIndexToModel(rowIndex);
AbstractApplicationTableModel<DemandeUIModel> tableModel =
1
0
r107 - in trunk: . faxtomail-persistence/src/main/java/com/franciaflex/faxtomail faxtomail-persistence/src/main/xmi faxtomail-service faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-web faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 30 May '14
by echatellier@users.forge.codelutin.com 30 May '14
30 May '14
Author: echatellier
Date: 2014-05-30 10:55:55 +0200 (Fri, 30 May 2014)
New Revision: 107
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/107
Log:
refs #4662: Display ldap groups
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/pom.xml
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java
trunk/faxtomail-ui-web/pom.xml
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-05-30 08:55:55 UTC (rev 107)
@@ -236,6 +236,22 @@
return applicationConfig.getOptionAsBoolean(FaxToMailConfigurationOption.SMTP_SSL.getKey());
}
+ public String getLdapHost() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_HOST.getKey());
+ }
+
+ public int getLdapPort() {
+ return applicationConfig.getOptionAsInt(FaxToMailConfigurationOption.LDAP_PORT.getKey());
+ }
+
+ public String getLdapUser() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_USER.getKey());
+ }
+
+ public String getLdapPassword() {
+ return applicationConfig.getOption(FaxToMailConfigurationOption.LDAP_PASSWORD.getKey());
+ }
+
public String getInstanceUrl() {
return applicationConfig.getOption(FaxToMailConfigurationOption.INSTANCE_URL.getKey());
}
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-05-30 08:55:55 UTC (rev 107)
@@ -77,29 +77,32 @@
"Mode développement, court-circuite l'envoi de mail",
"true", Boolean.class),
-// CREATE_TRAINING_USERS(
-// "extranetEncAhi.createTrainingUsers",
-// "Vrai s'il faut créer les comptes de formation au démarrage de l'application",
-// "true", Boolean.class),
-
STORAGE_FILE(
"faxtomail.storage",
"L'emplacement de stockage des fichiers, répertoire accessible en écriture sur le FS",
"/tmp/faxtomail/storage", File.class),
-// SUPPORT_EMAIL(
-// "extranetEncAhi.supportEmail",
-// "L'adresse mail à contacter par l'utilisateur pour demander de l'aide",
-// "extranet-enc-ahi-users(a)list.forge.codelutin.com", String.class),
-
LOG_CONFIGURATION_FILE(
"logConfigurationFile",
"Chemin vers le fichier de configuration des journaux",
- null,
- String.class),
+ null, String.class),
- //SERVICE
+ LDAP_HOST(
+ "faxtomail.ldap.host",
+ "Adresse du serveur LDAP", null, String.class),
+
+ LDAP_PORT(
+ "faxtomail.ldap.port",
+ "Port du serveur LDAP", "389", Integer.class),
+
+ LDAP_USER(
+ "faxtomail.ldap.user",
+ "Nom d'utilisateur pour la connexion au serveur ldap", null, String.class),
+ LDAP_PASSWORD(
+ "faxtomail.ldap.password",
+ "Mot de passe pour la connexion au serveur LDAP", null, String.class),
+
// TRANSIENT CONFIG
VERSION(
"faxtomail.version",
@@ -189,15 +192,6 @@
true
),
-// FAXTOMAIL_HELP_DIRECTORY(
-// "faxtomail.help.directory",
-// n("faxtomail.config.option.help.directory.description"),
-// "${faxtomail.basedir}/help",
-// File.class,
-// false,
-// true
-// ),
-
START_ACTION_FILE(
"faxtomail.startActionFile",
n("faxtomail.config.option.startActionFile.description"),
@@ -306,7 +300,7 @@
String description,
String defaultValue,
Class<?> type) {
- this(key, description, defaultValue, type, true);
+ this(key, description, defaultValue, type, false);
}
@Override
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-05-30 08:55:55 UTC (rev 107)
@@ -1,10 +1,10 @@
###
# #%L
-# Extranet ENC-AHI :: Persistence
+# FaxToMail :: Persistence
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2013 Ministère des Affaires sociales et de la Santé
+# 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
@@ -24,10 +24,31 @@
model.tagValue.notGenerateToString=true
model.tagValue.constantPrefix=PROPERTY_
model.tagValue.hibernateAttributeType.java.lang.String=text
-#model.tagValue.hibernateAttributeType.java.sql.Blob=blob
model.tagValue.useEnumerationName=true
model.tagValue.doNotGenerateBooleanGetMethods=true
+# EtatAttente
+com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.label.tagvalue.naturalId=true
+
+# Priority
+com.franciaflex.faxtomail.persistence.entities.Priority.attribute.label.tagvalue.naturalId=true
+
+# Range
+com.franciaflex.faxtomail.persistence.entities.Range.attribute.label.tagvalue.naturalId=true
+
+# DemandType
+com.franciaflex.faxtomail.persistence.entities.DemandType.attribute.label.tagvalue.naturalId=true
+
+# Client
+#com.franciaflex.faxtomail.persistence.entities.Client.attribute.emailAddress.tagvalue.naturalId=true
+
+
+# EmailAccount
+com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.protocol.tagvalue.naturalId=true
+com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.host.tagvalue.naturalId=true
+com.franciaflex.faxtomail.persistence.entities.EmailAccount.attribute.login.tagvalue.naturalId=true
+
+
# Attachment
com.franciaflex.faxtomail.persistence.entities.Attachment.attribute.originalFile.tagvalue.notNull=true
@@ -40,17 +61,16 @@
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.parent.tagvalue.notNull=false
com.franciaflex.faxtomail.persistence.entities.MailFolder.attribute.name.tagvalue.naturalId=true
-# EtatAttente
-com.franciaflex.faxtomail.persistence.entities.EtatAttente.attribute.label.tagvalue.naturalId=true
+# MailFilter
+com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.expression.tagvalue.naturalId=true
+com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.mailFolder.tagvalue.notNull=true
+com.franciaflex.faxtomail.persistence.entities.MailFilter.attribute.position.tagvalue.unique=true
-# Priority
-com.franciaflex.faxtomail.persistence.entities.Priority.attribute.label.tagvalue.naturalId=true
+# FaxToMailGroup
+com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup.attribute.name.tagvalue.naturalId=true
-# Range
-com.franciaflex.faxtomail.persistence.entities.Range.attribute.label.tagvalue.naturalId=true
+# Email
+com.franciaflex.faxtomail.persistence.entities.Email.attribute.mailFolder.tagvalue.notNull=true
-# DemandType
-com.franciaflex.faxtomail.persistence.entities.DemandType.attribute.label.tagvalue.naturalId=true
-
-# Client
-#com.franciaflex.faxtomail.persistence.entities.Client.attribute.emailAddress.tagvalue.naturalId=true
+# History
+com.franciaflex.faxtomail.persistence.entities.History.attribute.type.tagvalue.notNull=true
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/pom.xml
===================================================================
--- trunk/faxtomail-service/pom.xml 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-service/pom.xml 2014-05-30 08:55:55 UTC (rev 107)
@@ -153,6 +153,10 @@
<artifactId>h2</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.unboundid</groupId>
+ <artifactId>unboundid-ldapsdk</artifactId>
+ </dependency>
</dependencies>
<build>
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-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationService.java 2014-05-30 08:55:55 UTC (rev 107)
@@ -39,7 +39,11 @@
import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFilterTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
-import com.google.common.collect.Lists;
+import com.unboundid.ldap.sdk.LDAPConnection;
+import com.unboundid.ldap.sdk.LDAPException;
+import com.unboundid.ldap.sdk.SearchResult;
+import com.unboundid.ldap.sdk.SearchResultEntry;
+import com.unboundid.ldap.sdk.SearchScope;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -49,12 +53,6 @@
private static final Log log = LogFactory.getLog(ConfigurationService.class);
- public List<Configuration> getAllConfigurations() {
- ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
- List<Configuration> configs = Lists.newArrayList(dao.findAll());
- return configs;
- }
-
/**
* Return unique database configuration.
*
@@ -69,7 +67,12 @@
return config;
}
- public Configuration saveConfiguration(Configuration config) {
+ /**
+ * Save configuration.
+ *
+ * @param config cufiguration to save
+ */
+ public void saveConfiguration(Configuration config) {
ConfigurationTopiaDao dao = getPersistenceContext().getConfigurationDao();
if (config.isPersisted()) {
config = dao.update(config);
@@ -77,13 +80,28 @@
config = dao.create(config);
}
getPersistenceContext().commit();
- return config;
}
-
- public Collection<MailFilter> saveMailFilters(Collection<MailFilter> mailFilters) {
+
+ /**
+ * Get all mail filter ordered by position.
+ *
+ * @return all mail filter
+ */
+ public List<MailFilter> getMailFilters() {
+ MailFilterTopiaDao mailFilterDao = getPersistenceContext().getMailFilterDao();
+ List<MailFilter> result = mailFilterDao.forAll().setOrderByArguments(MailFilter.PROPERTY_POSITION + " asc").findAll();
+ return result;
+ }
+
+ /**
+ * Save all mail filters.
+ *
+ * @param mailFilters mail filters to save
+ */
+ public void saveMailFilters(List<MailFilter> mailFilters) {
MailFilterTopiaDao dao = getPersistenceContext().getMailFilterDao();
- Collection<MailFilter> result = new ArrayList<>();
+ int position = 0;
for (MailFilter mailFilter : mailFilters) {
MailFilter filter;
@@ -95,19 +113,67 @@
}
filter.setExpression(mailFilter.getExpression());
filter.setMailFolder(mailFilter.getMailFolder());
+ filter.setPosition(position);
if (create) {
filter = dao.create(filter);
} else {
filter = dao.update(filter);
}
- result.add(filter);
+
+ position++;
}
- return result;
}
- public Collection<EmailAccount> getEmailAccounts() {
+ /**
+ * Return all email accounts.
+ *
+ * @return all email account
+ */
+ public List<EmailAccount> getEmailAccounts() {
EmailAccountTopiaDao emailAccountTopiaDao = getPersistenceContext().getEmailAccountDao();
- return new ArrayList<>(emailAccountTopiaDao.findAll());
+ return emailAccountTopiaDao.findAll();
}
+
+ /**
+ *
+ * @param emailAccounts
+ */
+ public void saveEmailAccounts(List<EmailAccount> emailAccounts) {
+
+ }
+
+ /**
+ * Get ldap connection.
+ *
+ * @return
+ * @throws LDAPException
+ */
+ protected LDAPConnection getLDAPConnection() throws LDAPException {
+ // host, port, username and password
+ return new LDAPConnection(getApplicationConfig().getLdapHost(),
+ getApplicationConfig().getLdapPort(),
+ getApplicationConfig().getLdapUser(),
+ getApplicationConfig().getLdapPassword());
+ }
+
+ public List<String> getAllGroups() throws LDAPException {
+ List<String> results = new ArrayList<>();
+
+ // ldapsearch -h ldap.codelutin.home -b "ou=Group,DC=codelutin,DC=home" "objectClass=posixGroup"
+ String baseDN = "ou=Group,DC=codelutin,DC=home";
+ String filter = "(objectClass=posixGroup)";
+
+ LDAPConnection connection = getLDAPConnection();
+ if (connection.isConnected()) {
+ SearchResult searchResult = connection.search(baseDN, SearchScope.ONE, filter);
+
+ List<SearchResultEntry> searchEntries = searchResult.getSearchEntries();
+ for (SearchResultEntry searchEntry : searchEntries) {
+ results.add(searchEntry.getAttributeValue("cn"));
+ }
+ }
+
+ return results;
+ }
}
Modified: trunk/faxtomail-ui-web/pom.xml
===================================================================
--- trunk/faxtomail-ui-web/pom.xml 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-ui-web/pom.xml 2014-05-30 08:55:55 UTC (rev 107)
@@ -242,6 +242,11 @@
<groupId>org.webjars</groupId>
<artifactId>angular-ui-utils</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>angular-ui-sortable</artifactId>
+ </dependency>
</dependencies>
<build>
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-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-05-30 08:55:55 UTC (rev 107)
@@ -35,8 +35,10 @@
import com.franciaflex.faxtomail.persistence.entities.Action;
import com.franciaflex.faxtomail.persistence.entities.Configuration;
import com.franciaflex.faxtomail.persistence.entities.ConfigurationImpl;
+import com.franciaflex.faxtomail.persistence.entities.EmailAccount;
import com.franciaflex.faxtomail.persistence.entities.EtatAttente;
import com.franciaflex.faxtomail.persistence.entities.Field;
+import com.franciaflex.faxtomail.persistence.entities.MailFilter;
import com.franciaflex.faxtomail.persistence.entities.MailFolder;
import com.franciaflex.faxtomail.services.service.ConfigurationService;
import com.franciaflex.faxtomail.services.service.MailFolderService;
@@ -65,6 +67,12 @@
protected List<MailFolder> mailFolders;
+ protected List<MailFilter> mailFilters;
+
+ protected List<String> groupNames;
+
+ protected List<EmailAccount> emailAccounts;
+
@Override
public void prepare() throws Exception {
configuration = configurationService.getConfiguration();
@@ -75,6 +83,9 @@
public String input() throws Exception {
etatAttentes = referentielService.getAllEtatAttente();
mailFolders = mailFolderService.getRootMailFolders();
+ groupNames = configurationService.getAllGroups();
+ emailAccounts = configurationService.getEmailAccounts();
+ mailFilters = configurationService.getMailFilters();
return INPUT;
}
@@ -135,4 +146,8 @@
Type type = new TypeToken<List<MailFolder>>() {}.getType();
this.mailFolders = getGson().fromJson(json, type);
}
+
+ public List<String> getGroupNames() {
+ return groupNames;
+ }
}
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-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-05-30 08:55:55 UTC (rev 107)
@@ -48,6 +48,8 @@
'etatAttenteFields': <s:property value="toJson(etatAttenteFields)" escapeHtml="false"/>,
'mailFolders': <s:property value="toJson(mailFolders)" escapeHtml="false"/>,
'searchDisplayColumns': <s:property value="toJson(configuration.searchDisplayColumns)" escapeHtml="false"/>,
+ 'groupNames': <s:property value="toJson(groupNames)" escapeHtml="false"/>,
+ 'emailAccounts': <s:property value="toJson(emailAccounts)" escapeHtml="false"/>
});
</script>
</head>
@@ -55,17 +57,19 @@
<body>
<div ng-app="ConfigurationModule">
<!-- navbar -->
- <header class="navbar navbar-inverse navbar-static-top bs-docs-nav" id="top" role="banner">
+ <header class="navbar navbar-inverse navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a>
</div>
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+ <nav class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
- <li class="active"><a href="<s:url action='configuration-input' />" class="navbar-brand">Configuration</a></li>
- <li><a href="<s:url action='import-input' />" class="navbar-brand">Import</a></li>
+ <li class="active"><a href="<s:url action='configuration-input' />">
+ <span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
+ <li><a href="<s:url action='import-input' />">
+ <span class="glyphicon glyphicon-upload"></span> Import</a></li>
</ul>
- </div>
+ </nav>
</div>
</header>
@@ -200,8 +204,10 @@
</thead>
<tbody>
<tr ng-repeat="customerResponsible in selectedMailFolder.customerResponsibles track by $index">
- <td>{{customerResponsible}}</td>
<td>
+ <span class="glyphicon glyphicon-user"></span>
+ {{customerResponsible}}</td>
+ <td>
<a class="pull-right btn btn-danger btn-xs" ng-click="removeCustomerResponsible($index)">
<span class="glyphicon glyphicon-remove"></span>
</a>
@@ -210,7 +216,7 @@
</tbody>
</table>
- Nouveau : <input type="email" ng-model="newCustomerResponsible" />
+ Nouveau : <input type="email" ng-model="newCustomerResponsible" placeholder="nom.prenom(a)franciaflex.fr" />
<a class="btn btn-success btn-xs" ng-click="addCustomerResponsible()" ng-disabled="!newCustomerResponsible">
<span class="glyphicon glyphicon-ok"></span>
</a>
@@ -238,8 +244,10 @@
</thead>
<tbody>
<tr ng-repeat="replyAddress in selectedMailFolder.replyAddresses track by $index">
- <td>{{replyAddress}}</td>
<td>
+ <span class="glyphicon glyphicon-user"></span>
+ {{replyAddress}}</td>
+ <td>
<a class="pull-right btn btn-danger btn-xs" ng-click="removeReplyAddress($index)">
<span class="glyphicon glyphicon-remove"></span>
</a>
@@ -248,7 +256,7 @@
</tbody>
</table>
- Nouveau : <input type="email" ng-model="newReplyAddress" />
+ Nouveau : <input type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
<a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
<span class="glyphicon glyphicon-ok"></span>
</a>
@@ -294,8 +302,27 @@
<th>Type</th>
</tr>
</thead>
- <tbody></tbody>
+ <tbody>
+
+ </tbody>
</table>
+
+ <div class="form-group">
+ Nouveau utilisateur : <input type="email" ng-model="newReplyAddress" placeholder="nom.prenom(a)franciaflex.fr" />
+ <a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newReplyAddress">
+ <span class="glyphicon glyphicon-ok"></span>
+ </a>
+ </div>
+
+ <div class="form-group">
+ Nouveau groupe :
+ <select ng-model="newWriteAccessGroup" ng-options="groupName for groupName in groupNames">
+ <option></option>
+ </select>
+ <a class="btn btn-success btn-xs" ng-click="addReplyAddress()" ng-disabled="!newWriteAccessGroup">
+ <span class="glyphicon glyphicon-ok"></span>
+ </a>
+ </div>
</div>
</div>
</div>
@@ -432,12 +459,12 @@
<thead>
<tr>
<th>Dossier</th>
- <th ng-repeat="ldapGroup in ldapGroups">{{ldapGroup}}</th>
+ <th ng-repeat="groupName in groupNames">{{groupName}}</th>
</tr>
</thead>
<tbody ng-repeat="mailFolder in flatMailFolders()">
<th>{{mailFolder.name}}</th>
- <td ng-repeat="ldapGroup in ldapGroups">
+ <td ng-repeat="groupName in groupNames">
<input type="checkbox" />
</td>
</tbody>
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-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/import-input.jsp 2014-05-30 08:55:55 UTC (rev 107)
@@ -34,17 +34,19 @@
<body>
<div>
<!-- navbar -->
- <header class="navbar navbar-inverse navbar-static-top bs-docs-nav" id="top" role="banner">
+ <header class="navbar navbar-inverse navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<a href="<s:url value='/' />" class="navbar-brand">FaxToMail</a>
</div>
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+ <nav class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
- <li><a href="<s:url action='configuration-input' />" class="navbar-brand">Configuration</a></li>
- <li class="active"><a href="<s:url action='import-input' />" class="navbar-brand">Import</a></li>
+ <li><a href="<s:url action='configuration-input' />">
+ <span class="glyphicon glyphicon-cog"></span> Configuration</a></li>
+ <li class="active"><a href="<s:url action='import-input' />">
+ <span class="glyphicon glyphicon-upload"></span> Import</a></li>
</ul>
- </div>
+ </nav>
</div>
</header>
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-30 08:55:55 UTC (rev 107)
@@ -35,6 +35,8 @@
$scope.etatAttenteFields = ConfigurationData.etatAttenteFields;
//{Array} les etats d'attentes disponibles
$scope.etatAttentes = ConfigurationData.etatAttentes;
+ // {Array} Liste des groupes ldap
+ $scope.groupNames = ConfigurationData.groupNames;
// method privée recursive pour retourner l'ensemble des dossiers
var recursiveAddMailFolder = function(result, mailFolders) {
@@ -316,6 +318,5 @@
*/
FaxToMailModule.controller('ConfigurationLdapController', ['$scope', '$http', 'ConfigurationData',
function($scope, $http, ConfigurationData) {
- // {Array} Liste des groupes ldap
- $scope.ldapGroups = ["Group1", "Group2", "Group3", "Group4", "Group5"];
+
}]);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-05-30 08:31:12 UTC (rev 106)
+++ trunk/pom.xml 2014-05-30 08:55:55 UTC (rev 107)
@@ -531,6 +531,13 @@
<dependency>
<groupId>org.webjars</groupId>
+ <artifactId>angular-ui-sortable</artifactId>
+ <version>0.12.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.1.1-1</version>
<scope>runtime</scope>
@@ -562,6 +569,12 @@
</exclusion>
</exclusions>
</dependency>
+
+ <dependency>
+ <groupId>com.unboundid</groupId>
+ <artifactId>unboundid-ldapsdk</artifactId>
+ <version>2.3.6</version>
+ </dependency>
</dependencies>
</dependencyManagement>
1
0
r106 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande
by kmorin@users.forge.codelutin.com 30 May '14
by kmorin@users.forge.codelutin.com 30 May '14
30 May '14
Author: kmorin
Date: 2014-05-30 10:31:12 +0200 (Fri, 30 May 2014)
New Revision: 106
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/106
Log:
fixes #5150 NPE au clic sur un noeud de l'arborescence
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-05-28 09:37:42 UTC (rev 105)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-05-30 08:31:12 UTC (rev 106)
@@ -45,15 +45,10 @@
import com.franciaflex.faxtomail.ui.swing.util.FolderTreeNode;
import com.google.common.base.Function;
import com.google.common.collect.Collections2;
-
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.JXTable;
-import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import javax.swing.*;
@@ -65,7 +60,6 @@
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
-
import java.awt.*;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
@@ -288,14 +282,20 @@
@Override
protected Collection<String> getColumns() {
+ Collection<String> columns = null;
MailFolder selectedFolder = getModel().getSelectedFolder();
- return selectedFolder == null || selectedFolder.getFolderTableColumns() == null ? null :
+ if (selectedFolder != null) {
+ List<Field> folderTableColumns = selectedFolder.getFolderTableColumns();
+ if (folderTableColumns != null) {
Collections2.transform(selectedFolder.getFolderTableColumns(), new Function<Field, String>() {
@Override
public String apply(Field field) {
return field.toString();
}
});
+ }
+ }
+ return columns;
}
@Override
1
0
r105 - trunk/faxtomail-ui-web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 28 May '14
by echatellier@users.forge.codelutin.com 28 May '14
28 May '14
Author: echatellier
Date: 2014-05-28 11:37:42 +0200 (Wed, 28 May 2014)
New Revision: 105
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/105
Log:
refs #4662: Correction de l'affichage des filtres
Modified:
trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js
===================================================================
--- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-28 09:27:47 UTC (rev 104)
+++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-05-28 09:37:42 UTC (rev 105)
@@ -251,13 +251,13 @@
var mailFilters = [];
angular.forEach($scope.flatMailFolders(), function(mailFolder) {
if (mailFolder.filters) {
- mailFilters = mailFilters.concat(mailFolder.filters);
- angular.forEach($scope.mailFilters, function(mailFilter) {
+ //mailFilters = mailFilters.concat(mailFolder.filters);
+ angular.forEach(mailFolder.filters, function(mailFilter) {
// ca c'est pas propre, on modifie l'object original pour affichage
- mailFilter.fmMailFolder = mailFolder;
+ mailFilter.fmMailFolder = {name:mailFolder.name};
- mailFilters.push(mailFolder);
+ mailFilters.push(mailFilter);
});
} else {
mailFolder.filters = [];
@@ -268,7 +268,12 @@
// add new filter action
$scope.addNewFilter = function() {
- var filter = {expression: $scope.selectedFilter, fmMailFolder: $scope.selectedFolder};
+ var filter = {
+ expression: $scope.selectedFilter,
+ fmMailFolder: {
+ name: $scope.selectedFolder.name
+ }
+ };
$scope.selectedFolder.filters.push(filter);
// clear form
1
0