Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
March 2014
- 2 participants
- 12 discussions
27 May '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/1/>
------------------------------------------
[...truncated 117 lines...]
A faxtomail-ui-swing/src/main/filtered-resources/faxtomail.config
A faxtomail-ui-swing/src/main/filtered-resources/log4j.properties
A faxtomail-ui-swing/src/main/resources
A faxtomail-ui-swing/src/main/resources/i18n
A faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties
A faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
A faxtomail-ui-swing/src/main/resources/META-INF
A faxtomail-ui-swing/src/main/resources/log4j.properties
A faxtomail-ui-swing/src/main/resources/icons
AU faxtomail-ui-swing/src/main/resources/icons/action-reload-ui.png
AU faxtomail-ui-swing/src/main/resources/icons/action-config.png
AU faxtomail-ui-swing/src/main/resources/icons/action-reload-application.png
AU faxtomail-ui-swing/src/main/resources/icons/action-exit.png
AU faxtomail-ui-swing/src/main/resources/icons/action-reload-shortcut.png
A faxtomail-ui-swing/src/main/resources/com
A faxtomail-ui-swing/src/main/resources/com/franciaflex
A faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail
A faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui
A faxtomail-ui-swing/src/main/resources/com/franciaflex/faxtomail/ui/swing
A faxtomail-ui-swing/pom.xml
A faxtomail-ui-swing/README.txt
A faxtomail-persistence
A faxtomail-persistence/LICENSE.txt
A faxtomail-persistence/src
A faxtomail-persistence/src/test
A faxtomail-persistence/src/test/java
A faxtomail-persistence/src/main
A faxtomail-persistence/src/main/java
A faxtomail-persistence/src/main/java/com
A faxtomail-persistence/src/main/java/com/franciaflex
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/RessourceClassLoader.java
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/ProgressionModel.java
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationOption.java
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfigurationProvider.java
A faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/FaxToMailConfiguration.java
A faxtomail-persistence/src/main/resources
A faxtomail-persistence/src/main/resources/faxtomail.properties
A faxtomail-persistence/src/main/resources/i18n
A faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties
A faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties
A faxtomail-persistence/src/main/resources/META-INF
A faxtomail-persistence/src/main/resources/META-INF/services
A faxtomail-persistence/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider
A faxtomail-persistence/src/main/xmi
A faxtomail-persistence/src/main/xmi/faxtomail.properties
AU faxtomail-persistence/src/main/xmi/faxtomail.zargo
A faxtomail-persistence/pom.xml
A faxtomail-persistence/README.txt
A src
A faxtomail-ui-web
A faxtomail-ui-web/LICENSE.txt
A faxtomail-ui-web/src
A faxtomail-ui-web/src/main
A faxtomail-ui-web/src/main/java
A faxtomail-ui-web/src/main/java/com
A faxtomail-ui-web/src/main/java/com/franciaflex
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailActionSupport.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailIllegalAccessException.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/DefaultFaxToMailWebApplicationContext.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailInterceptor.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailSession.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailStrutsObjectFactory.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailEntityNotFoundException.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailNoIdException.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/IndexAction.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java
A faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/FaxToMailApplicationListener.java
A faxtomail-ui-web/src/main/resources
A faxtomail-ui-web/src/main/resources/i18n
A faxtomail-ui-web/src/main/resources/i18n/faxtomail-web_fr_FR.properties
A faxtomail-ui-web/src/main/resources/struts.properties
A faxtomail-ui-web/src/main/resources/shiro.ini
A faxtomail-ui-web/src/main/resources/struts.xml
A faxtomail-ui-web/src/main/resources/validators.xml
A faxtomail-ui-web/src/main/resources/xwork-conversion.properties
A faxtomail-ui-web/src/main/resources/log4j.properties
A faxtomail-ui-web/src/main/webapp
A faxtomail-ui-web/src/main/webapp/WEB-INF
A faxtomail-ui-web/src/main/webapp/WEB-INF/decorators.xml
A faxtomail-ui-web/src/main/webapp/WEB-INF/decorators
A faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/version.jsp
A faxtomail-ui-web/src/main/webapp/WEB-INF/decorators/layout.jsp
A faxtomail-ui-web/src/main/webapp/WEB-INF/content
A faxtomail-ui-web/src/main/webapp/WEB-INF/content/index.jsp
A faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin
A faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration.jsp
A faxtomail-ui-web/src/main/webapp/WEB-INF/web.xml
A faxtomail-ui-web/src/main/webapp/css
A faxtomail-ui-web/src/main/webapp/css/select2
AU faxtomail-ui-web/src/main/webapp/css/select2/select2-spinner.gif
AU faxtomail-ui-web/src/main/webapp/css/select2/select2.png
A faxtomail-ui-web/src/main/webapp/css/select2/select2.css
AU faxtomail-ui-web/src/main/webapp/css/select2/select2x2.png
A faxtomail-ui-web/src/main/webapp/css/jstree
A faxtomail-ui-web/src/main/webapp/css/jstree/themes
A faxtomail-ui-web/src/main/webapp/css/jstree/themes/default
AU faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/32px.png
A faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.css
A faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/style.min.css
AU faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/throbber.gif
AU faxtomail-ui-web/src/main/webapp/css/jstree/themes/default/40px.png
A faxtomail-ui-web/src/main/webapp/css/configuration.css
A faxtomail-ui-web/src/main/webapp/js
A faxtomail-ui-web/src/main/webapp/js/select2
A faxtomail-ui-web/src/main/webapp/js/select2/LICENSE
A faxtomail-ui-web/src/main/webapp/js/select2/select2_locale_fr.js
A faxtomail-ui-web/src/main/webapp/js/select2/select2.min.js
A faxtomail-ui-web/src/main/webapp/js/configuration.js
A faxtomail-ui-web/src/main/webapp/js/jquery.ui.touch.js
A faxtomail-ui-web/src/main/webapp/js/require.js
A faxtomail-ui-web/src/main/webapp/js/jstree
A faxtomail-ui-web/src/main/webapp/js/jstree/jstree.js
A faxtomail-ui-web/src/main/webapp/js/jstree/jstree.min.js
A faxtomail-ui-web/pom.xml
A faxtomail-ui-web/README.txt
A pom.xml
A README.txt
U .
At revision 10
Parsing POMs
Discovered a new module com.franciaflex:faxtomail FaxToMail
Discovered a new module com.franciaflex.faxtomail:faxtomail-persistence FaxToMail :: Persistence
Discovered a new module com.franciaflex.faxtomail:faxtomail-service FaxToMail :: Service
Discovered a new module com.franciaflex.faxtomail:faxtomail-ui-web FaxToMail :: Web
Discovered a new module com.franciaflex.faxtomail:faxtomail-ui-swing FaxToMail :: UI
Modules changed, recalculating dependency graph
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/codelutin.com/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-codelutin.com/webapps/jenkins/WEB-INF/lib/remoting-2.33.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 54753
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/ws/trunk/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] FaxToMail
[INFO] FaxToMail :: Persistence
[INFO] FaxToMail :: Service
[INFO] FaxToMail :: Web
[INFO] FaxToMail :: UI
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-parent…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-parent… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-… (0 B at 0.0 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-release-properties) @ faxtomail ---
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] FaxToMail ......................................... FAILURE [3.239s]
[INFO] FaxToMail :: Persistence .......................... SKIPPED
[INFO] FaxToMail :: Service .............................. SKIPPED
[INFO] FaxToMail :: Web .................................. SKIPPED
[INFO] FaxToMail :: UI ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.485s
[INFO] Finished at: Sat Feb 15 01:16:29 CET 2014
[INFO] Final Memory: 16M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (check-release-properties) on project faxtomail: org.apache.maven.plugins.enforcer.RequireProperty failed with message:
[ERROR] You must set a dbVersion property!
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (check-release-properties) on project faxtomail: org.apache.maven.plugins.enforcer.RequireProperty failed with message:
You must set a dbVersion property!
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.maven.plugins.enforcer.RequireProperty failed with message:
You must set a dbVersion property!
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:188)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
Caused by: org.apache.maven.enforcer.rule.api.EnforcerRuleException: You must set a dbVersion property!
at org.apache.maven.plugins.enforcer.AbstractPropertyEnforcerRule.execute(AbstractPropertyEnforcerRule.java:119)
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:177)
... 32 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: faxtomail-commits(a)list.forge.codelutin.com
channel stopped
Skipping sonar analysis due to bad build status FAILURE
1
36
Build failed in Jenkins: faxtomail-nightly » FaxToMail :: Persistence #10
by admin+ci-codelutin.com@codelutin.com 22 Apr '14
by admin+ci-codelutin.com@codelutin.com 22 Apr '14
22 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
Changes:
[kmorin] refs #4654 [ECRAN] Liste des mails / fax
refs #4655 [ECRAN] Détail d'un mail / fax
------------------------------------------
[...truncated 123 lines...]
[INFO]
[INFO] --- license-maven-plugin:1.6:update-file-header (update-file-header) @ faxtomail-persistence ---
[INFO] Will search files to update from root <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] Will search files to update from root <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] - adding license header on file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] Scan 143 files header done in 132.031ms.
[INFO]
* uptodate header on 11 files.
* add header on 132 files.
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-persistence ---
[INFO] Compiling 121 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.10:check (default) @ faxtomail-persistence ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.6:generate-changes (jredmine-generate-changes) @ faxtomail-persistence ---
[INFO] Skipping goal (skipGenerateChanges flag is on).
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ faxtomail-persistence ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ faxtomail-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ faxtomail-persistence ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ faxtomail-persistence ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ faxtomail-persistence ---
[INFO] Building jar: <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO]
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ faxtomail-persistence >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ faxtomail-persistence ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-persistence ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ faxtomail-persistence ---
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[INFO]
[INFO] --- eugene-maven-plugin:2.7.4:generate (generate-entities) @ faxtomail-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] Copy file <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…> to <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] No file generated.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…> for 1 file(s).
[INFO] No file generated.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagValue.java.lang.String] : the tagvalue 'java.lang.String' is unkown.
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:303) loadModelTagValue - Invalid model tag value [model.tagValue.useEnumerationName] : this tagvalue 'useEnumerationName' can not be apply on the model.
INFO [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:270) loadModelProperties - 5 tag values were succesfull imported from <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO] No file generated.
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator TopiaMetaTransformer
INFO [pool-1-thread-1 for channel] (ObjectModelTransformerToJava.java:998) isInClassPath - Will not generate [com.franciaflex.faxtomail.persistence.entities.EmailTopiaDao], already found in class-path.
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO]
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ faxtomail-persistence <<<
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ faxtomail-persistence ---
[INFO] Building jar: <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO]
[INFO] --- maven-javadoc-plugin:2.9.1:jar (attach-javadocs) @ faxtomail-persistence ---
[INFO] Building jar: <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex.faxto…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ faxtomail-persistence ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-pgp-passphrase) @ faxtomail-persistence ---
[INFO] Exporting server [gpg-signer] username in ${gpg.keyname}
[INFO] Exporting server [gpg-signer] password in ${gpg.passphrase}
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-artifacts) @ faxtomail-persistence ---
[INFO] Loaded /var/local/forge/data/codelutin.com/jenkins/workspace/faxtomail-nightly/trunk/target/collect-artifacts.txt
[INFO] Copying faxtomail-persistence-0.1-SNAPSHOT.jar to /var/local/forge/data/codelutin.com/jenkins/workspace/faxtomail-nightly/trunk/target/collect/com.franciaflex.faxtomail--faxtomail-persistence/faxtomail-persistence-0.1-SNAPSHOT.jar
[INFO] Copying THIRD-PARTY.properties to /var/local/forge/data/codelutin.com/jenkins/workspace/faxtomail-nightly/trunk/target/collect/com.franciaflex.faxtomail--faxtomail-persistence/THIRD-PARTY.properties
[INFO] Copying faxtomail-persistence-0.1-SNAPSHOT-sources.jar to /var/local/forge/data/codelutin.com/jenkins/workspace/faxtomail-nightly/trunk/target/collect/com.franciaflex.faxtomail--faxtomail-persistence/faxtomail-persistence-0.1-SNAPSHOT-sources.jar
[INFO] Copying faxtomail-persistence-0.1-SNAPSHOT-javadoc.jar to /var/local/forge/data/codelutin.com/jenkins/workspace/faxtomail-nightly/trunk/target/collect/com.franciaflex.faxtomail--faxtomail-persistence/faxtomail-persistence-0.1-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-attachements) @ faxtomail-persistence ---
[WARNING] Skipping goal (No file to collect).
[INFO]
[INFO] --- maven-gpg-plugin:1.4:sign (sign-artifacts) @ faxtomail-persistence ---
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-only (analyze) @ faxtomail-persistence ---
[INFO] Used declared dependencies found:
[INFO] org.nuiton.topia:topia-persistence:jar:3.0-alpha-10:compile
[INFO] org.nuiton:nuiton-utils:jar:3.0-SNAPSHOT:compile
[INFO] org.nuiton:nuiton-config:jar:3.0-alpha-2:compile
[INFO] org.nuiton:nuiton-updater:jar:3.0-alpha-2:compile
[INFO] org.nuiton.jaxx:jaxx-application-api:jar:2.8.2:compile
[INFO] org.nuiton.i18n:nuiton-i18n:jar:3.0:compile
[INFO] com.google.guava:guava:jar:16.0.1:compile
[INFO] org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] commons-io:commons-io:jar:2.4:compile
[INFO] commons-logging:commons-logging:jar:1.1.3:compile
[WARNING] Used undeclared dependencies found:
[WARNING] org.hibernate:hibernate-core:jar:4.2.8.Final:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.nuiton:nuiton-decorator:jar:3.0-alpha-3:compile
[WARNING] commons-collections:commons-collections:jar:3.2.1:compile
[WARNING] org.swinglabs.swingx:swingx-common:jar:1.6.4:compile
[WARNING] org.apache.commons:commons-vfs2:jar:2.0:compile
[WARNING] net.sourceforge.jtds:jtds:jar:1.3.1:compile
[WARNING] commons-beanutils:commons-beanutils:jar:1.9.1:compile
[JENKINS] Archiving disabled
1
9
02 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-ci/13/changes>
Changes:
[kmorin] refs #4654 [ECRAN] Liste des mails / fax
refs #4655 [ECRAN] Détail d'un mail / fax
------------------------------------------
[...truncated 148 lines...]
[INFO] Add compile source root : <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (scan-sources) @ faxtomail-persistence ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-persistence ---
[INFO] Copying faxtomail-persistence.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO] Copying faxtomail-persistence.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-persistence ---
[WARNING] bundle fr_FR contains 30/33 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 33/33 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 18 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-persistence ---
[INFO] Compiling 121 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ faxtomail-persistence ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ faxtomail-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ faxtomail-persistence ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ faxtomail-persistence ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ faxtomail-persistence ---
[INFO] Building jar: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-persist…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ faxtomail-persistence ---
[JENKINS] Archiving disabled
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: Service 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-service ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-service ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (scan-sources) @ faxtomail-service ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserValidation (scan-sources) @ faxtomail-service ---
[INFO] Load rules file validation.rules
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-service >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-service ---
[INFO] Copying faxtomail-service.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO] Copying faxtomail-service.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-service <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (scan-sources) @ faxtomail-service ---
[WARNING] bundle fr_FR contains 4/5 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 67/67 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-service ---
[INFO] Compiling 16 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…> uses unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ faxtomail-service ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ faxtomail-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ faxtomail-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ faxtomail-service ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ faxtomail-service ---
[INFO] Building jar: <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-service…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ faxtomail-service ---
[JENKINS] Archiving disabled
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: Web 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-ui-web ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-ui-web ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserStruts2 (parseJsp) @ faxtomail-ui-web ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (parseOthersAndGen) @ faxtomail-ui-web ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-ui-web ---
[INFO] Copying faxtomail-ui-web.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO] Copying faxtomail-ui-web.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:collect-i18n-artifacts (collect-i18n-artifacts) @ faxtomail-ui-web ---
[INFO] collected 8 i18n artifacts for locale fr_FR stored in <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO] collected 8 i18n artifacts for locale en_GB stored in <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web ---
[WARNING] bundle fr_FR contains 34/92 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 90/144 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-ui-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-ui-web ---
[INFO] Compiling 12 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>:[161,25] cannot find symbol
symbol: variable PROPERTY_CLIENT_CODE
location: interface com.franciaflex.faxtomail.persistence.entities.Email
[INFO] 1 error
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] FaxToMail ......................................... SUCCESS [ 2.880 s]
[INFO] FaxToMail :: Persistence .......................... SUCCESS [ 13.371 s]
[INFO] FaxToMail :: Service .............................. SUCCESS [ 2.035 s]
[INFO] FaxToMail :: Web .................................. FAILURE [ 1.880 s]
[INFO] FaxToMail :: UI ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.664 s
[INFO] Finished at: 2014-03-31T18:56:17+01:00
[JENKINS] Archiving disabled
[INFO] Final Memory: 46M/697M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faxtomail-ui-web: Compilation failure
[ERROR] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>:[161,25] cannot find symbol
[ERROR] symbol: variable PROPERTY_CLIENT_CODE
[ERROR] location: interface com.franciaflex.faxtomail.persistence.entities.Email
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project faxtomail-ui-web: Compilation failure
<http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>:[161,25] cannot find symbol
symbol: variable PROPERTY_CLIENT_CODE
location: interface com.franciaflex.faxtomail.persistence.entities.Email
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
<http://ci.codelutin.com/jenkins/job/faxtomail-ci/ws/trunk/faxtomail-ui-web/…>:[161,25] cannot find symbol
symbol: variable PROPERTY_CLIENT_CODE
location: interface com.franciaflex.faxtomail.persistence.entities.Email
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :faxtomail-ui-web
Sending e-mails to: faxtomail-commits(a)list.forge.codelutin.com
channel stopped
1
2
Build failed in Jenkins: faxtomail-ci » FaxToMail :: Web #13
by admin+ci-codelutin.com@codelutin.com 02 Apr '14
by admin+ci-codelutin.com@codelutin.com 02 Apr '14
02 Apr '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail :: Web 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail-ui-web ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail-ui-web ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserStruts2 (parseJsp) @ faxtomail-ui-web ---
[INFO]
[INFO] --- i18n-maven-plugin:3.0:parserJava (parseOthersAndGen) @ faxtomail-ui-web ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:get (get) @ faxtomail-ui-web ---
[INFO] Copying faxtomail-ui-web.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] Copying faxtomail-ui-web.properties to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:gen (parseOthersAndGen) @ faxtomail-ui-web ---
[INFO]
[INFO] >>> i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web >>>
[INFO]
[INFO] --- i18n-maven-plugin:3.0:collect-i18n-artifacts (collect-i18n-artifacts) @ faxtomail-ui-web ---
[INFO] collected 8 i18n artifacts for locale fr_FR stored in <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] collected 8 i18n artifacts for locale en_GB stored in <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO]
[INFO] <<< i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web <<<
[INFO]
[INFO] --- i18n-maven-plugin:3.0:bundle (parseOthersAndGen) @ faxtomail-ui-web ---
[WARNING] bundle fr_FR contains 34/92 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 90/144 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ faxtomail-ui-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ faxtomail-ui-web ---
[INFO] Compiling 12 source files to <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.codelutin.com/jenkins/job/faxtomail-ci/com.franciaflex.faxtomail$…>:[161,25] cannot find symbol
symbol: variable PROPERTY_CLIENT_CODE
location: interface com.franciaflex.faxtomail.persistence.entities.Email
[INFO] 1 error
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
1
Build failed in Jenkins: faxtomail-nightly » FaxToMail #1
by admin+ci-codelutin.com@codelutin.com 31 Mar '14
by admin+ci-codelutin.com@codelutin.com 31 Mar '14
31 Mar '14
See <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex$faxto…>
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/faxtomail-nightly/com.franciaflex$faxto…> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] FaxToMail
[INFO] FaxToMail :: Persistence
[INFO] FaxToMail :: Service
[INFO] FaxToMail :: Web
[INFO] FaxToMail :: UI
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building FaxToMail 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-parent…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-parent… (0 B at 0.0 KB/sec)
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/cod…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/groups/faxtomail-group/org/codehaus/m…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-…
[INFO] Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-maven-… (0 B at 0.0 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ faxtomail ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-release-properties) @ faxtomail ---
[JENKINS] Archiving disabled
1
9
31 Mar '14
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(a)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>
1
0
r22 - in trunk/faxtomail-ui-swing: . src/license src/main/java/com/franciaflex/faxtomail/ui/swing/actions src/main/java/com/franciaflex/faxtomail/ui/swing/util src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment
by kmorin@users.forge.codelutin.com 24 Mar '14
by kmorin@users.forge.codelutin.com 24 Mar '14
24 Mar '14
Author: kmorin
Date: 2014-03-24 16:55:50 +0100 (Mon, 24 Mar 2014)
New Revision: 22
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/22
Log:
refs #4666 [ECRAN] Pi?\195?\168ces jointes
Modified:
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
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/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/AttachmentEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-03-24 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-03-24 15:55:50 UTC (rev 22)
@@ -258,8 +258,23 @@
<artifactId>pdf-renderer</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.media.jai</groupId>
+ <artifactId>com.springsource.javax.media.jai.core</artifactId>
+ <version>1.1.3</version>
+ </dependency>
+
</dependencies>
+ <!-- TODO -->
+ <repositories>
+ <repository>
+ <id>com.springsource.repository.bundles.external</id>
+ <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
+ <url>http://repository.springsource.com/maven/bundles/external</url>
+ </repository>
+ </repositories>
+
<build>
<resources>
<resource>
Modified: trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-03-24 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/license/THIRD-PARTY.properties 2014-03-24 15:55:50 UTC (rev 22)
@@ -8,6 +8,7 @@
# - Common Development and Distribution License (CDDL) v1.0
# - Common Public License Version 1.0
# - Eclipse Public License, Version 1.0
+# - GNU Affero General Public License v3
# - GNU General Public License - Version 2 with the class path exception
# - GNU General Public License, Version 2 with the Classpath Exception
# - GNU Lesser General Public License, Version 2.1
@@ -27,6 +28,9 @@
# Please fill the missing licenses for dependencies :
#
#
-#Tue Feb 25 10:11:09 CET 2014
+#Mon Mar 24 15:58:44 CET 2014
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
+#to check
+javax.media.jai--com.springsource.javax.media.jai.codec--1.1.3=Apache License
+javax.media.jai--com.springsource.javax.media.jai.core--1.1.3=Apache License
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 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-03-24 15:55:50 UTC (rev 22)
@@ -10,6 +10,7 @@
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;
@@ -24,9 +25,11 @@
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;
/**
@@ -36,7 +39,7 @@
public class GenerateAnnotatedAttachmentAction extends AbstractFaxToMailAction<PDFEditorUIModel, PDFEditorUI, PDFEditorUIHandler> {
public GenerateAnnotatedAttachmentAction(PDFEditorUIHandler handler) {
- super(handler, false);
+ super(handler, true);
}
@Override
@@ -48,8 +51,12 @@
if (FaxToMailUIUtil.isFileAPDF(file)) {
fis = new FileInputStream(file);
+ } else if (FaxToMailUIUtil.isFileATxt(file)) {
+ File target = handler.convertTextToPdf(file);
+ fis = new FileInputStream(target);
+
} else {
- File target = File.createTempFile("test", ".pdf");
+ File target = File.createTempFile(file.getName(), ".pdf");
Document document = new Document();
FileOutputStream fos = new FileOutputStream(target);
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 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-03-24 15:55:50 UTC (rev 22)
@@ -158,4 +158,12 @@
public static boolean isFileAPDF(File file) {
return FileUtil.extension(file).toUpperCase().equals("PDF");
}
+
+ public static boolean isFileATxt(File file) {
+ return FileUtil.extension(file).toUpperCase().equals("TXT");
+ }
+
+ public static boolean isFileATif(File file) {
+ return FileUtil.extension(file).toUpperCase().equals("TIF");
+ }
}
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 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java 2014-03-24 15:55:50 UTC (rev 22)
@@ -1,11 +1,25 @@
package com.franciaflex.faxtomail.ui.swing.util;
+import com.sun.media.jai.codec.ByteArraySeekableStream;
+import com.sun.media.jai.codec.ImageCodec;
+import com.sun.media.jai.codec.ImageDecoder;
+import com.sun.media.jai.codec.SeekableStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.imageio.ImageIO;
+import javax.media.jai.PlanarImage;
import javax.swing.*;
-import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
+import java.awt.image.BufferedImage;
+import java.awt.image.RenderedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
/**
* @author Kevin Morin (Code Lutin)
@@ -13,6 +27,8 @@
*/
public class JImagePanel extends JPanel {
+ private static final Log log = LogFactory.getLog(JImagePanel.class);
+
protected Image img;
protected Image scaledImage;
@@ -65,10 +81,39 @@
return scaledImage;
}
- public void setImg(String img) {
- setImg(new ImageIcon(img).getImage());
+ public void setImg(File img) {
+ BufferedImage bufferedImage;
+ try {
+ bufferedImage = ImageIO.read(img);
+
+ } catch (IOException e) {
+ log.error("error while reading image " + img.getAbsolutePath(), e);
+ bufferedImage = null;
+ }
+ if (bufferedImage != null) {
+ setImg(bufferedImage);
+ }
}
+ public void setTifImage(File file) {
+ try {
+ FileInputStream fis = new FileInputStream(file);
+ FileChannel channel = fis.getChannel();
+ ByteBuffer buffer = ByteBuffer.allocate((int) channel.size());
+ channel.read(buffer);
+ SeekableStream stream = new ByteArraySeekableStream(buffer.array());
+ String[] names = ImageCodec.getDecoderNames(stream);
+ ImageDecoder dec = ImageCodec.createImageDecoder(names[0], stream, null);
+ RenderedImage im = dec.decodeAsRenderedImage();
+ Image image = PlanarImage.wrapRenderedImage(im).getAsBufferedImage();
+
+ setImg(image);
+
+ } catch (IOException e) {
+ log.error("error while reading image " + file.getAbsolutePath(), e);
+ }
+ }
+
public void setImg(Image img) {
this.img = img;
this.scaledImage = img;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-24 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-24 15:55:50 UTC (rev 22)
@@ -42,7 +42,7 @@
public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<AttachmentEditorUIModel, AttachmentEditorUI> {
public static final List<String> EDITABLE_EXTENSIONS = Lists.newArrayList("PDF", "PNG", "JPG", "JPEG", "GIF",
- "TIF", "JP2", "BMP", "WMF", "JB2", "TXT");
+ "TIF", "BMP", "TXT");
@Override
public void afterInit(AttachmentEditorUI ui) {
@@ -174,7 +174,8 @@
} else {
Desktop desktop = FaxToMailUIUtil.getDesktopForBrowse();
try {
- desktop.browse(file.toURI());
+// desktop.browse(file.toURI());
+ desktop.open(file);
} catch (IOException e) {
getContext().getErrorHelper().showErrorDialog(t("swing.error.cannot.open.file"));
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-24 11:13:05 UTC (rev 21)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-24 15:55:50 UTC (rev 22)
@@ -1,3 +1,7 @@
+#attachmentPanel {
+ border: { BorderFactory.createEmptyBorder(2, 3, 2, 3) };
+}
+
#attachmentNameLabel {
text: { attachment != null ? getAttachment().getOriginalFile().getName() : null };
}
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 11:13:05 UTC (rev 21)
+++ 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)
@@ -2,9 +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;
@@ -13,20 +18,19 @@
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.FileUtil;
import javax.swing.*;
-import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.image.BufferedImage;
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;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
@@ -75,6 +79,20 @@
File file = model.getNotNullFile();
if (file != null) {
+ if (FaxToMailUIUtil.isFileATxt(file)) {
+ try {
+ file = convertTextToPdf(file);
+
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("", e);
+ }
+ } catch (DocumentException e) {
+ if (log.isErrorEnabled()) {
+ log.error("", e);
+ }
+ }
+ }
if (FaxToMailUIUtil.isFileAPDF(file)) {
getUI().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
@@ -86,10 +104,6 @@
model.setPageNumber(pdf.getNumPages());
model.setCurrentPageIndex(1);
- } catch (FileNotFoundException e) {
- if (log.isErrorEnabled()) {
- log.error("", e);
- }
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("", e);
@@ -100,7 +114,49 @@
} else {
model.setPageNumber(1);
model.setCurrentPageIndex(1);
- getUI().getContainer().setImg(file.getAbsolutePath());
+
+ JImagePanel container = getUI().getContainer();
+ if (FaxToMailUIUtil.isFileATxt(file)) {
+ JTextPane textPane = new JTextPane();
+ textPane.setEditable(false);
+ try {
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
+ String text = new String();
+ while (br.readLine() != null) {
+ text += br.readLine() + "\n";
+ }
+ textPane.setText(text);
+
+ log.debug(textPane.getText());
+
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("", e);
+ }
+ }
+ container.add(textPane);
+
+ Insets insets = container.getInsets();
+ Dimension size = textPane.getPreferredSize();
+
+ container.setPreferredSize(size);
+ container.setMinimumSize(size);
+ container.setMaximumSize(size);
+ container.setSize(size);
+
+ textPane.setBounds(insets.left, insets.top, size.width, size.height);
+
+ container.updateUI();
+
+ } else {
+ if (FaxToMailUIUtil.isFileATif(file)) {
+ container.setTifImage(file);
+
+ } else {
+ container.setImg(file);
+ }
+ }
}
model.firePropertyChanged(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, null, 1);
}
@@ -180,14 +236,16 @@
}
protected void addPanel(JPanel panel) {
- ui.getContainer().add(panel, 0);
+ JImagePanel container = ui.getContainer();
+ container.add(panel, 0);
- Insets insets = ui.getContainer().getInsets();
+ Insets insets = container.getInsets();
Dimension size = panel.getPreferredSize();
- panel.setBounds(0 + insets.left, 0 + insets.top,
+ Rectangle rect = container.getVisibleRect();
+ panel.setBounds(rect.x + insets.left, rect.y + insets.top,
size.width, size.height);
- ui.getContainer().updateUI();
+ container.updateUI();
cm.registerComponent(panel);
}
@@ -216,7 +274,8 @@
true, // fill background with white
true // block until drawing is done
);
- getUI().getContainer().setImg(image);
+ JImagePanel container = getUI().getContainer();
+ container.setImg(image);
PDFEditorUIModel.Page p = getModel().getPage(pageNb);
for (JPanel panel : p.getNotes()) {
@@ -226,8 +285,31 @@
panel.setVisible(true);
}
- getUI().getContainer().updateUI();
+ container.updateUI();
}
}
}
+
+ public File convertTextToPdf(File file) throws IOException, DocumentException {
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
+ String text = new String();
+ while (br.readLine() != null) {
+ text += br.readLine() + "\n";
+ }
+
+ file = File.createTempFile(file.getName(), ".pdf");
+
+ Document document = new Document();
+ FileOutputStream fos = new FileOutputStream(file);
+ PdfWriter writer = PdfWriter.getInstance(document, fos);
+ writer.open();
+
+ document.open();
+ document.add(new Paragraph(text));
+ document.close();
+ writer.close();
+ return file;
+ }
+
}
1
0
r21 - in trunk/faxtomail-ui-swing/src/main: java/com/franciaflex/faxtomail/ui/swing/actions java/com/franciaflex/faxtomail/ui/swing/content java/com/franciaflex/faxtomail/ui/swing/util java/com/franciaflex/faxtomail/ui/swing/util/attachment resources/i18n
by kmorin@users.forge.codelutin.com 24 Mar '14
by kmorin@users.forge.codelutin.com 24 Mar '14
24 Mar '14
Author: kmorin
Date: 2014-03-24 12:13:05 +0100 (Mon, 24 Mar 2014)
New Revision: 21
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/21
Log:
refs #4666 [ECRAN] Pi?\195?\168ces jointes
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractToolbarPopupUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx
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
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-03-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-03-24 11:13:05 UTC (rev 21)
@@ -45,7 +45,7 @@
public class ShowDemandeAction extends AbstractChangeScreenAction {
public ShowDemandeAction(MainUIHandler handler) {
- super(handler, false, FaxToMailScreen.DEMANDE);
+ super(handler, true, FaxToMailScreen.DEMANDE);
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-03-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/MainUIHandler.java 2014-03-24 11:13:05 UTC (rev 21)
@@ -366,9 +366,9 @@
this.currentBody = screenUI;
getContext().getSwingSession().add(currentBody, true);
ui.getBody().setTitle(screenTitle);
- ui.getBody().add(currentBody);
ui.getBody().setLeftDecoration(new JLabel(icon));
ui.getBody().setRightDecoration(rightDecoration);
+ ui.getBody().add(currentBody);
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractToolbarPopupUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractToolbarPopupUI.css 2014-03-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractToolbarPopupUI.css 2014-03-24 11:13:05 UTC (rev 21)
@@ -1,4 +1,4 @@
#dialog {
undecorated: true;
- alwaysOnTop: true;
+ //alwaysOnTop: true;
}
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css 2014-03-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css 2014-03-24 11:13:05 UTC (rev 21)
@@ -1,36 +1,56 @@
#toolbar {
floatable: false;
- margin: {new java.awt.Insets(0, 0, 0, 5)};
+ margin: {new java.awt.Insets(5, 0, 0, 5)};
borderPainted: false;
}
#noteButton {
actionIcon: note;
+ toolTipText: "faxtomail.pdfEitor.button.addNote.tip";
}
#crossButton {
actionIcon: cross;
+ toolTipText: "faxtomail.pdfEitor.button.addCross.tip";
}
#prevPageButton {
- enabled: { getModel().getCurrentPageIndex() > 0 };
- actionIcon: cross;
+ actionIcon: left;
+ enabled: { getModel().getCurrentPageIndex() > 1 };
+ toolTipText: "faxtomail.pdfEitor.button.previousPage";
}
+#pageNumber {
+ bean: { model };
+ property: "currentPageIndex";
+ modelText: { String.valueOf(model.getCurrentPageIndex()) };
+ useFloat: false;
+ useSign: false;
+ autoPopup: false;
+ showPopupButton: false;
+ showReset: false;
+ width: 50;
+}
+
+#pageTotal {
+ text: { " / " + String.valueOf(model.getPages().length) };
+}
+
#nextPageButton {
- enabled: { getModel().getCurrentPageIndex() < getModel().getPages().length - 1 };
- actionIcon: cross;
+ actionIcon: right;
+ enabled: { getModel().getCurrentPageIndex() < getModel().getPages().length };
+ toolTipText: "faxtomail.pdfEitor.button.nextPage";
}
#cancelButton {
actionIcon: cancel;
- text: "faxtomail.reply.action.cancel";
- toolTipText: "faxtomail.reply.action.cancel.tip";
+ text: "faxtomail.pdfEitor.action.cancel";
+ toolTipText: "faxtomail.pdfEitor.action.cancel.tip";
}
#validateButton {
actionIcon: validate;
- text: "faxtomail.reply.action.validate";
- toolTipText: "faxtomail.reply.action.validate.tip";
+ text: "faxtomail.pdfEitor.action.validate";
+ toolTipText: "faxtomail.pdfEitor.action.validate.tip";
_applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.GenerateAnnotatedAttachmentAction.class};
}
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx 2014-03-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx 2014-03-24 11:13:05 UTC (rev 21)
@@ -1,4 +1,5 @@
-<JPanel layout='{new BorderLayout()}'
+<JPanel id="pdfEditorUIPanel"
+ layout='{new BorderLayout()}'
implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<PDFEditorUIModel, PDFEditorUIHandler>'>
<import>
@@ -7,6 +8,10 @@
com.franciaflex.faxtomail.ui.swing.util.JImagePanel
+ javax.swing.SwingConstants
+
+ jaxx.runtime.swing.editor.NumberEditor
+
</import>
<script><![CDATA[
@@ -25,8 +30,14 @@
onActionPerformed="handler.addNote()"/>
<JButton id='crossButton'
onActionPerformed="handler.addCross()"/>
+
+ <JSeparator constructorParams="SwingConstants.VERTICAL"/>
+
<JButton id="prevPageButton"
onActionPerformed="getModel().decPageIndex()"/>
+ <NumberEditor id='pageNumber'
+ constructorParams='this' />
+ <JLabel id="pageTotal"/>
<JButton id="nextPageButton"
onActionPerformed="getModel().incPageIndex()"/>
</JToolBar>
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-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java 2014-03-24 11:13:05 UTC (rev 21)
@@ -16,9 +16,12 @@
import org.nuiton.util.FileUtil;
import javax.swing.*;
+import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -52,27 +55,13 @@
cm.setDragInsets(cr.getDragInsets());
cm.setEdgeInsets(new Insets(0, 0, 0, 0));
- getModel().addPropertyChangeListener(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, new PropertyChangeListener() {
+ getModel().addPropertyChangeListener(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX,
+ new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- if (pdf != null) {
- int pageNb = (int) evt.getNewValue();
- PDFPage page = pdf.getPage(pageNb +1);
- // create the image
- Rectangle rect = new Rectangle(0, 0, (int) page.getBBox().getWidth(),
- (int) page.getBBox().getHeight());
-
- Image image = page.getImage(rect.width, rect.height, // width & height
- rect, // clip rect
- null, // null for the ImageObserver
- true, // fill background with white
- true // block until drawing is done
- );
- getUI().getContainer().setImg(image);
- getUI().getContainer().updateUI();
-
- //TODO kmorin 20140321 hide the panels of the previous pages + chanegs icons + display the number of pages
- }
+ Integer pageNb = (Integer) evt.getNewValue();
+ Integer prevPageNb = (Integer) evt.getOldValue();
+ updatePageNumber(pageNb, prevPageNb);
}
});
@@ -95,7 +84,7 @@
pdf = new PDFFile(buf);
model.setPageNumber(pdf.getNumPages());
- model.setCurrentPageIndex(0);
+ model.setCurrentPageIndex(1);
} catch (FileNotFoundException e) {
if (log.isErrorEnabled()) {
@@ -110,10 +99,10 @@
} else {
model.setPageNumber(1);
- model.setCurrentPageIndex(0);
+ model.setCurrentPageIndex(1);
getUI().getContainer().setImg(file.getAbsolutePath());
-
}
+ model.firePropertyChanged(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, null, 1);
}
}
}
@@ -140,6 +129,18 @@
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);
@@ -191,4 +192,42 @@
cm.registerComponent(panel);
}
+ protected void updatePageNumber(Integer pageNb, Integer prevPageNb) {
+ if (pdf != null) {
+ if (pageNb != null) {
+ if (prevPageNb != null) {
+ PDFEditorUIModel.Page p = getModel().getPage(prevPageNb);
+ for (JPanel panel : p.getNotes()) {
+ panel.setVisible(false);
+ }
+ for (JPanel panel : p.getCrosses()) {
+ panel.setVisible(false);
+ }
+ }
+
+ PDFPage page = pdf.getPage(pageNb);
+ // create the image
+ Rectangle rect = new Rectangle(0, 0, (int) page.getBBox().getWidth(),
+ (int) page.getBBox().getHeight());
+
+ Image image = page.getImage(rect.width, rect.height, // width & height
+ rect, // clip rect
+ null, // null for the ImageObserver
+ true, // fill background with white
+ true // block until drawing is done
+ );
+ getUI().getContainer().setImg(image);
+
+ PDFEditorUIModel.Page p = getModel().getPage(pageNb);
+ for (JPanel panel : p.getNotes()) {
+ panel.setVisible(true);
+ }
+ for (JPanel panel : p.getCrosses()) {
+ panel.setVisible(true);
+ }
+
+ getUI().getContainer().updateUI();
+ }
+ }
+ }
}
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-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java 2014-03-24 11:13:05 UTC (rev 21)
@@ -18,6 +18,7 @@
*/
public class PDFEditorUIModel extends AbstractFaxToMailBeanUIModel<Attachment, PDFEditorUIModel> {
+ public static final String PROPERTY_PAGES = "pages";
public static final String PROPERTY_CURRENT_PAGE_INDEX = "currentPageIndex";
protected final Attachment editObject = new AttachmentImpl();
@@ -35,6 +36,10 @@
notes.add(note);
}
+ public void removeNote(JPanel note) {
+ notes.remove(note);
+ }
+
public List<JImagePanel> getCrosses() {
return crosses;
}
@@ -43,10 +48,14 @@
crosses.add(cross);
}
+ public void removeCross(JPanel cross) {
+ crosses.remove(cross);
+ }
}
protected Page[] pages;
+ // first page is 1 not 0
protected int currentPageIndex = -1;
protected static Binder<PDFEditorUIModel, Attachment> toBeanBinder =
@@ -107,35 +116,43 @@
for (int i = 0 ; i < nb ; i++) {
pages[i] = new Page();
}
+ firePropertyChanged(PROPERTY_PAGES, null, pages);
}
public Page getCurrentPage() {
- if (pages == null || currentPageIndex < 0 | currentPageIndex >= pages.length) {
+ if (pages == null || currentPageIndex < 1 || currentPageIndex > pages.length) {
return null;
}
- return pages[currentPageIndex];
+ return pages[currentPageIndex - 1];
}
+ public Page getPage(int i) {
+ if (pages == null || i < 1 || i > pages.length) {
+ return null;
+ }
+ return pages[i - 1];
+ }
+
public int getCurrentPageIndex() {
return currentPageIndex;
}
public void setCurrentPageIndex(int currentPageIndex) {
Object oldValue = getCurrentPageIndex();
+ currentPageIndex = Math.max(1, currentPageIndex);
+ if (pages != null) {
+ currentPageIndex = Math.min(pages.length, currentPageIndex);
+ }
this.currentPageIndex = currentPageIndex;
firePropertyChange(PROPERTY_CURRENT_PAGE_INDEX, oldValue, currentPageIndex);
}
public void decPageIndex() {
- if (currentPageIndex > 0) {
- setCurrentPageIndex(currentPageIndex - 1);
- }
+ setCurrentPageIndex(currentPageIndex - 1);
}
public void incPageIndex() {
- if (currentPageIndex < pages.length - 1) {
- setCurrentPageIndex(currentPageIndex + 1);
- }
+ setCurrentPageIndex(currentPageIndex + 1);
}
@Override
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-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-03-24 11:13:05 UTC (rev 21)
@@ -251,6 +251,14 @@
faxtomail.main.title.applicationName=
faxtomail.main.title.nodb=
faxtomail.message.action.running=
+faxtomail.pdfEitor.action.cancel=
+faxtomail.pdfEitor.action.cancel.tip=
+faxtomail.pdfEitor.action.validate=
+faxtomail.pdfEitor.action.validate.tip=
+faxtomail.pdfEitor.button.addCross.tip=
+faxtomail.pdfEitor.button.addNote.tip=
+faxtomail.pdfEitor.button.nextPage=
+faxtomail.pdfEitor.button.previousPage=
faxtomail.print.button.label=
faxtomail.property.get.error=
faxtomail.property.set.error=
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-21 16:34:28 UTC (rev 20)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-03-24 11:13:05 UTC (rev 21)
@@ -135,6 +135,14 @@
faxtomail.main.title.application=FaxToMail
faxtomail.main.title.applicationName=FaxToMail
faxtomail.main.title.nodb=
+faxtomail.pdfEitor.action.cancel=Annuler
+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.nextPage=Page suivante
+faxtomail.pdfEitor.button.previousPage=Page précédente
faxtomail.quantitiesByRange.button.text=OK
faxtomail.quantitiesByRange.title=Quantités par gamme
faxtomail.rangeRows.table.header.commandNumber=N° commande / devis
@@ -177,3 +185,4 @@
faxtomail.validator.error.email.demandType.required=Type de demande requis
faxtomail.validator.error.email.projectReference.required=Référence chantier requise
swing.error.cannot.open.file=
+test=
1
0
21 Mar '14
Author: kmorin
Date: 2014-03-21 17:34:28 +0100 (Fri, 21 Mar 2014)
New Revision: 20
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/20
Log:
refs #4666 [ECRAN] Pi?\195?\168ces jointes
Added:
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/util/JImagePanel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx
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/icons/action-cross.png
trunk/faxtomail-ui-swing/src/main/resources/icons/action-note.png
trunk/faxtomail-ui-swing/src/main/resources/icons/add.png
trunk/faxtomail-ui-swing/src/main/resources/icons/cross.png
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.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/util/AbstractFaxToMailUIHandler.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/attachment/AttachmentEditorUIHandler.java
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/AttachmentItem.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.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/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-03-21 16:34:28 UTC (rev 20)
@@ -248,6 +248,16 @@
<!--<artifactId>novaworx-syntax</artifactId>-->
<!--</dependency>-->
+ <dependency>
+ <groupId>com.itextpdf</groupId>
+ <artifactId>itextpdf</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>pdf-renderer</artifactId>
+ </dependency>
+
</dependencies>
<build>
@@ -745,28 +755,28 @@
</build>
</profile>
- <profile>
- <id>profiling</id>
+ <!--<profile>-->
+ <!--<id>profiling</id>-->
- <build>
- <resources>
- <resource>
- <directory>src/main/profiling</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- </resources>
- </build>
+ <!--<build>-->
+ <!--<resources>-->
+ <!--<resource>-->
+ <!--<directory>src/main/profiling</directory>-->
+ <!--<includes>-->
+ <!--<include>**/*</include>-->
+ <!--</includes>-->
+ <!--</resource>-->
+ <!--</resources>-->
+ <!--</build>-->
- <dependencies>
+ <!--<dependencies>-->
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>nuiton-profiling</artifactId>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </profile>
+ <!--<dependency>-->
+ <!--<groupId>org.nuiton</groupId>-->
+ <!--<artifactId>nuiton-profiling</artifactId>-->
+ <!--<scope>runtime</scope>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--</profile>-->
</profiles>
</project>
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -27,6 +27,15 @@
import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler;
import com.franciaflex.faxtomail.ui.swing.actions.StartAction;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailExceptionHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
+import com.itextpdf.text.*;
+import com.itextpdf.text.Image;
+import com.itextpdf.text.Rectangle;
+import com.itextpdf.text.pdf.ColumnText;
+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.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -34,6 +43,10 @@
import javax.swing.*;
import javax.swing.plaf.BorderUIResource;
import java.awt.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
import java.util.Arrays;
/**
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,148 @@
+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.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.Phrase;
+import com.itextpdf.text.Rectangle;
+import com.itextpdf.text.pdf.BaseFont;
+import com.itextpdf.text.pdf.ColumnText;
+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 javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URL;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class GenerateAnnotatedAttachmentAction extends AbstractFaxToMailAction<PDFEditorUIModel, PDFEditorUI, PDFEditorUIHandler> {
+
+ public GenerateAnnotatedAttachmentAction(PDFEditorUIHandler handler) {
+ super(handler, false);
+ }
+
+ @Override
+ public void doAction() throws Exception {
+
+ File file = getModel().getNotNullFile();
+
+ FileInputStream fis;
+ if (FaxToMailUIUtil.isFileAPDF(file)) {
+ fis = new FileInputStream(file);
+
+ } else {
+ File target = File.createTempFile("test", ".pdf");
+
+ Document document = new Document();
+ FileOutputStream fos = new FileOutputStream(target);
+ PdfWriter writer = PdfWriter.getInstance(document, fos);
+ writer.open();
+
+ URL resource = file.toURI().toURL();
+ Image image = Image.getInstance(resource);
+ Rectangle pageSize = new Rectangle(image.getWidth(), image.getHeight());
+ document.setPageSize(pageSize);
+ document.setMargins(0, 0, 0, 0);
+
+ document.open();
+ document.add(image);
+ document.close();
+ writer.close();
+
+ fis = new FileInputStream(target);
+ }
+
+ PdfReader pdfReader = new PdfReader(fis);
+
+ File target = new File(getModel().getOriginalFile().getName() + "-annoté.pdf");
+ FileOutputStream fos = new FileOutputStream(target);
+ PdfStamper pdfStamper = new PdfStamper(pdfReader, fos);
+
+ int pageNb = getModel().getPages().length;
+
+ for (int i = 0 ; i < pageNb ; i++) {
+ PdfContentByte cb = pdfStamper.getOverContent(i + 1);
+
+ for (JPanel panel : getModel().getPages()[i].getNotes()) {
+
+ Point location = panel.getLocation();
+ int width = panel.getWidth();
+ int height = panel.getHeight();
+ int x = location.x;
+ int y = getUI().getContainer().getHeight() - location.y - height;
+ Insets insets = panel.getInsets();
+
+ cb.saveState();
+ cb.setColorFill(BaseColor.YELLOW);
+ cb.rectangle(x, y, width, height);
+ cb.fill();
+ cb.restoreState();
+
+ cb.saveState();
+ JTextArea textArea = (JTextArea) panel.getComponent(0);
+ float fontSize = textArea.getFont().getSize2D();
+ cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA_OBLIQUE, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED), fontSize * 1.3f);
+
+ ColumnText ct = new ColumnText(cb);
+ 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();
+ String[] rows = text.split("\n");
+ for (String s : rows) {
+ if (s.isEmpty()) {
+ s = " ";
+ }
+ ct.addText(new Phrase(s));
+ ct.go();
+ }
+ JLabel label = (JLabel) panel.getComponent(1);
+ ct.addText(new Phrase(label.getText()));
+ ct.go();
+
+ cb.restoreState();
+ }
+
+ for (JImagePanel panel : getModel().getPages()[i].getCrosses()) {
+
+ Point location = panel.getLocation();
+ int width = panel.getWidth();
+ int height = panel.getHeight();
+ int x = location.x;
+ 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));
+ cross.scaleAbsolute(width, height);
+ cross.setAbsolutePosition(x, y);
+ cb.addImage(cross);
+ cb.restoreState();
+ }
+ }
+
+ pdfStamper.close();
+ pdfReader.close();
+
+ getModel().setEditedFile(target);
+ }
+
+
+}
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-03-21 16:34:28 UTC (rev 20)
@@ -259,3 +259,9 @@
actionIcon: reply;
enabled: { model.isValid() && model.isEditable() };
}
+
+#linkButton {
+ text: "faxtomail.demande.link.button.label";
+ actionIcon: link;
+ enabled: { model.isValid() && model.isEditable() };
+}
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-03-21 16:34:28 UTC (rev 20)
@@ -274,6 +274,7 @@
<JButton id="printButton"/>
<JButton id="archiveButton"/>
<JButton id="replyButton" onActionPerformed="handler.reply()"/>
+ <JButton id="linkButton" onActionPerformed="handler.link()"/>
</JPanel>
</JPanel>
\ No newline at end of file
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -139,7 +139,6 @@
+ "<p>This is some sample text</p>\n"
+ "<p><a href=\"http://devdaily.com/blog/\">devdaily blog</a></p>\n"
+ "<p><img src=\"http://jarnal.wikispaces.com/space/showlogo/1301230030/logo.png\"/></p>\n"
- + "<p><test>ouaf ! une chaussette :P</test></p>\n"
+ "</body>\n";
htmlString = htmlString.replaceAll("<img src=\"(.*?)\"(/>|>.*?</img>)", "[image : $1]");
@@ -375,4 +374,8 @@
model.setTo(getModel().getSender());
openFrame(dialogContent, t("faxtomail.reply.title", getModel().getObject()), new Dimension(800, 600));
}
+
+ public void link() {
+ //TODO
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -40,6 +40,7 @@
import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
import org.nuiton.jaxx.application.swing.ApplicationUI;
import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
+import org.nuiton.jaxx.application.swing.util.*;
import org.nuiton.validator.bean.simple.SimpleBeanValidator;
import javax.swing.*;
@@ -250,4 +251,5 @@
SwingUtil.center(getContext().getMainUI(), result);
result.setVisible(true);
}
+
}
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -42,6 +42,7 @@
import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
+import org.nuiton.util.FileUtil;
import javax.swing.*;
import javax.swing.event.ChangeListener;
@@ -53,6 +54,7 @@
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
@@ -152,4 +154,8 @@
}
return new int[] { pfNb, savNb };
}
+
+ public static boolean isFileAPDF(File file) {
+ return FileUtil.extension(file).toUpperCase().equals("PDF");
+ }
}
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/JImagePanel.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,90 @@
+package com.franciaflex.faxtomail.ui.swing.util;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class JImagePanel extends JPanel {
+
+ protected Image img;
+ protected Image scaledImage;
+
+ protected boolean scaleImageToFitPanel;
+
+ protected ComponentAdapter resizeAdapter = new ComponentAdapter() {
+ @Override
+ public void componentResized(ComponentEvent e) {
+ Component component = e.getComponent();
+ if (img != null) {
+ scaledImage = img.getScaledInstance(component.getWidth(), component.getHeight(), Image.SCALE_SMOOTH);
+ }
+ repaint();
+ }
+ };
+
+ public JImagePanel() {
+ setLayout(null);
+ }
+
+ public JImagePanel(Image img) {
+ this();
+ setImg(img);
+ }
+
+ public JImagePanel(String img) {
+ this(new ImageIcon(img).getImage());
+ }
+
+ public boolean isScaleImageToFitPanel() {
+ return scaleImageToFitPanel;
+ }
+
+ public void setScaleImageToFitPanel(boolean scaleImageToFitPanel) {
+ if (this.scaleImageToFitPanel != scaleImageToFitPanel) {
+ if (scaleImageToFitPanel) {
+ addComponentListener(resizeAdapter);
+ } else {
+ removeComponentListener(resizeAdapter);
+ }
+ }
+ this.scaleImageToFitPanel = scaleImageToFitPanel;
+ }
+
+ public Image getImg() {
+ return img;
+ }
+
+ public Image getScaledImage() {
+ return scaledImage;
+ }
+
+ public void setImg(String img) {
+ setImg(new ImageIcon(img).getImage());
+ }
+
+ public void setImg(Image img) {
+ this.img = img;
+ this.scaledImage = img;
+
+ Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
+ setPreferredSize(size);
+ setMinimumSize(size);
+ setMaximumSize(size);
+ setSize(size);
+ }
+
+ @Override
+ public void paintComponent(Graphics g) {
+ if (scaledImage != null) {
+ Insets insets = getInsets();
+ g.drawImage(scaledImage, insets.left, insets.top, this);
+ }
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -2,46 +2,35 @@
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl;
-import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
-import com.google.common.base.Function;
import com.google.common.collect.Iterables;
-import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.model.JaxxDefaultListModel;
+import com.google.common.collect.Lists;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections4.CollectionUtils;
-import org.jdesktop.swingx.JXList;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.HighlighterFactory;
-import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import org.jdesktop.swingx.table.TableColumnExt;
-import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
-import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
+import org.nuiton.util.FileUtil;
import javax.swing.*;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.AbstractTableModel;
-import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableColumnModel;
-import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;
import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
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;
import static org.nuiton.i18n.I18n.t;
@@ -52,6 +41,9 @@
*/
public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<AttachmentEditorUIModel, AttachmentEditorUI> {
+ public static final List<String> EDITABLE_EXTENSIONS = Lists.newArrayList("PDF", "PNG", "JPG", "JPEG", "GIF",
+ "TIF", "JP2", "BMP", "WMF", "JB2", "TXT");
+
@Override
public void afterInit(AttachmentEditorUI ui) {
@@ -150,7 +142,7 @@
File file = ui.getFile().getSelectedFile();
if (file != null) {
- attachment.setFile(file);
+ attachment.setOriginalFile(file);
getModel().addAttachment(attachment);
resetFields();
}
@@ -162,18 +154,31 @@
public void openAttachment(Attachment attachment) {
// File file = getPersistenceService().getAttachmentFile(attachment.getId());
- File file = attachment.getFile();
+ File file = attachment.getEditedFile();
+ if (file == null) {
+ file = attachment.getOriginalFile();
+ }
if (!file.exists()) {
throw new ApplicationTechnicalException(t("faxtomail.attachmentEditor.fileNotFound", file.getAbsolutePath()));
}
- Desktop desktop = FaxToMailUIUtil.getDesktopForBrowse();
- try {
- desktop.browse(file.toURI());
+ String extension = FileUtil.extension(file);
+ if (EDITABLE_EXTENSIONS.contains(extension.toUpperCase())) {
- } catch (IOException e) {
- getContext().getErrorHelper().showErrorDialog(t("swing.error.cannot.open.file"));
+ PDFEditorUI dialogContent = new PDFEditorUI(ui);
+ dialogContent.getModel().fromEntity(attachment);
+ openDialog(dialogContent, file.getName(), getContext().getMainUI().getSize());
+ dialogContent.getModel().toEntity(attachment);
+
+ } else {
+ Desktop desktop = FaxToMailUIUtil.getDesktopForBrowse();
+ try {
+ desktop.browse(file.toURI());
+
+ } catch (IOException e) {
+ getContext().getErrorHelper().showErrorDialog(t("swing.error.cannot.open.file"));
+ }
}
}
@@ -184,9 +189,11 @@
ui.setAlwaysOnTop(false);
}
int answer = JOptionPane.showConfirmDialog(ui,
- t("faxtomail.attachmentEditor.deleteAttachment.message", attachment.getFile()),
+ t("faxtomail.attachmentEditor.deleteAttachment.message",
+ attachment.getOriginalFile().getName()),
t("faxtomail.attachmentEditor.deleteAttachment.title"),
- JOptionPane.YES_NO_OPTION);
+ JOptionPane.YES_NO_OPTION
+ );
if (hackDialog) {
ui.setAlwaysOnTop(true);
}
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -78,9 +78,11 @@
firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, attachments);
}
- public void setAttachments(Collection<Attachment> attachments) {
+ public void setAttachment(Collection<Attachment> attachments) {
this.attachments.clear();
- this.attachments.addAll(attachments);
+ if (attachments != null) {
+ this.attachments.addAll(attachments);
+ }
firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, this.attachments);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-21 16:34:28 UTC (rev 20)
@@ -1,5 +1,5 @@
#attachmentNameLabel {
- text: {attachment != null ? getAttachment().getFile().getName() : null};
+ text: { attachment != null ? getAttachment().getOriginalFile().getName() : null };
}
#toolbar {
@@ -15,4 +15,5 @@
#removeAttachmentButton {
actionIcon: "delete";
toolTipText: "faxtomail.attachmentEditor.action.remove.tip";
+ enabled: { getAttachment() != null && getAttachment().getTopiaId() == null };
}
\ No newline at end of file
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.css 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,36 @@
+#toolbar {
+ floatable: false;
+ margin: {new java.awt.Insets(0, 0, 0, 5)};
+ borderPainted: false;
+}
+
+#noteButton {
+ actionIcon: note;
+}
+
+#crossButton {
+ actionIcon: cross;
+}
+
+#prevPageButton {
+ enabled: { getModel().getCurrentPageIndex() > 0 };
+ actionIcon: cross;
+}
+
+#nextPageButton {
+ enabled: { getModel().getCurrentPageIndex() < getModel().getPages().length - 1 };
+ actionIcon: cross;
+}
+
+#cancelButton {
+ actionIcon: cancel;
+ text: "faxtomail.reply.action.cancel";
+ toolTipText: "faxtomail.reply.action.cancel.tip";
+}
+
+#validateButton {
+ actionIcon: validate;
+ text: "faxtomail.reply.action.validate";
+ toolTipText: "faxtomail.reply.action.validate.tip";
+ _applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.GenerateAnnotatedAttachmentAction.class};
+}
\ No newline at end of file
Added: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUI.jaxx 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,45 @@
+<JPanel layout='{new BorderLayout()}'
+ implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<PDFEditorUIModel, PDFEditorUIHandler>'>
+
+ <import>
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI
+ com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil
+
+ com.franciaflex.faxtomail.ui.swing.util.JImagePanel
+
+ </import>
+
+ <script><![CDATA[
+
+ public PDFEditorUI(FaxToMailUI parentUI) {
+ FaxToMailUIUtil.setParentUI(this, parentUI);
+ }
+
+ ]]></script>
+
+ <PDFEditorUIModel id='model' initializer='new PDFEditorUIModel()'/>
+
+ <JToolBar id="toolbar"
+ constraints='BorderLayout.NORTH'>
+ <JButton id='noteButton'
+ onActionPerformed="handler.addNote()"/>
+ <JButton id='crossButton'
+ onActionPerformed="handler.addCross()"/>
+ <JButton id="prevPageButton"
+ onActionPerformed="getModel().decPageIndex()"/>
+ <JButton id="nextPageButton"
+ onActionPerformed="getModel().incPageIndex()"/>
+ </JToolBar>
+
+ <JScrollPane constraints='BorderLayout.CENTER'>
+ <JPanel>
+ <JImagePanel id="container">
+ </JImagePanel>
+ </JPanel>
+ </JScrollPane>
+
+ <JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
+ <JButton id='cancelButton' onActionPerformed='handler.closeDialog()'/>
+ <JButton id='validateButton'/>
+ </JPanel>
+</JPanel>
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIHandler.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,194 @@
+package com.franciaflex.faxtomail.ui.swing.util.attachment;
+
+import com.franciaflex.faxtomail.persistence.entities.Attachment;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
+import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
+import com.franciaflex.faxtomail.ui.swing.util.JImagePanel;
+import com.itextpdf.text.pdf.BaseFont;
+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;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.FileUtil;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.util.Date;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class PDFEditorUIHandler extends AbstractFaxToMailUIHandler<PDFEditorUIModel, PDFEditorUI> {
+
+ 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();
+
+ protected PDFFile pdf;
+
+ @Override
+ public void afterInit(PDFEditorUI pdfEditorUI) {
+ initUI(pdfEditorUI);
+
+ cm.setDragInsets(cr.getDragInsets());
+ cm.setEdgeInsets(new Insets(0, 0, 0, 0));
+
+ getModel().addPropertyChangeListener(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (pdf != null) {
+ int pageNb = (int) evt.getNewValue();
+ PDFPage page = pdf.getPage(pageNb +1);
+ // create the image
+ Rectangle rect = new Rectangle(0, 0, (int) page.getBBox().getWidth(),
+ (int) page.getBBox().getHeight());
+
+ Image image = page.getImage(rect.width, rect.height, // width & height
+ rect, // clip rect
+ null, // null for the ImageObserver
+ true, // fill background with white
+ true // block until drawing is done
+ );
+ getUI().getContainer().setImg(image);
+ getUI().getContainer().updateUI();
+
+ //TODO kmorin 20140321 hide the panels of the previous pages + chanegs icons + display the number of pages
+ }
+ }
+ });
+
+ getModel().addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (Attachment.PROPERTY_ORIGINAL_FILE.equals(evt.getPropertyName())
+ || Attachment.PROPERTY_EDITED_FILE.equals(evt.getPropertyName())) {
+
+ PDFEditorUIModel model = (PDFEditorUIModel) evt.getSource();
+ File file = model.getNotNullFile();
+
+ if (file != null) {
+ if (FaxToMailUIUtil.isFileAPDF(file)) {
+ getUI().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ try {
+ RandomAccessFile raf = new RandomAccessFile(file, "r");
+ FileChannel channel = raf.getChannel();
+ ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
+ pdf = new PDFFile(buf);
+
+ model.setPageNumber(pdf.getNumPages());
+ model.setCurrentPageIndex(0);
+
+ } catch (FileNotFoundException e) {
+ if (log.isErrorEnabled()) {
+ log.error("", e);
+ }
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("", e);
+ }
+ }
+ getUI().setCursor(Cursor.getDefaultCursor());
+
+ } else {
+ model.setPageNumber(1);
+ model.setCurrentPageIndex(0);
+ getUI().getContainer().setImg(file.getAbsolutePath());
+
+ }
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
+ public SwingValidator<PDFEditorUIModel> getValidator() {
+ return null;
+ }
+
+ @Override
+ public void onCloseUI() {
+
+ }
+
+ public void addNote() {
+ final JPanel panel = new JPanel(new BorderLayout());
+ panel.setBackground(Color.YELLOW);
+ panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
+
+ JTextArea textArea = new JTextArea();
+ textArea.setBorder(null);
+ textArea.setOpaque(false);
+ textArea.setBackground(null);
+ textArea.setFont(Font.decode(BaseFont.HELVETICA));
+ panel.add(textArea, BorderLayout.CENTER);
+
+ 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);
+ }
+
+ 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);
+ }
+
+ protected void addPanel(JPanel panel) {
+ ui.getContainer().add(panel, 0);
+
+ Insets insets = ui.getContainer().getInsets();
+ Dimension size = panel.getPreferredSize();
+ panel.setBounds(0 + insets.left, 0 + insets.top,
+ size.width, size.height);
+
+ ui.getContainer().updateUI();
+
+ cm.registerComponent(panel);
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/PDFEditorUIModel.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -0,0 +1,145 @@
+package com.franciaflex.faxtomail.ui.swing.util.attachment;
+
+import com.franciaflex.faxtomail.persistence.entities.Attachment;
+import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import com.franciaflex.faxtomail.ui.swing.util.JImagePanel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import javax.swing.*;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class PDFEditorUIModel extends AbstractFaxToMailBeanUIModel<Attachment, PDFEditorUIModel> {
+
+ public static final String PROPERTY_CURRENT_PAGE_INDEX = "currentPageIndex";
+
+ protected final Attachment editObject = new AttachmentImpl();
+
+ public class Page {
+
+ protected List<JPanel> notes = new ArrayList<JPanel>();
+ protected List<JImagePanel> crosses = new ArrayList<JImagePanel>();
+
+ public List<JPanel> getNotes() {
+ return notes;
+ }
+
+ public void addNote(JPanel note) {
+ notes.add(note);
+ }
+
+ public List<JImagePanel> getCrosses() {
+ return crosses;
+ }
+
+ public void addCross(JImagePanel cross) {
+ crosses.add(cross);
+ }
+
+ }
+
+ protected Page[] pages;
+
+ protected int currentPageIndex = -1;
+
+ protected static Binder<PDFEditorUIModel, Attachment> toBeanBinder =
+ BinderFactory.newBinder(PDFEditorUIModel.class,
+ Attachment.class);
+
+ protected static Binder<Attachment, PDFEditorUIModel> fromBeanBinder =
+ BinderFactory.newBinder(Attachment.class, PDFEditorUIModel.class);
+
+ public PDFEditorUIModel() {
+ super(fromBeanBinder, toBeanBinder);
+ }
+
+ public void setOriginalFile(File file) {
+ Object oldValue = getOriginalFile();
+ editObject.setOriginalFile(file);
+ firePropertyChange(Attachment.PROPERTY_ORIGINAL_FILE, oldValue, file);
+ }
+
+ public File getOriginalFile() {
+ return editObject.getOriginalFile();
+ }
+
+ public void setEditedFile(File file) {
+ Object oldValue = getEditedFile();
+ editObject.setEditedFile(file);
+ firePropertyChange(Attachment.PROPERTY_EDITED_FILE, oldValue, file);
+ }
+
+ public File getEditedFile() {
+ return editObject.getEditedFile();
+ }
+
+ public File getNotNullFile() {
+ File file = getEditedFile();
+ if (file == null) {
+ file = getOriginalFile();
+ }
+ return file;
+ }
+
+ public String getTopiaId() {
+ return editObject.getTopiaId();
+ }
+
+ public void setTopiaId(String id) {
+ Object oldValue = getTopiaId();
+ editObject.setTopiaId(id);
+ firePropertyChange(Attachment.PROPERTY_TOPIA_ID, oldValue, id);
+ }
+
+ public Page[] getPages() {
+ return pages;
+ }
+
+ public void setPageNumber(int nb) {
+ pages = new Page[nb];
+ for (int i = 0 ; i < nb ; i++) {
+ pages[i] = new Page();
+ }
+ }
+
+ public Page getCurrentPage() {
+ if (pages == null || currentPageIndex < 0 | currentPageIndex >= pages.length) {
+ return null;
+ }
+ return pages[currentPageIndex];
+ }
+
+ public int getCurrentPageIndex() {
+ return currentPageIndex;
+ }
+
+ public void setCurrentPageIndex(int currentPageIndex) {
+ Object oldValue = getCurrentPageIndex();
+ this.currentPageIndex = currentPageIndex;
+ firePropertyChange(PROPERTY_CURRENT_PAGE_INDEX, oldValue, currentPageIndex);
+ }
+
+ public void decPageIndex() {
+ if (currentPageIndex > 0) {
+ setCurrentPageIndex(currentPageIndex - 1);
+ }
+ }
+
+ public void incPageIndex() {
+ if (currentPageIndex < pages.length - 1) {
+ setCurrentPageIndex(currentPageIndex + 1);
+ }
+ }
+
+ @Override
+ protected Attachment newEntity() {
+ return new AttachmentImpl();
+ }
+}
Modified: 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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java 2014-03-21 16:34:28 UTC (rev 20)
@@ -32,7 +32,7 @@
boolean doAction = super.prepareAction();
if (doAction) {
- attachmentFile = attachment.getFile();
+ attachmentFile = attachment.getOriginalFile();
file = saveFile(
ApplicationIOUtil.getBaseName(attachmentFile.getName()),
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-03-21 16:34:28 UTC (rev 20)
@@ -125,6 +125,7 @@
faxtomail.demande.lastModificationDate.label=
faxtomail.demande.lastModified.label=
faxtomail.demande.lastModifiedBy.label=
+faxtomail.demande.link.button.label=
faxtomail.demande.mailBody.label=
faxtomail.demande.mailFolder.label=
faxtomail.demande.message.label=
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-14 17:07:36 UTC (rev 19)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-03-21 16:34:28 UTC (rev 20)
@@ -37,17 +37,19 @@
faxtomail.demande.archive.button.label=Archiver
faxtomail.demande.askCancelEditBeforeLeaving.cancelSave=L'élément n'est pas valide et ne peut être sauvé.
faxtomail.demande.askSaveBeforeLeaving.save=Vous avez modifié l'élément mais vous n'avez pas enregistré ces modifications.
-faxtomail.demande.attachment.label=
+faxtomail.demande.attachment.label=Pièces-jointes
faxtomail.demande.back.button.label=Quitter
-faxtomail.demande.client.label=
+faxtomail.demande.client.label=Client
faxtomail.demande.clientCode.label=Client
faxtomail.demande.demandStatus.label=Statut
faxtomail.demande.demandType.label=Type
+faxtomail.demande.docType.label=Type
faxtomail.demande.ediCodeNumber.label=Retour EDI
faxtomail.demande.etatAttente.label=État attente
-faxtomail.demande.fax.label=
+faxtomail.demande.fax.label=Fax
faxtomail.demande.firstOpened.label=Première ouverture
faxtomail.demande.lastModified.label=Dernière modification
+faxtomail.demande.link.button.label=Coupler
faxtomail.demande.mailBody.label=Corps du mail
faxtomail.demande.mailFolder.label=Dossier
faxtomail.demande.message.label=Message
@@ -63,6 +65,7 @@
faxtomail.demande.save.button.label=Enregistrer
faxtomail.demande.sender.label=Émetteur
faxtomail.demande.sender.manualCreation=Création manuelle
+faxtomail.demande.status.label=Statut
faxtomail.demande.takenBy.label=Pris par
faxtomail.demande.transmit.button.label=Transmettre
faxtomail.demandeList.action.archive=Archiver
Added: trunk/faxtomail-ui-swing/src/main/resources/icons/action-cross.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-swing/src/main/resources/icons/action-cross.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-swing/src/main/resources/icons/action-note.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-swing/src/main/resources/icons/action-note.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-swing/src/main/resources/icons/add.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-swing/src/main/resources/icons/add.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/faxtomail-ui-swing/src/main/resources/icons/cross.png
===================================================================
(Binary files differ)
Property changes on: trunk/faxtomail-ui-swing/src/main/resources/icons/cross.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-14 17:07:36 UTC (rev 19)
+++ trunk/pom.xml 2014-03-21 16:34:28 UTC (rev 20)
@@ -250,6 +250,12 @@
<!--<version>${xworkVersion}</version>-->
<!--</dependency>-->
+ <dependency>
+ <groupId>com.itextpdf</groupId>
+ <artifactId>itextpdf</artifactId>
+ <version>5.5.0</version>
+ </dependency>
+
<!-- librairie Jaxx -->
<dependency>
<groupId>org.nuiton.jaxx</groupId>
@@ -322,7 +328,19 @@
<version>${swingXVersion}</version>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>de.intarsys.opensource</groupId>-->
+ <!--<artifactId>jPodRenderer</artifactId>-->
+ <!--<version>5.5.1</version>-->
+ <!--</dependency>-->
+
<dependency>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>pdf-renderer</artifactId>
+ <version>1.0.5</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.0</version>
1
0
14 Mar '14
Author: kmorin
Date: 2014-03-14 18:07:36 +0100 (Fri, 14 Mar 2014)
New Revision: 19
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/19
Log:
refs #4654 [ECRAN] Liste des mails / fax
refs #4655 [ECRAN] D?\195?\169tail d'un mail / fax
Added:
trunk/faxtomail-persistence/src/main/resources/faxToMail.properties
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java
Removed:
trunk/faxtomail-persistence/src/main/resources/faxtomail.properties
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java
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.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/resources/i18n/faxtomail-service_fr_FR.properties
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.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/ShowDemandeAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.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/AttachmentEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.jaxx
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/SaveAttachmentAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItemModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.jaxx
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUIHandler.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/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
trunk/pom.xml
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,12 +1,24 @@
package com.franciaflex.faxtomail.persistence.entities;
+import static org.nuiton.i18n.I18n.n;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
*/
public enum HistoryType {
- CREATION,
- OPENING,
- MODIFICATION
+ CREATION(n("faxtomail.historyType.creation")),
+ OPENING(n("faxtomail.historyType.opening")),
+ MODIFICATION(n("faxtomail.historyType.modification"));
+
+ protected String labelKey;
+
+ private HistoryType(String labelKey) {
+ this.labelKey = labelKey;
+ }
+
+ public String getLabelKey() {
+ return labelKey;
+ }
}
Copied: trunk/faxtomail-persistence/src/main/resources/faxToMail.properties (from rev 17, trunk/faxtomail-persistence/src/main/resources/faxtomail.properties)
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/faxToMail.properties (rev 0)
+++ trunk/faxtomail-persistence/src/main/resources/faxToMail.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -0,0 +1,17 @@
+hibernate.connection.driver_class=org.h2.Driver
+hibernate.connection.url=jdbc:h2:file:/tmp/faxtomail/h2data
+hibernate.connection.username=sa
+hibernate.connection.password=
+
+hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.hbm2ddl.auto=update
+hibernate.show_sql=false
+hibernate.format_sql=true
+hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
+
+hibernate.c3p0.min_size=5
+hibernate.c3p0.max_size=20
+hibernate.c3p0.timeout=1800
+hibernate.c3p0.max_statements=50
+
+# hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
Deleted: trunk/faxtomail-persistence/src/main/resources/faxtomail.properties
===================================================================
--- trunk/faxtomail-persistence/src/main/resources/faxtomail.properties 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-persistence/src/main/resources/faxtomail.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,17 +0,0 @@
-hibernate.connection.driver_class=org.h2.Driver
-hibernate.connection.url=jdbc:h2:file:/tmp/faxtomail/h2data
-hibernate.connection.username=sa
-hibernate.connection.password=
-
-hibernate.dialect=org.hibernate.dialect.H2Dialect
-hibernate.hbm2ddl.auto=update
-hibernate.show_sql=false
-hibernate.format_sql=true
-hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
-
-hibernate.c3p0.min_size=5
-hibernate.c3p0.max_size=20
-hibernate.c3p0.timeout=1800
-hibernate.c3p0.max_statements=50
-
-# hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_en_GB.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -20,6 +20,9 @@
faxtomail.config.option.ui.showNumberEditorButton.description=
faxtomail.config.option.version.description=
faxtomail.config.parse.error=
+faxtomail.historyType.creation=
+faxtomail.historyType.modification=
+faxtomail.historyType.opening=
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -20,6 +20,9 @@
faxtomail.config.option.ui.showNumberEditorButton.description=
faxtomail.config.option.version.description=
faxtomail.config.parse.error=
+faxtomail.historyType.creation=Création
+faxtomail.historyType.modification=Modification
+faxtomail.historyType.opening=Ouverture
faxtomail.persistence.loader.error=
faxtomail.persistence.mkDir.error=
faxtomail.service.config.deleteTempDirectory.error=
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/DecoratorService.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -27,6 +27,7 @@
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.LogFactory;
import org.nuiton.decorator.Decorator;
import org.nuiton.decorator.DecoratorProvider;
@@ -34,7 +35,10 @@
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
+import java.util.List;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -12,17 +12,22 @@
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.persistence.entities.RangeRowTopiaDao;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
+import com.google.common.collect.Sets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaEntityVisitor;
import org.nuiton.topia.persistence.pager.TopiaPagerBean;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -33,10 +38,11 @@
private static final Log log = LogFactory.getLog(EmailService.class);
public Email getEmailById(String id) {
- return getPersistenceContext().getEmailDao().findByTopiaId(id);
+ Email email = getPersistenceContext().getEmailDao().findByTopiaId(id);
+ return email;
}
- public Email saveEmail(Email email, FaxToMailUser user) {
+ public Email saveEmail(Email email, FaxToMailUser user, String... modifiedFields) {
Date now = getNow();
EmailTopiaDao dao = getPersistenceContext().getEmailDao();
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
@@ -73,6 +79,7 @@
History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_FIELDS, Sets.newHashSet(modifiedFields),
History.PROPERTY_MODIFICATION_DATE, now);
email.addHistory(history);
@@ -120,7 +127,12 @@
email.addHistory(history);
if (email.getTakenBy() == null) {
+ history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
+ History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_TAKEN_BY),
+ History.PROPERTY_MODIFICATION_DATE, date);
email.setTakenBy(user);
+ email.addHistory(history);
}
email = emailDao.update(email);
@@ -137,6 +149,7 @@
HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao();
History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION,
History.PROPERTY_FAX_TO_MAIL_USER, user,
+ History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_TAKEN_BY),
History.PROPERTY_MODIFICATION_DATE, new Date());
email.addHistory(history);
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -55,6 +55,7 @@
import com.franciaflex.faxtomail.services.DecoratorService;
import com.franciaflex.faxtomail.services.FaxToMailServiceSupport;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -338,6 +339,13 @@
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_PROJECT_REFERENCE,
+ Email.PROPERTY_OBJECT,
+ Email.PROPERTY_RECEPTION_DATE,
+ Email.PROPERTY_MAIL_FOLDER,
+ Email.PROPERTY_DEMAND_STATUS),
History.PROPERTY_MODIFICATION_DATE, now);
String projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(now));
@@ -357,13 +365,20 @@
email.setDemandType(types.get(random.nextInt(types.size())));
email.setPriority(priorities.get(random.nextInt(priorities.size())));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, user);
+ getEmailService().saveEmail(email, user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
}
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -1);
Date yesterday = cal.getTime();
history = historyDao.create(History.PROPERTY_TYPE, HistoryType.CREATION,
+ History.PROPERTY_FIELDS, Sets.newHashSet(Email.PROPERTY_SENDER,
+ Email.PROPERTY_CLIENT_CODE,
+ Email.PROPERTY_PROJECT_REFERENCE,
+ Email.PROPERTY_OBJECT,
+ Email.PROPERTY_RECEPTION_DATE,
+ Email.PROPERTY_MAIL_FOLDER,
+ Email.PROPERTY_DEMAND_STATUS),
History.PROPERTY_MODIFICATION_DATE, yesterday);
projectRef = t("faxtomail.email.projectReference.default", dateDecorator.toString(yesterday));
@@ -383,7 +398,7 @@
email.setDemandType(types.get(random.nextInt(types.size())));
email.setPriority(priorities.get(random.nextInt(priorities.size())));
email.setRangeRow(rangeRows);
- getEmailService().saveEmail(email, user);
+ getEmailService().saveEmail(email, user, Email.PROPERTY_DEMAND_TYPE, Email.PROPERTY_PRIORITY, Email.PROPERTY_RANGE_ROW);
}
}
Modified: trunk/faxtomail-service/src/main/resources/i18n/faxtomail-service_fr_FR.properties
===================================================================
--- trunk/faxtomail-service/src/main/resources/i18n/faxtomail-service_fr_FR.properties 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-service/src/main/resources/i18n/faxtomail-service_fr_FR.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -1 +1,5 @@
faxtomail.email.projectReference.default=Votre demande du %s
+faxtomail.service.referential.import.clients.error=
+faxtomail.validator.error.email.clientCode.required=
+faxtomail.validator.error.email.demandType.required=
+faxtomail.validator.error.email.projectReference.required=
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -38,6 +38,7 @@
import com.franciaflex.faxtomail.services.service.MailFolderService;
import com.franciaflex.faxtomail.services.service.ReferentielService;
import com.franciaflex.faxtomail.services.service.UserService;
+import com.franciaflex.faxtomail.services.service.ValidationService;
import com.franciaflex.faxtomail.ui.swing.content.MainUI;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
import com.franciaflex.faxtomail.ui.swing.util.UIMessageNotifier;
@@ -512,6 +513,10 @@
return serviceContext.newService(DecoratorService.class);
}
+ public ValidationService getValidationService() {
+ return serviceContext.newService(ValidationService.class);
+ }
+
public MailFolderService getMailFolderService() {
return serviceContext.newService(MailFolderService.class);
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/RunFaxToMail.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -57,7 +57,7 @@
// Create configuration
FaxToMailConfiguration config =
- new FaxToMailConfiguration("faxtomail.properties", args);
+ new FaxToMailConfiguration("faxToMail.properties", args);
// Create application context
FaxToMailUIContext context = FaxToMailUIContext.newContext(config);
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,6 +1,7 @@
package com.franciaflex.faxtomail.ui.swing.actions;
import com.franciaflex.faxtomail.persistence.entities.Email;
+import com.franciaflex.faxtomail.persistence.entities.EmailImpl;
import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.ui.swing.FaxToMailScreen;
@@ -12,8 +13,12 @@
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
import com.franciaflex.faxtomail.ui.swing.content.demande.RangeTableModel;
import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntities;
+import org.nuiton.util.beans.BeanMonitor;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -32,12 +37,23 @@
DemandeUIModel model = getModel();
FaxToMailUIContext context = getContext();
- Email persistedEmail = context.getEmailService().getEmailById(model.getTopiaId());
-
+ Email persistedEmail;
+ String topiaId = model.getTopiaId();
+ if (!StringUtils.isBlank(topiaId)) {
+ persistedEmail = context.getEmailService().getEmailById(topiaId);
+ } else {
+ persistedEmail = new EmailImpl();
+ }
+
RangeTableModel rtm = (RangeTableModel) getUI().getRangeTable().getModel();
List<RangeRowModel> rows = rtm.getRows();
- Map<String, RangeRow> rangeRowsById = Maps.uniqueIndex(model.getRangeRow(), TopiaEntities.getTopiaIdFunction());
+ Collection<RangeRow> rangeRows = model.getRangeRow();
+ if (rangeRows == null) {
+ rangeRows = new ArrayList<>();
+ }
+ Map<String, RangeRow> rangeRowsById = Maps.uniqueIndex(rangeRows, TopiaEntities.getTopiaIdFunction());
+
for (RangeRowModel rangeRowModel : rows) {
if (rangeRowModel.isValid()) {
RangeRow rangeRow = rangeRowsById.get(rangeRowModel.getTopiaId());
@@ -52,7 +68,8 @@
FaxToMailUser currentUser = context.getCurrentUser();
Email email = model.toEntity(persistedEmail);
- context.getEmailService().saveEmail(email, currentUser);
+ String[] modifiedProperties = getHandler().getMonitor().getModifiedProperties();
+ context.getEmailService().saveEmail(email, currentUser, modifiedProperties);
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -74,12 +74,13 @@
break;
case JOptionPane.NO_OPTION:
- // TODO kmorin 201410305 how to set the email in readonly
+ currentEmail.setEditable(false);
break;
case JOptionPane.YES_OPTION:
- getContext().getEmailService().takeEmail(currentEmail.getTopiaId(), currentUser);
- // TODO kmorin 201410305 how to update on screen
+ Email email = getContext().getEmailService().takeEmail(currentEmail.getTopiaId(), currentUser);
+ currentEmail.fromEntity(email);
+ currentEmail.setEditable(true);
break;
}
}
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -107,6 +107,7 @@
for (Email email : emails) {
DemandeUIModel demand = new DemandeUIModel();
demand.fromEntity(email);
+ demand.setValid(isDemandeValid(demand));
demands.add(demand);
}
model.setEmails(demands);
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-03-14 17:07:36 UTC (rev 19)
@@ -23,12 +23,17 @@
showReset: false;
showDecorator: false;
bean: {model};
+ enabled: { model.isEditable() };
}
JXDatePicker {
_selectOnFocus: { true };
}
+JTextField, JXTable, BeanFilterableComboBox, #messageField, ButtonAttachment {
+ editable: { model.isEditable() };
+}
+
.rightLabel {
horizontalAlignment: { SwingConstants.RIGHT };
font-style: "italic";
@@ -70,27 +75,19 @@
#clientField {
text: {model.getClientCode()};
- _validatorLabel: { t("faxtomail.demande.client.label") };
+ _validatorLabel: { t("faxtomail.demande.clientCode.label") };
}
#docTypeLabel {
- text: "faxtomail.demande.docType.label";
+ text: "faxtomail.demande.demandType.label";
}
#docTypeComboBox {
property: demandType;
selectedItem: { model.getDemandType() };
- _validatorLabel: { t("faxtomail.demande.docType.label") };
+ _validatorLabel: { t("faxtomail.demande.demandType.label") };
}
-#ediCodeNumberLabel {
- text: "faxtomail.demande.ediCodeNumber.label";
-}
-
-#ediCodeNumberField {
- text: { model.getEdiCodeNumber() };
-}
-
#priorityLabel {
text: "faxtomail.demande.priority.label";
}
@@ -102,7 +99,7 @@
}
#statusLabel {
- text: "faxtomail.demande.status.label";
+ text: "faxtomail.demande.demandStatus.label";
}
#statusField {
@@ -190,6 +187,17 @@
text: { handler.decorate(model.getLastModificationDate()) };
}
+#ediCodeNumberLabel {
+ text: "faxtomail.demande.ediCodeNumber.label";
+ visible: { model.getEdiCodeNumber() != null };
+}
+
+#ediCodeNumberField {
+ text: { model.getEdiCodeNumber() };
+ visible: { model.getEdiCodeNumber() != null };
+}
+
+
.horizontal-separator {
text: " | ";
}
@@ -225,29 +233,29 @@
#saveButton {
text: "faxtomail.demande.save.button.label";
actionIcon: save;
- enabled: { model.isValid() };
+ enabled: { model.isValid() && model.isEditable() };
_applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAndExitAction.class };
}
#transmitButton {
text: "faxtomail.demande.transmit.button.label";
actionIcon: transmit;
- enabled: { model.isValid() };
+ enabled: { model.isValid() && model.isEditable() };
}
#printButton {
text: "faxtomail.demande.print.button.label";
actionIcon: print;
- enabled: { model.isValid() };
+ enabled: { model.isValid() && model.isEditable() };
}
#archiveButton {
text: "faxtomail.demande.archive.button.label";
- enabled: { model.isValid() };
+ enabled: { model.isValid() && model.isEditable() };
}
#replyButton {
text: "faxtomail.demande.reply.button.label";
actionIcon: reply;
- enabled: { model.isValid() };
+ enabled: { model.isValid() && model.isEditable() };
}
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-03-14 17:07:36 UTC (rev 19)
@@ -164,26 +164,7 @@
<JLabel id='statusField'/>
</cell>
</row>
- <row>
- <cell>
- <JLabel id='ediCodeNumberLabel'/>
- </cell>
- <cell weightx='1'>
- <JTextField id='ediCodeNumberField'
- onKeyReleased='handler.setText(event, "ediCodeNumber")'/>
- </cell>
- </row>
- <!--<row>-->
- <!--<cell anchor='east'>-->
- <!--<JLabel id='gammeLabel'/>-->
- <!--</cell>-->
- <!--<cell weightx='1' columns='6'>-->
- <!--<BeanFilterableComboBox id='gammeComboBox'-->
- <!--constructorParams='this'-->
- <!--genericType="Range"/>-->
- <!--</cell>-->
- <!--</row>-->
<row>
<cell>
<JLabel id="takenByLabel"/>
@@ -235,6 +216,16 @@
</cell>
</row>
+ <row>
+ <cell>
+ <JLabel id='ediCodeNumberLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JTextField id='ediCodeNumberField'
+ onKeyReleased='handler.setText(event, "ediCodeNumber")'/>
+ </cell>
+ </row>
+
</Table>
</JScrollPane>
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -48,6 +48,7 @@
import org.nuiton.jaxx.application.swing.table.MoveToPreviousEditableCellAction;
import org.nuiton.jaxx.application.swing.table.MoveToPreviousEditableRowAction;
import org.nuiton.topia.persistence.TopiaEntities;
+import org.nuiton.util.beans.BeanMonitor;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
@@ -71,8 +72,10 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -89,6 +92,8 @@
/** Logger. */
private static final Log log = LogFactory.getLog(DemandeUIHandler.class);
+ protected BeanMonitor monitor;
+
/**
* Persistence service.
*
@@ -103,6 +108,9 @@
DemandeUIModel model = getContext().getCurrentEmail();
listModelIsModify(model);
+ Set<String> propertiesToIgnore = getPropertiesToIgnore();
+ monitor = new BeanMonitor(true, propertiesToIgnore.toArray(new String[propertiesToIgnore.size()]));
+ monitor.setBean(model);
this.ui.setContextValue(model);
}
@@ -162,11 +170,15 @@
// init range model
final RangeTableModel rangeTableModel = new RangeTableModel(columnModel);
List<RangeRowModel> rangeRowModels = new ArrayList<RangeRowModel>();
- for (RangeRow rangeRow : model.getRangeRow()) {
- RangeRowModel rangeRowModel = new RangeRowModel();
- rangeRowModel.fromEntity(rangeRow);
- rangeRowModel.setValid(isRangeRowValid(rangeRowModel));
- rangeRowModels.add(rangeRowModel);
+
+ Collection<RangeRow> rangeRows = model.getRangeRow();
+ if (rangeRows != null) {
+ for (RangeRow rangeRow : rangeRows) {
+ RangeRowModel rangeRowModel = new RangeRowModel();
+ rangeRowModel.fromEntity(rangeRow);
+ rangeRowModel.setValid(isRangeRowValid(rangeRowModel));
+ rangeRowModels.add(rangeRowModel);
+ }
}
rangeTableModel.setRows(rangeRowModels);
@@ -279,18 +291,16 @@
@Override
public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
boolean result = false;
- if (adapter.isEditable()) {
- AbstractApplicationTableModel model = (AbstractApplicationTableModel) table.getModel();
- int viewRow = adapter.row;
- int modelRow = adapter.convertRowIndexToModel(viewRow);
- RangeRowModel row = (RangeRowModel) model.getEntry(modelRow);
- result = !row.isValid();
- }
+ AbstractApplicationTableModel model = (AbstractApplicationTableModel) table.getModel();
+ int viewRow = adapter.row;
+ int modelRow = adapter.convertRowIndexToModel(viewRow);
+ RangeRowModel row = (RangeRowModel) model.getEntry(modelRow);
+ result = !row.isValid();
return result;
}
};
Color color = new Color(255, 51, 51);
- table.addHighlighter(new ColorHighlighter(rowIsInvalidPredicate, color, null, color.darker(), null));
+ table.addHighlighter(new ColorHighlighter(rowIsInvalidPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
SwingValidator validator = this.ui.getValidator();
listenValidatorValid(validator, model);
@@ -308,11 +318,20 @@
}
@Override
+ protected Set<String> getPropertiesToIgnore() {
+ Set<String> result = super.getPropertiesToIgnore();
+ result.add(DemandeUIModel.PROPERTY_EDITABLE);
+ return result;
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
}
clearValidators();
+ ui.getAttachmentsButton().setSelected(false);
+ ui.getHistoryButton().setSelected(false);
}
@Override
@@ -332,6 +351,10 @@
return ui.getValidator();
}
+ public BeanMonitor getMonitor() {
+ return monitor;
+ }
+
protected boolean isRangeRowValid(RangeRowModel rangeRow) {
return (rangeRow.getProductQuantity() != null && rangeRow.getProductQuantity() > 0
|| rangeRow.getSavQuantity() != null && rangeRow.getSavQuantity() > 0)
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -23,7 +23,6 @@
*/
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;
@@ -36,7 +35,6 @@
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
-import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.attachment.AttachmentModelAware;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,7 +46,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
-import java.util.List;
import static org.nuiton.i18n.I18n.t;
@@ -62,6 +59,7 @@
public static final String PROPERTY_PF_NB = "pfNb";
public static final String PROPERTY_SAV_NB = "savNb";
+ public static final String PROPERTY_EDITABLE = "editable";
protected final Email editObject = new EmailImpl();
@@ -73,6 +71,8 @@
protected int savNb;
+ protected boolean editable = true;
+
protected static Binder<DemandeUIModel, Email> toBeanBinder =
BinderFactory.newBinder(DemandeUIModel.class,
Email.class);
@@ -113,6 +113,7 @@
setSavNb(savNb);
}
});
+
}
public Boolean getFax() {
@@ -411,6 +412,16 @@
firePropertyChange(PROPERTY_SAV_NB, oldValue, savNb);
}
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ Object oldValue = isEditable();
+ this.editable = editable;
+ firePropertyChange(PROPERTY_EDITABLE, oldValue, editable);
+ }
+
@Override
protected Email newEntity() {
return new EmailImpl();
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -6,9 +6,11 @@
import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.persistence.entities.Priority;
import com.franciaflex.faxtomail.persistence.entities.RangeRow;
+import com.franciaflex.faxtomail.services.service.ValidationService;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
import com.franciaflex.faxtomail.ui.swing.actions.ShowDemandeAction;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
+import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel;
import com.franciaflex.faxtomail.ui.swing.util.attachment.AttachmentCellEditor;
import com.franciaflex.faxtomail.ui.swing.util.attachment.AttachmentCellRenderer;
import com.google.common.base.Function;
@@ -17,12 +19,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
import org.jdesktop.swingx.decorator.Highlighter;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.decorator.Decorator;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
+import org.nuiton.validator.NuitonValidatorFactory;
+import org.nuiton.validator.NuitonValidatorResult;
import javax.swing.*;
import javax.swing.event.ChangeListener;
@@ -161,6 +167,18 @@
};
table.addHighlighter(highlighter);
+ HighlightPredicate rowIsInvalidPredicate = new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ int viewRow = adapter.row;
+ int modelRow = adapter.convertRowIndexToModel(viewRow);
+ DemandeUIModel row = tableModel.getEntry(modelRow);
+ return !row.isValid() && row.getTakenBy()!= null;
+ }
+ };
+ Color color = new Color(255, 51, 51);
+ table.addHighlighter(new ColorHighlighter(rowIsInvalidPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
+
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
JXTable table = (JXTable) evt.getSource();
@@ -188,6 +206,11 @@
context.getActionEngine().runAction(new ShowDemandeAction(context.getMainUI().getHandler()));
}
+ protected boolean isDemandeValid(DemandeUIModel d) {
+ NuitonValidatorResult result = NuitonValidatorFactory.newValidator(DemandeUIModel.class).validate(d);
+ return result.isValid();
+ }
+
public class QuantityTableCellRenderer extends DefaultTableCellRenderer {
protected Function<RangeRow, Integer> getQuantityFunction;
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentCellEditor.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -129,14 +129,14 @@
public boolean stopCellEditing() {
boolean b = super.stopCellEditing();
if (b) {
- editorButton.setBean(null);
+ editorButton.init(null);
}
return b;
}
@Override
public void cancelCellEditing() {
- editorButton.setBean(null);
+ editorButton.init(null);
super.cancelCellEditing();
}
}
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.css 2014-03-14 17:07:36 UTC (rev 19)
@@ -2,23 +2,22 @@
title: "faxtomail.attachmentEditor.title";
}
+#attachments {
+ editable: true;
+}
+
#fileLabel {
text: "faxtomail.attachmentEditor.field.file";
- labelFor: {file};
+ labelFor: { file };
}
-#fileNameLabel {
- text: "faxtomail.attachmentEditor.field.fileName";
- labelFor: {fileName};
+#file {
+ enabled: { model.isEditable() };
}
-#fileCommentLabel {
- text: "faxtomail.attachmentEditor.field.fileComment";
- labelFor: {fileComment};
-}
-
#addButton {
actionIcon: add;
toolTipText: "faxtomail.attachmentEditor.action.add.tip";
+ enabled: { model.isEditable() };
}
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUI.jaxx 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,11 +1,14 @@
<com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupUI
- superGenericType="FaxToMailUIContext, AttachmentEditorUIHandler"
+ superGenericType="AttachmentEditorUIModel, AttachmentEditorUIHandler"
id='attachmentDialog'>
<import>
- com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext
+ com.franciaflex.faxtomail.persistence.entities.Attachment
jaxx.runtime.swing.editor.FileEditor
+ jaxx.runtime.swing.model.JaxxDefaultListModel
+
+ org.jdesktop.swingx.JXTable
org.jdesktop.swingx.JXTitledPanel
javax.swing.JComponent
</import>
@@ -14,19 +17,16 @@
and the button to remove existing attachments -->
<Boolean id='editable' javaBean='true'/>
- <!-- bean property -->
- <AttachmentModelAware id='bean' javaBean='null'/>
+ <AttachmentEditorUIModel id='model'
+ initializer='new AttachmentEditorUIModel()'/>
- <FaxToMailUIContext id='model'
- initializer='getContextValue(FaxToMailUIContext.class)'/>
-
<JXTitledPanel id='body'>
<JScrollPane id='attachmentBodyScrollPane'>
<Table id='mainPanel'>
<row fill='both' weighty='1'>
<cell fill='both' weightx='1' columns='3'>
- <JPanel id='attachments' layout='{new GridLayout(0, 1)}'></JPanel>
+ <JXTable id='attachments' />
</cell>
</row>
<row fill='both'>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -3,26 +3,45 @@
import com.franciaflex.faxtomail.persistence.entities.Attachment;
import com.franciaflex.faxtomail.persistence.entities.AttachmentImpl;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.ComponentMover;
-import jaxx.runtime.swing.ComponentResizer;
+import jaxx.runtime.swing.model.JaxxDefaultListModel;
import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.jdesktop.swingx.JXList;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.HighlighterFactory;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import org.jdesktop.swingx.table.TableColumnExt;
+import org.jdesktop.swingx.table.TableColumnModelExt;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
+import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableColumnModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
+import java.awt.event.ActionListener;
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;
import static org.nuiton.i18n.I18n.t;
@@ -31,24 +50,65 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<FaxToMailUIContext, AttachmentEditorUI> {
+public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<AttachmentEditorUIModel, AttachmentEditorUI> {
@Override
- public void beforeInit(AttachmentEditorUI ui) {
- super.beforeInit(ui);
+ public void afterInit(AttachmentEditorUI ui) {
- getUI().addPropertyChangeListener(AttachmentEditorUI.PROPERTY_BEAN, new PropertyChangeListener() {
+ ui.getFile().setDialogOwner(ui);
+ super.afterInit(ui);
+
+ initTable(ui.getAttachments());
+
+ getModel().addPropertyChangeListener(AttachmentEditorUIModel.PROPERTY_ATTACHMENT, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- init();
+ AbstractTableModel tableModel = (AbstractTableModel) getUI().getAttachments().getModel();
+ tableModel.fireTableDataChanged();
}
});
}
- @Override
- public void afterInit(AttachmentEditorUI ui) {
- ui.getFile().setDialogOwner(ui);
- super.afterInit(ui);
+ protected void initTable(JXTable table) {
+
+ TableModel attachmentTableModel = new AbstractTableModel() {
+ @Override
+ public int getRowCount() {
+ return CollectionUtils.size(getModel().getAttachment());
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 1;
+ }
+
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ return Iterables.get(getModel().getAttachment(), rowIndex);
+ }
+
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return true;
+ }
+ };
+
+ attachmentTableModel.addTableModelListener(new TableModelListener() {
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ getUI().pack();
+ }
+ });
+
+ TableColumnModel columnModel = new DefaultTableColumnModel();
+ TableColumn column = new TableColumn();
+ column.setCellRenderer(new AttachmentItemRenderer());
+ column.setCellEditor(new AttachmentItemEditor());
+ columnModel.addColumn(column);
+
+ table.setModel(attachmentTableModel);
+ table.setColumnModel(columnModel);
+ table.addHighlighter(HighlighterFactory.createAlternateStriping());
}
@Override
@@ -61,24 +121,10 @@
}
@Override
- public SwingValidator<FaxToMailUIContext> getValidator() {
+ public SwingValidator<AttachmentEditorUIModel> getValidator() {
return null;
}
- public void init() {
- resetFields();
- ui.getAttachments().removeAll();
- AttachmentModelAware bean = ui.getBean();
- if (bean != null) {
- Collection<Attachment> attachments = bean.getAttachment();
- if (attachments != null) {
- for (Attachment attachment : attachments) {
- addAttachment(attachment);
- }
- }
- }
- }
-
public void place(JComponent component) {
// Computes the location of bottom left corner of the cell
Component comp = component;
@@ -100,42 +146,18 @@
}
public void addAttachment() {
- AttachmentModelAware bean = ui.getBean();
Attachment attachment = new AttachmentImpl();
File file = ui.getFile().getSelectedFile();
if (file != null) {
-// String name = ui.getFileName().getText();
-// if (StringUtils.isEmpty(name)) {
- String name = file.getName();
-// }
-// attachment.setObjectType(bean.getObjectType());
-// attachment.setObjectId(bean.getObjectId());
-// attachment.setName(name);
-// attachment.setComment(ui.getFileComment().getText());
attachment.setFile(file);
-
-// attachment = getPersistenceService().createAttachment(attachment, file);
- bean.addAttachment(attachment);
-
+ getModel().addAttachment(attachment);
resetFields();
- addAttachment(attachment);
-
- ui.pack();
}
}
- protected void addAttachment(final Attachment attachment) {
- AttachmentItem item = new AttachmentItem();
- item.setAttachment(attachment);
- item.setHandler(this);
- ui.getAttachments().add(item);
- }
-
protected void resetFields() {
ui.getFile().setSelectedFilePath(null);
-// ui.getFileName().setText("");
-// ui.getFileComment().setText("");
}
public void openAttachment(Attachment attachment) {
@@ -155,14 +177,6 @@
}
}
- public void saveAttachment(Attachment attachment) {
-
- SaveAttachmentAction action = getContext().getActionFactory().createLogicAction(
- this, SaveAttachmentAction.class);
- action.setAttachment(attachment);
- getContext().getActionEngine().runAction(action);
- }
-
public void removeAttachment(AttachmentItem attachmentItem) {
Attachment attachment = attachmentItem.getAttachment();
boolean hackDialog = ui.isAlwaysOnTop();
@@ -178,13 +192,56 @@
}
if (answer == JOptionPane.YES_OPTION) {
- AttachmentModelAware bean = ui.getBean();
// getPersistenceService().deleteAttachment(attachment.getId());
- bean.removeAttachment(attachment);
- ui.getAttachments().remove(attachmentItem);
+ getModel().removeAttachment(attachment);
ui.pack();
}
}
+
+ protected class AttachmentItemRenderer extends AttachmentItem implements TableCellRenderer {
+
+ public AttachmentItemRenderer() {
+ setHandler(AttachmentEditorUIHandler.this);
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ Attachment attachment = (Attachment) value;
+ setAttachment(attachment);
+ return this;
+ }
+ }
+
+ protected class AttachmentItemEditor extends AbstractCellEditor implements TableCellEditor {
+
+ protected AttachmentItem attachmentItem;
+
+ public AttachmentItemEditor() {
+ attachmentItem = new AttachmentItem();
+ attachmentItem.setHandler(AttachmentEditorUIHandler.this);
+ }
+
+ public Component getTableCellEditorComponent(JTable table, Object value,
+ boolean isSelected, int row, int column) {
+ Attachment attachment = (Attachment) value;
+ attachmentItem.setAttachment(attachment);
+ return attachmentItem;
+ }
+
+ @Override
+ public Object getCellEditorValue() {
+ return attachmentItem.getAttachment();
+ }
+
+ public boolean stopCellEditing() {
+ return super.stopCellEditing();
+ }
+
+ protected void fireEditingStopped() {
+ super.fireEditingStopped();
+ }
+ }
+
}
Added: 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 (rev 0)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentEditorUIModel.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -0,0 +1,91 @@
+package com.franciaflex.faxtomail.ui.swing.util.attachment;
+
+import com.franciaflex.faxtomail.persistence.entities.Attachment;
+import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<AttachmentModelAware, AttachmentEditorUIModel>
+ implements AttachmentModelAware {
+
+ public static final String PROPERTY_FILE = "file";
+ public static final String PROPERTY_EDITABLE = "editable";
+
+ protected File file;
+ protected boolean editable = true;
+
+ protected final Collection<Attachment> attachments = new ArrayList<Attachment>();
+
+ protected static Binder<AttachmentEditorUIModel, AttachmentModelAware> toBeanBinder =
+ BinderFactory.newBinder(AttachmentEditorUIModel.class,
+ AttachmentModelAware.class);
+
+ protected static Binder<AttachmentModelAware, AttachmentEditorUIModel> fromBeanBinder =
+ BinderFactory.newBinder(AttachmentModelAware.class, AttachmentEditorUIModel.class);
+
+ protected AttachmentEditorUIModel() {
+ super(fromBeanBinder, toBeanBinder);
+ }
+
+ public File getFile() {
+ return file;
+ }
+
+ public void setFile(File file) {
+ Object oldValue = getFile();
+ this.file = file;
+ firePropertyChange(PROPERTY_FILE, oldValue, file);
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ Object oldValue = isEditable();
+ this.editable = editable;
+ firePropertyChange(PROPERTY_EDITABLE, oldValue, editable);
+ }
+
+ @Override
+ public Collection<Attachment> getAttachment() {
+ return attachments;
+ }
+
+ @Override
+ public void addAllAttachment(Collection<Attachment> attachments) {
+ this.attachments.addAll(attachments);
+ firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, this.attachments);
+ }
+
+ @Override
+ public void addAttachment(Attachment attachment) {
+ attachments.add(attachment);
+ firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, attachments);
+ }
+
+ @Override
+ public void removeAttachment(Attachment attachment) {
+ attachments.remove(attachment);
+ firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, attachments);
+ }
+
+ public void setAttachments(Collection<Attachment> attachments) {
+ this.attachments.clear();
+ this.attachments.addAll(attachments);
+ firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, null, this.attachments);
+ }
+
+ @Override
+ protected AttachmentModelAware newEntity() {
+ return null;
+ }
+}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.css 2014-03-14 17:07:36 UTC (rev 19)
@@ -12,11 +12,6 @@
toolTipText: "faxtomail.attachmentEditor.action.open.tip";
}
-#saveAttachmentButton {
- actionIcon: "import";
- toolTipText: "faxtomail.attachmentEditor.action.save.tip";
-}
-
#removeAttachmentButton {
actionIcon: "delete";
toolTipText: "faxtomail.attachmentEditor.action.remove.tip";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.jaxx 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/AttachmentItem.jaxx 2014-03-14 17:07:36 UTC (rev 19)
@@ -15,8 +15,6 @@
<JToolBar id='toolbar' constraints='BorderLayout.EAST'>
<JButton id='openAttachmentButton'
onActionPerformed='handler.openAttachment(attachment)'/>
- <JButton id='saveAttachmentButton'
- onActionPerformed='handler.saveAttachment(attachment)'/>
<JButton id='removeAttachmentButton'
onActionPerformed='handler.removeAttachment(this)'/>
</JToolBar>
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/ButtonAttachment.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -30,11 +30,17 @@
*/
public class ButtonAttachment extends AbstractToolbarPopupButton<AttachmentEditorUI> {
- private transient PropertyChangeListener listenAttachmentsChanged;
public ButtonAttachment(AttachmentModelAware model) {
setToolTipText(t("faxtomail.attachmentEditor.action.tip"));
- setBean(model);
+ 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);
}
@Override
@@ -52,47 +58,17 @@
return t("faxtomail.attachmentEditor.text", attachmentNb);
}
- public void init() {
- popup.getHandler().init();
- }
-
public void init(AttachmentModelAware model) {
- setBean(model);
- init();
+ popup.getModel().fromEntity(model);
+ setText(getButtonText(model != null ? model.getAttachment() : null));
}
public AttachmentModelAware getBean() {
- return popup.getBean();
+ return popup.getModel();
}
- protected void setBean(AttachmentModelAware model) {
- AttachmentModelAware bean = popup.getBean();
- if (bean != null) {
- ((AbstractSerializableBean) bean).removePropertyChangeListener(AttachmentModelAware.PROPERTY_ATTACHMENT, getListenAttachmentsChanged());
- }
- popup.setBean(model);
-
- if (model != null) {
-
- ((AbstractSerializableBean) model).addPropertyChangeListener(AttachmentModelAware.PROPERTY_ATTACHMENT, getListenAttachmentsChanged());
- Collection<Attachment> attachments = model.getAttachment();
- setText(ButtonAttachment.getButtonText(attachments));
- }
+ public void setEditable(boolean editable) {
+ popup.getModel().setEditable(editable);
}
- protected PropertyChangeListener getListenAttachmentsChanged() {
- if (listenAttachmentsChanged == null) {
- listenAttachmentsChanged = new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- List<Attachment> attachment = (List<Attachment>) evt.getNewValue();
- setText(getButtonText(attachment));
- if (!popup.isVisible()) {
- init();
- }
- }
- };
- }
- return listenAttachmentsChanged;
- }
}
Modified: 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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/attachment/SaveAttachmentAction.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -15,7 +15,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 2.4
*/
-public class SaveAttachmentAction extends AbstractFaxToMailAction<FaxToMailUIContext, AttachmentEditorUI, AttachmentEditorUIHandler> {
+public class SaveAttachmentAction extends AbstractFaxToMailAction<AttachmentEditorUIModel, AttachmentEditorUI, AttachmentEditorUIHandler> {
private Attachment attachment;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.css 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.css 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,8 +1,20 @@
+#historyItemPanel {
+ border: { BorderFactory.createEmptyBorder(2, 3, 2, 3) };
+}
+
#type {
- text : { JAXXUtil.getStringValue(model.getType()) };
+ text : { JAXXUtil.getStringValue(model.getType().getLabelKey()) };
font-weight: "bold";
}
+#fields {
+ text : { handler.decorateFields(model.getFields()) };
+}
+
+#data {
+ opaque: false;
+}
+
#userLabel {
text : "faxtomail.common.by.label";
font-style: "italic";
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.jaxx 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItem.jaxx 2014-03-14 17:07:36 UTC (rev 19)
@@ -11,20 +11,22 @@
static jaxx.runtime.JAXXUtil.getStringValue
</import>
- <HistoryItemModel id='model' initializer="new HistoryItemModel(getContextValue(History.class))" />
+ <HistoryItemModel id='model' initializer="new HistoryItemModel()" />
<HistoryListUIHandler id="handler" initializer="getContextValue(HistoryListUIHandler.class)" />
<script><![CDATA[
-public HistoryItem(History history, HistoryListUIHandler handler) {
- setContextValue(history);
+public HistoryItem(HistoryListUIHandler handler) {
setContextValue(handler);
}
]]></script>
<JLabel id='type'/>
- <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}">
+ <JLabel id='fields'/>
+
+ <JPanel id="data"
+ layout="{new FlowLayout(FlowLayout.LEADING)}">
<JLabel id='userLabel'/>
<JLabel id='user'/>
<JLabel id='dateLabel'/>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItemModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItemModel.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryItemModel.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -6,12 +6,18 @@
import com.franciaflex.faxtomail.persistence.entities.HistoryImpl;
import com.franciaflex.faxtomail.persistence.entities.HistoryType;
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel;
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
+import java.util.List;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
@@ -27,9 +33,8 @@
protected final History editObject = new HistoryImpl();
- public HistoryItemModel(History history) {
+ public HistoryItemModel() {
super(fromBeanBinder, toBeanBinder);
- fromEntity(history);
}
public HistoryType getType() {
@@ -42,6 +47,15 @@
firePropertyChanged(History.PROPERTY_TYPE, oldValue, type);
}
+ public void setFields(Collection<String> fields) {
+ editObject.setFields(fields);
+ firePropertyChanged(History.PROPERTY_FIELDS, null, fields);
+ }
+
+ public Collection<String> getFields() {
+ return editObject.getFields();
+ }
+
public Date getModificationDate() {
return editObject.getModificationDate();
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.css 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.css 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,3 +1,7 @@
#body {
title: "faxtomail.historyList.title";
}
+
+#histories {
+ enabled: false;
+}
\ No newline at end of file
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.jaxx
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.jaxx 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUI.jaxx 2014-03-14 17:07:36 UTC (rev 19)
@@ -3,6 +3,7 @@
id='historyListDialog'>
<import>
+ org.jdesktop.swingx.JXList
org.jdesktop.swingx.JXTitledPanel
</import>
@@ -11,7 +12,7 @@
<JXTitledPanel id='body'>
<JScrollPane id='attachmentBodyScrollPane'>
- <JPanel id='histories' layout='{new GridLayout(0, 1)}'></JPanel>
+ <JXList id='histories' />
</JScrollPane>
</JXTitledPanel>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUIHandler.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/history/HistoryListUIHandler.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -1,19 +1,30 @@
package com.franciaflex.faxtomail.ui.swing.util.history;
-import com.franciaflex.faxtomail.persistence.entities.Email;
import com.franciaflex.faxtomail.persistence.entities.History;
import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel;
-import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler;
-import jaxx.runtime.JAXXUtil;
+import com.google.common.collect.Iterables;
+import jaxx.runtime.swing.model.JaxxDefaultListModel;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXList;
+import org.jdesktop.swingx.decorator.HighlighterFactory;
+import org.nuiton.util.StringUtil;
import javax.swing.*;
+import javax.swing.text.Highlighter;
import java.awt.*;
-import java.util.Collection;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.*;
+import java.util.List;
+import static org.nuiton.i18n.I18n.n;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
@@ -22,6 +33,25 @@
private final static Log log = LogFactory.getLog(HistoryListUIHandler.class);
+ static {
+ n("faxtomail.demande.receptionDate.label");
+ n("faxtomail.demande.ediCodeNumber.label");
+ n("faxtomail.demande.projectReference.label");
+ n("faxtomail.demande.sender.label");
+ n("faxtomail.demande.fax.label");
+ n("faxtomail.demande.recipient.label");
+ n("faxtomail.demande.object.label");
+ n("faxtomail.demande.clientCode.label");
+ n("faxtomail.demande.mailFolder.label");
+ n("faxtomail.demande.attachment.label");
+ n("faxtomail.demande.demandStatus.label");
+ n("faxtomail.demande.demandType.label");
+ n("faxtomail.demande.priority.label");
+ n("faxtomail.demande.etatAttente.label");
+ n("faxtomail.demande.takenBy.label");
+ n("faxtomail.demande.rangeRow.label");
+ }
+
@Override
public void beforeInit(HistoryListUI ui) {
super.beforeInit(ui);
@@ -37,13 +67,12 @@
public void afterInit(HistoryListUI ui) {
super.afterInit(ui);
- Collection<History> histories = getModel().getHistory();
- if (histories != null) {
- for (History history : histories) {
- HistoryItem item = new HistoryItem(history, this);
- ui.getHistories().add(item);
- }
- }
+ JXList list = ui.getHistories();
+ list.setCellRenderer(new HistoryListCellRenderer());
+ JaxxDefaultListModel listModel = new JaxxDefaultListModel<History>();
+ listModel.setAllElements(getModel().getHistory());
+ list.setModel(listModel);
+ list.addHighlighter(HighlighterFactory.createAlternateStriping());
}
@Override
@@ -59,4 +88,43 @@
protected JComponent getComponentToFocus() {
return null;
}
+
+ public String decorateFields(Collection<String> fields) {
+ List<String> fieldLabels = new ArrayList<String>();
+ if (fields != null) {
+ for (String field : fields) {
+ fieldLabels.add(t("faxtomail.demande." + field + ".label"));
+ }
+ }
+ return StringUtils.join(fieldLabels, ", ");
+ }
+
+ protected class HistoryListCellRenderer extends HistoryItem
+ implements ListCellRenderer {
+
+ public HistoryListCellRenderer() {
+ super(HistoryListUIHandler.this);
+
+ getModel().addPropertyChangeListener(History.PROPERTY_FIELDS, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getNewValue() != null) {
+ add(getFields(), 1);
+ } else {
+ remove(getFields());
+ }
+ }
+ });
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ History history = (History) value;
+ getModel().fromEntity(history);
+ if (CollectionUtils.isEmpty(getModel().getFields())) {
+ remove(getFields());
+ }
+ return this;
+ }
+ }
}
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -103,22 +103,30 @@
faxtomail.demande.archive.button.mnemonic=
faxtomail.demande.askCancelEditBeforeLeaving.cancelSave=
faxtomail.demande.askSaveBeforeLeaving.save=
+faxtomail.demande.attachment.label=
faxtomail.demande.back.button.label=
faxtomail.demande.back.button.mnemonic=
faxtomail.demande.client.label=
+faxtomail.demande.clientCode.label=
+faxtomail.demande.demandStatus.label=
+faxtomail.demande.demandType.label=
faxtomail.demande.demandeNumber.label=
+faxtomail.demande.demandeType.label=
faxtomail.demande.docType.label=
faxtomail.demande.ediCodeNumber.label=
faxtomail.demande.etatAttente.label=
+faxtomail.demande.fax.label=
faxtomail.demande.finishedProducts.label=
faxtomail.demande.firstOpened.label=
faxtomail.demande.firstOpenedBy.label=
faxtomail.demande.firstOpeningDate.label=
faxtomail.demande.gamme.label=
+faxtomail.demande.history.label=
faxtomail.demande.lastModificationDate.label=
faxtomail.demande.lastModified.label=
faxtomail.demande.lastModifiedBy.label=
faxtomail.demande.mailBody.label=
+faxtomail.demande.mailFolder.label=
faxtomail.demande.message.label=
faxtomail.demande.object.label=
faxtomail.demande.print.button.label=
@@ -126,8 +134,12 @@
faxtomail.demande.priority.label=
faxtomail.demande.projectReference.default=
faxtomail.demande.projectReference.label=
+faxtomail.demande.rangeRow.label=
faxtomail.demande.received.label=
faxtomail.demande.receivedDate.label=
+faxtomail.demande.receptionDate=
+faxtomail.demande.receptionDate.label=
+faxtomail.demande.recipient.label=
faxtomail.demande.ref.label=
faxtomail.demande.reply.button.label=
faxtomail.demande.reply.button.mnemonic=
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-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-03-14 17:07:36 UTC (rev 19)
@@ -37,25 +37,32 @@
faxtomail.demande.archive.button.label=Archiver
faxtomail.demande.askCancelEditBeforeLeaving.cancelSave=L'élément n'est pas valide et ne peut être sauvé.
faxtomail.demande.askSaveBeforeLeaving.save=Vous avez modifié l'élément mais vous n'avez pas enregistré ces modifications.
+faxtomail.demande.attachment.label=
faxtomail.demande.back.button.label=Quitter
-faxtomail.demande.client.label=Client
-faxtomail.demande.docType.label=Type
+faxtomail.demande.client.label=
+faxtomail.demande.clientCode.label=Client
+faxtomail.demande.demandStatus.label=Statut
+faxtomail.demande.demandType.label=Type
faxtomail.demande.ediCodeNumber.label=Retour EDI
faxtomail.demande.etatAttente.label=État attente
+faxtomail.demande.fax.label=
faxtomail.demande.firstOpened.label=Première ouverture
faxtomail.demande.lastModified.label=Dernière modification
faxtomail.demande.mailBody.label=Corps du mail
+faxtomail.demande.mailFolder.label=Dossier
faxtomail.demande.message.label=Message
faxtomail.demande.object.label=Objet
faxtomail.demande.print.button.label=Imprimer
faxtomail.demande.priority.label=Priorité
faxtomail.demande.projectReference.label=Référence chantier
+faxtomail.demande.rangeRow.label=Gammes
faxtomail.demande.receivedDate.label=Reçu le
+faxtomail.demande.receptionDate.label=Date de réception
+faxtomail.demande.recipient.label=Destinataire
faxtomail.demande.reply.button.label=Répondre
faxtomail.demande.save.button.label=Enregistrer
faxtomail.demande.sender.label=Émetteur
faxtomail.demande.sender.manualCreation=Création manuelle
-faxtomail.demande.status.label=Statut
faxtomail.demande.takenBy.label=Pris par
faxtomail.demande.transmit.button.label=Transmettre
faxtomail.demandeList.action.archive=Archiver
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/FaxToMailApplicationContext.java 2014-03-14 17:07:36 UTC (rev 19)
@@ -25,7 +25,7 @@
public static FaxToMailConfiguration getApplicationConfig() {
if (applicationConfig == null) {
- applicationConfig = new FaxToMailConfiguration("faxtomail.properties");
+ applicationConfig = new FaxToMailConfiguration("faxToMail.properties");
}
return applicationConfig;
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-12 18:14:43 UTC (rev 18)
+++ trunk/pom.xml 2014-03-14 17:07:36 UTC (rev 19)
@@ -83,7 +83,7 @@
<nuitonCsvVersion>3.0-alpha-3</nuitonCsvVersion>
<nuitonDecoratorVersion>3.0-alpha-3</nuitonDecoratorVersion>
<nuitonUpdaterVersion>3.0-alpha-2</nuitonUpdaterVersion>
- <nuitonUtilsVersion>3.0-rc-2</nuitonUtilsVersion>
+ <nuitonUtilsVersion>3.0-SNAPSHOT</nuitonUtilsVersion>
<nuitonValidatorVersion>3.0-alpha-3</nuitonValidatorVersion>
<nuitonWebVersion>1.15-alpha-3</nuitonWebVersion>
1
0