r23 - in trunk: . faxtomail-persistence faxtomail-persistence/src/main/java/com/franciaflex/faxtomail faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-persistence/src/main/resources faxtomail-persistence/src/main/resources/i18n faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services faxtomail-service/src/main/java/com/franciaf
Author: kmorin Date: 2014-03-31 18:30:02 +0200 (Mon, 31 Mar 2014) New Revision: 23 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/23 Log: refs #4654 [ECRAN] Liste des mails / fax refs #4655 [ECRAN] D?\195?\169tail d'un mail / fax Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ArchiveAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.jaxx Removed: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java Modified: trunk/faxtomail-persistence/pom.xml trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java trunk/faxtomail-persistence/src/main/resources/faxToMail.properties trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ClientImportModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentCellEditor.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/ButtonAttachment.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties trunk/pom.xml Modified: trunk/faxtomail-persistence/pom.xml =================================================================== --- trunk/faxtomail-persistence/pom.xml 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/pom.xml 2014-03-31 16:30:02 UTC (rev 23) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + FaxToMail :: Persistence + %% + Copyright (C) 2014 Franciaflex + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> @@ -29,6 +51,11 @@ </dependency> <dependency> + <groupId>net.sourceforge.jtds</groupId> + <artifactId>jtds</artifactId> + </dependency> + + <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> </dependency> Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java 2014-03-31 16:30:02 UTC (rev 23) @@ -9,18 +9,18 @@ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the + * 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 Lesser Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Lesser Public + * You should have received a copy of the GNU General Public * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java 2014-03-31 16:30:02 UTC (rev 23) @@ -9,18 +9,18 @@ * Copyright (C) 2013 Ministère des Affaires sociales et de la Santé * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the + * 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 Lesser Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Lesser Public + * You should have received a copy of the GNU General Public * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ @@ -332,4 +332,4 @@ // not used } -} \ No newline at end of file +} Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,29 @@ package com.franciaflex.faxtomail.persistence; +/* + * #%L + * FaxToMail :: Persistence + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 Franciaflex + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import org.jdesktop.beans.AbstractSerializableBean; import org.nuiton.jaxx.application.type.ApplicationProgressionModel; import org.nuiton.updater.DownloadMonitor; Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,29 @@ package com.franciaflex.faxtomail.persistence; +/* + * #%L + * FaxToMail :: Persistence + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 Franciaflex + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,29 @@ package com.franciaflex.faxtomail.persistence.entities; +/* + * #%L + * FaxToMail :: Persistence + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 Franciaflex + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import com.google.common.base.Preconditions; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,29 @@ package com.franciaflex.faxtomail.persistence.entities; +/* + * #%L + * FaxToMail :: Persistence + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 Franciaflex + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import static org.nuiton.i18n.I18n.n; /** @@ -10,7 +34,10 @@ CREATION(n("faxtomail.historyType.creation")), OPENING(n("faxtomail.historyType.opening")), - MODIFICATION(n("faxtomail.historyType.modification")); + MODIFICATION(n("faxtomail.historyType.modification")), + REPLY(n("faxtomail.historyType.reply")), + PRINTING(n("faxtomail.historyType.printing")), + ARCHIVED(n("faxtomail.historyType.archive")); protected String labelKey; Modified: trunk/faxtomail-persistence/src/main/resources/faxToMail.properties =================================================================== --- trunk/faxtomail-persistence/src/main/resources/faxToMail.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/resources/faxToMail.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -1,3 +1,26 @@ +### +# #%L +# FaxToMail :: Persistence +# $Id:$ +# $HeadURL:$ +# %% +# Copyright (C) 2014 Franciaflex +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### hibernate.connection.driver_class=org.h2.Driver hibernate.connection.url=jdbc:h2:file:/tmp/faxtomail/h2data hibernate.connection.username=sa @@ -3,4 +26,11 @@ hibernate.connection.password= +#hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver +#hibernate.connection.url=jdbc:jtds:sqlserver://192.168.100.247:1433/faxtomail +#hibernate.connection.username=fx +#hibernate.connection.password=FX2013! + +#hibernate.dialect=org.hibernate.dialect.SQLServerDialect + hibernate.dialect=org.hibernate.dialect.H2Dialect hibernate.hbm2ddl.auto=update Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties =================================================================== --- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -20,9 +20,12 @@ faxtomail.config.option.ui.showNumberEditorButton.description= faxtomail.config.option.version.description= faxtomail.config.parse.error= +faxtomail.historyType.archive= faxtomail.historyType.creation= faxtomail.historyType.modification= faxtomail.historyType.opening= +faxtomail.historyType.printing= +faxtomail.historyType.reply= faxtomail.persistence.loader.error= faxtomail.persistence.mkDir.error= faxtomail.service.config.deleteTempDirectory.error= Modified: trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties =================================================================== --- trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -20,9 +20,12 @@ faxtomail.config.option.ui.showNumberEditorButton.description= faxtomail.config.option.version.description= faxtomail.config.parse.error= +faxtomail.historyType.archive= faxtomail.historyType.creation=Création faxtomail.historyType.modification=Modification faxtomail.historyType.opening=Ouverture +faxtomail.historyType.printing= +faxtomail.historyType.reply= faxtomail.persistence.loader.error= faxtomail.persistence.mkDir.error= faxtomail.service.config.deleteTempDirectory.error= Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties =================================================================== --- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -7,22 +7,23 @@ # Copyright (C) 2013 Ministère des Affaires sociales et de la Santé # %% # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of the +# 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 Lesser Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Lesser Public +# You should have received a copy of the GNU General Public # License along with this program. If not, see -# <http://www.gnu.org/licenses/lgpl-3.0.html>. +# <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### model.tagValue.notGenerateToString=true model.tagValue.constantPrefix=PROPERTY_ model.tagValue.java.lang.String=text +#model.tagValue.java.lang.String=nvarchar($l) model.tagValue.useEnumerationName=true model.tagValue.doNotGenerateBooleanGetMethods=true Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo =================================================================== (Binary files differ) Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-03-31 16:30:02 UTC (rev 23) @@ -121,7 +121,7 @@ } }); registerMultiJXPathDecorator(HasLabel.class, "${label}$s", SEPARATOR, " - "); - registerMultiJXPathDecorator(Attachment.class, "${file}$s", SEPARATOR, " - "); + registerMultiJXPathDecorator(Attachment.class, "${originalFile}$s", SEPARATOR, " - "); registerMultiJXPathDecorator(FaxToMailUser.class, "${trigraph}$s#${firstName}$s#${lastName}$s", SEPARATOR, " "); } }; Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-03-31 16:30:02 UTC (rev 23) @@ -16,6 +16,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaEntityVisitor; +import org.nuiton.topia.persistence.internal.AbstractTopiaDao; import org.nuiton.topia.persistence.pager.TopiaPagerBean; import java.beans.PropertyChangeEvent; @@ -92,8 +93,9 @@ public List<Email> getEmailForFolder(MailFolder folder) { EmailTopiaDao dao = getPersistenceContext().getEmailDao(); List<Email> result = new ArrayList<>(dao.forMailFolderEquals(folder) - .setOrderByArguments(Email.PROPERTY_RECEPTION_DATE) - .findAll()); + .addNull(Email.PROPERTY_ARCHIVE_DATE) + .setOrderByArguments(Email.PROPERTY_RECEPTION_DATE) + .findAll()); return result; } @@ -158,13 +160,23 @@ return email; } - public List<Email> search(Email emailLike) { + public List<Email> search(Email emailLike, Date minReceptionDate, Date maxReceptionDate, + Date minModificationDate, Date maxModificationDate, FaxToMailUser modifier, + Date minPrintingDate, Date maxPrintingDate) { + + HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao(); + AbstractTopiaDao.InnerTopiaQueryBuilderAddCriteriaOrRunQueryStep<History> queryBuilder = + historyDao.newQueryBuilder(); + if (modifier != null) { + queryBuilder.addEquals(History.PROPERTY_FAX_TO_MAIL_USER, modifier); + } + List<History> histories = new ArrayList<>(queryBuilder.findAll()); + EmailTopiaDao dao = getPersistenceContext().getEmailDao(); List<Email> result = new ArrayList<>(dao.newQueryBuilder() .addContainsText(Email.PROPERTY_OBJECT, emailLike.getObject()) .addContainsText(Email.PROPERTY_SENDER, emailLike.getSender()) - .addContainsText(Email.PROPERTY_CLIENT_CODE, emailLike.getClientCode()) - .addContainsText(Email.PROPERTY_EDI_CODE_NUMBER, emailLike.getEdiCodeNumber()) +// .addContainsText(Email.PROPERTY_CLIENT_CODE, emailLike.getClientCode()) .addContainsText(Email.PROPERTY_PROJECT_REFERENCE, emailLike.getProjectReference()) .addEqualsIfNotNull(Email.PROPERTY_TAKEN_BY, emailLike.getTakenBy()) .addEqualsIfNotNull(Email.PROPERTY_DEMAND_TYPE, emailLike.getDemandType()) Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-03-31 16:30:02 UTC (rev 23) @@ -340,7 +340,7 @@ Date now = new Date(); History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION, History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER, - Email.PROPERTY_CLIENT_CODE, + Email.PROPERTY_CLIENT, Email.PROPERTY_PROJECT_REFERENCE, Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE, @@ -351,7 +351,7 @@ Email email = emailDao.create(Email.PROPERTY_SENDER, sender, Email.PROPERTY_FAX, fax, - Email.PROPERTY_CLIENT_CODE, client.getCode(), + Email.PROPERTY_CLIENT, client, Email.PROPERTY_PROJECT_REFERENCE, projectRef, Email.PROPERTY_OBJECT, client.getCaracteristic1() + " / " + client.getCode() + " / " + client.getName() + " / " + client.getFaxNumber() + " / " + dateDecorator.toString(now), Email.PROPERTY_RECEPTION_DATE, now, @@ -373,7 +373,7 @@ Date yesterday = cal.getTime(); history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION, History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER, - Email.PROPERTY_CLIENT_CODE, + Email.PROPERTY_CLIENT, Email.PROPERTY_PROJECT_REFERENCE, Email.PROPERTY_OBJECT, Email.PROPERTY_RECEPTION_DATE, @@ -384,7 +384,7 @@ email = emailDao.create(Email.PROPERTY_SENDER, sender, Email.PROPERTY_FAX, fax, - Email.PROPERTY_CLIENT_CODE, client.getCode(), + Email.PROPERTY_CLIENT, client, Email.PROPERTY_PROJECT_REFERENCE, projectRef, Email.PROPERTY_OBJECT, client.getCaracteristic1() + " / " + client.getCode() + " / " + client.getName() + " / " + client.getFaxNumber() + " / " + dateDecorator.toString(yesterday), Email.PROPERTY_RECEPTION_DATE, yesterday, Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ClientImportModel.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ClientImportModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/imports/ClientImportModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -26,6 +26,7 @@ } }; newMandatoryColumn("Id_Correspondance", Client.PROPERTY_ID); + newMandatoryColumn("Societe", Client.PROPERTY_BRAND); newMandatoryColumn("Nom", Client.PROPERTY_NAME); newMandatoryColumn("Caracteristique1", Client.PROPERTY_CARACTERISTIC1, nullParser); newMandatoryColumn("Caracteristique2", Client.PROPERTY_CARACTERISTIC2, nullParser); @@ -34,7 +35,6 @@ newMandatoryColumn("Adresse_Mail", Client.PROPERTY_EMAIL_ADDRESS, nullParser); newMandatoryColumn("Code_Client", Client.PROPERTY_CODE); - newIgnoredColumn("Societe"); newIgnoredColumn("Client_Top"); newIgnoredColumn("Objet_Message"); newIgnoredColumn("Destination"); Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ArchiveAction.java (from rev 17, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java) =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ArchiveAction.java (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ArchiveAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,45 @@ +package com.franciaflex.faxtomail.ui.swing.actions; + +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIHandler; +import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler; + +import javax.swing.*; + +import java.util.Date; + +import static org.nuiton.i18n.I18n.t; + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public class ArchiveAction extends SaveDemandeAndExitAction { + + public ArchiveAction(DemandeUIHandler handler) { + super(handler); + } + + //TODO kmorin 20140326 ask confirmation +// @Override +// public boolean prepareAction() throws Exception { +// String htmlMessage = String.format( +// AbstractApplicationUIHandler.CONFIRMATION_FORMAT, +// message, +// t("jaxx.application.common.askCancelEditBeforeLeaving.help")); +// int i = JOptionPane.showConfirmDialog( +// null, +// htmlMessage, +// t("jaxx.application.common.askCancelEditBeforeLeaving.title"), +// JOptionPane.OK_CANCEL_OPTION, +// JOptionPane.QUESTION_MESSAGE); +// +// boolean result = i == JOptionPane.OK_OPTION; +// return result; +// } + + @Override + public void doAction() throws Exception { + getModel().setArchiveDate(new Date()); + super.doAction(); + } +} Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,35 +1,33 @@ package com.franciaflex.faxtomail.ui.swing.actions; -import com.franciaflex.faxtomail.persistence.entities.Attachment; -import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl; import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil; import com.franciaflex.faxtomail.ui.swing.util.JImagePanel; +import com.franciaflex.faxtomail.ui.swing.util.attachment.PDFEditorCrossUI; +import com.franciaflex.faxtomail.ui.swing.util.attachment.PDFEditorNoteUI; import com.franciaflex.faxtomail.ui.swing.util.attachment.PDFEditorUI; import com.franciaflex.faxtomail.ui.swing.util.attachment.PDFEditorUIHandler; import com.franciaflex.faxtomail.ui.swing.util.attachment.PDFEditorUIModel; import com.itextpdf.text.BaseColor; import com.itextpdf.text.Document; import com.itextpdf.text.Image; -import com.itextpdf.text.Paragraph; import com.itextpdf.text.Phrase; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.ColumnText; +import com.itextpdf.text.pdf.PdfAction; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfStamper; import com.itextpdf.text.pdf.PdfWriter; import jaxx.runtime.JAXXUtil; import jaxx.runtime.SwingUtil; -import org.nuiton.util.FileUtil; +import org.apache.commons.io.FileUtils; import javax.swing.*; import java.awt.*; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.FileReader; import java.net.URL; /** @@ -79,7 +77,7 @@ PdfReader pdfReader = new PdfReader(fis); - File target = new File(getModel().getOriginalFile().getName() + "-annoté.pdf"); + File target = new File(FileUtils.getTempDirectory(), getModel().getOriginalFile().getName() + "-annoté.pdf"); FileOutputStream fos = new FileOutputStream(target); PdfStamper pdfStamper = new PdfStamper(pdfReader, fos); @@ -88,14 +86,14 @@ for (int i = 0 ; i < pageNb ; i++) { PdfContentByte cb = pdfStamper.getOverContent(i + 1); - for (JPanel panel : getModel().getPages()[i].getNotes()) { + for (PDFEditorNoteUI note : getModel().getPages()[i].getNotes()) { - Point location = panel.getLocation(); - int width = panel.getWidth(); - int height = panel.getHeight(); + Point location = note.getLocation(); + int width = note.getWidth(); + int height = note.getHeight(); int x = location.x; int y = getUI().getContainer().getHeight() - location.y - height; - Insets insets = panel.getInsets(); + Insets insets = note.getInsets(); cb.saveState(); cb.setColorFill(BaseColor.YELLOW); @@ -104,7 +102,7 @@ cb.restoreState(); cb.saveState(); - JTextArea textArea = (JTextArea) panel.getComponent(0); + JTextArea textArea = note.getNoteText(); float fontSize = textArea.getFont().getSize2D(); cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA_OBLIQUE, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED), fontSize * 1.3f); @@ -112,7 +110,10 @@ ct.setSimpleColumn(x + insets.left, y + insets.bottom, x + insets.left + width - insets.right, y + insets.bottom + height - insets.top); ct.setLeading(fontSize + 3); - String text = textArea.getText(); + ct.addText(new Phrase(note.getTitle())); + ct.go(); + + String text = note.getText(); String[] rows = text.split("\n"); for (String s : rows) { if (s.isEmpty()) { @@ -121,9 +122,6 @@ ct.addText(new Phrase(s)); ct.go(); } - JLabel label = (JLabel) panel.getComponent(1); - ct.addText(new Phrase(label.getText())); - ct.go(); cb.restoreState(); } @@ -137,7 +135,7 @@ int y = getUI().getContainer().getHeight() - location.y - height; cb.saveState(); - Image cross = Image.getInstance(JAXXUtil.class.getResource(SwingUtil.DEFAULT_ICON_PATH + PDFEditorUIHandler.CROSS_IMAGE_FILE)); + Image cross = Image.getInstance(JAXXUtil.class.getResource(SwingUtil.DEFAULT_ICON_PATH + PDFEditorCrossUI.CROSS_IMAGE_FILE)); cross.scaleAbsolute(width, height); cross.setAbsolutePosition(x, y); cb.addImage(cross); @@ -148,6 +146,11 @@ pdfStamper.close(); pdfReader.close(); + Document document = new Document(); + PdfWriter writer = PdfWriter.getInstance(document, fos); + PdfAction action = new PdfAction(PdfAction.PRINTDIALOG); + writer.setOpenAction(action); + getModel().setEditedFile(target); } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,6 @@ package com.franciaflex.faxtomail.ui.swing.actions; +import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.EmailImpl; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; @@ -65,6 +66,9 @@ } } +// Collection<Attachment> attachments = getUI().getAttachmentsButton().getBean().getAttachment(); +// model.setAttachment(attachments); + FaxToMailUser currentUser = context.getCurrentUser(); Email email = model.toEntity(persistedEmail); Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeFromListAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,41 @@ +package com.franciaflex.faxtomail.ui.swing.actions; + +import com.franciaflex.faxtomail.persistence.entities.Email; +import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; +import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public class SaveDemandeFromListAction extends AbstractFaxToMailAction<DemandeListUIModel, DemandeListUI, DemandeListUIHandler> { + + protected String[] modifiedProperties; + + public SaveDemandeFromListAction(DemandeListUIHandler handler) { + super(handler, false); + } + + public void setModifiedProperties(String... properties) { + modifiedProperties = properties; + } + + @Override + public void doAction() throws Exception { + DemandeUIModel model = getModel().getCurrentEmail(); + FaxToMailUIContext context = getContext(); + + String topiaId = model.getTopiaId(); + Email persistedEmail = context.getEmailService().getEmailById(topiaId); + + FaxToMailUser currentUser = context.getCurrentUser(); + Email email = model.toEntity(persistedEmail); + + email = context.getEmailService().saveEmail(email, currentUser, modifiedProperties); + model.fromEntity(email); + } +} Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -22,14 +22,18 @@ @Override public void doAction() throws Exception { - Email email = getModel().toEntity(); - List<Email> emails = getContext().getEmailService().search(email); + SearchUIModel model = getModel(); + Email email = model.toEntity(); + List<Email> emails = getContext().getEmailService().search(email, model.getMinReceptionDate(), model.getMaxReceptionDate(), + model.getMinModificationDate(), model.getMaxModificationDate(), model.getModifiedBy(), + model.getMinPrintingDate(), model.getMaxPrintingDate()); List<DemandeUIModel> result = new ArrayList<>(); for (Email mail : emails) { DemandeUIModel demand = new DemandeUIModel(); - demand.fromEntity(email); + demand.fromEntity(mail); + demand.setValid(handler.isDemandeValid(demand)); result.add(demand); } - getModel().setResults(result); + model.setResults(result); } } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-03-31 16:30:02 UTC (rev 23) @@ -50,6 +50,15 @@ text: { String.valueOf(model.getEmailNb()) }; } +#quotationNbLabel { + text: "faxtomail.demandeList.quotationNbLabel"; + font-style: "italic"; +} + +#quotationNbField { + text: { String.valueOf(model.getQuotationNb()) }; +} + #pfNbLabel { text: "faxtomail.demandeList.pfNbLabel"; font-style: "italic"; @@ -87,13 +96,6 @@ enabled: { model.isReplyEnabled() }; } -#addAttachmentMenu { - actionIcon: attachment; - text: "faxtomail.demandeList.action.attachment"; - toolTipText: "faxtomail.demandeList.action.attachment.tip"; - enabled: { model.isAddAttachmentEnabled() }; -} - #archiveMenu { text: "faxtomail.demandeList.action.archive"; toolTipText: "faxtomail.demandeList.action.archive.tip"; Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -62,8 +62,6 @@ onActionPerformed='handler.print()'/> <JMenuItem id='replyMenu' onActionPerformed='handler.reply()'/> - <JMenuItem id='addAttachmentMenu' - onActionPerformed='handler.addAttachment()'/> <JMenuItem id='archiveMenu' onActionPerformed='handler.archive()'/> </JPopupMenu> @@ -79,6 +77,9 @@ <JLabel id="demandNbLabel"/> <JLabel id="demandNbField"/> <JLabel styleClass="horizontal-separator"/> + <JLabel id="quotationNbLabel"/> + <JLabel id="quotationNbField"/> + <JLabel styleClass="horizontal-separator"/> <JLabel id="pfNbLabel"/> <JLabel id="pfNbField"/> <JLabel styleClass="horizontal-separator"/> 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-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-03-31 16:30:02 UTC (rev 23) @@ -24,36 +24,27 @@ import com.franciaflex.faxtomail.persistence.entities.Company; import com.franciaflex.faxtomail.persistence.entities.Email; -import com.franciaflex.faxtomail.persistence.entities.EmailImpl; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.History; import com.franciaflex.faxtomail.persistence.entities.HistoryImpl; import com.franciaflex.faxtomail.persistence.entities.HistoryType; import com.franciaflex.faxtomail.persistence.entities.MailFolder; -import com.franciaflex.faxtomail.persistence.entities.Range; -import com.franciaflex.faxtomail.persistence.entities.RangeRow; import com.franciaflex.faxtomail.ui.swing.actions.ComputeQuantitiesByRangeAction; -import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction; +import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeFromListAction; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler; -import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler; import com.franciaflex.faxtomail.ui.swing.util.CloseableUI; -import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel; 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.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; -import org.jdesktop.swingx.decorator.ComponentAdapter; -import org.jdesktop.swingx.decorator.Highlighter; -import org.jdesktop.swingx.table.DefaultTableColumnModelExt; -import org.jdesktop.swingx.table.TableColumnModelExt; import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel; import javax.swing.*; -import javax.swing.event.ChangeListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; @@ -61,7 +52,6 @@ import javax.swing.tree.TreePath; import java.awt.*; -import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -69,12 +59,9 @@ import java.util.Collection; import java.util.Date; import java.util.Enumeration; -import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.nuiton.i18n.I18n.t; - /** * Handler of UI {@link com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler}. * @@ -86,6 +73,22 @@ /** Logger. */ private static final Log log = LogFactory.getLog(DemandeListUIHandler.class); + protected final PropertyChangeListener selectedDemandeChangeListener = new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + + String propertyName = evt.getPropertyName(); + if (Email.PROPERTY_PRIORITY.equals(propertyName)) { + SaveDemandeFromListAction saveAction = + getContext().getActionFactory().createLogicAction(DemandeListUIHandler.this, + SaveDemandeFromListAction.class); + saveAction.setModifiedProperties(propertyName); + getContext().getActionEngine().runAction(saveAction); + } + + } + }; + @Override public void beforeInit(DemandeListUI ui) { @@ -122,32 +125,69 @@ initUI(ui); + DemandeListUIModel model = getModel(); + // init table final JXTable dataTable = getUI().getDataTable(); - final AbstractApplicationTableModel<DemandeUIModel> tableModel = initDemandeTable(dataTable); + final AbstractApplicationTableModel<DemandeUIModel> tableModel = initDemandeTable(dataTable, false); - getModel().addPropertyChangeListener(DemandeListUIModel.PROPERTY_EMAILS, new PropertyChangeListener() { + dataTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + ListSelectionModel source = (ListSelectionModel) e.getSource(); + + DemandeListUIModel model = getModel(); + if (source.isSelectionEmpty()) { + model.setCurrentEmail(null); + } else { + int rowIndex = source.getLeadSelectionIndex(); + model.setCurrentEmail(tableModel.getEntry(rowIndex)); + } + } + }); + + model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_EMAILS, new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { List<DemandeUIModel> emails = (List<DemandeUIModel>) evt.getNewValue(); tableModel.setRows(emails); + int quotationNb = 0; int pfNb = 0; int savNb = 0; for (DemandeUIModel email : emails) { + quotationNb += email.getQuotationNb(); pfNb += email.getPfNb(); savNb += email.getSavNb(); } - DemandeListUIModel model = getModel(); + DemandeListUIModel model = (DemandeListUIModel) evt.getSource(); + model.setQuotationNb(quotationNb); model.setPfNb(pfNb); model.setSavNb(savNb); } }); + model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_CURRENT_EMAIL, new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + DemandeUIModel oldDemande = (DemandeUIModel) evt.getOldValue(); + if (oldDemande != null) { + oldDemande.removePropertyChangeListener(selectedDemandeChangeListener); + } + + DemandeUIModel newDemande = (DemandeUIModel) evt.getNewValue(); + if (newDemande != null) { + newDemande.addPropertyChangeListener(selectedDemandeChangeListener); + } + } + }); + // init tree Map<MailFolder, DefaultMutableTreeNode> nodesByFolder = - FaxToMailUIUtil.initFolderTree(getContext(), ui.getNavigationTree(), getModel().getFolders()); + FaxToMailUIUtil.initFolderTree(getContext(), ui.getNavigationTree(), model.getFolders()); ui.getNavigationTree().addTreeSelectionListener(new TreeSelectionListener() { @Override @@ -181,6 +221,12 @@ } @Override + protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) { + super.onDoubleClickOnDemande(selectedEmail); + selectedEmail.removePropertyChangeListener(selectedDemandeChangeListener); + } + + @Override protected JComponent getComponentToFocus() { return getUI().getNavigationTree(); } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -37,8 +37,10 @@ public static final String PROPERTY_FOLDERS = "folders"; public static final String PROPERTY_EMAILS = "emails"; + public static final String PROPERTY_CURRENT_EMAIL = "currentEmail"; public static final String PROPERTY_EMAIL_NB = "emailNb"; public static final String PROPERTY_SELECTED_FOLDER = "selectedFolder"; + public static final String PROPERTY_QUOTATION_NB = "quotationNb"; public static final String PROPERTY_PF_NB = "pfNb"; public static final String PROPERTY_SAV_NB = "savNb"; public static final String PROPERTY_REPLY_ENABLED = "replyEnabled"; @@ -48,12 +50,16 @@ protected List<DemandeUIModel> emails; + protected DemandeUIModel currentEmail; + protected MailFolder selectedFolder; protected boolean replyEnabled; protected boolean addAttachmentEnabled; + protected int quotationNb; + protected int pfNb; protected int savNb; @@ -80,6 +86,16 @@ firePropertyChange(PROPERTY_EMAIL_NB, oldValue, newValue); } + public DemandeUIModel getCurrentEmail() { + return currentEmail; + } + + public void setCurrentEmail(DemandeUIModel currentEmail) { + Object oldValue = getCurrentEmail(); + this.currentEmail = currentEmail; + firePropertyChange(PROPERTY_CURRENT_EMAIL, oldValue, currentEmail); + } + public int getEmailNb() { return emails == null ? 0 : emails.size(); } @@ -125,6 +141,16 @@ firePropertyChange(PROPERTY_ADD_ATTACHMENT_ENABLED, oldValue, addAttachmentEnabled); } + public int getQuotationNb() { + return quotationNb; + } + + public void setQuotationNb(int quotationNb) { + Object oldValue = getPfNb(); + this.quotationNb = quotationNb; + firePropertyChange(PROPERTY_QUOTATION_NB, oldValue, quotationNb); + } + public int getPfNb() { return pfNb; } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-03-31 16:30:02 UTC (rev 23) @@ -70,7 +70,7 @@ } #clientLabel { - text: "faxtomail.demande.client.label"; + text: "faxtomail.demande.clientCode.label"; } #clientField { @@ -78,6 +78,14 @@ _validatorLabel: { t("faxtomail.demande.clientCode.label") }; } +#brandLabel { + text: "faxtomail.demande.clientBrand.label"; +} + +#brandField { + text: {model.getClientBrand()}; +} + #docTypeLabel { text: "faxtomail.demande.demandType.label"; } @@ -125,6 +133,15 @@ _validatorLabel: { t("faxtomail.demande.projectReference.label") }; } +#companyReferenceLabel { + text: "faxtomail.demande.companyReference.label"; +} + +#companyReferenceField { + text: { model.getCompanyReference() }; + _validatorLabel: { t("faxtomail.demande.companyReference.label") }; +} + #messageLabel { text: "faxtomail.demande.message.label"; verticalAlignment: { SwingConstants.TOP }; @@ -202,6 +219,15 @@ text: " | "; } +#quotationNbLabel { + text: "faxtomail.demandeList.quotationNbLabel"; + font-style: "italic"; +} + +#quotationNbField { + text: { String.valueOf(model.getQuotationNb()) }; +} + #pfNbLabel { text: "faxtomail.demandeList.pfNbLabel"; font-style: "italic"; @@ -252,6 +278,7 @@ #archiveButton { text: "faxtomail.demande.archive.button.label"; enabled: { model.isValid() && model.isEditable() }; + _applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.ArchiveAction.class }; } #replyButton { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -87,7 +87,7 @@ <cell> <JLabel id='receivedDateLabel'/> </cell> - <cell> + <cell columns="3"> <JLabel id='receivedDateField'/> </cell> </row> @@ -95,7 +95,7 @@ <cell> <JLabel id='senderLabel'/> </cell> - <cell> + <cell columns="3"> <JLabel id='senderField'/> </cell> </row> @@ -103,7 +103,7 @@ <cell> <JLabel id='objectLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <JTextField id='objectField' onKeyReleased='handler.setText(event, "object")'/> </cell> @@ -116,12 +116,19 @@ <JTextField id='clientField' onKeyReleased='handler.setText(event, "clientCode")'/> </cell> + <cell> + <JLabel id='brandLabel'/> + </cell> + <cell weightx='1'> + <JTextField id='brandField' + onKeyReleased='handler.setText(event, "clientBrand")'/> + </cell> </row> <row> <cell> <JLabel id='docTypeLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <BeanFilterableComboBox id='docTypeComboBox' constructorParams='this' genericType="DemandType"/> @@ -131,7 +138,7 @@ <cell> <JLabel id='priorityLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <BeanFilterableComboBox id='priorityComboBox' constructorParams='this' genericType="Priority"/> @@ -141,16 +148,25 @@ <cell> <JLabel id='projectReferenceLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <JTextField id='projectReferenceField' onKeyReleased='handler.setText(event, "projectReference")'/> </cell> </row> <row> <cell> + <JLabel id='companyReferenceLabel'/> + </cell> + <cell weightx='1' columns="3"> + <JTextField id='companyReferenceField' + onKeyReleased='handler.setText(event, "companyReference")'/> + </cell> + </row> + <row> + <cell> <JLabel id='etatAttenteLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <BeanFilterableComboBox id='etatAttenteComboBox' constructorParams='this' genericType="EtatAttente"/> @@ -160,7 +176,7 @@ <cell> <JLabel id='statusLabel'/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <JLabel id='statusField'/> </cell> </row> @@ -169,12 +185,12 @@ <cell> <JLabel id="takenByLabel"/> </cell> - <cell weightx='1' > + <cell weightx='1' columns="3"> <JLabel id="takenByField"/> </cell> </row> <row> - <cell columns='2'> + <cell columns='4'> <JLabel id="firstOpenedLabel"/> </cell> </row> @@ -182,7 +198,7 @@ <cell> <JLabel id="firstOpenedByLabel"/> </cell> - <cell> + <cell columns="3"> <JLabel id="firstOpenedByField"/> </cell> </row> @@ -190,12 +206,12 @@ <cell> <JLabel id="firstOpeningDateLabel"/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <JLabel id="firstOpeningDateField"/> </cell> </row> <row> - <cell columns='2'> + <cell columns='4'> <JLabel id="lastModifiedLabel"/> </cell> </row> @@ -203,7 +219,7 @@ <cell> <JLabel id="lastModifiedByLabel"/> </cell> - <cell> + <cell columns="3"> <JLabel id="lastModifiedByField"/> </cell> </row> @@ -211,7 +227,7 @@ <cell> <JLabel id="lastModificationDateLabel"/> </cell> - <cell weightx='1'> + <cell weightx='1' columns="3"> <JLabel id="lastModificationDateField"/> </cell> </row> @@ -232,6 +248,9 @@ <JPanel layout="{new BorderLayout()}"> <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}" constraints='BorderLayout.NORTH'> + <JLabel id="quotationNbLabel"/> + <JLabel id="quotationNbField"/> + <JLabel styleClass="horizontal-separator"/> <JLabel id="pfNbLabel"/> <JLabel id="pfNbField"/> <JLabel styleClass="horizontal-separator"/> @@ -271,7 +290,7 @@ <JButton id="backButton"/> <JButton id="saveButton"/> <JButton id="transmitButton" onActionPerformed="handler.transmitDemande()"/> - <JButton id="printButton"/> + <JButton id="printButton" onActionPerformed="handler.print()"/> <JButton id="archiveButton"/> <JButton id="replyButton" onActionPerformed="handler.reply()"/> <JButton id="linkButton" onActionPerformed="handler.link()"/> Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-03-31 16:30:02 UTC (rev 23) @@ -23,6 +23,7 @@ */ +import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.persistence.entities.Range; import com.franciaflex.faxtomail.persistence.entities.RangeRow; import com.franciaflex.faxtomail.services.service.ReferentielService; @@ -69,8 +70,11 @@ import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; +import java.awt.print.PrinterJob; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -158,10 +162,14 @@ addColumnToModel(columnModel, RangeTableModel.COMMAND_NUMBER_COLUMN); addIntegerColumnToModel(columnModel, - RangeTableModel.PRODUCT_QUANTITY_COLUMN, - null, - table); + RangeTableModel.QUOTATION_QUANTITY_COLUMN, + null, + table); addIntegerColumnToModel(columnModel, + RangeTableModel.PRODUCT_QUANTITY_COLUMN, + null, + table); + addIntegerColumnToModel(columnModel, RangeTableModel.SAV_QUANTITY_COLUMN, null, table); @@ -181,9 +189,10 @@ } rangeTableModel.setRows(rangeRowModels); - int[] quantities = FaxToMailUIUtil.computeQuantities(rangeRowModels); - model.setPfNb(quantities[0]); - model.setSavNb(quantities[1]); + Map<String, Integer> quantities = FaxToMailUIUtil.computeQuantities(rangeRowModels); + model.setQuotationNb(quantities.get(DemandeUIModel.PROPERTY_QUOTATION_NB)); + model.setPfNb(quantities.get(DemandeUIModel.PROPERTY_PF_NB)); + model.setSavNb(quantities.get(DemandeUIModel.PROPERTY_SAV_NB)); // add listener to update row validity and quantity totals table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @@ -197,14 +206,16 @@ String propertyName = evt.getPropertyName(); if (RangeRowModel.PROPERTY_VALID.equals(propertyName) + || RangeRow.PROPERTY_QUOTATION_QUANTITY.equals(propertyName) || RangeRow.PROPERTY_PRODUCT_QUANTITY.equals(propertyName) || RangeRow.PROPERTY_SAV_QUANTITY.equals(propertyName)) { List<RangeRowModel> rangeRows = rangeTableModel.getRows(); - int[] quantities = FaxToMailUIUtil.computeQuantities(rangeRows); + Map<String, Integer> quantities = FaxToMailUIUtil.computeQuantities(rangeRows); DemandeUIModel model = getModel(); - model.setPfNb(quantities[0]); - model.setSavNb(quantities[1]); + model.setQuotationNb(quantities.get(DemandeUIModel.PROPERTY_QUOTATION_NB)); + model.setPfNb(quantities.get(DemandeUIModel.PROPERTY_PF_NB)); + model.setSavNb(quantities.get(DemandeUIModel.PROPERTY_SAV_NB)); } } @@ -308,7 +319,6 @@ model.setModify(false); registerValidators(validator); - } @Override @@ -355,9 +365,7 @@ } protected boolean isRangeRowValid(RangeRowModel rangeRow) { - return (rangeRow.getProductQuantity() != null && rangeRow.getProductQuantity() > 0 - || rangeRow.getSavQuantity() != null && rangeRow.getSavQuantity() > 0) - && rangeRow.getRange() != null; + return rangeRow.getRange() != null; } public void transmitDemande() { @@ -366,6 +374,25 @@ openDialog(dialogContent, t("faxtomail.chooseMailFolder.title"), new Dimension(350, 500)); } + public void print() { + for (Attachment attachment : getModel().getAttachment()) { +// try { + File editedFile = attachment.getEditedFile(); + if (editedFile == null) { + editedFile = attachment.getOriginalFile(); + } + log.info("print " + editedFile.getAbsolutePath()); +// Desktop.getDesktop().print(editedFile); + + +// } catch (IOException e) { +// if (log.isErrorEnabled()) { +// log.error("", e); +// } +// } + } + } + public void reply() { ReplyFormUI dialogContent = new ReplyFormUI(ui); ReplyFormUIModel model = dialogContent.getModel(); @@ -378,4 +405,5 @@ public void link() { //TODO } + } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -23,6 +23,7 @@ */ import com.franciaflex.faxtomail.persistence.entities.Attachment; +import com.franciaflex.faxtomail.persistence.entities.Client; import com.franciaflex.faxtomail.persistence.entities.DemandStatus; import com.franciaflex.faxtomail.persistence.entities.DemandType; import com.franciaflex.faxtomail.persistence.entities.Email; @@ -57,16 +58,23 @@ private static final Log log = LogFactory.getLog(DemandeUIModel.class); + public static final String PROPERTY_QUOTATION_NB = "quotationNb"; public static final String PROPERTY_PF_NB = "pfNb"; public static final String PROPERTY_SAV_NB = "savNb"; + public static final String PROPERTY_CLIENT_CODE = "clientCode"; + public static final String PROPERTY_CLIENT_BRAND = "clientBrand"; public static final String PROPERTY_EDITABLE = "editable"; protected final Email editObject = new EmailImpl(); + protected final Collection<Attachment> attachments = new ArrayList<Attachment>(); + protected History firstOpeningHistory; protected History lastModificationHistory; + protected int quotationNb; + protected int pfNb; protected int savNb; @@ -94,10 +102,16 @@ @Override public void propertyChange(PropertyChangeEvent evt) { Collection<RangeRow> rangeRows = (Collection<RangeRow>) evt.getNewValue(); + int quotationNb = 0; int pfNb = 0; int savNb = 0; if (rangeRows != null) { for (RangeRow rangeRow : rangeRows) { + Integer quotationQuantity = rangeRow.getQuotationQuantity(); + if (quotationQuantity != null) { + quotationNb += quotationQuantity; + } + Integer productQuantity = rangeRow.getProductQuantity(); if (productQuantity != null) { pfNb += productQuantity; @@ -109,6 +123,7 @@ } } } + setQuotationNb(quotationNb); setPfNb(pfNb); setSavNb(savNb); } @@ -168,14 +183,48 @@ public void setClientCode(String clientCode) { Object oldValue = getClientCode(); - editObject.setClientCode(clientCode); - firePropertyChanged(Email.PROPERTY_CLIENT_CODE, oldValue, clientCode); + Client client = editObject.getClient(); + if (client != null) { + client.setCode(clientCode); + firePropertyChanged(PROPERTY_CLIENT_CODE, oldValue, clientCode); + + } else { + firePropertyChanged(PROPERTY_CLIENT_CODE, oldValue, null); + } } + public void setClient(Client client) { + Object oldValue = getClient(); + editObject.setClient(client); + firePropertyChanged(Email.PROPERTY_CLIENT, oldValue, client); + } + + public Client getClient() { + return editObject.getClient(); + } + public String getClientCode() { - return editObject.getClientCode(); + Client client = editObject.getClient(); + return client != null ? client.getCode() : null; } + public void setClientBrand(String clientBrand) { + Object oldValue = getClientBrand(); + Client client = editObject.getClient(); + if (client != null) { + client.setBrand(clientBrand); + firePropertyChanged(PROPERTY_CLIENT_BRAND, oldValue, clientBrand); + + } else { + firePropertyChanged(PROPERTY_CLIENT_BRAND, oldValue, null); + } + } + + public String getClientBrand() { + Client client = editObject.getClient(); + return client != null ? client.getBrand() : null; + } + public void setEtatAttente(EtatAttente etatAttente) { Object oldValue = getEtatAttente(); editObject.setEtatAttente(etatAttente); @@ -256,6 +305,16 @@ return editObject.getProjectReference(); } + public void setCompanyReference(String companyReference) { + Object oldValue = getCompanyReference(); + editObject.setCompanyReference(companyReference); + firePropertyChanged(Email.PROPERTY_COMPANY_REFERENCE, oldValue, companyReference); + } + + public String getCompanyReference() { + return editObject.getCompanyReference(); + } + public void setHistory(Collection<History> history) { Object oldValue = getHistory(); editObject.setHistory(history); @@ -331,29 +390,32 @@ @Override public Collection<Attachment> getAttachment() { - return editObject.getAttachment(); + return attachments; } @Override public void addAllAttachment(Collection<Attachment> attachment) { - editObject.addAllAttachment(attachment); + attachments.addAll(attachment); firePropertyChange(Email.PROPERTY_ATTACHMENT, null, getAttachment()); } @Override public void addAttachment(Attachment attachment) { - editObject.addAttachment(attachment); + attachments.add(attachment); firePropertyChange(Email.PROPERTY_ATTACHMENT, null, getAttachment()); } @Override public void removeAttachment(Attachment attachment) { - editObject.removeAttachment(attachment); + attachments.remove(attachment); firePropertyChange(Email.PROPERTY_ATTACHMENT, null, getAttachment()); } public void setAttachment(Collection<Attachment> attachment) { - editObject.setAttachment(attachment); + attachments.clear(); + if (attachment != null) { + attachments.addAll(attachment); + } firePropertyChange(Email.PROPERTY_ATTACHMENT, null, getAttachment()); } @@ -392,6 +454,24 @@ editObject.setMailFolder(mailFolder); } + public Date getArchiveDate() { + return editObject.getArchiveDate(); + } + + public void setArchiveDate(Date archiveDate) { + editObject.setArchiveDate(archiveDate); + } + + public int getQuotationNb() { + return quotationNb; + } + + public void setQuotationNb(int quotationNb) { + Object oldValue = getQuotationNb(); + this.quotationNb = quotationNb; + firePropertyChange(PROPERTY_QUOTATION_NB, oldValue, quotationNb); + } + public int getPfNb() { return pfNb; } @@ -426,4 +506,13 @@ protected Email newEntity() { return new EmailImpl(); } + + @Override + public boolean equals(Object obj) { + if (obj == null || !obj.getClass().isAssignableFrom(DemandeUIModel.class)) { + return false; + } + DemandeUIModel other = (DemandeUIModel) obj; + return editObject.equals(other.editObject); + } } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeRowModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -40,6 +40,19 @@ return editObject.getCommandNumber(); } + public void setQuotationQuantity(Integer quotationQuantity) { + if (quotationQuantity == null) { + quotationQuantity = 0; + } + Object oldValue = getQuotationQuantity(); + editObject.setQuotationQuantity(quotationQuantity); + firePropertyChange(RangeRow.PROPERTY_QUOTATION_QUANTITY, oldValue, quotationQuantity); + } + + public Integer getQuotationQuantity() { + return editObject.getQuotationQuantity(); + } + public void setProductQuantity(Integer productQuantity) { if (productQuantity == null) { productQuantity = 0; Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/RangeTableModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -28,6 +28,11 @@ n("faxtomail.rangeRows.table.header.commandNumber"), n("faxtomail.rangeRows.table.header.commandNumber.tip")); + public static final ColumnIdentifier<RangeRow> QUOTATION_QUANTITY_COLUMN = ColumnIdentifier.newId( + RangeRow.PROPERTY_QUOTATION_QUANTITY, + n("faxtomail.rangeRows.table.header.quotationColumn"), + n("faxtomail.rangeRows.table.header.quotationColumn.tip")); + public static final ColumnIdentifier<RangeRow> PRODUCT_QUANTITY_COLUMN = ColumnIdentifier.newId( RangeRow.PROPERTY_PRODUCT_QUANTITY, n("faxtomail.rangeRows.table.header.productColumn"), Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -140,7 +140,7 @@ </cell> <cell columns='3' weightx="1"> <JTextField id='senderField' - onKeyReleased='handler.setText(event, "senderEmailAddress")'/> + onKeyReleased='handler.setText(event, "sender")'/> </cell> <cell> 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-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-03-31 16:30:02 UTC (rev 23) @@ -83,6 +83,7 @@ super.beforeInit(ui); SearchUIModel searchUIModel = new SearchUIModel(); + searchUIModel.setTakenBy(getContext().getCurrentUser()); searchUIModel.setModifiedBy(getContext().getCurrentUser()); Date now = new Date(); @@ -106,6 +107,9 @@ ReferentielService referentielService = getContext().getReferentielService(); + initBeanFilterableComboBox(ui.getTakenByComboBox(), + getContext().getUserService().getAllUsers(), + getModel().getTakenBy()); initBeanFilterableComboBox(ui.getModifiedByComboBox(), getContext().getUserService().getAllUsers(), getModel().getModifiedBy()); @@ -123,7 +127,7 @@ null); JXTable dataTable = getUI().getDataTable(); - final AbstractApplicationTableModel<DemandeUIModel> tableModel = initDemandeTable(dataTable); + final AbstractApplicationTableModel<DemandeUIModel> tableModel = initDemandeTable(dataTable, true); getModel().addPropertyChangeListener(SearchUIModel.PROPERTY_RESULTS, new PropertyChangeListener() { @Override Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -118,15 +118,15 @@ return editObject.getObject(); } - public void setClientCode(String clientCode) { - Object oldValue = getClientCode(); - editObject.setClientCode(clientCode); - firePropertyChanged(Email.PROPERTY_CLIENT_CODE, oldValue, clientCode); - } +// public void setClientCode(String clientCode) { +// Object oldValue = getClientCode(); +// editObject.setClientCode(clientCode); +// firePropertyChanged(Email.PROPERTY_CLIENT_CODE, oldValue, clientCode); +// } - public String getClientCode() { - return editObject.getClientCode(); - } +// public String getClientCode() { +// return editObject.getClientCode(); +// } public void setEtatAttente(EtatAttente etatAttente) { Object oldValue = getEtatAttente(); 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-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-03-31 16:30:02 UTC (rev 23) @@ -51,7 +51,9 @@ private static final Log log = LogFactory.getLog(AbstractFaxToMailDemandListHandler.class); - public AbstractApplicationTableModel<DemandeUIModel> initDemandeTable(JXTable table) { + public AbstractApplicationTableModel<DemandeUIModel> initDemandeTable(JXTable table, boolean sortable) { + table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN); + TableColumnModelExt columnModel = new DefaultTableColumnModelExt(); Company franciaflex = getContext().getCurrentCompany(); @@ -61,9 +63,11 @@ Email.PROPERTY_PRIORITY, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_OBJECT, - Email.PROPERTY_CLIENT_CODE, + DemandeUIModel.PROPERTY_CLIENT_CODE, + DemandeUIModel.PROPERTY_CLIENT_BRAND, Email.PROPERTY_SENDER, Email.PROPERTY_PROJECT_REFERENCE, + Email.PROPERTY_COMPANY_REFERENCE, Email.PROPERTY_RECEPTION_DATE, Email.PROPERTY_RECIPIENT, Email.PROPERTY_DEMAND_STATUS, @@ -80,13 +84,13 @@ addComboDataColumnToModel(columnModel, DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName), getDecorator(Priority.class, null), - getContext().getReferentielService().getAllPriority()); + getContext().getReferentielService().getAllPriority()).setSortable(sortable); } else if (Email.PROPERTY_ATTACHMENT.equals(columnName)) { addColumnToModel(columnModel, AttachmentCellEditor.newEditor(ui), AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)), - DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName)); + DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName)).setSortable(sortable); } else { TableCellRenderer tableCellRenderer; @@ -129,7 +133,7 @@ addColumnToModel(columnModel, null, tableCellRenderer, - DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName)); + DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName)).setSortable(sortable); } } @@ -149,6 +153,13 @@ Font font = renderer.getFont(); renderer.setFont(font.deriveFont(Font.BOLD)); } + highlight = row.getArchiveDate() != null; + if (highlight) { + Font font = renderer.getFont(); + renderer.setFont(font.deriveFont(Font.ITALIC)); + //TODO kmorin 20140326 find color between gray and black + renderer.setForeground(Color.DARK_GRAY); + } return renderer; } @@ -187,6 +198,7 @@ rowIndex = table.convertRowIndexToModel(rowIndex); DemandeUIModel selectedEmail = tableModel.getEntry(rowIndex); + onDoubleClickOnDemande(selectedEmail); FaxToMailUIContext context = getContext(); Email email = context.getEmailService().addToOpeningHistory(selectedEmail.getTopiaId(), context.getCurrentUser(), @@ -200,13 +212,16 @@ return tableModel; } + protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) { + } + protected void openDemand(DemandeUIModel selectedEmail) { FaxToMailUIContext context = getContext(); context.setCurrentEmail(selectedEmail); context.getActionEngine().runAction(new ShowDemandeAction(context.getMainUI().getHandler())); } - protected boolean isDemandeValid(DemandeUIModel d) { + public boolean isDemandeValid(DemandeUIModel d) { NuitonValidatorResult result = NuitonValidatorFactory.newValidator(DemandeUIModel.class).validate(d); return result.isValid(); } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -72,12 +72,18 @@ n("faxtomail.demandeList.table.header.recipient"), n("faxtomail.demandeList.table.header.recipient.tip"))); - put(Email.PROPERTY_CLIENT_CODE, + put(DemandeUIModel.PROPERTY_CLIENT_CODE, ColumnIdentifier.<Email>newReadOnlyId( - Email.PROPERTY_CLIENT_CODE, + DemandeUIModel.PROPERTY_CLIENT_CODE, n("faxtomail.demandeList.table.header.client"), n("faxtomail.demandeList.table.header.client.tip"))); + put(DemandeUIModel.PROPERTY_CLIENT_BRAND, + ColumnIdentifier.<Email>newReadOnlyId( + DemandeUIModel.PROPERTY_CLIENT_BRAND, + n("faxtomail.demandeList.table.header.brand"), + n("faxtomail.demandeList.table.header.brand.tip"))); + put(Email.PROPERTY_DEMAND_STATUS, ColumnIdentifier.<Email>newReadOnlyId( Email.PROPERTY_DEMAND_STATUS, @@ -120,6 +126,12 @@ n("faxtomail.demandeList.table.header.projectReference"), n("faxtomail.demandeList.table.header.projectReference.tip"))); + put(Email.PROPERTY_COMPANY_REFERENCE, + ColumnIdentifier.<Email>newReadOnlyId( + Email.PROPERTY_COMPANY_REFERENCE, + n("faxtomail.demandeList.table.header.companyReference"), + n("faxtomail.demandeList.table.header.companyReference.tip"))); + put(DemandeUIModel.PROPERTY_PF_NB, ColumnIdentifier.<Email>newReadOnlyId( DemandeUIModel.PROPERTY_PF_NB, @@ -144,6 +156,7 @@ super(columnModel, false, false); List<ColumnIdentifier> nonEditableColumns = new ArrayList<ColumnIdentifier>(COLUMN_IDENTIFIERS.values()); nonEditableColumns.remove(COLUMN_IDENTIFIERS.get(Email.PROPERTY_PRIORITY)); + nonEditableColumns.remove(COLUMN_IDENTIFIERS.get(Email.PROPERTY_ATTACHMENT)); setNoneEditableCols(nonEditableColumns.toArray(new ColumnIdentifier[nonEditableColumns.size()])); } Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-03-31 16:30:02 UTC (rev 23) @@ -136,11 +136,17 @@ return result; } - public static int[] computeQuantities(Collection<RangeRowModel> rangeRows) { + public static Map<String, Integer> computeQuantities(Collection<RangeRowModel> rangeRows) { + int quotationNb = 0; int pfNb = 0; int savNb = 0; for (RangeRowModel rangeRow : rangeRows) { if (rangeRow.isValid()) { + Integer quotationQuantity = rangeRow.getQuotationQuantity(); + if (quotationQuantity != null) { + quotationNb += quotationQuantity; + } + Integer productQuantity = rangeRow.getProductQuantity(); if (productQuantity != null) { pfNb += productQuantity; @@ -152,7 +158,11 @@ } } } - return new int[] { pfNb, savNb }; + Map<String, Integer> result = new HashMap<String, Integer>(); + result.put(DemandeUIModel.PROPERTY_QUOTATION_NB, quotationNb); + result.put(DemandeUIModel.PROPERTY_PF_NB, pfNb); + result.put(DemandeUIModel.PROPERTY_SAV_NB, savNb); + return result; } public static boolean isFileAPDF(File file) { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -29,7 +29,7 @@ private static final Log log = LogFactory.getLog(JImagePanel.class); - protected Image img; + protected Image image; protected Image scaledImage; protected boolean scaleImageToFitPanel; @@ -38,8 +38,8 @@ @Override public void componentResized(ComponentEvent e) { Component component = e.getComponent(); - if (img != null) { - scaledImage = img.getScaledInstance(component.getWidth(), component.getHeight(), Image.SCALE_SMOOTH); + if (image != null) { + scaledImage = image.getScaledInstance(component.getWidth(), component.getHeight(), Image.SCALE_SMOOTH); } repaint(); } @@ -49,15 +49,6 @@ setLayout(null); } - public JImagePanel(Image img) { - this(); - setImg(img); - } - - public JImagePanel(String img) { - this(new ImageIcon(img).getImage()); - } - public boolean isScaleImageToFitPanel() { return scaleImageToFitPanel; } @@ -73,15 +64,15 @@ this.scaleImageToFitPanel = scaleImageToFitPanel; } - public Image getImg() { - return img; + public Image getImage() { + return image; } public Image getScaledImage() { return scaledImage; } - public void setImg(File img) { + public void setImage(File img) { BufferedImage bufferedImage; try { bufferedImage = ImageIO.read(img); @@ -91,7 +82,7 @@ bufferedImage = null; } if (bufferedImage != null) { - setImg(bufferedImage); + setImage(bufferedImage); } } @@ -107,15 +98,15 @@ RenderedImage im = dec.decodeAsRenderedImage(); Image image = PlanarImage.wrapRenderedImage(im).getAsBufferedImage(); - setImg(image); + setImage(image); } catch (IOException e) { log.error("error while reading image " + file.getAbsolutePath(), e); } } - public void setImg(Image img) { - this.img = img; + public void setImage(Image img) { + this.image = img; this.scaledImage = img; Dimension size = new Dimension(img.getWidth(null), img.getHeight(null)); @@ -125,6 +116,10 @@ setSize(size); } + public void setImage(String img) { + setImage(new ImageIcon(img).getImage()); + } + @Override public void paintComponent(Graphics g) { if (scaledImage != null) { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentCellEditor.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentCellEditor.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentCellEditor.java 2014-03-31 16:30:02 UTC (rev 23) @@ -71,8 +71,9 @@ public AttachmentCellEditor(FaxToMailUIContext context) { - this.editorButton = new ButtonAttachment(null); + this.editorButton = new ButtonAttachment("faxtomail.attachmentCellRenderer.text", null); this.editorButton.setBorder(new LineBorder(Color.BLACK)); + this.editorButton.setEditable(false); addCellEditorListener(new CellEditorListener() { @Override public void editingStopped(ChangeEvent e) { @@ -108,7 +109,7 @@ @Override public boolean shouldSelectCell(EventObject anEvent) { - return false; + return true; } @Override Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.css 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.css 2014-03-31 16:30:02 UTC (rev 23) @@ -2,19 +2,25 @@ title: "faxtomail.attachmentEditor.title"; } +#noAttachmentsLabel { + text: "faxtomail.attachmentEditor.attachments.empty"; + visible: { model.getAttachment().isEmpty() }; +} + #attachments { editable: true; + visible: { !model.getAttachment().isEmpty() }; } +#formPanel { + visible: { model.isEditable() }; +} + #fileLabel { text: "faxtomail.attachmentEditor.field.file"; labelFor: { file }; } -#file { - enabled: { model.isEditable() }; -} - #addButton { actionIcon: add; toolTipText: "faxtomail.attachmentEditor.action.add.tip"; Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.jaxx 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -22,49 +22,33 @@ <JXTitledPanel id='body'> <JScrollPane id='attachmentBodyScrollPane'> - <Table id='mainPanel'> + <JPanel id='mainPanel' layout="{new BorderLayout()}"> - <row fill='both' weighty='1'> - <cell fill='both' weightx='1' columns='3'> - <JXTable id='attachments' /> - </cell> - </row> - <row fill='both'> - <cell fill='both' weightx='1' columns='3'> - <JSeparator/> - </cell> - </row> - <row fill='both'> - <cell fill='both' weightx='1'> - <JLabel id='fileLabel'/> - </cell> - <cell fill='both' weightx='1'> - <FileEditor id='file'/> - </cell> - <cell fill='both' rows='3'> - <JButton id='addButton' - onActionPerformed='handler.addAttachment()'/> - </cell> - </row> - <!--<row fill='both'>--> - <!--<cell fill='both' weightx='1'>--> - <!--<JLabel id='fileNameLabel'/>--> - <!--</cell>--> - <!--<cell fill='both' weightx='1'>--> - <!--<JTextField id='fileName'/>--> - <!--</cell>--> - <!--</row>--> - <!--<row fill='both' weighty='1'>--> - <!--<cell fill='both' weightx='1'>--> - <!--<JLabel id='fileCommentLabel'/>--> - <!--</cell>--> - <!--<cell fill='both' weightx='1'>--> - <!--<JScrollPane>--> - <!--<JTextArea id='fileComment' rows='3'/>--> - <!--</JScrollPane>--> - <!--</cell>--> - <!--</row>--> - </Table> + <JLabel id='noAttachmentsLabel' constraints="BorderLayout.NORTH"/> + + <JXTable id='attachments' constraints="BorderLayout.CENTER"/> + + <Table id="formPanel" constraints="BorderLayout.SOUTH"> + <row fill='both'> + <cell fill='both' weightx='1' columns='3'> + <JSeparator/> + </cell> + </row> + <row fill='both'> + <cell fill='both' weightx='1'> + <JLabel id='fileLabel'/> + </cell> + <cell fill='both' weightx='1'> + <FileEditor id='file'/> + </cell> + <cell fill='both' rows='3'> + <JButton id='addButton' + onActionPerformed='handler.addAttachment()'/> + </cell> + </row> + </Table> + + </JPanel> </JScrollPane> </JXTitledPanel> </com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupUI> \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -62,28 +62,32 @@ @Override public void addAllAttachment(Collection<Attachment> attachments) { + Object oldValue = new ArrayList<Attachment>(getAttachment()); this.attachments.addAll(attachments); - firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, this.attachments); + firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, this.attachments); } @Override public void addAttachment(Attachment attachment) { + Object oldValue = new ArrayList<Attachment>(getAttachment()); attachments.add(attachment); - firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, attachments); + firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, attachments); } @Override public void removeAttachment(Attachment attachment) { + Object oldValue = new ArrayList<Attachment>(getAttachment()); attachments.remove(attachment); - firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, attachments); + firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, attachments); } public void setAttachment(Collection<Attachment> attachments) { + Object oldValue = new ArrayList<Attachment>(getAttachment()); this.attachments.clear(); if (attachments != null) { this.attachments.addAll(attachments); } - firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, this.attachments); + firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, this.attachments); } @Override Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/ButtonAttachment.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/ButtonAttachment.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/ButtonAttachment.java 2014-03-31 16:30:02 UTC (rev 23) @@ -3,18 +3,8 @@ import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupButton; -import jaxx.runtime.SwingUtil; import org.apache.commons.collections4.CollectionUtils; -import org.jdesktop.beans.AbstractSerializableBean; -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.awt.event.HierarchyBoundsAdapter; -import java.awt.event.HierarchyEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collection; @@ -30,16 +20,36 @@ */ public class ButtonAttachment extends AbstractToolbarPopupButton<AttachmentEditorUI> { + protected AttachmentModelAware attachmentModelAware; + protected String textKey; + + private PropertyChangeListener listener = new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + List<Attachment> attachments = (List<Attachment>) evt.getNewValue(); + setText(getButtonText(attachments)); + + if (attachmentModelAware != null) { + List<Attachment> oldValue = (List<Attachment>) evt.getOldValue(); + Collection<Attachment> toAdd = CollectionUtils.subtract(attachments, oldValue); + attachmentModelAware.addAllAttachment(toAdd); + + Collection<Attachment> toRemove = CollectionUtils.subtract(oldValue, attachments); + for (Attachment attachment : toRemove) { + attachmentModelAware.removeAttachment(attachment); + } + } + } + };; + public ButtonAttachment(AttachmentModelAware model) { + this("faxtomail.attachmentEditor.text", model); + } + + public ButtonAttachment(String textKey, AttachmentModelAware model) { + this.textKey = textKey; setToolTipText(t("faxtomail.attachmentEditor.action.tip")); - popup.getModel().addPropertyChangeListener(AttachmentEditorUIModel.PROPERTY_ATTACHMENT, new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - List<Attachment> attachment = (List<Attachment>) evt.getNewValue(); - setText(getButtonText(attachment)); - } - }); init(model); } @@ -53,13 +63,16 @@ return new AttachmentEditorUI(FaxToMailUIContext.getApplicationContext()); } - public static String getButtonText(Collection<Attachment> attachments) { + public String getButtonText(Collection<Attachment> attachments) { int attachmentNb = CollectionUtils.size(attachments); - return t("faxtomail.attachmentEditor.text", attachmentNb); + return t(textKey, attachmentNb); } public void init(AttachmentModelAware model) { + attachmentModelAware = model; + popup.getModel().removePropertyChangeListener(AttachmentEditorUIModel.PROPERTY_ATTACHMENT, listener); popup.getModel().fromEntity(model); + popup.getModel().addPropertyChangeListener(AttachmentEditorUIModel.PROPERTY_ATTACHMENT, listener); setText(getButtonText(model != null ? model.getAttachment() : null)); } Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.css (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.css 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,12 @@ +#crossPanel { + scaleImageToFitPanel: { true }; + border: { BorderFactory.createDashedBorder(null) }; +} + +#removeButton { + text: "X"; + //borderPainted: { false }; + //border: { null }; + //opaque : { false }; + //background: { null }; +} \ No newline at end of file Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.jaxx (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorCrossUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,30 @@ +<com.franciaflex.faxtomail.ui.swing.util.JImagePanel id='crossPanel'> + + <import> + java.awt.Color + java.awt.Dimension + java.awt.Font + javax.swing.BorderFactory + com.franciaflex.faxtomail.ui.swing.util.JImagePanel + </import> + + <script><![CDATA[ + + public static final String CROSS_IMAGE_FILE = "cross.png"; + + public PDFEditorCrossUI() { + setImage(SwingUtil.createImageIcon("cross.png").getImage()); + } + + protected void removeCross() { + JImagePanel container = getParentContainer(JImagePanel.class); + container.remove(this); + container.updateUI(); + } + + ]]></script> + + <JButton id="removeButton" + onActionPerformed="removeCross()"/> + +</com.franciaflex.faxtomail.ui.swing.util.JImagePanel> \ No newline at end of file Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.css (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.css 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,30 @@ +#notePanel { + background: { Color.YELLOW }; + border : { BorderFactory.createEmptyBorder(2, 2, 2, 2) }; +} + +#noteHeader { + background: { null }; +} + +#noteTitle { + font: { Font.decode(BaseFont.HELVETICA).deriveFont(Font.ITALIC) }; + text: { getTitle() }; +} + +#removeButton { + text: "X"; + borderPainted: { false }; + border: { null }; + opaque : { false }; + background: { null }; +} + +#noteText { + border: { null }; + opaque : { false }; + background: { null }; + font: { Font.decode(BaseFont.HELVETICA) }; + lineWrap: { false }; + wrapStyleWord: { false }; +} \ No newline at end of file Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.jaxx (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorNoteUI.jaxx 2014-03-31 16:30:02 UTC (rev 23) @@ -0,0 +1,52 @@ +<JPanel id='notePanel' layout='{new BorderLayout()}'> + + <import> + java.awt.Color + java.awt.Dimension + java.awt.Font + java.awt.Insets + java.awt.Point + javax.swing.BorderFactory + com.itextpdf.text.pdf.BaseFont + com.franciaflex.faxtomail.ui.swing.util.JImagePanel + </import> + + <script><![CDATA[ + + protected void textTyped() { + setText(getNoteText().getText()); + + JImagePanel container = getParentContainer(JImagePanel.class); + Point location = getLocation(); + Insets insets = container.getInsets(); + Dimension size = getPreferredSize(); + setBounds(location.x + insets.left, location.y + insets.top, + size.width, size.height); + } + + protected void removeNote() { + JImagePanel container = getParentContainer(JImagePanel.class); + container.remove(this); + container.updateUI(); + } + + ]]></script> + + <String id="title" javaBean="null"/> + <String id="text" javaBean=""/> + + <JPanel id="noteHeader" + layout='{ new BorderLayout() }' + constraints="BorderLayout.NORTH"> + <JLabel id="noteTitle" + constraints="BorderLayout.CENTER"/> + <JButton id="removeButton" + constraints="BorderLayout.EAST" + onActionPerformed="removeNote()"/> + </JPanel> + + <JTextArea id="noteText" + constraints="BorderLayout.CENTER" + onKeyTyped="textTyped()"/> + +</JPanel> \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java 2014-03-31 16:30:02 UTC (rev 23) @@ -2,17 +2,14 @@ import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler; -import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI; import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil; import com.franciaflex.faxtomail.ui.swing.util.JImagePanel; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Paragraph; -import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.PdfWriter; import com.sun.pdfview.PDFFile; import com.sun.pdfview.PDFPage; -import jaxx.runtime.SwingUtil; import jaxx.runtime.swing.ComponentMover; import jaxx.runtime.swing.ComponentResizer; import jaxx.runtime.validator.swing.SwingValidator; @@ -21,14 +18,12 @@ import javax.swing.*; import java.awt.*; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; +import java.awt.event.ContainerEvent; +import java.awt.event.ContainerListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; @@ -45,8 +40,6 @@ private static final Log log = LogFactory.getLog(PDFEditorUIHandler.class); - public static final String CROSS_IMAGE_FILE = "cross.png"; - protected ComponentMover cm = new ComponentMover(); protected ComponentResizer cr = new ComponentResizer(); @@ -59,6 +52,33 @@ cm.setDragInsets(cr.getDragInsets()); cm.setEdgeInsets(new Insets(0, 0, 0, 0)); + + ui.getContainer().addContainerListener(new ContainerListener() { + @Override + public void componentAdded(ContainerEvent e) { + Component child = e.getChild(); + PDFEditorUIModel.Page currentPage = getModel().getCurrentPage(); + if (child.getClass().isAssignableFrom(PDFEditorNoteUI.class)) { + currentPage.addNote((PDFEditorNoteUI) child); + + } else if (child.getClass().isAssignableFrom(PDFEditorCrossUI.class)) { + currentPage.addCross((PDFEditorCrossUI) child); + } + } + + @Override + public void componentRemoved(ContainerEvent e) { + Component child = e.getChild(); + PDFEditorUIModel.Page currentPage = getModel().getCurrentPage(); + if (child.getClass().isAssignableFrom(PDFEditorNoteUI.class)) { + currentPage.removeNote((PDFEditorNoteUI) child); + + } else if (child.getClass().isAssignableFrom(PDFEditorCrossUI.class)) { + currentPage.removeCross((PDFEditorCrossUI) child); + } + } + }); + getModel().addPropertyChangeListener(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, new PropertyChangeListener() { @Override @@ -154,7 +174,7 @@ container.setTifImage(file); } else { - container.setImg(file); + container.setImage(file); } } } @@ -181,58 +201,20 @@ } public void addNote() { - final JPanel panel = new JPanel(new BorderLayout()); - panel.setBackground(Color.YELLOW); - panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - -// JLabel closeButton = new JLabel("X"); -// closeButton.addMouseListener(new MouseAdapter() { -// @Override -// public void mouseClicked(MouseEvent e) { -// super.mouseClicked(e); -// getModel().getCurrentPage().removeNote(panel); -// ui.getContainer().remove(panel); -// ui.getContainer().updateUI(); -// } -// }); -// panel.add(closeButton, BorderLayout.EAST); - - JTextArea textArea = new JTextArea(); - textArea.setBorder(null); - textArea.setOpaque(false); - textArea.setBackground(null); - textArea.setFont(Font.decode(BaseFont.HELVETICA)); - panel.add(textArea, BorderLayout.CENTER); - + PDFEditorNoteUI note = new PDFEditorNoteUI(); String title = decorate(new Date()) + " - " + getContext().getCurrentUser().getTrigraph(); - JLabel label = new JLabel(title); - label.setFont(Font.decode(BaseFont.HELVETICA).deriveFont(Font.ITALIC)); - panel.add(label, BorderLayout.SOUTH); - - textArea.addKeyListener(new KeyAdapter() { - @Override - public void keyTyped(KeyEvent e) { - Dimension size = panel.getPreferredSize(); - Point location = panel.getLocation(); - Insets insets = ui.getContainer().getInsets(); - panel.setBounds(0 + insets.left, 0 + insets.top, - size.width, size.height); - panel.setLocation(location); - } - }); - - addPanel(panel); - getModel().getCurrentPage().addNote(panel); + note.setTitle(title); + addPanel(note); } public void addCross() { - java.awt.Image cross = SwingUtil.createImageIcon(CROSS_IMAGE_FILE).getImage(); - JImagePanel panel = new JImagePanel(cross); - panel.setScaleImageToFitPanel(true); - panel.setBorder(BorderFactory.createDashedBorder(null)); - addPanel(panel); - cr.registerComponent(panel); - getModel().getCurrentPage().addCross(panel); +// java.awt.Image cross = SwingUtil.createImageIcon(CROSS_IMAGE_FILE).getImage(); +// JImagePanel panel = new JImagePanel(cross); +// panel.setScaleImageToFitPanel(true); +// panel.setBorder(BorderFactory.createDashedBorder(null)); + PDFEditorCrossUI cross = new PDFEditorCrossUI(); + addPanel(cross); + cr.registerComponent(cross); } protected void addPanel(JPanel panel) { @@ -275,7 +257,7 @@ true // block until drawing is done ); JImagePanel container = getUI().getContainer(); - container.setImg(image); + container.setImage(image); PDFEditorUIModel.Page p = getModel().getPage(pageNb); for (JPanel panel : p.getNotes()) { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java 2014-03-31 16:30:02 UTC (rev 23) @@ -25,18 +25,18 @@ public class Page { - protected List<JPanel> notes = new ArrayList<JPanel>(); + protected List<PDFEditorNoteUI> notes = new ArrayList<PDFEditorNoteUI>(); protected List<JImagePanel> crosses = new ArrayList<JImagePanel>(); - public List<JPanel> getNotes() { + public List<PDFEditorNoteUI> getNotes() { return notes; } - public void addNote(JPanel note) { + public void addNote(PDFEditorNoteUI note) { notes.add(note); } - public void removeNote(JPanel note) { + public void removeNote(PDFEditorNoteUI note) { notes.remove(note); } Deleted: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java 2014-03-31 16:30:02 UTC (rev 23) @@ -1,81 +0,0 @@ -package com.franciaflex.faxtomail.ui.swing.util.attachment; - -import com.franciaflex.faxtomail.persistence.entities.Attachment; -import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; -import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction; -import org.nuiton.jaxx.application.ApplicationIOUtil; - -import java.io.File; - -import static org.nuiton.i18n.I18n.t; - -/** - * To persist a attachment. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.4 - */ -public class SaveAttachmentAction extends AbstractFaxToMailAction<AttachmentEditorUIModel, AttachmentEditorUI, AttachmentEditorUIHandler> { - - private Attachment attachment; - - public SaveAttachmentAction(AttachmentEditorUIHandler handler) { - super(handler, false); - } - - protected File file; - - protected File attachmentFile; - - @Override - public boolean prepareAction() throws Exception { - boolean doAction = super.prepareAction(); - if (doAction) { - - attachmentFile = attachment.getOriginalFile(); - - file = saveFile( - ApplicationIOUtil.getBaseName(attachmentFile.getName()), - ApplicationIOUtil.getExtension(attachmentFile.getName()), - t("faxtomail.attachmentEditor.saveAttachment.title"), - t("faxtomail.attachmentEditor.saveAttachment.button")); - doAction = file != null; - } - return doAction; - } - - @Override - public void doAction() throws Exception { - - AttachmentEditorUI ui = getUI(); - - boolean hackDialog = ui.isAlwaysOnTop(); - if (hackDialog) { - ui.setAlwaysOnTop(false); - } - try { - - ApplicationIOUtil.copyFile(attachmentFile, file, - t("faxtomail.attachmentEditor.saveAttachment.error.message", attachmentFile, file.getName())); - sendMessage( - t("faxtomail.attachmentEditor.saveAttachment.success.message", file.getName())); - - } finally { - if (hackDialog) { - ui.setAlwaysOnTop(true); - } - } - } - - public void setAttachment(Attachment attachment) { - this.attachment = attachment; - } - - @Override - public void releaseAction() { - super.releaseAction(); - attachmentFile = null; - attachment = null; - file = null; - } -} Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties =================================================================== --- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -11,6 +11,7 @@ Supprimer= T\\u00e9l\\u00e9copie\ re\\u00e7ue\ le\ 10/01/2014\ \\u00e0\ 13\:37= Voir= +X= application.action.create.error= application.error.ui.business.warning= faxtomail.action.create.error= @@ -29,6 +30,7 @@ faxtomail.attachmentEditor.action.save.mnemonic= faxtomail.attachmentEditor.action.save.tip= faxtomail.attachmentEditor.action.tip= +faxtomail.attachmentEditor.attachments.empty= faxtomail.attachmentEditor.deleteAttachment.message= faxtomail.attachmentEditor.deleteAttachment.title= faxtomail.attachmentEditor.field.file= @@ -106,8 +108,11 @@ faxtomail.demande.attachment.label= faxtomail.demande.back.button.label= faxtomail.demande.back.button.mnemonic= +faxtomail.demande.brand.label= faxtomail.demande.client.label= +faxtomail.demande.clientBrand.label= faxtomail.demande.clientCode.label= +faxtomail.demande.companyReference.label= faxtomail.demande.demandStatus.label= faxtomail.demande.demandType.label= faxtomail.demande.demandeNumber.label= @@ -176,12 +181,17 @@ faxtomail.demandeList.action.reply.tip= faxtomail.demandeList.demandNbLabel= faxtomail.demandeList.pfNbLabel= +faxtomail.demandeList.quotationNbLabel= faxtomail.demandeList.savNbLabel= faxtomail.demandeList.table.header.attachment= faxtomail.demandeList.table.header.attachment.tip= +faxtomail.demandeList.table.header.brand= +faxtomail.demandeList.table.header.brand.tip= faxtomail.demandeList.table.header.client= faxtomail.demandeList.table.header.client.tip= faxtomail.demandeList.table.header.commandNb= +faxtomail.demandeList.table.header.companyReference= +faxtomail.demandeList.table.header.companyReference.tip= faxtomail.demandeList.table.header.ediCodeNumber= faxtomail.demandeList.table.header.ediCodeNumber.tip= faxtomail.demandeList.table.header.folder= @@ -270,6 +280,8 @@ faxtomail.rangeRows.table.header.productColumn= faxtomail.rangeRows.table.header.productColumn.tip= faxtomail.rangeRows.table.header.product_column= +faxtomail.rangeRows.table.header.quotationColumn= +faxtomail.rangeRows.table.header.quotationColumn.tip= faxtomail.rangeRows.table.header.range= faxtomail.rangeRows.table.header.range.tip= faxtomail.rangeRows.table.header.savQuantity= Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties =================================================================== --- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-03-31 16:30:02 UTC (rev 23) @@ -1,4 +1,5 @@ \ |\ = +X= application.action.create.error= application.error.ui.business.warning= faxtomail.alert.alreadyTakenBy.button.quit=Quitter @@ -14,6 +15,7 @@ faxtomail.attachmentEditor.action.remove.tip=Supprimer la pièce jointe faxtomail.attachmentEditor.action.save.tip=Enregistrer la pièce jointe en local faxtomail.attachmentEditor.action.tip=Pièces jointes +faxtomail.attachmentEditor.attachments.empty=Aucune pièce jointe faxtomail.attachmentEditor.deleteAttachment.message=Êtes-vous sûr de vouloir supprimer la pièce-jointe %s ? faxtomail.attachmentEditor.deleteAttachment.title=Suppression de pièce-jointe faxtomail.attachmentEditor.field.file=Fichier @@ -39,8 +41,9 @@ faxtomail.demande.askSaveBeforeLeaving.save=Vous avez modifié l'élément mais vous n'avez pas enregistré ces modifications. faxtomail.demande.attachment.label=Pièces-jointes faxtomail.demande.back.button.label=Quitter -faxtomail.demande.client.label=Client +faxtomail.demande.clientBrand.label=Marque faxtomail.demande.clientCode.label=Client +faxtomail.demande.companyReference.label=Notre référence faxtomail.demande.demandStatus.label=Statut faxtomail.demande.demandType.label=Type faxtomail.demande.docType.label=Type @@ -82,11 +85,16 @@ faxtomail.demandeList.action.reply.tip=Répondre faxtomail.demandeList.demandNbLabel=Nombre de demandes faxtomail.demandeList.pfNbLabel=Nombre de produits finis +faxtomail.demandeList.quotationNbLabel=Nombre de devis faxtomail.demandeList.savNbLabel=Nombre de SAV faxtomail.demandeList.table.header.attachment=PJ faxtomail.demandeList.table.header.attachment.tip=Pièces-jointes +faxtomail.demandeList.table.header.brand=Marque +faxtomail.demandeList.table.header.brand.tip=Marque faxtomail.demandeList.table.header.client=Client faxtomail.demandeList.table.header.client.tip=Client +faxtomail.demandeList.table.header.companyReference=Notre ref +faxtomail.demandeList.table.header.companyReference.tip=Notre référence faxtomail.demandeList.table.header.ediCodeNumber=Code EDI faxtomail.demandeList.table.header.ediCodeNumber.tip=Code EDI faxtomail.demandeList.table.header.object=Objet @@ -139,8 +147,8 @@ faxtomail.pdfEitor.action.cancel.tip=Ne pas enregistrer les changements et fermer faxtomail.pdfEitor.action.validate=Valider faxtomail.pdfEitor.action.validate.tip=Enregistrer les changements et fermer -faxtomail.pdfEitor.button.addCross.tip=Ajouter une note -faxtomail.pdfEitor.button.addNote.tip=Ajouter une croix +faxtomail.pdfEitor.button.addCross.tip=Ajouter une croix +faxtomail.pdfEitor.button.addNote.tip=Ajouter une note faxtomail.pdfEitor.button.nextPage=Page suivante faxtomail.pdfEitor.button.previousPage=Page précédente faxtomail.quantitiesByRange.button.text=OK @@ -149,6 +157,8 @@ faxtomail.rangeRows.table.header.commandNumber.tip=N° commande / devis faxtomail.rangeRows.table.header.productColumn=Qté produits faxtomail.rangeRows.table.header.productColumn.tip=Quantité de produits +faxtomail.rangeRows.table.header.quotationColumn=Qté devis +faxtomail.rangeRows.table.header.quotationColumn.tip=Quantité de devis faxtomail.rangeRows.table.header.range=Gamme faxtomail.rangeRows.table.header.range.tip=Gamme faxtomail.rangeRows.table.header.savQuantity=Qté SAV @@ -171,7 +181,7 @@ faxtomail.search.comment.label=Commentaire faxtomail.search.docType.label=Type document faxtomail.search.modifiedBetween.label=Modifié entre le -faxtomail.search.modifiedBy.label=par +faxtomail.search.modifiedBy.label=Modifié par faxtomail.search.object.label=Objet faxtomail.search.printedBetween.label=Imprimé entre le faxtomail.search.receivedBetween.label=Reçu entre le Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-03-24 15:55:50 UTC (rev 22) +++ trunk/pom.xml 2014-03-31 16:30:02 UTC (rev 23) @@ -1,5 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + FaxToMail + %% + Copyright (C) 2014 Franciaflex + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -92,7 +114,7 @@ <hibernateVersion>4.2.8.Final</hibernateVersion> <h2Version>1.3.174</h2Version> - <jaxxVersion>2.8.2-SNAPSHOT</jaxxVersion> + <jaxxVersion>2.8.2</jaxxVersion> <swingXVersion>1.6.4</swingXVersion> <xworkVersion>2.3.15.1</xworkVersion> @@ -167,6 +189,12 @@ <scope>runtime</scope> </dependency> + <dependency> + <groupId>net.sourceforge.jtds</groupId> + <artifactId>jtds</artifactId> + <version>1.3.1</version> + </dependency> + <!-- librairies utils --> <dependency> @@ -585,17 +613,17 @@ <build> <plugins> - <plugin> - <artifactId>maven-enforcer-plugin</artifactId> - <executions> - <execution> - <id>check-release-properties</id> - <goals> - <goal>enforce</goal> - </goals> - <phase>initialize</phase> - <configuration> - <rules> + <!--<plugin>--> + <!--<artifactId>maven-enforcer-plugin</artifactId>--> + <!--<executions>--> + <!--<execution>--> + <!--<id>check-release-properties</id>--> + <!--<goals>--> + <!--<goal>enforce</goal>--> + <!--</goals>--> + <!--<phase>initialize</phase>--> + <!--<configuration>--> + <!--<rules>--> <!--<requireProperty>--> <!--<property>jreVersion</property>--> <!--<message>You must set a jreVersion property!</message>--> @@ -608,15 +636,15 @@ <!--<property>reportVersion</property>--> <!--<message>You must set a reportVersion property!</message>--> <!--</requireProperty>--> - </rules> - <ignoreCache>true</ignoreCache> - <failFast>true</failFast> - <fail>true</fail> + <!--</rules>--> + <!--<ignoreCache>true</ignoreCache>--> + <!--<failFast>true</failFast>--> + <!--<fail>true</fail>--> - </configuration> - </execution> - </executions> - </plugin> + <!--</configuration>--> + <!--</execution>--> + <!--</executions>--> + <!--</plugin>--> </plugins> </build>
participants (1)
-
kmorin@users.forge.codelutin.com