branch pollen-udpate-1.6 created (now 12a68bb)
This is an automated email from the git hooks/post-receive script. New change to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git at 12a68bb Update jfreechart This branch includes the following new commits: new 50c50d5 Add dev mode case for i18n init new 132c8cb Fix javadoc new 20ce604 Update h2 new ffbb889 Udpate selenium new 6dd7118 Update slf4j new ebffdd4 Update shiro new b045c28 Update commons-email new 6b590d2 Update commons-lang3 new 6e0be32 Update guava new 699a3c4 Update commons-collections4 new 966dbf6 Update hibernate new fd2f225 Fix hibernate-c3p0 as runtime new 038eccd Update javax.mail new a730c1d Update mockito new db013f6 Update junit new 7ff845d fixes #1307: Drop tomcat 6 support Update nuiton-web, nuiton-utils, nuiton-i18n (nightmare :( ) new f84fd99 Copy TransactionFilter for compatibility with topia 2 new 730e259 Update topia, eugene, hibernate (4.3) new 28290a9 Update postgresql new b2970d9 Replace deprecated i18n methods new 53ec7cc Update postgresql new b4a95b9 Update struts, struts-jquery-plugin new 124bd37 Fix jquery attr/prop change (1.6+) new 12a68bb Update jfreechart The 24 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 12a68bb5e6e5a72ecff5810ed3420b76b42efad2 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:21:40 2015 +0100 Update jfreechart commit 124bd373650585f228851edca37a2fad38309c1d Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:16:18 2015 +0100 Fix jquery attr/prop change (1.6+) commit b4a95b9a32fbebc0128272090484611f9a584363 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:06:09 2015 +0100 Update struts, struts-jquery-plugin commit 53ec7cc8b3c0d2d70c353711f2569bd07ba938a8 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:38:42 2015 +0100 Update postgresql commit b2970d948b4a79cf45f6eb5c299670cc438fd73c Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:36:37 2015 +0100 Replace deprecated i18n methods commit 28290a9dff795355e78b63b76683feba8bbf0afd Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:27:48 2015 +0100 Update postgresql commit 730e2599473f37c7041e119867904592214663e7 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:22:54 2015 +0100 Update topia, eugene, hibernate (4.3) commit f84fd9971947d97739e6354e7fb0c25109c3dd3c Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 23:37:00 2015 +0100 Copy TransactionFilter for compatibility with topia 2 commit 7ff845dfa4c0c477a2e4788cb60b09361d119f03 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 23:36:00 2015 +0100 fixes #1307: Drop tomcat 6 support Update nuiton-web, nuiton-utils, nuiton-i18n (nightmare :( ) commit db013f6a77467081a164cbcd747520cd45cfeea9 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:18:21 2015 +0100 Update junit commit a730c1d7566cceba653854aebc8540c66cd4d469 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:17:41 2015 +0100 Update mockito commit 038eccd543445909a9a78484763133cedf702ed1 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:15:40 2015 +0100 Update javax.mail commit fd2f225d861d1e25c7c6b418d99f77d08902654f Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:06:26 2015 +0100 Fix hibernate-c3p0 as runtime commit 966dbf6482aad4f068a1cbdd0ea687743514f047 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:00:13 2015 +0100 Update hibernate commit 699a3c4ed0548357a9fd1d994bc57f5d31514eef Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 20:48:52 2015 +0100 Update commons-collections4 commit 6e0be32c38dd2cf597ddee1aec6e214c71e70a20 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 20:27:26 2015 +0100 Update guava commit 6b590d20ff4e869752668f37e71667a47257fba5 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 20:23:22 2015 +0100 Update commons-lang3 commit b045c28a4414530d761254d8ec271b057443cad6 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 20:22:51 2015 +0100 Update commons-email commit ebffdd4f6d32d5abbbf9c38a66b1603ff582fb87 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 20:00:03 2015 +0100 Update shiro commit 6dd71181dd2bb9f71fde7322d0fcc244d8936b6b Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 19:52:08 2015 +0100 Update slf4j commit ffbb8890760860b37ed4931f9fe0dfc546a87288 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 19:48:21 2015 +0100 Udpate selenium commit 20ce604599e6d149163310dc8128d01f89d658c2 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 19:42:20 2015 +0100 Update h2 commit 132c8cb77966f5ef8fe57841ed6ab17a3c2868bc Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 19:38:08 2015 +0100 Fix javadoc commit 50c50d5adc9a712d3fb97a987fddc886d2c21f06 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 19:37:55 2015 +0100 Add dev mode case for i18n init -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 966dbf6482aad4f068a1cbdd0ea687743514f047 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:00:13 2015 +0100 Update hibernate --- pollen-persistence/pom.xml | 5 +++++ pollen-persistence/src/test/resources/db.properties | 8 +++++++- pollen-services/pom.xml | 4 ++++ pollen-services/src/test/resources/pollen-fake.properties | 8 +++++++- pollen-ui-struts2/src/test/resources/pollen-it.properties | 8 +++++++- pom.xml | 8 +++++++- 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index eacf3e9..e473e34 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -64,6 +64,11 @@ <artifactId>hibernate-core</artifactId> </dependency> <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-c3p0</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency> diff --git a/pollen-persistence/src/test/resources/db.properties b/pollen-persistence/src/test/resources/db.properties index 6d65c2a..e5d8eeb 100644 --- a/pollen-persistence/src/test/resources/db.properties +++ b/pollen-persistence/src/test/resources/db.properties @@ -4,7 +4,7 @@ # $Id$ # $HeadURL$ # %% -# Copyright (C) 2009 - 2012 CodeLutin +# Copyright (C) 2009 - 2015 CodeLutin # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -26,3 +26,9 @@ hibernate.dialect=org.hibernate.dialect.H2Dialect hibernate.connection.username=sa hibernate.connection.password=sa hibernate.connection.driver_class=org.h2.Driver + +hibernate.c3p0.min_size=5 +hibernate.c3p0.max_size=20 +hibernate.c3p0.timeout=300 +hibernate.c3p0.max_statements=50 +hibernate.c3p0.idle_test_period=3000 diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index d231676..6676f02 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -67,6 +67,10 @@ <artifactId>hibernate-core</artifactId> </dependency> <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-c3p0</artifactId> + </dependency> + <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </dependency> diff --git a/pollen-services/src/test/resources/pollen-fake.properties b/pollen-services/src/test/resources/pollen-fake.properties index d2673a8..40601fe 100644 --- a/pollen-services/src/test/resources/pollen-fake.properties +++ b/pollen-services/src/test/resources/pollen-fake.properties @@ -4,7 +4,7 @@ # $Id$ # $HeadURL$ # %% -# Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit +# Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -28,6 +28,12 @@ hibernate.connection.username=sa hibernate.connection.password= hibernate.connection.driver_class=org.h2.Driver +hibernate.c3p0.min_size=5 +hibernate.c3p0.max_size=20 +hibernate.c3p0.timeout=300 +hibernate.c3p0.max_statements=50 +hibernate.c3p0.idle_test_period=300 + # Migration configuration topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine topia.service.migration.callback=org.chorem.pollen.entities.migration.PollenMigrationCallback diff --git a/pollen-ui-struts2/src/test/resources/pollen-it.properties b/pollen-ui-struts2/src/test/resources/pollen-it.properties index a9c0ee5..42c5ec6 100644 --- a/pollen-ui-struts2/src/test/resources/pollen-it.properties +++ b/pollen-ui-struts2/src/test/resources/pollen-it.properties @@ -4,7 +4,7 @@ # $Id$ # $HeadURL$ # %% -# Copyright (C) 2009 - 2012 CodeLutin +# Copyright (C) 2009 - 2015 CodeLutin # %% # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -36,6 +36,12 @@ hibernate.connection.url=jdbc:h2:file:${pollen.dataDirectory}/db/pollendb hibernate.show_sql=false hibernate.hbm2ddl.auto=update +hibernate.c3p0.min_size=5 +hibernate.c3p0.max_size=20 +hibernate.c3p0.timeout=300 +hibernate.c3p0.max_statements=50 +hibernate.c3p0.idle_test_period=300 + # Database migration configuration topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine topia.service.migration.callback=org.chorem.pollen.entities.migration.PollenMigrationCallback diff --git a/pom.xml b/pom.xml index 5edf763..4b9f63e 100644 --- a/pom.xml +++ b/pom.xml @@ -174,7 +174,7 @@ <slf4jVersion>1.7.13</slf4jVersion> <jettyVersion>8.1.11.v20130520</jettyVersion> <!--jettyVersion>${jettyPluginVersion}</jettyVersion--> - <hibernateVersion>4.2.1.Final</hibernateVersion> + <hibernateVersion>4.2.21.Final</hibernateVersion> <seleniumVersion>2.48.2</seleniumVersion> <mockitoVersion>1.9.5</mockitoVersion> @@ -282,6 +282,12 @@ <artifactId>hibernate-core</artifactId> <version>${hibernateVersion}</version> </dependency> + + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-c3p0</artifactId> + <version>${hibernateVersion}</version> + </dependency> <dependency> <groupId>postgresql</groupId> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit fd2f225d861d1e25c7c6b418d99f77d08902654f Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:06:26 2015 +0100 Fix hibernate-c3p0 as runtime --- pollen-services/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index 6676f02..64dcac4 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -69,6 +69,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-c3p0</artifactId> + <scope>runtime</scope> </dependency> <dependency> <groupId>javax.mail</groupId> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 038eccd543445909a9a78484763133cedf702ed1 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:15:40 2015 +0100 Update javax.mail --- pollen-services/pom.xml | 4 ++-- pom.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index 64dcac4..b7db58f 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -72,8 +72,8 @@ <scope>runtime</scope> </dependency> <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> + <groupId>com.sun.mail</groupId> + <artifactId>javax.mail</artifactId> </dependency> <dependency> <groupId>rome</groupId> diff --git a/pom.xml b/pom.xml index 4b9f63e..9a85d05 100644 --- a/pom.xml +++ b/pom.xml @@ -451,9 +451,9 @@ <!-- Others --> <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - <version>1.4.7</version> + <groupId>com.sun.mail</groupId> + <artifactId>javax.mail</artifactId> + <version>1.5.4</version> </dependency> <dependency> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit a730c1d7566cceba653854aebc8540c66cd4d469 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:17:41 2015 +0100 Update mockito --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a85d05..d7ef589 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ <!--jettyVersion>${jettyPluginVersion}</jettyVersion--> <hibernateVersion>4.2.21.Final</hibernateVersion> <seleniumVersion>2.48.2</seleniumVersion> - <mockitoVersion>1.9.5</mockitoVersion> + <mockitoVersion>1.10.19</mockitoVersion> <httpCommonsHttpclientVersion>4.3</httpCommonsHttpclientVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit db013f6a77467081a164cbcd747520cd45cfeea9 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 21:18:21 2015 +0100 Update junit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d7ef589..8912381 100644 --- a/pom.xml +++ b/pom.xml @@ -544,7 +544,7 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> + <version>4.12</version> <scope>test</scope> </dependency> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 7ff845dfa4c0c477a2e4788cb60b09361d119f03 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 23:36:00 2015 +0100 fixes #1307: Drop tomcat 6 support Update nuiton-web, nuiton-utils, nuiton-i18n (nightmare :( ) --- pollen-persistence/pom.xml | 4 ++ .../pollen/PollenApplicationConfigProvider.java | 17 ++--- .../org/chorem/pollen/PollenConfiguration.java | 29 +++++---- .../chorem/pollen/PollenConfigurationOption.java | 76 +++++++++++----------- pollen-services/pom.xml | 2 +- pollen-ui-struts2/pom.xml | 23 ++----- pollen-ui-struts2/src/it/createPoll/pom.xml | 2 +- .../src/it/createPoll/src/jetty/jetty-context.xml | 4 +- .../src/jetty/jetty-context.xml | 4 +- .../pollVoteVisibility/src/jetty/jetty-context.xml | 4 +- pollen-ui-struts2/src/it/pollen-ui-it/pom.xml | 11 ++-- .../src/it/security/src/jetty/jetty-context.xml | 4 +- pollen-ui-struts2/src/jetty/jetty-context.xml | 4 +- .../pollen/ui/PollenTopiaTransactionFilter.java | 1 - .../pollen/ui/actions/PollenActionSupport.java | 27 ++++---- .../chorem/pollen/ui/actions/admin/DeleteUser.java | 6 +- .../pollen/ui/actions/admin/ManageUsers.java | 26 ++++---- .../pollen/ui/actions/poll/ResultForPoll.java | 18 ++--- .../pollen/ui/actions/poll/admin/ClosePoll.java | 4 +- .../pollen/ui/actions/poll/admin/DeletePoll.java | 4 +- .../ui/actions/poll/form/AbstractPollForm.java | 66 +++++++++---------- .../pollen/ui/actions/poll/form/ClonePoll.java | 8 +-- .../pollen/ui/actions/poll/form/CreatePoll.java | 10 +-- .../pollen/ui/actions/poll/form/EditPoll.java | 8 +-- .../ui/actions/poll/vote/AbstractVoteAction.java | 14 ++-- .../pollen/ui/actions/poll/vote/AddChoice.java | 6 +- .../pollen/ui/actions/poll/vote/AddComment.java | 8 +-- .../pollen/ui/actions/poll/vote/DeleteChoice.java | 4 +- .../pollen/ui/actions/poll/vote/DeleteComment.java | 4 +- .../pollen/ui/actions/poll/vote/DeleteVote.java | 4 +- .../pollen/ui/actions/poll/vote/ModeratePoll.java | 4 +- .../pollen/ui/actions/poll/vote/VoteForPoll.java | 30 ++++----- .../chorem/pollen/ui/actions/user/AttachPoll.java | 10 +-- .../pollen/ui/actions/user/CreateFavoriteList.java | 12 ++-- .../ui/actions/user/CreateFavoriteListVoter.java | 16 ++--- .../pollen/ui/actions/user/DeleteFavoriteList.java | 6 +- .../ui/actions/user/DeleteFavoriteListVoter.java | 4 +- .../org/chorem/pollen/ui/actions/user/Edit.java | 18 ++--- .../pollen/ui/actions/user/EditFavoriteList.java | 6 +- .../ui/actions/user/EditFavoriteListVoter.java | 16 ++--- .../org/chorem/pollen/ui/actions/user/Login.java | 10 +-- .../pollen/ui/actions/user/LostPassword.java | 8 +-- .../chorem/pollen/ui/actions/user/Register.java | 20 +++--- .../ui/security/AbstractPollenAuthorization.java | 32 ++++----- pom.xml | 26 ++++---- 45 files changed, 310 insertions(+), 310 deletions(-) diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index e473e34..b30d03d 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -52,6 +52,10 @@ <artifactId>nuiton-utils</artifactId> </dependency> <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-config</artifactId> + </dependency> + <dependency> <groupId>org.nuiton.i18n</groupId> <artifactId>nuiton-i18n</artifactId> </dependency> diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java b/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java index a8722f2..d2b7ad8 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -22,12 +22,13 @@ */ package org.chorem.pollen; -import org.nuiton.util.ApplicationConfig; -import org.nuiton.util.ApplicationConfigProvider; +import static org.nuiton.i18n.I18n.l; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; +import org.nuiton.config.ApplicationConfigProvider; +import org.nuiton.config.ConfigActionDef; +import org.nuiton.config.ConfigOptionDef; /** * Application config provider (for site generation). @@ -44,16 +45,16 @@ public class PollenApplicationConfigProvider implements ApplicationConfigProvide @Override public String getDescription(Locale locale) { - return l_(locale, "pollen.application.config"); + return l(locale, "pollen.application.config"); } @Override - public ApplicationConfig.OptionDef[] getOptions() { + public ConfigOptionDef[] getOptions() { return PollenConfigurationOption.values(); } @Override - public ApplicationConfig.ActionDef[] getActions() { - return new ApplicationConfig.ActionDef[0]; + public ConfigActionDef[] getActions() { + return new ConfigActionDef[0]; } } diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java b/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java index 8bde13d..ef099ef 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -22,8 +22,15 @@ */ package org.chorem.pollen; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.Comparator; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.logging.Log; @@ -32,19 +39,13 @@ import org.chorem.pollen.business.persistence.ChoiceType; import org.chorem.pollen.business.persistence.PollCommentVisibility; import org.chorem.pollen.business.persistence.PollType; import org.chorem.pollen.business.persistence.PollVoteVisibility; -import org.nuiton.util.ApplicationConfig; -import org.nuiton.util.ArgumentsParserException; +import org.nuiton.config.ApplicationConfig; +import org.nuiton.config.ArgumentsParserException; import org.nuiton.util.FileUtil; -import org.nuiton.util.Version; +import org.nuiton.util.version.Version; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Collections; -import java.util.Comparator; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; /** * Pollen configuration. diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java b/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java index b113174..f665c56 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java @@ -22,17 +22,17 @@ */ package org.chorem.pollen; -import org.chorem.pollen.business.persistence.PollCommentVisibility; -import org.chorem.pollen.business.persistence.PollVoteVisibility; -import org.chorem.pollen.business.persistence.ChoiceType; -import org.chorem.pollen.business.persistence.PollType; -import org.hibernate.dialect.H2Dialect; -import org.nuiton.util.ApplicationConfig; +import static org.nuiton.i18n.I18n.n; import java.io.File; import java.net.URL; -import static org.nuiton.i18n.I18n.n_; +import org.chorem.pollen.business.persistence.ChoiceType; +import org.chorem.pollen.business.persistence.PollCommentVisibility; +import org.chorem.pollen.business.persistence.PollType; +import org.chorem.pollen.business.persistence.PollVoteVisibility; +import org.hibernate.dialect.H2Dialect; +import org.nuiton.config.ConfigOptionDef; /** * All Pollen configuration options. @@ -40,109 +40,109 @@ import static org.nuiton.i18n.I18n.n_; * @author tchemit <chemit@codelutin.com> * @since 1.3 */ -public enum PollenConfigurationOption implements ApplicationConfig.OptionDef { +public enum PollenConfigurationOption implements ConfigOptionDef { /** login for default admin. */ - APPLICATION_URL("siteUrl", n_("pollen.configuration.siteUrl"), "", URL.class), + APPLICATION_URL("siteUrl", n("pollen.configuration.siteUrl"), "", URL.class), /** login for default admin. */ - DATA_DIR("pollen.dataDirectory", n_("pollen.configuration.dataDirectory"), "/var/local/pollen/data", File.class), + DATA_DIR("pollen.dataDirectory", n("pollen.configuration.dataDirectory"), "/var/local/pollen/data", File.class), /** login for default admin. */ - ADMIN_LOGIN("adminLogin", n_("pollen.configuration.db.login"), "admin", String.class), + ADMIN_LOGIN("adminLogin", ("pollen.configuration.db.login"), "admin", String.class), /** password for default admin. */ - ADMIN_PASSWORD("adminPassword", n_("pollen.configuration.db.password"), "pollen", String.class), + ADMIN_PASSWORD("adminPassword", n("pollen.configuration.db.password"), "pollen", String.class), /** email for default admin. */ - ADMIN_EMAIL("adminEmail", n_("pollen.configuration.adminEmail"), "admin@domain.com", String.class), + ADMIN_EMAIL("adminEmail", n("pollen.configuration.adminEmail"), "admin@domain.com", String.class), /** email for contact link. */ - CONTACT_EMAIL("contactEmail", n_("pollen.configuration.contactEmail"), "", String.class), + CONTACT_EMAIL("contactEmail", n("pollen.configuration.contactEmail"), "", String.class), /** host for email sending configuration. */ - EMAIL_HOST("email_host", n_("pollen.configuration.emailHost"), "smtp", String.class), + EMAIL_HOST("email_host", n("pollen.configuration.emailHost"), "smtp", String.class), /** port for email sending configuration. */ - EMAIL_PORT("email_port", n_("pollen.configuration.emailPort"), "25", String.class), + EMAIL_PORT("email_port", n("pollen.configuration.emailPort"), "25", String.class), /** flag to use ssl for email sending configuration. */ - EMAIL_SSL("email_ssl", n_("pollen.configuration.emailSsl"), "false", boolean.class), + EMAIL_SSL("email_ssl", n("pollen.configuration.emailSsl"), "false", boolean.class), /** flag to use auth for email sending configuration. */ - EMAIL_AUTH("email_auth", n_("pollen.configuration.emailAuth"), "false", boolean.class), + EMAIL_AUTH("email_auth", n("pollen.configuration.emailAuth"), "false", boolean.class), /** login to use if auth at email sending. */ - EMAIL_AUTH_LOGIN("email_auth_login", n_("pollen.configuration.emailAuthLogin"), "", String.class), + EMAIL_AUTH_LOGIN("email_auth_login", n("pollen.configuration.emailAuthLogin"), "", String.class), /** password to use if auth at email sending. */ - EMAIL_AUTH_PASSWORD("email_auth_password", n_("pollen.configuration.emailAuthPassword"), "", String.class), + EMAIL_AUTH_PASSWORD("email_auth_password", n("pollen.configuration.emailAuthPassword"), "", String.class), /** from for email sending configuration. */ - EMAIL_FROM("email_from", n_("pollen.configuration.emailFrom"), "bot@pollen.org", String.class), + EMAIL_FROM("email_from", n("pollen.configuration.emailFrom"), "bot@pollen.org", String.class), /** directory to store emails before sending them. */ - EMAIL_DIR("pollen.emails.directory", n_("pollen.configuration.emaiDirectory"), "${pollen.dataDirectory}/emails", File.class), + EMAIL_DIR("pollen.emails.directory", n("pollen.configuration.emaiDirectory"), "${pollen.dataDirectory}/emails", File.class), /** path for feed directory. */ - FEED_DIR("feedDir", n_("pollen.configuration.feedDirectory"), "${pollen.dataDirectory}/feeds", File.class), + FEED_DIR("feedDir", n("pollen.configuration.feedDirectory"), "${pollen.dataDirectory}/feeds", File.class), /** path for uploaded images directory. */ - IMG_DIR("upImgDir", n_("pollen.configuration.imageDirectory"), "${pollen.dataDirectory}/uploadedImages", File.class), + IMG_DIR("upImgDir", n("pollen.configuration.imageDirectory"), "${pollen.dataDirectory}/uploadedImages", File.class), /** path for temporary directory. */ - TMP_DIR("tmpDir", n_("pollen.configuration.tmpDirectory"), "${pollen.dataDirectory}/tmp", File.class), + TMP_DIR("tmpDir", n("pollen.configuration.tmpDirectory"), "${pollen.dataDirectory}/tmp", File.class), /** nb votes to display per page. */ - NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage", n_("pollen.configuration.nbVoteByPage"), "25", int.class), + NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage", n("pollen.configuration.nbVoteByPage"), "25", int.class), /** Charset of Pollen. */ - CHARSET("pollen.charset", n_("pollen.configuration.charset"), "UTF-8", String.class), + CHARSET("pollen.charset", n("pollen.configuration.charset"), "UTF-8", String.class), /** Default poll type to use at a new poll creation. */ - DEFAULT_POLL_TYPE("pollen.default.pollType", n_("pollen.configuration.defaultPollType"), PollType.FREE.name(), PollType.class), + DEFAULT_POLL_TYPE("pollen.default.pollType", n("pollen.configuration.defaultPollType"), PollType.FREE.name(), PollType.class), /** Default vote counting type to use at a new poll creation. */ - DEFAULT_VOTE_COUNTING_TYPE("pollen.default.voteCountingType", n_("pollen.configuration.defaultVoteCountingType"), "0", Integer.class), + DEFAULT_VOTE_COUNTING_TYPE("pollen.default.voteCountingType", n("pollen.configuration.defaultVoteCountingType"), "0", Integer.class), /** Default choice type to use at a new poll creation. */ - DEFAULT_CHOICE_TYPE("pollen.default.choiceType", n_("pollen.configuration.defaultChoiceType"), ChoiceType.TEXT.name(), ChoiceType.class), + DEFAULT_CHOICE_TYPE("pollen.default.choiceType", n("pollen.configuration.defaultChoiceType"), ChoiceType.TEXT.name(), ChoiceType.class), /** * Default poll vote visibility to use at a new poll creation. * * @since 1.4.5 */ - DEFAULT_POLL_VOTE_VISIBILITY("pollen.default.pollVoteVisibility", n_("pollen.configuration.defaultPollVoteVisibility"), PollVoteVisibility.EVERYBODY.name(), PollVoteVisibility.class), + DEFAULT_POLL_VOTE_VISIBILITY("pollen.default.pollVoteVisibility", n("pollen.configuration.defaultPollVoteVisibility"), PollVoteVisibility.EVERYBODY.name(), PollVoteVisibility.class), /** * Default poll comment visibility to use at a new poll creation. * * @since 1.4.5 */ - DEFAULT_POLL_COMMENT_VISIBILITY("pollen.default.pollCommentVisibility", n_("pollen.configuration.defaultPollCommentVisibility"), PollCommentVisibility.EVERYBODY.name(), PollCommentVisibility.class), + DEFAULT_POLL_COMMENT_VISIBILITY("pollen.default.pollCommentVisibility", ("pollen.configuration.defaultPollCommentVisibility"), PollCommentVisibility.EVERYBODY.name(), PollCommentVisibility.class), /** * Default poll comment visibility to use at a new poll creation. * * @since 1.4.5 */ - DEFAULT_POLL_RESULT_PUBLIC("pollen.default.pollResultPublic", n_("pollen.configuration.defaultPollResultPublic"), "true", boolean.class), + DEFAULT_POLL_RESULT_PUBLIC("pollen.default.pollResultPublic", n("pollen.configuration.defaultPollResultPublic"), "true", boolean.class), /** db driver. */ - DB_DRIVER("hibernate.connection.driver_class", n_("pollen.configuration.dbDriver"), org.h2.Driver.class.getName(), Class.class), + DB_DRIVER("hibernate.connection.driver_class", n("pollen.configuration.dbDriver"), org.h2.Driver.class.getName(), Class.class), /** db dialect. */ - DB_DIALECT("hibernate.dialect", n_("pollen.configuration.dbDialect"), H2Dialect.class.getName(), Class.class), + DB_DIALECT("hibernate.dialect", n("pollen.configuration.dbDialect"), H2Dialect.class.getName(), Class.class), /** db url. */ - DB_URL("hibernate.connection.url", n_("pollen.configuration.dbUrl"), "jdbc:h2:file:${pollen.dataDirectory}/db/pollendb", String.class), + DB_URL("hibernate.connection.url", n("pollen.configuration.dbUrl"), "jdbc:h2:file:${pollen.dataDirectory}/db/pollendb", String.class), /** login to db. */ - DB_LOGIN("hibernate.connection.username", n_("pollen.configuration.dbLogin"), "sa", String.class), + DB_LOGIN("hibernate.connection.username", n("pollen.configuration.dbLogin"), "sa", String.class), /** passowrd to db. */ - DB_PASSWORD("hibernate.connection.password", n_("pollen.configuration.dbPassword"), "", String.class); + DB_PASSWORD("hibernate.connection.password", n("pollen.configuration.dbPassword"), "", String.class); /** Configuration key. */ protected final String key; diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index b7db58f..3e33bd5 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -34,7 +34,7 @@ </dependency> <dependency> <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> + <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> diff --git a/pollen-ui-struts2/pom.xml b/pollen-ui-struts2/pom.xml index c2403c8..5f3bbbd 100644 --- a/pollen-ui-struts2/pom.xml +++ b/pollen-ui-struts2/pom.xml @@ -120,7 +120,7 @@ </dependency> <dependency> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-runner</artifactId> </dependency> @@ -153,7 +153,7 @@ <dependency> <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> + <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> @@ -347,7 +347,7 @@ <pluginManagement> <plugins> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <stopKey>B</stopKey> @@ -381,19 +381,6 @@ <uriEncoding>UTF-8</uriEncoding> </configuration> </plugin> - - <plugin> - <groupId>org.apache.tomcat.maven</groupId> - <artifactId>tomcat6-maven-plugin</artifactId> - <configuration> - <path>/${defaultWebContextPath}</path> - <systemProperties> - <siteUrl>${defaultSiteUrl}</siteUrl> - <pollen.log.dir>${defaultLogDir}</pollen.log.dir> - </systemProperties> - <uriEncoding>UTF-8</uriEncoding> - </configuration> - </plugin> </plugins> </pluginManagement> </build> @@ -460,7 +447,7 @@ <!-- Compile jsp for embedded war --> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-jspc-maven-plugin</artifactId> <version>${jettyPluginVersion}</version> <executions> @@ -552,7 +539,7 @@ </includes> </overlay> <overlay> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-runner</artifactId> <type>jar</type> </overlay> diff --git a/pollen-ui-struts2/src/it/createPoll/pom.xml b/pollen-ui-struts2/src/it/createPoll/pom.xml index 21ddc4c..be52f6f 100644 --- a/pollen-ui-struts2/src/it/createPoll/pom.xml +++ b/pollen-ui-struts2/src/it/createPoll/pom.xml @@ -5,7 +5,7 @@ $Id$ $HeadURL$ %% - Copyright (C) 2009 - 2012 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/pollen-ui-struts2/src/it/createPoll/src/jetty/jetty-context.xml b/pollen-ui-struts2/src/it/createPoll/src/jetty/jetty-context.xml index 6c1e8c3..0126ae4 100644 --- a/pollen-ui-struts2/src/it/createPoll/src/jetty/jetty-context.xml +++ b/pollen-ui-struts2/src/it/createPoll/src/jetty/jetty-context.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Pollen :: UI (struts2) @@ -22,7 +22,7 @@ #L% --> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> +<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> diff --git a/pollen-ui-struts2/src/it/pollCommentVisibility/src/jetty/jetty-context.xml b/pollen-ui-struts2/src/it/pollCommentVisibility/src/jetty/jetty-context.xml index 6c1e8c3..0126ae4 100644 --- a/pollen-ui-struts2/src/it/pollCommentVisibility/src/jetty/jetty-context.xml +++ b/pollen-ui-struts2/src/it/pollCommentVisibility/src/jetty/jetty-context.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Pollen :: UI (struts2) @@ -22,7 +22,7 @@ #L% --> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> +<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> diff --git a/pollen-ui-struts2/src/it/pollVoteVisibility/src/jetty/jetty-context.xml b/pollen-ui-struts2/src/it/pollVoteVisibility/src/jetty/jetty-context.xml index 6c1e8c3..0126ae4 100644 --- a/pollen-ui-struts2/src/it/pollVoteVisibility/src/jetty/jetty-context.xml +++ b/pollen-ui-struts2/src/it/pollVoteVisibility/src/jetty/jetty-context.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Pollen :: UI (struts2) @@ -22,7 +22,7 @@ #L% --> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> +<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> diff --git a/pollen-ui-struts2/src/it/pollen-ui-it/pom.xml b/pollen-ui-struts2/src/it/pollen-ui-it/pom.xml index 05104ce..35e616f 100644 --- a/pollen-ui-struts2/src/it/pollen-ui-it/pom.xml +++ b/pollen-ui-struts2/src/it/pollen-ui-it/pom.xml @@ -5,7 +5,7 @@ $Id$ $HeadURL$ %% - Copyright (C) 2009 - 2012 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -63,7 +63,7 @@ </dependency> <dependency> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-runner</artifactId> </dependency> @@ -247,8 +247,9 @@ <pluginManagement> <plugins> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> + <version>${jettyVersion}</version> <configuration> <stopKey>A</stopKey> <stopPort>1269</stopPort> @@ -324,7 +325,7 @@ <plugins> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <executions> <execution> @@ -411,7 +412,7 @@ <plugins> <plugin> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <executions> <execution> diff --git a/pollen-ui-struts2/src/it/security/src/jetty/jetty-context.xml b/pollen-ui-struts2/src/it/security/src/jetty/jetty-context.xml index 6c1e8c3..0126ae4 100644 --- a/pollen-ui-struts2/src/it/security/src/jetty/jetty-context.xml +++ b/pollen-ui-struts2/src/it/security/src/jetty/jetty-context.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Pollen :: UI (struts2) @@ -22,7 +22,7 @@ #L% --> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> +<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> diff --git a/pollen-ui-struts2/src/jetty/jetty-context.xml b/pollen-ui-struts2/src/jetty/jetty-context.xml index 6c1e8c3..0126ae4 100644 --- a/pollen-ui-struts2/src/jetty/jetty-context.xml +++ b/pollen-ui-struts2/src/jetty/jetty-context.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Pollen :: UI (struts2) @@ -22,7 +22,7 @@ #L% --> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> +<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Call name="setAttribute"> diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java index 627e839..da38da2 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java @@ -28,7 +28,6 @@ import org.chorem.pollen.PollenApplicationContext; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; import org.nuiton.topia.TopiaRuntimeException; -import org.nuiton.web.filter.TopiaTransactionFilter; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java index 81e20ce..ad32068 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java @@ -22,11 +22,14 @@ */ package org.chorem.pollen.ui.actions; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.opensymphony.xwork2.ActionContext; -import com.opensymphony.xwork2.inject.Inject; +import java.net.URL; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletRequest; +import javax.servlet.http.HttpServletRequest; + import org.apache.commons.collections4.CollectionUtils; import org.apache.struts2.interceptor.ParameterAware; import org.apache.struts2.interceptor.ServletRequestAware; @@ -53,21 +56,19 @@ import org.chorem.pollen.services.impl.SecurityService; import org.chorem.pollen.services.impl.UserService; import org.chorem.pollen.services.impl.VoteService; import org.chorem.pollen.ui.PollenSession; +import org.chorem.pollen.ui.TopiaTransactionFilter; import org.chorem.pollen.ui.interceptors.PollenSecurityInterceptor; import org.chorem.pollen.ui.security.AbstractPollenAuthorization; import org.chorem.pollen.votecounting.VoteCounting; import org.chorem.pollen.votecounting.VoteCountingFactory; import org.nuiton.topia.TopiaContext; -import org.nuiton.web.filter.TopiaTransactionFilter; import org.nuiton.web.struts2.BaseAction; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; -import java.net.URL; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Map; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.inject.Inject; /** * Pollen action support. diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java index d33aeb8..f67cdf8 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -68,12 +68,12 @@ public class DeleteUser extends PollenActionSupport { service.deleteUser(userId); addFlashMessage( - _("pollen.information.user.deleted", user.getDisplayName())); + t("pollen.information.user.deleted", user.getDisplayName())); result = SUCCESS; } catch (UserNotFoundException e) { addFieldError("deleteUser.login", - _("pollen.error.user.not.found")); + t("pollen.error.user.not.found")); } return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java index 2cf3b48..25e4f21 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -75,15 +75,15 @@ public class ManageUsers extends PollenActionSupport { if (StringUtils.isBlank(account.getLogin())) { addFieldError("createUser.login", - _("pollen.error.login.required")); + t("pollen.error.login.required")); } if (StringUtils.isBlank(account.getEmail())) { addFieldError("createUser.email", - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else if (!StringUtil.isEmail(account.getEmail())) { addFieldError("createUser.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } else if ("edit".equals(action)) { @@ -91,15 +91,15 @@ public class ManageUsers extends PollenActionSupport { if (StringUtils.isBlank(account.getLogin())) { addFieldError("editUser.login", - _("pollen.error.pollAccount.votingId.required")); + t("pollen.error.pollAccount.votingId.required")); } if (StringUtils.isBlank(account.getEmail())) { addFieldError("editUser.email", - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else if (!StringUtil.isEmail(account.getEmail())) { addFieldError("editUser.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } } @@ -113,7 +113,7 @@ public class ManageUsers extends PollenActionSupport { getUserService().createUser(user, true); addFlashMessage( - _("pollen.information.user.created", + t("pollen.information.user.created", user.getDisplayName())); // remove this user, otherwise it will be reused in the user lists user = null; @@ -121,11 +121,11 @@ public class ManageUsers extends PollenActionSupport { result = SUCCESS; } catch (UserLoginAlreadyUsedException e) { addFieldError("createUser.login", - _("pollen.error.user.login.already.used")); + t("pollen.error.user.login.already.used")); } catch (UserEmailAlreadyUsedException e) { addFieldError("createUser.email", - _("pollen.error.user.email.already.used")); + t("pollen.error.user.email.already.used")); } return result; @@ -140,7 +140,7 @@ public class ManageUsers extends PollenActionSupport { try { getUserService().updateUser(user, null, true); addFlashMessage( - _("pollen.information.user.updated", + t("pollen.information.user.updated", user.getDisplayName())); // remove this user, otherwise it will be reused in the user lists @@ -149,10 +149,10 @@ public class ManageUsers extends PollenActionSupport { result = SUCCESS; } catch (UserEmailAlreadyUsedException e) { addFieldError("editUser.email", - _("pollen.error.user.email.already.used")); + t("pollen.error.user.email.already.used")); } catch (UserInvalidPasswordException e) { addFieldError("editUser.password", - _("pollen.error.user.invalid.password")); + t("pollen.error.user.invalid.password")); } return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java index 6d73554..b948651 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java @@ -177,21 +177,21 @@ public class ResultForPoll extends PollenActionSupport implements PollenUserSecu result = creator.getEmail(); } if (StringUtils.isBlank(result)) { - result = _("pollen.common.undefined"); + result = t("pollen.common.undefined"); } return result; } public String getPollBeginDate() { Date date = poll.getBeginDate(); - String result = date == null ? _("pollen.common.undefined") : + String result = date == null ? t("pollen.common.undefined") : getPollService().decorateDate(date); return result; } public String getPollEndDate() { Date date = poll.getEndDate(); - String result = date == null ? _("pollen.common.undefined") : + String result = date == null ? t("pollen.common.undefined") : getPollService().decorateDate(date); return result; } @@ -227,9 +227,9 @@ public class ResultForPoll extends PollenActionSupport implements PollenUserSecu if (CollectionUtils.isEmpty(topRanking)) { victoryMessage = ""; } else if (topRanking.size() == 1) { - victoryMessage = _("pollen.common.victory"); + victoryMessage = t("pollen.common.victory"); } else { - victoryMessage = _("pollen.common.victories"); + victoryMessage = t("pollen.common.victories"); } return victoryMessage; } @@ -271,7 +271,7 @@ public class ResultForPoll extends PollenActionSupport implements PollenUserSecu } if (poll.isRunning(serviceContext.getCurrentTime())) { - addFlashWarning(_("pollen.information.pollRunning")); + addFlashWarning(t("pollen.information.pollRunning")); } if (log.isInfoEnabled()) { log.info("topRanking = " + pollResult.getTopRanking()); @@ -296,9 +296,9 @@ public class ResultForPoll extends PollenActionSupport implements PollenUserSecu if (poll.isPollGroup() && !getByGroup()) { // means poll votecount as anot group poll - title = _("pollen.common.pollResult.forPollAsNotGroupPoll"); + title = t("pollen.common.pollResult.forPollAsNotGroupPoll"); } else { - title = _("pollen.common.pollResult.forPoll"); + title = t("pollen.common.pollResult.forPoll"); } return getPollResultChartUrl(pollResult, title, width, height); @@ -307,7 +307,7 @@ public class ResultForPoll extends PollenActionSupport implements PollenUserSecu public String getGroupPollResultChartUrl(String groupId, int width, int height) { VoteCountingResult result = groupResult.getGroupResult(groupId); String groupName = getGroupName(groupId); - String title = _("pollen.common.pollResult.forGroup", groupName); + String title = t("pollen.common.pollResult.forGroup", groupName); return getPollResultChartUrl(result, title, width, height); } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/ClosePoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/ClosePoll.java index e338324..cb08e64 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/ClosePoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/ClosePoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -74,7 +74,7 @@ public class ClosePoll extends PollenActionSupport implements PollenUserSecurity getPollService().closePoll(poll.getPollId()); - addFlashMessage(_("pollen.information.poll.closed", title)); + addFlashMessage(t("pollen.information.poll.closed", title)); return SUCCESS; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/DeletePoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/DeletePoll.java index c36908f..67f4083 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/DeletePoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/DeletePoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -68,7 +68,7 @@ public class DeletePoll extends PollenActionSupport implements PollenUserSecurit } getPollService().deletePoll(poll.getPollId()); - addFlashMessage(_("pollen.information.poll.deleted", title)); + addFlashMessage(t("pollen.information.poll.deleted", title)); return SUCCESS; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/AbstractPollForm.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/AbstractPollForm.java index a246260..2902900 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/AbstractPollForm.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/AbstractPollForm.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -298,7 +298,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp poll = service.getPollEditable(pollUid, userAccount, isClone()); if (poll.isClosed()) { - addFlashWarning(_("pollen.warning.poll.is.closed.so.read.only")); + addFlashWarning(t("pollen.warning.poll.is.closed.so.read.only")); } List<Choice> pollChoices = poll.getChoice(); @@ -368,7 +368,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp } if (isVoteStarted()) { - addFlashMessage(_("pollen.information.poll.form.voteStarted")); + addFlashMessage(t("pollen.information.poll.form.voteStarted")); } return INPUT; @@ -689,13 +689,13 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp } public String getActionLabel() { - return isEdit() ? _("pollen.action.editPoll") : - _("pollen.action.createPoll"); + return isEdit() ? t("pollen.action.editPoll") : + t("pollen.action.createPoll"); } public String getPageTitle() { return isEdit() ? getPoll().getTitle() : - _("pollen.title.createPoll"); + t("pollen.title.createPoll"); } public boolean isVoteStarted() { @@ -798,7 +798,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // -- Title : required -- // if (StringUtils.isBlank(poll.getTitle())) { addInformationsError("poll.title", - _("pollen.error.poll.required.title")); + t("pollen.error.poll.required.title")); } if (isVoteStarted()) { @@ -812,7 +812,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // poll must have at least one choice addInformationsError("poll.choices", - _("pollen.error.poll.required.one.choice")); + t("pollen.error.poll.required.one.choice")); } else { switch (poll.getChoiceType()) { @@ -845,14 +845,14 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no name addInformationsError( choiceErrorField, - _("pollen.error.poll.choice.name.required")); + t("pollen.error.poll.choice.name.required")); continue; } if (choiceNames.contains(choiceName)) { // duplicated names addInformationsError( choiceErrorField, - _("pollen.error.poll.choice.already.used.name")); + t("pollen.error.poll.choice.already.used.name")); continue; } choiceNames.add(choiceName); @@ -873,7 +873,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no name addInformationsError( choiceErrorField, - _("pollen.error.poll.dateChoice.required")); + t("pollen.error.poll.dateChoice.required")); continue; } if (choice.getDate() == null) { @@ -881,7 +881,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // format error addInformationsError( choiceErrorField, - _("pollen.error.poll.dateChoice.badDateFormat")); + t("pollen.error.poll.dateChoice.badDateFormat")); continue; } @@ -893,7 +893,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // duplicated names addInformationsError( choiceErrorField, - _("pollen.error.poll.dateChoice.already.used")); + t("pollen.error.poll.dateChoice.already.used")); continue; } choiceNames.add(choiceValue); @@ -915,14 +915,14 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no name addInformationsError( choiceErrorField, - _("pollen.error.poll.imageChoice.upload.required")); + t("pollen.error.poll.imageChoice.upload.required")); continue; } if (choiceNames.contains(choiceName)) { // duplicated names addInformationsError( choiceErrorField, - _("pollen.error.poll.imageChoice.already.used")); + t("pollen.error.poll.imageChoice.already.used")); continue; } choiceNames.add(choiceName); @@ -932,7 +932,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // Bad content Type addInformationsError( choiceErrorField, - _("pollen.error.poll.imageChoice.upload.badContentType")); + t("pollen.error.poll.imageChoice.upload.badContentType")); //Remove the file and its thumb PollImageChoice imageChoice = (PollImageChoice) choice; File imageFile = new File(imageChoice.getLocation()); @@ -961,7 +961,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp if (validateEndDate(poll.getBeginDate(), poll.getEndDate())) { addOptionsError("poll.endDate", - _("pollen.error.poll.endDate.before.beginDate")); + t("pollen.error.poll.endDate.before.beginDate")); } // --- currentTime < endDate @@ -969,7 +969,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp addOptionsError( "poll.endDate", - _("pollen.error.poll.endDate.before.now")); + t("pollen.error.poll.endDate.before.now")); } } @@ -982,12 +982,12 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // reminderHourCountdown == null addOptionsError("reminderHourCountdown", - _("pollen.error.poll.reminderHourCountdown.required")); + t("pollen.error.poll.reminderHourCountdown.required")); } else if (getReminderHourCountdown() < 1) { // reminderHourCountdown <= 0 addOptionsError("reminderHourCountdown", - _("pollen.error.poll.reminderHourCountdown.greater.than.0")); + t("pollen.error.poll.reminderHourCountdown.greater.than.0")); } } } @@ -1000,11 +1000,11 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp if (getMaxChoices() == null) { // maxChoices == null addOptionsError("maxChoices", - _("pollen.error.poll.maxChoice.required")); + t("pollen.error.poll.maxChoice.required")); } else if (getMaxChoices() < 1) { // maxChoices <= 0 addOptionsError("maxChoices", - _("pollen.error.poll.maxChoice.greater.than.0")); + t("pollen.error.poll.maxChoice.greater.than.0")); } } } @@ -1015,7 +1015,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp !StringUtil.isEmail(creatorEmail)) { addOptionsError("poll.creator.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } @@ -1077,7 +1077,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp addOptionsError( fieldNamePrefix, - _("pollen.error.poll.required.votingList.name")); + t("pollen.error.poll.required.votingList.name")); } else { // check no votingList name doublon @@ -1087,7 +1087,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // name doublon addOptionsError( fieldNamePrefix, - _("pollen.error.poll.votingList.name.doublon")); + t("pollen.error.poll.votingList.name.doublon")); } } @@ -1098,7 +1098,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no weight filled (can be a bad conversion) addOptionsError( fieldNamePrefix, - _("pollen.error.poll.votingList.weight.not.valid")); + t("pollen.error.poll.votingList.weight.not.valid")); } } @@ -1112,7 +1112,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no personToList found for unique votingList 0 addOptionsError(fieldNamePrefix, - _("pollen.error.poll.required.one.personToList")); + t("pollen.error.poll.required.one.personToList")); } else { // check no doublon on voter names @@ -1148,7 +1148,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // voter name mandatory addOptionsError( fieldNamePrefix, - _("pollen.error.poll.personToList.votingId.required")); + t("pollen.error.poll.personToList.votingId.required")); } else { boolean add = voters.add(votingId); @@ -1157,7 +1157,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // voter name already used addOptionsError( fieldNamePrefix, - _("pollen.error.poll.personToList.votingId.doublon")); + t("pollen.error.poll.personToList.votingId.doublon")); } } @@ -1169,7 +1169,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // voter email mandatory addOptionsError(fieldNamePrefix, - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else { boolean validEmail = StringUtil.isEmail(email); @@ -1177,7 +1177,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // not a valid email addOptionsError(fieldNamePrefix, - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } else { boolean add = emails.add(email); @@ -1186,7 +1186,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // email already used addOptionsError( fieldNamePrefix, - _("pollen.error.poll.personToList.email.doublon")); + t("pollen.error.poll.personToList.email.doublon")); } } } @@ -1198,7 +1198,7 @@ public abstract class AbstractPollForm extends PollenActionSupportForEdition imp // no weight filled (can be a bad conversion) addOptionsError( fieldNamePrefix, - _("pollen.error.poll.personToList.weight.not.valid")); + t("pollen.error.poll.personToList.weight.not.valid")); } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/ClonePoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/ClonePoll.java index 321d40f..0ddd820 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/ClonePoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/ClonePoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -49,7 +49,7 @@ public class ClonePoll extends AbstractPollForm { @Override protected Poll savePoll(Poll poll) { poll = getPollService().createPoll(poll); - addFlashMessage(_("pollen.information.poll.created", poll.getTitle())); + addFlashMessage(t("pollen.information.poll.created", poll.getTitle())); return poll; } @@ -61,14 +61,14 @@ public class ClonePoll extends AbstractPollForm { addOptionsError( "poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); + t("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); } // --- endChoiceDate < endDate if (validateEndDate(poll.getEndChoiceDate(), poll.getEndDate())) { addOptionsError("poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.after.endDate")); + t("pollen.error.poll.endChoiceDate.after.endDate")); } } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/CreatePoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/CreatePoll.java index 4c4be4a..1ed1993 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/CreatePoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/CreatePoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -49,7 +49,7 @@ public class CreatePoll extends AbstractPollForm { @Override protected Poll savePoll(Poll poll) { poll = getPollService().createPoll(poll); - addFlashMessage(_("pollen.information.poll.created", poll.getTitle())); + addFlashMessage(t("pollen.information.poll.created", poll.getTitle())); return poll; } @@ -61,7 +61,7 @@ public class CreatePoll extends AbstractPollForm { addOptionsError( "poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); + t("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); } // --- currentTime < endChoiceDate @@ -69,14 +69,14 @@ public class CreatePoll extends AbstractPollForm { addOptionsError( "poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.before.now")); + t("pollen.error.poll.endChoiceDate.before.now")); } // --- endChoiceDate < endDate if (validateEndDate(poll.getEndChoiceDate(), poll.getEndDate())) { addOptionsError("poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.after.endDate")); + t("pollen.error.poll.endChoiceDate.after.endDate")); } } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/EditPoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/EditPoll.java index ae9f511..476db85 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/EditPoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/form/EditPoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -53,7 +53,7 @@ public class EditPoll extends AbstractPollForm { @Override protected Poll savePoll(Poll poll) throws PollNotFoundException { poll = getPollService().updatePoll(poll); - addFlashMessage(_("pollen.information.poll.updated", poll.getTitle())); + addFlashMessage(t("pollen.information.poll.updated", poll.getTitle())); return poll; } @@ -65,14 +65,14 @@ public class EditPoll extends AbstractPollForm { addOptionsError( "poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); + t("pollen.error.poll.endChoiceDate.before.beginChoiceDate")); } // --- endChoiceDate < endDate if (validateEndDate(poll.getEndChoiceDate(), poll.getEndDate())) { addOptionsError("poll.endChoiceDate", - _("pollen.error.poll.endChoiceDate.after.endDate")); + t("pollen.error.poll.endChoiceDate.after.endDate")); } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java index a7f5bb8..023b0d4 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -182,13 +182,13 @@ public abstract class AbstractVoteAction extends PollenActionSupport implements public String getPollVoteVisibilityName() { PollVoteVisibility strategy = getPoll().getPollVoteVisibility(); - String result = _(strategy.getI18nKey()); + String result = t(strategy.getI18nKey()); return result; } public String getPollVoteVisibilityHelp() { PollVoteVisibility strategy = getPoll().getPollVoteVisibility(); - String result = _(strategy.getI18nHelpKey()); + String result = t(strategy.getI18nHelpKey()); return result; } @@ -256,7 +256,7 @@ public abstract class AbstractVoteAction extends PollenActionSupport implements } public String getVoteMessages() { - return _("pollen.common.voteNbVotes", poll.sizeVote()); + return t("pollen.common.voteNbVotes", poll.sizeVote()); } public boolean isFeedFileExisting() { @@ -342,21 +342,21 @@ public abstract class AbstractVoteAction extends PollenActionSupport implements result = creator.getEmail(); } if (StringUtils.isBlank(result)) { - result = _("pollen.common.undefined"); + result = t("pollen.common.undefined"); } return result; } public String getPollBeginDate() { Date date = poll.getBeginDate(); - String result = date == null ? _("pollen.common.undefined") : + String result = date == null ? t("pollen.common.undefined") : getPollService().decorateDate(date); return result; } public String getPollEndDate() { Date date = poll.getEndDate(); - String result = date == null ? _("pollen.common.undefined") : + String result = date == null ? t("pollen.common.undefined") : getPollService().decorateDate(date); return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddChoice.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddChoice.java index c5f1a8f..1a84f28 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddChoice.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddChoice.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -107,7 +107,7 @@ public class AddChoice extends AbstractVoteAction implements Preparable, FileUpl if (StringUtils.isBlank(choiceName)) { String typeLabel = getText(choiceType.getI18nKey()); addFieldError("choice." + propName, - _("pollen.error.choice.empty", typeLabel)); + t("pollen.error.choice.empty", typeLabel)); } else { if (!poll.isChoiceEmpty()) { @@ -118,7 +118,7 @@ public class AddChoice extends AbstractVoteAction implements Preparable, FileUpl String pollChoiceName = pollChoice.getName(); if (pollChoiceName.equals(choiceName)) { addFieldError("choice." + propName, - _("pollen.error.poll.choice.already.used.name")); + t("pollen.error.poll.choice.already.used.name")); break; } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java index c823a69..96f7dc7 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -68,11 +68,11 @@ public class AddComment extends AbstractVoteAction implements Preparable { public void validate() { if (StringUtils.isBlank(getCommentAuthor())) { - addFieldError("commentAuthor", _("pollen.error.comment.name.empty")); + addFieldError("commentAuthor", t("pollen.error.comment.name.empty")); } if (StringUtils.isBlank(getCommentText())) { - addFieldError("commentText", _("pollen.error.comment.text.empty")); + addFieldError("commentText", t("pollen.error.comment.text.empty")); } } @@ -87,7 +87,7 @@ public class AddComment extends AbstractVoteAction implements Preparable { // create the comment getPollCommentService().createComment(getPoll(), comment); - addFlashMessage(_("pollen.information.comment.added")); + addFlashMessage(t("pollen.information.comment.added")); return SUCCESS; } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteChoice.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteChoice.java index a68237b..2b69f0b 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteChoice.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteChoice.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -50,7 +50,7 @@ public class DeleteChoice extends PollenActionSupport implements PollenUserSecur getPollService().deleteChoice(getPollUri().getPollId(), choiceId); - addFlashMessage(_("pollen.information.choice.deleted")); + addFlashMessage(t("pollen.information.choice.deleted")); return SUCCESS; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteComment.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteComment.java index ad22b4e..4d6de48 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteComment.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteComment.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -69,7 +69,7 @@ public class DeleteComment extends PollenActionSupport implements PollenUserSecu getPollCommentService().deleteComment(poll, commentId, reason); - addFlashMessage(_("pollen.information.comment.deleted")); + addFlashMessage(t("pollen.information.comment.deleted")); return SUCCESS; } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java index 7ae3b2c..bd3af5e 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -69,7 +69,7 @@ public class DeleteVote extends PollenActionSupport implements PollenUserSecurit getVoteService().deleteVote(poll, voteId, reason); - addFlashMessage(_("pollen.information.vote.deleted")); + addFlashMessage(t("pollen.information.vote.deleted")); if (poll.isPollFree() && getUserSecurityContext().isWithAccountId()){ diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/ModeratePoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/ModeratePoll.java index 97e5737..d4d7507 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/ModeratePoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/ModeratePoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -37,7 +37,7 @@ public class ModeratePoll extends AbstractVoteAction { prepareVotePage(); - addFlashWarning(_("pollen.information.moderate.page")); + addFlashWarning(t("pollen.information.moderate.page")); return INPUT; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java index 599cd49..866358e 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -35,7 +35,7 @@ import org.chorem.pollen.business.persistence.VoteToChoice; import org.chorem.pollen.services.impl.VoteService; import org.chorem.pollen.votecounting.VoteCounting; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Votes to a poll. @@ -64,18 +64,18 @@ public class VoteForPoll extends AbstractVoteAction implements Preparable { Poll poll = getPoll(); if (poll.isClosed()) { - addFlashWarning(_("pollen.information.pollClosed")); + addFlashWarning(t("pollen.information.pollClosed")); } else if (!isPollStarted()) { - addFlashWarning(_("pollen.information.pollNotStarted")); + addFlashWarning(t("pollen.information.pollNotStarted")); } else if (isPollFinished()) { - addFlashWarning(_("pollen.information.pollFinished")); + addFlashWarning(t("pollen.information.pollFinished")); } else if (!isVoteAllowed()) { - addFlashWarning(_("pollen.information.pollCanNotVote")); + addFlashWarning(t("pollen.information.pollCanNotVote")); } if (isPollChoiceRunning()) { - addFlashMessage(_("pollen.information.pollChoiceRunning")); + addFlashMessage(t("pollen.information.pollChoiceRunning")); } } @@ -95,13 +95,13 @@ public class VoteForPoll extends AbstractVoteAction implements Preparable { String name = pollAccount.getVotingId(); if (StringUtils.isBlank(name)) { addFieldError("pollAccount.votingId", - _("pollen.error.pollAccount.votingId.required")); + t("pollen.error.pollAccount.votingId.required")); } // check if the votingId is available if (!getVoteService().isVotingIdFree(poll, pollAccount.getTopiaId(), name)) { addFieldError("pollAccount.votingId", - _("pollen.error.user.alreadyVoted", name)); + t("pollen.error.user.alreadyVoted", name)); } } @@ -130,7 +130,7 @@ public class VoteForPoll extends AbstractVoteAction implements Preparable { // vote value changed String validMessage = - _("pollen.error.vote.invalidFormat", voteToChoice.getChoice().getName(), originalValue); + t("pollen.error.vote.invalidFormat", voteToChoice.getChoice().getName(), originalValue); addFieldError("vote.choices", validMessage); voteValid = false; break; @@ -174,7 +174,7 @@ public class VoteForPoll extends AbstractVoteAction implements Preparable { int maxChoice = getPoll().getMaxChoiceNb(); if (maxChoice != 0 && nbVotes > maxChoice) { addFieldError("vote.choices", - _("pollen.error.vote.maxChoiceNb", maxChoice)); + t("pollen.error.vote.maxChoiceNb", maxChoice)); } // check that total vote value is ok @@ -234,17 +234,17 @@ public class VoteForPoll extends AbstractVoteAction implements Preparable { boolean connected = getUserSecurityContext().isConnected(); if (connected) { - message = n_("pollen.information.vote.createdWithUpdateUrl.notConnected"); + message = n("pollen.information.vote.createdWithUpdateUrl.notConnected"); } else { - message = n_("pollen.information.vote.createdWithUpdateUrl"); + message = n("pollen.information.vote.createdWithUpdateUrl"); } - addFlashMessage(_(message, updateUrl)); + addFlashMessage(t(message, updateUrl)); } else { // there is a accountId in url, just inform vote is saved - addFlashMessage(_("pollen.information.vote.created")); + addFlashMessage(t("pollen.information.vote.created")); } return SUCCESS; diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/AttachPoll.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/AttachPoll.java index c01ae92..0bf78f2 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/AttachPoll.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/AttachPoll.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -79,7 +79,7 @@ public class AttachPoll extends PollenActionSupport { getPollService().attachPoll(id, userAccount); - addFlashMessage(_("pollen.information.poll.attached", poll.getTitle())); + addFlashMessage(t("pollen.information.poll.attached", poll.getTitle())); return SUCCESS; } @@ -90,7 +90,7 @@ public class AttachPoll extends PollenActionSupport { String id = getPollId(); if (StringUtils.isBlank(id)) { - addFieldError("pollId", _("pollen.error.pollId.empty")); + addFieldError("pollId", t("pollen.error.pollId.empty")); } else { try { @@ -103,11 +103,11 @@ public class AttachPoll extends PollenActionSupport { UserAccount userAccount = poll.getCreator().getUserAccount(); if (userAccount != null) { - addFieldError("pollId", _("pollen.error.pollAlreadyAttached")); + addFieldError("pollId", t("pollen.error.pollAlreadyAttached")); } } catch (PollNotFoundException e) { - addFieldError("pollId", _("pollen.error.pollNotFound")); + addFieldError("pollId", t("pollen.error.pollNotFound")); } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java index d3e16fc..703750c 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java @@ -5,7 +5,7 @@ package org.chorem.pollen.ui.actions.user; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -96,7 +96,7 @@ public class CreateFavoriteList extends PollenActionSupportForEdition implements if (StringUtils.isBlank(getCreateFavoriteList().getName())) { addFieldError("createFavoriteList.name", - _("pollen.error.favoriteListName.required")); + t("pollen.error.favoriteListName.required")); } } @@ -125,7 +125,7 @@ public class CreateFavoriteList extends PollenActionSupportForEdition implements } catch (FavoriteListAlreadyExistException ex) { addFieldError("createFavoriteList.name", - _("pollen.error.favoriteList.already.used")); + t("pollen.error.favoriteList.already.used")); } String result; @@ -136,11 +136,11 @@ public class CreateFavoriteList extends PollenActionSupportForEdition implements getTransaction().commitTransaction(); if (nbImports > 0) { - addFlashMessage(_("pollen.information.favoriteList.imported", + addFlashMessage(t("pollen.information.favoriteList.imported", createFavoriteList.getName(), nbImports)); } else { - addFlashMessage(_("pollen.information.favoriteList.created", + addFlashMessage(t("pollen.information.favoriteList.created", createFavoriteList.getName())); } createFavoriteList = null; @@ -196,7 +196,7 @@ public class CreateFavoriteList extends PollenActionSupportForEdition implements } catch (ParticipantAlreadyFoundInListException ex) { // WARNING ? addFlashError( - _("pollen.error.favoriteList.import.participantExists" + t("pollen.error.favoriteList.import.participantExists" , importedAccount.getEmail()) ); } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java index fb6e545..edc5285 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java @@ -5,7 +5,7 @@ package org.chorem.pollen.ui.actions.user; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -76,9 +76,9 @@ public class CreateFavoriteListVoter extends PollenActionSupportForEdition imple favoriteList = getFavoriteService().getFavoriteList( getPollenUserAccount(), favoriteListId); } catch (FavoriteListNotFoundException e) { - addFlashError(_("pollen.error.favoriteList.not.found")); + addFlashError(t("pollen.error.favoriteList.not.found")); } catch (FavoriteListNotOwnedByUserException e) { - addFlashError(_("pollen.error.favoriteList.not.owned.by.user")); + addFlashError(t("pollen.error.favoriteList.not.owned.by.user")); } } @@ -89,15 +89,15 @@ public class CreateFavoriteListVoter extends PollenActionSupportForEdition imple if (StringUtils.isBlank(account.getVotingId())) { addFieldError("createPollAccount.votingId", - _("pollen.error.pollAccount.votingId.required")); + t("pollen.error.pollAccount.votingId.required")); } if (StringUtils.isBlank(account.getEmail())) { addFieldError("createPollAccount.email", - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else if (!StringUtil.isEmail(account.getEmail())) { addFieldError("createPollAccount.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } @@ -116,14 +116,14 @@ public class CreateFavoriteListVoter extends PollenActionSupportForEdition imple favoriteList, pollAccount); addFlashMessage( - _("pollen.information.pollAccount.addedTofavoriteList", + t("pollen.information.pollAccount.addedTofavoriteList", pollAccount.getVotingId())); pollAccount = null; result = SUCCESS; } catch (ParticipantAlreadyFoundInListException e) { addFieldError("createPollAccount.email", - _("pollen.error.favoriteList.participant.already.found.in.list")); + t("pollen.error.favoriteList.participant.already.found.in.list")); } return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java index 7bb4a02..e1acef2 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -69,13 +69,13 @@ public class DeleteFavoriteList extends PollenActionSupport { PersonList deletedFavoritedList = service.deleteFavoriteList( getPollenUserAccount(), favoriteList); - addFlashMessage(_("pollen.information.favoriteList.deleted", + addFlashMessage(t("pollen.information.favoriteList.deleted", deletedFavoritedList.getName())); result = SUCCESS; } catch (UserNotFoundException e) { addFieldError("deleteUser.login", - _("pollen.error.user.not.found")); + t("pollen.error.user.not.found")); } return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java index 94b420a..d6a6a5f 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -75,7 +75,7 @@ public class DeleteFavoriteListVoter extends PollenActionSupport { service.removePollAccountToFavoriteList(favoriteList, pollAccount); addFlashMessage( - _("pollen.information.pollAccount.removedFromFavoriteList", + t("pollen.information.pollAccount.removedFromFavoriteList", pollAccount.getVotingId())); return SUCCESS; diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java index 6b78395..3fa31f1 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -84,18 +84,18 @@ public class Edit extends PollenActionSupportForEdition { if (StringUtils.isBlank(pollenUserAccount.getLogin())) { addFieldError("pollenUserAccount.login", - _("pollen.error.login.required")); + t("pollen.error.login.required")); } if (StringUtils.isBlank(pollenUserAccount.getPassword())) { addFieldError("pollenUserAccount.password", - _("pollen.error.password.required")); + t("pollen.error.password.required")); } if (StringUtils.isNotBlank(getNewPassword())) { if (ObjectUtils.notEqual(getNewPassword(), getNewPassword2())) { addFieldError("newPassword", - _("pollen.error.passwords.not.equals")); + t("pollen.error.passwords.not.equals")); } } @@ -103,10 +103,10 @@ public class Edit extends PollenActionSupportForEdition { if (!isExists()) { if (StringUtils.isBlank(pollenUserAccount.getEmail())) { addFieldError("pollenUserAccount.email", - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else if (!StringUtil.isEmail(pollenUserAccount.getEmail())) { addFieldError("pollenUserAccount.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } } @@ -127,14 +127,14 @@ public class Edit extends PollenActionSupportForEdition { // push back user to session getPollenSession().setUserAccount(updatedUser); - addFlashMessage(_("pollen.information.pollAccount.updated")); + addFlashMessage(t("pollen.information.pollAccount.updated")); result = SUCCESS; } catch (UserEmailAlreadyUsedException e) { addFieldError("pollenUserAccount.email", - _("pollen.error.user.email.already.used")); + t("pollen.error.user.email.already.used")); } catch (UserInvalidPasswordException e) { addFieldError("pollenUserAccount.password", - _("pollen.error.user.invalid.password")); + t("pollen.error.user.invalid.password")); } // reset password diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java index fcf287d..5934262 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java @@ -5,7 +5,7 @@ package org.chorem.pollen.ui.actions.user; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -60,9 +60,9 @@ public class EditFavoriteList extends PollenActionSupportForEdition { favoriteList = getFavoriteService().getFavoriteList( getPollenUserAccount(), favoriteListId); } catch (FavoriteListNotFoundException e) { - addFlashError(_("pollen.error.favoriteList.not.found")); + addFlashError(t("pollen.error.favoriteList.not.found")); } catch (FavoriteListNotOwnedByUserException e) { - addFlashError(_("pollen.error.favoriteList.not.owned.by.user")); + addFlashError(t("pollen.error.favoriteList.not.owned.by.user")); } return SUCCESS; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java index ac59cf9..e7c3e37 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java @@ -5,7 +5,7 @@ package org.chorem.pollen.ui.actions.user; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -79,9 +79,9 @@ public class EditFavoriteListVoter extends PollenActionSupportForEdition impleme favoriteList = getFavoriteService().getFavoriteList( getPollenUserAccount(), favoriteListId); } catch (FavoriteListNotFoundException e) { - addFlashError(_("pollen.error.favoriteList.not.found")); + addFlashError(t("pollen.error.favoriteList.not.found")); } catch (FavoriteListNotOwnedByUserException e) { - addFlashError(_("pollen.error.favoriteList.not.owned.by.user")); + addFlashError(t("pollen.error.favoriteList.not.owned.by.user")); } } @@ -92,15 +92,15 @@ public class EditFavoriteListVoter extends PollenActionSupportForEdition impleme if (StringUtils.isBlank(account.getVotingId())) { addFieldError("editPollAccount.votingId", - _("pollen.error.pollAccount.votingId.required")); + t("pollen.error.pollAccount.votingId.required")); } if (StringUtils.isBlank(account.getEmail())) { addFieldError("editPollAccount.email", - _("pollen.error.email.required")); + t("pollen.error.email.required")); } else if (!StringUtil.isEmail(account.getEmail())) { addFieldError("editPollAccount.email", - _("pollen.error.email.invalid")); + t("pollen.error.email.invalid")); } } @@ -119,14 +119,14 @@ public class EditFavoriteListVoter extends PollenActionSupportForEdition impleme favoriteList, editPollAccount); addFlashMessage( - _("pollen.information.pollAccount.updatedTofavoriteList", + t("pollen.information.pollAccount.updatedTofavoriteList", editPollAccount.getVotingId())); editPollAccount = null; result = SUCCESS; } catch (ParticipantAlreadyFoundInListException e) { addFieldError("editPollAccount.email", - _("pollen.error.favoriteList.participant.already.found.in.list")); + t("pollen.error.favoriteList.participant.already.found.in.list")); } return result; } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java index 76023e9..fd960a0 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -74,7 +74,7 @@ public class Login extends PollenActionSupport { public String execute() throws Exception { if (StringUtils.isBlank(login) || StringUtils.isBlank(password)) { - addFlashError(_("pollen.error.user.bad.login.or.password")); + addFlashError(t("pollen.error.user.bad.login.or.password")); } else { try { @@ -82,12 +82,12 @@ public class Login extends PollenActionSupport { getUserService().connect(login, password); getPollenSession().setUserAccount(userAccount); - addFlashMessage(_("pollen.information.your.are.loggued")); + addFlashMessage(t("pollen.information.your.are.loggued")); } catch (UserNotFoundException e) { - addFlashError(_("pollen.error.user.bad.login.or.password")); + addFlashError(t("pollen.error.user.bad.login.or.password")); } catch (UserInvalidPasswordException e) { - addFlashError(_("pollen.error.user.bad.login.or.password")); + addFlashError(t("pollen.error.user.bad.login.or.password")); } } diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java index 33dcf46..a9dc2f9 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -51,17 +51,17 @@ public class LostPassword extends PollenActionSupport { public String execute() throws Exception { if (StringUtils.isBlank(email) || !StringUtil.isEmail(email)) { - addFlashError(_("pollen.error.lostPassword.email")); + addFlashError(t("pollen.error.lostPassword.email")); } else { try { getUserService().lostPassword(email); - addFlashMessage(_("pollen.information.lostPassword.success")); + addFlashMessage(t("pollen.information.lostPassword.success")); } catch (UserNotFoundException e) { - addFlashError(_("pollen.error.lostPassword.user")); + addFlashError(t("pollen.error.lostPassword.user")); } } return SUCCESS; diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java index 9e1ac28..8256f1e 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -63,25 +63,25 @@ public class Register extends PollenActionSupportForEdition { public void validate() { if (StringUtils.isBlank(pollenUserAccount.getLogin())) { - addFieldError("pollenUserAccount.login", _("pollen.error.login.required")); + addFieldError("pollenUserAccount.login", t("pollen.error.login.required")); } if (StringUtils.isBlank(pollenUserAccount.getPassword())) { - addFieldError("pollenUserAccount.password", _("pollen.error.password.required")); + addFieldError("pollenUserAccount.password", t("pollen.error.password.required")); } if (StringUtils.isBlank(getPassword2())) { - addFieldError("password2", _("pollen.error.password2.required")); + addFieldError("password2", t("pollen.error.password2.required")); } if (ObjectUtils.notEqual(getPassword2(), pollenUserAccount.getPassword())) { - addFieldError("password2", _("pollen.error.passwords.not.equals")); + addFieldError("password2", t("pollen.error.passwords.not.equals")); } if (StringUtils.isBlank(pollenUserAccount.getEmail())) { - addFieldError("pollenUserAccount.email", _("pollen.error.email.required")); + addFieldError("pollenUserAccount.email", t("pollen.error.email.required")); } else if (!StringUtil.isEmail(pollenUserAccount.getEmail())) { - addFieldError("pollenUserAccount.email", _("pollen.error.email.invalid")); + addFieldError("pollenUserAccount.email", t("pollen.error.email.invalid")); } } @@ -93,12 +93,12 @@ public class Register extends PollenActionSupportForEdition { UserAccount createdUser = getUserService().createUser(pollenUserAccount, false); getPollenSession().setUserAccount(createdUser); - addFlashMessage(_("pollen.information.your.are.loggued")); + addFlashMessage(t("pollen.information.your.are.loggued")); result = SUCCESS; } catch (UserLoginAlreadyUsedException e) { - addFieldError("pollenUserAccount.login", _("pollen.error.user.login.already.used")); + addFieldError("pollenUserAccount.login", t("pollen.error.user.login.already.used")); } catch (UserEmailAlreadyUsedException e) { - addFieldError("pollenUserAccount.email", _("pollen.error.user.email.already.used")); + addFieldError("pollenUserAccount.email", t("pollen.error.user.email.already.used")); } // if error go back to input diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java index 5cf3eed..736d98d 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java @@ -22,8 +22,20 @@ */ package org.chorem.pollen.ui.security; -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; +import static org.nuiton.i18n.I18n.n_; + +import java.io.IOException; +import java.util.Locale; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.servlet.ServletContext; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.shiro.util.StringUtils; @@ -41,21 +53,11 @@ import org.chorem.pollen.services.impl.PollService; import org.chorem.pollen.services.impl.SecurityService; import org.chorem.pollen.ui.PollenSession; import org.chorem.pollen.ui.PollenUIUtils; +import org.chorem.pollen.ui.TopiaTransactionFilter; import org.nuiton.topia.TopiaContext; -import org.nuiton.web.filter.TopiaTransactionFilter; -import javax.servlet.ServletContext; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.nuiton.i18n.I18n.n_; +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; public abstract class AbstractPollenAuthorization extends AuthorizationFilter { diff --git a/pom.xml b/pom.xml index 8912381..bf6b042 100644 --- a/pom.xml +++ b/pom.xml @@ -162,24 +162,22 @@ <!-- customized versions --> <topiaVersion>2.8</topiaVersion> <eugenePluginVersion>2.6.3</eugenePluginVersion> - <nuitonI18nVersion>2.5.1</nuitonI18nVersion> + <nuitonI18nVersion>3.3</nuitonI18nVersion> + <nuitonWebVersion>1.18-SNAPSHOT</nuitonWebVersion> + <nuitonUtilsVersion>3.0-rc-8</nuitonUtilsVersion> - <nuitonWebVersion>1.13</nuitonWebVersion> - <nuitonUtilsVersion>2.6.12</nuitonUtilsVersion> <h2Version>1.3.176</h2Version> <postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion> <struts2Version>2.3.15.3</struts2Version> <jqueryPluginVersion>3.5.0</jqueryPluginVersion> <shiroVersion>1.2.4</shiroVersion> <slf4jVersion>1.7.13</slf4jVersion> - <jettyVersion>8.1.11.v20130520</jettyVersion> - <!--jettyVersion>${jettyPluginVersion}</jettyVersion--> + <jettyVersion>9.3.6.v20151106</jettyVersion> + <jettyPluginVersion>9.3.6.v20151106</jettyPluginVersion> <hibernateVersion>4.2.21.Final</hibernateVersion> <seleniumVersion>2.48.2</seleniumVersion> <mockitoVersion>1.10.19</mockitoVersion> - <httpCommonsHttpclientVersion>4.3</httpCommonsHttpclientVersion> - <pollenI18nBundle>pollen-i18n</pollenI18nBundle> <!-- license to use --> <license.licenseName>agpl_v3</license.licenseName> @@ -308,11 +306,17 @@ <artifactId>nuiton-utils</artifactId> <version>${nuitonUtilsVersion}</version> </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-config</artifactId> + <version>3.0-rc-2</version> + </dependency> <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-validator</artifactId> - <version>${nuitonUtilsVersion}</version> + <version>3.0</version> </dependency> <dependency> @@ -458,13 +462,13 @@ <dependency> <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> + <artifactId>javax.servlet-api</artifactId> + <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> - <groupId>org.mortbay.jetty</groupId> + <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-runner</artifactId> <version>${jettyVersion}</version> <scope>provided</scope> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit f84fd9971947d97739e6354e7fb0c25109c3dd3c Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Fri Nov 13 23:37:00 2015 +0100 Copy TransactionFilter for compatibility with topia 2 --- .../chorem/pollen/ui/TopiaTransactionFilter.java | 407 +++++++++++++++++++++ 1 file changed, 407 insertions(+) diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/TopiaTransactionFilter.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/TopiaTransactionFilter.java new file mode 100644 index 0000000..a3ecfd8 --- /dev/null +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/TopiaTransactionFilter.java @@ -0,0 +1,407 @@ +/* + * #%L + * Nuiton Web :: Nuiton Web + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 CodeLutin + * %% + * 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 + * 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. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.chorem.pollen.ui; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hibernate.Transaction; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.TopiaRuntimeException; +import org.nuiton.topia.framework.TopiaContextImplementor; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * <h2>Purpose of this filter</h2> + * This filter purpose is to inject in the request a transaction from + * {@link TopiaContext} and deal with the complete lifecycle of a topia + * transaction while a request. + * <p/> + * The injected transaction will be closed (if was really opened) at the end of + * the request. + * <h2>Configuration of the filter</h2> + * The filter accepts two configuration parameters: + * <ul> + * <li>{@code excludeMethods}: This parameters configure a set of method names + * which should never be called on the proxied transaction. + * When a such method is called on the transaction then the filter will pass in + * the hook {@link #onExcludeMethod(Object, Method, Object[])}. + * <p/> + * Default implementation of this hook is to throw an exception. + * </li> + * <li>{@code unusedMethods}: This parameters configure a set of method names + * which should be by-pass when the proxied transaction was not still open (via a {@link TopiaContext#beginTransaction()}. + * When a such method is called on the transaction then the filter will pass in + * the hook {@link #onUnusedMethod(Object, Method, Object[])}. + * <p/> + * Default implementation of this hook is to not return null values. + * </li> + * </ul> + * <h2>Obtain the transaction</h2> + * The (proxied) transaction is pushed as an attribute in the servlet request. + * <p/> + * The attribute name is defined by field {@link #requestAttributeName} + * (default value is {@link #TOPIA_TRANSACTION_REQUEST_ATTRIBUTE}) and can be + * changed. + * <p/> + * A convience method is created here to obtain the transaction {@link #getTransaction(ServletRequest)} : + * <pre> + * TopiaContext tx = TopiaTransactionFilter.getTransaction(ServletRequest); + * </pre> + * <p/> + * If you prefer to not use this nice method, you can also do this: + * <pre> + * TopiaContext tx = (TopiaContext) request.getAttribute(TopiaTransactionFilter#TOPIA_TRANSACTION_REQUEST_ATTRIBUTE); + * </pre> + * <p/> + * Or + * <pre> + * TopiaContext tx = (TopiaContext) request.getAttribute(modifiedAttributeName); + * </pre> + * + * @author tchemit <chemit@codelutin.com> + * @since 1.6 + */ +public abstract class TopiaTransactionFilter implements Filter { + + public static final String TOPIA_TRANSACTION_REQUEST_ATTRIBUTE = + "topiaTransaction"; + + public static final String[] DEFAULT_EXCLUDE_METHODS = { + "beginTransaction", + "closeContext", + "clear" + }; + + public static final String[] DEFAULT_UNUSED_METHODS = { + "toString", + "isClosed", + "closeContext", + "clear", + "equals", + "hashCode", + "finalize", + "getClass" + }; + + /** Logger. */ + private static final Log log = + LogFactory.getLog(TopiaTransactionFilter.class); + + /** names of methods to forbid access while using proxy. */ + protected Set<String> excludeMethods; + + /** names of methods to by-pass if no transaction opened on proxy. */ + protected Set<String> unusedMethods; + + /** + * Name of the request attribute where to push the transaction. + * <p/> + * By default will use value of + * {@link #TOPIA_TRANSACTION_REQUEST_ATTRIBUTE}. + * + * @since 1.10 + */ + protected String requestAttributeName = TOPIA_TRANSACTION_REQUEST_ATTRIBUTE; + + public Set<String> getExcludeMethods() { + return excludeMethods; + } + + public Set<String> getUnusedMethods() { + return unusedMethods; + } + + /** + * to change the {@link #requestAttributeName}. + * + * @param requestAttributeName new name of the request attribute + * where to push the transaction. + * @since 1.10 + */ + public void setRequestAttributeName(String requestAttributeName) { + this.requestAttributeName = requestAttributeName; + } + + public static TopiaContext getTransaction(ServletRequest request) { + TopiaContext topiaContext = (TopiaContext) + request.getAttribute(TOPIA_TRANSACTION_REQUEST_ATTRIBUTE); + return topiaContext; + } + + /** + * Method to open a new transaction. + * + * @param request incoming request + * @return the new freshly opened transaction + * @throws TopiaRuntimeException if any problem while opening a new transaction + */ + protected abstract TopiaContext beginTransaction(ServletRequest request) throws TopiaRuntimeException; + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + String methodsFromConfig; + + methodsFromConfig = filterConfig.getInitParameter("excludeMethods"); + String[] methods; + if (StringUtils.isNotEmpty(methodsFromConfig)) { + methods = methodsFromConfig.split(","); + } else { + methods = DEFAULT_EXCLUDE_METHODS; + } + excludeMethods = new HashSet<String>(Arrays.asList(methods)); + + methodsFromConfig = filterConfig.getInitParameter("unusedMethods"); + if (StringUtils.isNotEmpty(methodsFromConfig)) { + methods = methodsFromConfig.split(","); + } else { + methods = DEFAULT_UNUSED_METHODS; + } + unusedMethods = new HashSet<String>(Arrays.asList(methods)); + } + + @Override + public void doFilter(ServletRequest request, + ServletResponse response, + FilterChain chain) throws IOException, ServletException { + + // creates a proxy of a lazy transaction + + TopiaTransactionProxyInvocationHandler proxyInvocationHandler = + new TopiaTransactionProxyInvocationHandler(request); + + TopiaContext proxy = (TopiaContext) Proxy.newProxyInstance( + getClass().getClassLoader(), + new Class<?>[]{TopiaContext.class, + TopiaContextImplementor.class}, + proxyInvocationHandler + ); + + // push it in request as an attribute + request.setAttribute(requestAttributeName, proxy); + try { + + // chain to next filter + chain.doFilter(request, response); + } finally { + + // close the real transaction + onCloseTransaction(proxyInvocationHandler.transaction); + } + } + + /** + * Hook method called when a method with his name in + * {@link #excludeMethods} was invoked on the proxied transaction. + * + * @param proxy proxied transaction + * @param method method invoked + * @param args arguments of the invoked method + * @return the return code of the method + * @throws Throwable if any error to do. + */ + protected Object onExcludeMethod(Object proxy, + Method method, + Object[] args) throws Throwable { + + // not authorized + throw new IllegalAccessException( + "Not allowed to access method " + method.getName() + " on " + + proxy); + } + + /** + * Hook method to close the topia transaction of the request at the end of + * the request when all filter has been consumed. + * + * @param transaction the transaction to close (can be null if transaction + * was not required while the current request) + * @since 1.9.1 + */ + protected void onCloseTransaction(TopiaContext transaction) { + if (transaction == null) { + if (log.isTraceEnabled()) { + log.trace("no transaction to close"); + } + } else if (transaction.isClosed()) { + if (log.isTraceEnabled()) { + log.trace("transaction " + transaction + " is already closed"); + } + } else { + if (log.isDebugEnabled()) { + log.debug("closing transaction " + transaction); + } + try { + // let's rollback transaction if the transaction was not rollbacked nor committed + // as the topia context close context does not affect hibernate transaction + // so if something bad happen then we will always have a + Transaction tx = ((TopiaContextImplementor) transaction).getHibernate().getTransaction(); + if (!tx.wasCommitted() && !tx.wasRolledBack()) { + if (log.isDebugEnabled()) { + log.debug("rollback transaction!"); + } + tx.rollback(); + } + transaction.closeContext(); + } catch (TopiaException e) { + throw new TopiaRuntimeException(e); + } + } + } + + /** + * Hook method called when a method with his name in + * {@link #unusedMethods} was invoked on the proxied transaction + * while the underlying transaction is still not opened. + * + * @param proxy the proxy itself + * @param method method invoked + * @param args arguments of the invoked method + * @return the return code of the method + * @throws Throwable if any error to do. + */ + protected Object onUnusedMethod(Object proxy, + Method method, + Object[] args) throws Throwable { + + // by-pass method since no transaction found + + String methodName = method.getName(); + if (log.isDebugEnabled()) { + log.debug("Skip execution of method " + methodName + + " since no transaction is instanciated."); + } + + Set<String> methods = getUnusedMethods(); + if (methods.contains("toString")) { + + return "No transaction opened yet for this proxy"; + } + + if (methods.contains("isClosed")) { + + return false; + } + + if (methods.contains("equals")) { + + return false; + } + + if (methods.contains("hashCode")) { + + return 0; + } + + if (methods.contains("getClass")) { + + return TopiaContext.class; + } + + return null; + } + + /** + * Handler of a proxy on a {@link TopiaContext}. + * + * @see #excludeMethods + */ + public class TopiaTransactionProxyInvocationHandler implements InvocationHandler { + + /** Incoming request that creates this handler. */ + protected final ServletRequest request; + + /** Target to use for the proxy. */ + protected TopiaContext transaction; + + protected TopiaTransactionProxyInvocationHandler(ServletRequest request) { + this.request = request; + } + + @Override + public Object invoke(Object proxy, + Method method, + Object[] args) throws Throwable { + + String methodName = method.getName(); + + if (getExcludeMethods().contains(methodName)) { + + Object result = onExcludeMethod(proxy, method, args); + return result; + } + + if (transaction == null) { + + if (log.isTraceEnabled()) { + log.trace("transaction started due to a call to " + methodName); + } + + if (getUnusedMethods().contains(methodName)) { + + Object result = onUnusedMethod(proxy, method, args); + return result; + } + + // first time transaction is required, create its + transaction = beginTransaction(request); + + if (log.isDebugEnabled()) { + log.debug("Open transaction " + transaction); + } + } + + // can invoke the method on the transaction + try { + Object result = method.invoke(transaction, args); + return result; + } catch (Exception eee) { + if (log.isErrorEnabled()) { + log.error("Could not execute method " + method.getName(), eee); + } + throw eee; + } + } + } + +} -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 730e2599473f37c7041e119867904592214663e7 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:22:54 2015 +0100 Update topia, eugene, hibernate (4.3) --- pollen-persistence/pom.xml | 1 + pollen-persistence/src/main/xmi/pollen.properties | 3 +-- .../chorem/pollen/entities/migration/PollenMigrationCallback.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_1.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_2.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_3.java | 6 +++--- .../pollen/entities/migration/PollenMigrationCallbackV1_3_1.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_4.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_4_5.java | 8 ++++---- .../pollen/entities/migration/PollenMigrationCallbackV1_5.java | 8 ++++---- pom.xml | 6 +++--- 11 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index b30d03d..b56ab8c 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -120,6 +120,7 @@ org.nuiton.topia.generator.TopiaMetaTransformer, org.nuiton.topia.generator.BinderHelperTransformer </templates> + <failIfUnsafe>false</failIfUnsafe> </configuration> <goals> <goal>generate</goal> diff --git a/pollen-persistence/src/main/xmi/pollen.properties b/pollen-persistence/src/main/xmi/pollen.properties index 0bec073..d4ed772 100644 --- a/pollen-persistence/src/main/xmi/pollen.properties +++ b/pollen-persistence/src/main/xmi/pollen.properties @@ -25,10 +25,9 @@ model.tagvalue.notGenerateToString=true model.tagvalue.constantPrefix=PROPERTY_ model.tagvalue.java.lang.String=text model.tagvalue.version=1.5 -model.tagvalue.doNotGenerateBooleanGetMethods=true model.tagvalue.indexForeignKeys=true -org.chorem.pollen.business.persistence.Poll.attribute.choice.stereotype=indexed +org.chorem.pollen.business.persistence.Poll.attribute.choice.stereotype=indexedCollection org.chorem.pollen.business.persistence.Poll.attribute.vote.stereotype=ordered org.chorem.pollen.business.persistence.Poll.attribute.vote.tagvalue.orderBy=topiaCreateDate diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallback.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallback.java index 79e6523..2116b8e 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallback.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallback.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -24,8 +24,8 @@ package org.chorem.pollen.entities.migration; import org.chorem.pollen.entities.PollenDAOHelper; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.util.List; @@ -43,7 +43,7 @@ public class PollenMigrationCallback extends TopiaMigrationCallbackByClassNG { @Override public Version getApplicationVersion() { - return VersionUtil.valueOf(PollenDAOHelper.getModelVersion()); + return Versions.valueOf(PollenDAOHelper.getModelVersion()); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java index 6dd5ddd..16986bf 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -28,8 +28,8 @@ import org.hibernate.dialect.PostgreSQLDialect; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.util.Arrays; import java.util.List; @@ -44,7 +44,7 @@ public class PollenMigrationCallbackV1_1 extends TopiaMigrationCallbackByClassNG @Override public Version getVersion() { - return VersionUtil.valueOf("1.1"); + return Versions.valueOf("1.1"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java index 48e304b..175ff7e 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -28,8 +28,8 @@ import org.hibernate.dialect.PostgreSQLDialect; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.util.Arrays; import java.util.List; @@ -44,7 +44,7 @@ public class PollenMigrationCallbackV1_2 extends TopiaMigrationCallbackByClassNG @Override public Version getVersion() { - return VersionUtil.valueOf("1.2"); + return Versions.valueOf("1.2"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java index d2aa507..43a0f23 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java @@ -32,8 +32,8 @@ import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.framework.TopiaSQLQuery; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.sql.Connection; import java.sql.PreparedStatement; @@ -52,7 +52,7 @@ public class PollenMigrationCallbackV1_3 extends TopiaMigrationCallbackByClassNG @Override public Version getVersion() { - return VersionUtil.valueOf("1.3"); + return Versions.valueOf("1.3"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3_1.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3_1.java index 9461626..c50cdc0 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3_1.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3_1.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -26,8 +26,8 @@ import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.framework.TopiaSQLQuery; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.sql.Connection; import java.sql.PreparedStatement; @@ -45,7 +45,7 @@ public class PollenMigrationCallbackV1_3_1 extends TopiaMigrationCallbackByClass @Override public Version getVersion() { - return VersionUtil.valueOf("1.3.1"); + return Versions.valueOf("1.3.1"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java index d844dee..27ad9f1 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -43,8 +43,8 @@ import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.framework.TopiaSQLQuery; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.io.File; import java.io.IOException; @@ -69,7 +69,7 @@ public class PollenMigrationCallbackV1_4 extends TopiaMigrationCallbackByClassNG @Override public Version getVersion() { - return VersionUtil.valueOf("1.4"); + return Versions.valueOf("1.4"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4_5.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4_5.java index a8c7950..16d94f3 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4_5.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4_5.java @@ -5,7 +5,7 @@ package org.chorem.pollen.entities.migration; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2012 CodeLutin, Tony Chemit + * Copyright (C) 2012 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -26,8 +26,8 @@ import org.chorem.pollen.business.persistence.Poll; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.util.List; @@ -41,7 +41,7 @@ public class PollenMigrationCallbackV1_4_5 extends TopiaMigrationCallbackByClass @Override public Version getVersion() { - return VersionUtil.valueOf("1.4.5"); + return Versions.valueOf("1.4.5"); } @Override diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_5.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_5.java index c54750d..83c1fbd 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_5.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_5.java @@ -6,7 +6,7 @@ package org.chorem.pollen.entities.migration; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -45,8 +45,8 @@ import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.framework.TopiaSQLQuery; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.Versions; import java.sql.Connection; import java.sql.PreparedStatement; @@ -71,7 +71,7 @@ public class PollenMigrationCallbackV1_5 extends TopiaMigrationCallbackByClassNG @Override public Version getVersion() { - return VersionUtil.valueOf("1.5"); + return Versions.valueOf("1.5"); } @Override diff --git a/pom.xml b/pom.xml index bf6b042..bc5d06f 100644 --- a/pom.xml +++ b/pom.xml @@ -160,8 +160,8 @@ <projectId>pollen</projectId> <!-- customized versions --> - <topiaVersion>2.8</topiaVersion> - <eugenePluginVersion>2.6.3</eugenePluginVersion> + <topiaVersion>2.11</topiaVersion> + <eugenePluginVersion>3.0-alpha-1</eugenePluginVersion> <nuitonI18nVersion>3.3</nuitonI18nVersion> <nuitonWebVersion>1.18-SNAPSHOT</nuitonWebVersion> <nuitonUtilsVersion>3.0-rc-8</nuitonUtilsVersion> @@ -174,7 +174,7 @@ <slf4jVersion>1.7.13</slf4jVersion> <jettyVersion>9.3.6.v20151106</jettyVersion> <jettyPluginVersion>9.3.6.v20151106</jettyPluginVersion> - <hibernateVersion>4.2.21.Final</hibernateVersion> + <hibernateVersion>4.3.11.Final</hibernateVersion> <seleniumVersion>2.48.2</seleniumVersion> <mockitoVersion>1.10.19</mockitoVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 28290a9dff795355e78b63b76683feba8bbf0afd Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:27:48 2015 +0100 Update postgresql --- .../entities/migration/PollenMigrationCallbackV1_1.java | 11 ++++++----- .../entities/migration/PollenMigrationCallbackV1_2.java | 11 ++++++----- .../entities/migration/PollenMigrationCallbackV1_3.java | 2 +- pom.xml | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java index 16986bf..ec1c02a 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_1.java @@ -22,18 +22,18 @@ */ package org.chorem.pollen.entities.migration; +import java.util.Arrays; +import java.util.List; + import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; -import org.hibernate.dialect.PostgreSQLDialect; +import org.hibernate.dialect.PostgreSQL81Dialect; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; import org.nuiton.util.version.Version; import org.nuiton.util.version.Versions; -import java.util.Arrays; -import java.util.List; - /** * Migration for version {@code 1.1}. * @@ -60,7 +60,8 @@ public class PollenMigrationCallbackV1_1 extends TopiaMigrationCallbackByClassNG String[] sqls = null; // Script de migration - if (dialect instanceof PostgreSQLDialect) { + // PostgreSQL81Dialect must match PostgreSQLDialect and PostgreSQL9Dialect + if (dialect instanceof PostgreSQL81Dialect) { sqls = new String[]{ "alter table useraccount rename langage to language;", "alter table pollaccount add accountid varchar;", diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java index 175ff7e..a8e2e70 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java @@ -22,18 +22,18 @@ */ package org.chorem.pollen.entities.migration; +import java.util.Arrays; +import java.util.List; + import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; -import org.hibernate.dialect.PostgreSQLDialect; +import org.hibernate.dialect.PostgreSQL81Dialect; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG; import org.nuiton.util.version.Version; import org.nuiton.util.version.Versions; -import java.util.Arrays; -import java.util.List; - /** * Migration for version {@code 1.2}. * @@ -59,7 +59,8 @@ public class PollenMigrationCallbackV1_2 extends TopiaMigrationCallbackByClassNG String[] sqls = null; - if (dialect instanceof PostgreSQLDialect) { + // PostgreSQL81Dialect must match PostgreSQLDialect and PostgreSQL9Dialect + if (dialect instanceof PostgreSQL81Dialect) { sqls = new String[]{ "alter table poll add endchoicedate timestamp without time zone;"}; } else if (dialect instanceof H2Dialect) { diff --git a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java index 43a0f23..edc5443 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java +++ b/pollen-services/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_3.java @@ -236,7 +236,7 @@ public class PollenMigrationCallbackV1_3 extends TopiaMigrationCallbackByClassNG // build the new mapping between old id associated to new enum ordinal Map<String, Integer> result = Maps.newHashMap(); - for (Enum choiceType : enums) { + for (Enum<E> choiceType : enums) { // find it in existing mapping String name = choiceType.name(); diff --git a/pom.xml b/pom.xml index bc5d06f..4afa678 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ <nuitonUtilsVersion>3.0-rc-8</nuitonUtilsVersion> <h2Version>1.3.176</h2Version> - <postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion> + <postgresqlVersion>9.4-1205-jdbc41</postgresqlVersion> <struts2Version>2.3.15.3</struts2Version> <jqueryPluginVersion>3.5.0</jqueryPluginVersion> <shiroVersion>1.2.4</shiroVersion> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit b2970d948b4a79cf45f6eb5c299670cc438fd73c Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:36:37 2015 +0100 Replace deprecated i18n methods --- .../pollen/business/persistence/ChoiceType.java | 10 ++--- .../persistence/PollCommentVisibility.java | 6 +-- .../pollen/business/persistence/PollType.java | 8 ++-- .../business/persistence/PollVoteVisibility.java | 18 ++++----- .../pollen/services/PollenServiceSupport.java | 8 ++-- .../exceptions/FavoriteListImportException.java | 14 +++---- .../chorem/pollen/services/impl/EmailService.java | 32 ++++++++-------- .../pollen/services/impl/FavoriteService.java | 6 +-- .../pollen/services/impl/PollFeedService.java | 44 +++++++++++----------- .../chorem/pollen/services/impl/PollService.java | 18 ++++----- .../pollen/services/impl/SecurityService.java | 8 ++-- .../chorem/pollen/services/impl/UserService.java | 10 ++--- .../pollen/votecounting/AbstractVoteCounting.java | 14 +++---- .../pollen/votecounting/BordaVoteCounting.java | 14 +++---- .../pollen/votecounting/CondorcetVoteCounting.java | 14 +++---- .../pollen/votecounting/CoombsVoteCounting.java | 14 +++---- .../votecounting/InstantRunoffVoteCounting.java | 14 +++---- .../pollen/votecounting/NormalVoteCounting.java | 10 ++--- .../pollen/votecounting/NumberVoteCounting.java | 10 ++--- .../votecounting/PercentageVoteCounting.java | 14 +++---- 20 files changed, 143 insertions(+), 143 deletions(-) diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/ChoiceType.java b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/ChoiceType.java index 47b5a01..511c6e6 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/ChoiceType.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/ChoiceType.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -22,12 +22,12 @@ */ package org.chorem.pollen.business.persistence; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; public enum ChoiceType implements I18nAble { - TEXT(n_("pollen.choiceType.text")), - DATE(n_("pollen.choiceType.date")), - IMAGE(n_("pollen.choiceType.image")); + TEXT(n("pollen.choiceType.text")), + DATE(n("pollen.choiceType.date")), + IMAGE(n("pollen.choiceType.image")); private final String i18nKey; diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollCommentVisibility.java b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollCommentVisibility.java index fcf57e4..f47fc69 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollCommentVisibility.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollCommentVisibility.java @@ -22,7 +22,7 @@ package org.chorem.pollen.business.persistence; * #L% */ -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Define how comment can be shown in a poll. @@ -33,9 +33,9 @@ import static org.nuiton.i18n.I18n.n_; public enum PollCommentVisibility implements I18nAble { /** Nobody can see comments. */ - NOBODY(n_("pollen.pollCommentVisibilty.nobody")), + NOBODY(n("pollen.pollCommentVisibilty.nobody")), /** Every body can see comments. */ - EVERYBODY(n_("pollen.pollCommentVisibilty.everybody")); + EVERYBODY(n("pollen.pollCommentVisibilty.everybody")); private final String i18nKey; diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollType.java b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollType.java index ffc733a..9cf5d62 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollType.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollType.java @@ -22,13 +22,13 @@ */ package org.chorem.pollen.business.persistence; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; public enum PollType implements I18nAble { - FREE(n_("pollen.pollType.free")), - RESTRICTED(n_("pollen.pollType.restricted")), - GROUP(n_("pollen.pollType.group")); + FREE(n("pollen.pollType.free")), + RESTRICTED(n("pollen.pollType.restricted")), + GROUP(n("pollen.pollType.group")); private final String i18nKey; diff --git a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollVoteVisibility.java b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollVoteVisibility.java index 34fd38c..e25f135 100644 --- a/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollVoteVisibility.java +++ b/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollVoteVisibility.java @@ -22,7 +22,7 @@ package org.chorem.pollen.business.persistence; * #L% */ -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Define how vote can be visible in a poll. @@ -37,17 +37,17 @@ public enum PollVoteVisibility implements I18nAble { * <p/> * This means every votes are anonymous. */ - NOBODY(n_("pollen.pollVoteVisibilty.nobody"), - n_("pollen.pollVoteVisibilty.nobody.help")), + NOBODY(n("pollen.pollVoteVisibilty.nobody"), + n("pollen.pollVoteVisibilty.nobody.help")), /** Only creator (or Pollen adin) can see votes. */ - CREATOR_ONLY(n_("pollen.pollVoteVisibilty.creatorOnly"), - n_("pollen.pollVoteVisibilty.creatorOnly.help")), + CREATOR_ONLY(n("pollen.pollVoteVisibilty.creatorOnly"), + n("pollen.pollVoteVisibilty.creatorOnly.help")), /** Only participant of poll can see votes. */ - PARTICIPANT_ONLY(n_("pollen.pollVoteVisibilty.participantOnly"), - n_("pollen.pollVoteVisibilty.participantOnly.help")), + PARTICIPANT_ONLY(n("pollen.pollVoteVisibilty.participantOnly"), + n("pollen.pollVoteVisibilty.participantOnly.help")), /** Every body can see votes. */ - EVERYBODY(n_("pollen.pollVoteVisibilty.everybody"), - n_("pollen.pollVoteVisibilty.everybody.help")); + EVERYBODY(n("pollen.pollVoteVisibilty.everybody"), + n("pollen.pollVoteVisibilty.everybody.help")); private final String i18nKey; diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceSupport.java b/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceSupport.java index 058249a..7d74d07 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceSupport.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceSupport.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -38,7 +38,7 @@ import java.util.Date; import java.util.List; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.l; /** * @author tchemit <chemit@codelutin.com> @@ -112,12 +112,12 @@ public class PollenServiceSupport implements PollenService { } public String getDateTimePattern() { - String result = l_(serviceContext.getLocale(), "pollen.common.dateTimePattern"); + String result = l(serviceContext.getLocale(), "pollen.common.dateTimePattern"); return result; } public String getDatePattern() { - String result = l_(serviceContext.getLocale(), "pollen.common.datePattern"); + String result = l(serviceContext.getLocale(), "pollen.common.datePattern"); return result; } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java b/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java index fffacff..a820b21 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -24,9 +24,9 @@ package org.chorem.pollen.services.exceptions; import java.util.Locale; -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.t; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Exception during favorite list import. There is @@ -38,14 +38,14 @@ public class FavoriteListImportException extends Exception { private static final long serialVersionUID = 1L; - private static final String I18N_KEY = n_("pollen.error.import"); + private static final String I18N_KEY = n("pollen.error.import"); private String importName; private String causeMessage; public FavoriteListImportException(String importName, String causeMessage, Throwable cause) { - super(_(I18N_KEY, importName, causeMessage), cause); + super(t(I18N_KEY, importName, causeMessage), cause); this.importName = importName; this.causeMessage = causeMessage; } @@ -76,7 +76,7 @@ public class FavoriteListImportException extends Exception { result = getMessage(); } else { - result = l_(locale, I18N_KEY, getImportName(), getCauseMessage()); + result = l(locale, I18N_KEY, getImportName(), getCauseMessage()); } return result; } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java index de4ed88..d0e6bf1 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -42,7 +42,7 @@ import org.nuiton.util.StringUtil; import java.util.List; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.l; public class EmailService extends PollenServiceSupport { @@ -55,9 +55,9 @@ public class EmailService extends PollenServiceSupport { StringUtil.isEmail(user.getEmail())) { Locale locale = getLocale(); - String subject = l_(locale, "pollen.email.userRegister.subject", + String subject = l(locale, "pollen.email.userRegister.subject", user.getLogin()); - String content = l_(locale, "pollen.email.userRegister.content", + String content = l(locale, "pollen.email.userRegister.content", user.getDisplayName(), user.getLogin(), user.getPassword(), serviceContext.getApplicationURL()); @@ -76,9 +76,9 @@ public class EmailService extends PollenServiceSupport { Locale locale = getLocale(); - String subject = l_(locale, "pollen.email.lostPassword.subject", + String subject = l(locale, "pollen.email.lostPassword.subject", user.getLogin()); - String content = l_(locale, "pollen.email.lostPassword.content", + String content = l(locale, "pollen.email.lostPassword.content", user.getDisplayName(), user.getLogin(), newPassword, serviceContext.getApplicationURL()); @@ -109,9 +109,9 @@ public class EmailService extends PollenServiceSupport { int nbVotes = poll.sizeVote(); - String subject = l_(locale, "pollen.email.voteEmail.subject", + String subject = l(locale, "pollen.email.voteEmail.subject", pollTitle); - String content = l_(locale, "pollen.email.voteEmail.content", + String content = l(locale, "pollen.email.voteEmail.content", pollTitle, nbVotes, summaryUrl); PollenEmail pollenEmail = createPollenEmail( @@ -139,15 +139,15 @@ public class EmailService extends PollenServiceSupport { String subject, content; if (poll.isPollFree()) { - subject = l_(locale, "pollen.email.createPoll.subject", + subject = l(locale, "pollen.email.createPoll.subject", pollTitle); - content = l_(locale, "pollen.email.createPoll.content", + content = l(locale, "pollen.email.createPoll.content", pollTitle, poll.getPollId(), summaryUrl); } else { - subject = l_(locale, "pollen.email.createRestrictedPoll.subject", + subject = l(locale, "pollen.email.createRestrictedPoll.subject", pollTitle); - content = l_(locale, "pollen.email.createRestrictedPoll.content", + content = l(locale, "pollen.email.createRestrictedPoll.content", pollTitle, summaryUrl); } @@ -212,7 +212,7 @@ public class EmailService extends PollenServiceSupport { List<PollAccount> votingPollAccounts = poll.getPollAccounts(true); if (CollectionUtils.isNotEmpty(votingPollAccounts)) { - String subject = l_(locale, "pollen.email.reminderEmail.subject", + String subject = l(locale, "pollen.email.reminderEmail.subject", pollTitle); List<PollenEmail> emails = Lists.newArrayList(); @@ -221,7 +221,7 @@ public class EmailService extends PollenServiceSupport { PollUrl.newPollUrl(voteURL, account.getAccountId()); String content = - l_(locale, "pollen.email.reminderEmail.content", + l(locale, "pollen.email.reminderEmail.content", pollTitle, account.getVotingId(), accountVoteURL); PollenEmail pollenEmail = createPollenEmail( @@ -239,14 +239,14 @@ public class EmailService extends PollenServiceSupport { PollAccount account, PollUrl voteURL) { - String subject = l_(locale, "pollen.email.votingEmail.subject", + String subject = l(locale, "pollen.email.votingEmail.subject", pollTitle); PollUrl accountVoteURL = PollUrl.newPollUrl(voteURL, account.getAccountId()); String content = - l_(locale, "pollen.email.votingEmail.content", + l(locale, "pollen.email.votingEmail.content", pollTitle, account.getVotingId(), accountVoteURL); PollenEmail result = createPollenEmail( diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java index 001c19d..c94801d 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -64,7 +64,7 @@ import java.util.List; import java.util.Locale; import java.util.Properties; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.l; public class FavoriteService extends PollenServiceSupport { @@ -401,7 +401,7 @@ public class FavoriteService extends PollenServiceSupport { if (!StringUtil.isEmail(email)) { // email is not valid - String error = l_(locale, "pollen.error.import.invalid.email", lineNumber, email); + String error = l(locale, "pollen.error.import.invalid.email", lineNumber, email); throw new FavoriteListImportException(filename, error, null); } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java index 6e2a76e..4d3da98 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -53,8 +53,8 @@ import java.io.IOException; import java.io.Writer; import java.util.List; -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.t; +import static org.nuiton.i18n.I18n.l; /** * Service to manage feed of a poll. @@ -107,10 +107,10 @@ public class PollFeedService extends PollenServiceSupport { public void onPollCreated(Poll poll) { - String title = _("pollen.feed.createPollContent", + String title = t("pollen.feed.createPollContent", poll.getCreator().getVotingId()); - String content = _("pollen.feed.createPollContent", + String content = t("pollen.feed.createPollContent", poll.getDescription()); addFeedEntry(poll, title, content); @@ -119,10 +119,10 @@ public class PollFeedService extends PollenServiceSupport { public void onCommentAdded(Poll poll, Comment comment) { - String title = _("pollen.feed.addCommentTitle", + String title = t("pollen.feed.addCommentTitle", comment.getAuthor()); - String content = _("pollen.feed.addCommentContent", + String content = t("pollen.feed.addCommentContent", comment.getText()); addFeedEntry(poll, title, content); @@ -130,11 +130,11 @@ public class PollFeedService extends PollenServiceSupport { public void onCommentDeleted(Poll poll, Comment comment, String reason) { - String title = _("pollen.feed.deleteCommentTitle", + String title = t("pollen.feed.deleteCommentTitle", comment.getAuthor(), reason); String content = - _("pollen.feed.deleteCommentContent", comment.getText()); + t("pollen.feed.deleteCommentContent", comment.getText()); addFeedEntry(poll, title, content); } @@ -150,14 +150,14 @@ public class PollFeedService extends PollenServiceSupport { if (vote.isAnonymous()) { - userId = _("pollen.common.anonymous"); + userId = t("pollen.common.anonymous"); } else { userId = vote.getPollAccount().getVotingId(); } - String title = _("pollen.feed.addVoteTitle", userId); + String title = t("pollen.feed.addVoteTitle", userId); - String content = _("pollen.feed.addVoteContent", pollResult); + String content = t("pollen.feed.addVoteContent", pollResult); addFeedEntry(poll, title, content); } @@ -173,14 +173,14 @@ public class PollFeedService extends PollenServiceSupport { if (vote.isAnonymous()) { - userId = _("pollen.common.anonymous"); + userId = t("pollen.common.anonymous"); } else { userId = vote.getPollAccount().getVotingId(); } - String title = _("pollen.feed.updateVoteTitle", userId); + String title = t("pollen.feed.updateVoteTitle", userId); - String content = _("pollen.feed.updateVoteContent", pollResult); + String content = t("pollen.feed.updateVoteContent", pollResult); addFeedEntry(poll, title, content); } @@ -195,23 +195,23 @@ public class PollFeedService extends PollenServiceSupport { String userId; if (vote.isAnonymous()) { - userId = _("pollen.common.anonymous"); + userId = t("pollen.common.anonymous"); } else { userId = voteAccount.getVotingId(); } - String title = _("pollen.feed.deleteVoteTitle", userId, reason); + String title = t("pollen.feed.deleteVoteTitle", userId, reason); - String content = _("pollen.feed.deleteVoteContent", pollResult); + String content = t("pollen.feed.deleteVoteContent", pollResult); addFeedEntry(poll, title, content); } public void onChoiceAdded(Poll poll, Choice choice) { - String title = _("pollen.feed.addChoiceTitle", choice.getName()); + String title = t("pollen.feed.addChoiceTitle", choice.getName()); - String content = _("pollen.feed.addChoiceContent", + String content = t("pollen.feed.addChoiceContent", choice.getDescription()); addFeedEntry(poll, title, content); @@ -321,9 +321,9 @@ public class PollFeedService extends PollenServiceSupport { protected SyndFeed createFeed(File file, Poll poll) throws IOException, FeedException { - String title = l_(getLocale(), "pollen.feed.pollTitle", + String title = l(getLocale(), "pollen.feed.pollTitle", poll.getTitle()); - String description = l_(getLocale(), "pollen.feed.pollDescription", + String description = l(getLocale(), "pollen.feed.pollDescription", poll.getDescription()); PollUrlService urlService = newService(PollUrlService.class); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java index e8e794b..42e9ca7 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -74,7 +74,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.l; public class PollService extends PollenServiceSupport { @@ -243,12 +243,12 @@ public class PollService extends PollenServiceSupport { ); Locale l = serviceContext.getLocale(); if (poll.getBeginDate() == null) { - map.put(Poll.PROPERTY_BEGIN_DATE, l_(l, "pollen.common.undefined")); + map.put(Poll.PROPERTY_BEGIN_DATE, l(l, "pollen.common.undefined")); } else { map.put(Poll.PROPERTY_BEGIN_DATE, decorateDate(poll.getBeginDate())); } if (poll.getEndDate() == null) { - map.put(Poll.PROPERTY_END_DATE, l_(l, "pollen.common.undefined")); + map.put(Poll.PROPERTY_END_DATE, l(l, "pollen.common.undefined")); } else { map.put(Poll.PROPERTY_END_DATE, decorateDate(poll.getEndDate())); } @@ -265,26 +265,26 @@ public class PollService extends PollenServiceSupport { // can always add choices addingchoiceText = - l_(l, "pollen.common.addingChoicesAlways"); + l(l, "pollen.common.addingChoicesAlways"); } else if (beginDate == null) { // until enddate addingchoiceText = - l_(l, "pollen.common.addingChoicesTo", + l(l, "pollen.common.addingChoicesTo", decorateDate(endDate)); } else if (endDate == null) { // from begin date addingchoiceText = - l_(l, "pollen.common.addingChoicesFrom", + l(l, "pollen.common.addingChoicesFrom", decorateDate(beginDate)); } else { addingchoiceText = - l_(l, "pollen.common.addingChoicesContent", + l(l, "pollen.common.addingChoicesContent", decorateDate(beginDate), decorateDate(endDate)); } } else { - addingchoiceText = l_(l, "pollen.common.unauthorized"); + addingchoiceText = l(l, "pollen.common.unauthorized"); } map.put("addingChoices", addingchoiceText); map.put("id", poll.getTopiaId()); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java index e6d7242..db6763c 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java @@ -44,7 +44,7 @@ import java.util.List; import java.util.Set; import static org.chorem.pollen.PollenUserSecurityContext.PollenUserSecurityRole; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Service to manager security. @@ -132,7 +132,7 @@ public class SecurityService extends PollenServiceSupport { if (!continuousResults && !poll.isClosed()) { // results are not continuous and poll is not closed - return n_("pollen.security.error.poll.not.closed.and.results.not.continuous"); + return n("pollen.security.error.poll.not.closed.and.results.not.continuous"); } if (!publicResults) { @@ -142,7 +142,7 @@ public class SecurityService extends PollenServiceSupport { if (!securityContext.isCreator() && !securityContext.isAdmin()) { // not a poll admin, can not access result - return n_("pollen.security.error.poll.result.private.and.access.not.granted"); + return n("pollen.security.error.poll.result.private.and.access.not.granted"); } } @@ -180,7 +180,7 @@ public class SecurityService extends PollenServiceSupport { if (!poll.isPollFree() && !securityContext.isRestrictedVoter()) { // on none free poll, only restricted user can vote - return n_("pollen.security.error.poll.not.free.and.access.not.granted"); + return n("pollen.security.error.poll.not.free.and.access.not.granted"); } return null; } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java b/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java index 4e1f3a4..551ab02 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java @@ -4,7 +4,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + * Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -46,7 +46,7 @@ import org.nuiton.util.beans.Binder; import java.util.List; -import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.t; public class UserService extends PollenServiceSupport { @@ -300,12 +300,12 @@ public class UserService extends PollenServiceSupport { try { createUser(user, false); if (log.isInfoEnabled()) { - log.info(_("pollen.info.admin.created", login)); + log.info(t("pollen.info.admin.created", login)); } } catch (Exception eee) { if (log.isInfoEnabled()) { - log.info(_("pollen.info.admin.exists") + " : " + - _(eee.getMessage())); + log.info(t("pollen.info.admin.exists") + " : " + + t(eee.getMessage())); } } } diff --git a/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCounting.java b/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCounting.java index e797c20..4ced60d 100644 --- a/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCounting.java +++ b/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/AbstractVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -25,7 +25,7 @@ package org.chorem.pollen.votecounting; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; +import static org.nuiton.i18n.I18n.l; /** * Base abstract implementation of a {@link VoteCounting}. @@ -73,22 +73,22 @@ public abstract class AbstractVoteCounting<S extends VoteCountingStrategy> imple @Override public final String getName(Locale locale) { - String result = l_(locale, i18nName); + String result = l(locale, i18nName); return result; } @Override public final String getShortHelp(Locale locale) { - String voteName = l_(locale, i18nName); - String voteHelp = l_(locale, i18nShortHelp); + String voteName = l(locale, i18nName); + String voteHelp = l(locale, i18nShortHelp); String result = - l_(locale, "pollen.voteCountingType.help", voteName, voteHelp); + l(locale, "pollen.voteCountingType.help", voteName, voteHelp); return result; } @Override public final String getHelp(Locale locale) { - String result = l_(locale, i18nHelp); + String result = l(locale, i18nHelp); return result; } diff --git a/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java b/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java index 93c11bf..1838e2e 100644 --- a/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java +++ b/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,8 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Borda vote counting entry point. @@ -43,9 +43,9 @@ public class BordaVoteCounting extends AbstractVoteCounting<BordaVoteCountingStr public BordaVoteCounting() { super(ID, BordaVoteCountingStrategy.class, - n_("pollen.voteCountingType.borda"), - n_("pollen.voteCountingType.borda.shortHelp"), - n_("pollen.voteCountingType.borda.help") + n("pollen.voteCountingType.borda"), + n("pollen.voteCountingType.borda.shortHelp"), + n("pollen.voteCountingType.borda.help") ); } @@ -59,7 +59,7 @@ public class BordaVoteCounting extends AbstractVoteCounting<BordaVoteCountingStr public String getVoteValueNotValidMessage(Locale locale, String choiceName, String voteValue) { - return l_(locale, "pollen.error.vote.invalidBordaVoteValue", + return l(locale, "pollen.error.vote.invalidBordaVoteValue", choiceName, voteValue); } diff --git a/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java b/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java index 2708765..e2ad38b 100644 --- a/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java +++ b/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,8 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -43,9 +43,9 @@ public class CondorcetVoteCounting extends AbstractVoteCounting<CondorcetVoteCou public CondorcetVoteCounting() { super(ID, CondorcetVoteCountingStrategy.class, - n_("pollen.voteCountingType.condorcet"), - n_("pollen.voteCountingType.condorcet.shortHelp"), - n_("pollen.voteCountingType.condorcet.help") + n("pollen.voteCountingType.condorcet"), + n("pollen.voteCountingType.condorcet.shortHelp"), + n("pollen.voteCountingType.condorcet.help") ); } @@ -59,7 +59,7 @@ public class CondorcetVoteCounting extends AbstractVoteCounting<CondorcetVoteCou public String getVoteValueNotValidMessage(Locale locale, String choiceName, String voteValue) { - return l_(locale, "pollen.error.vote.invalidCondorcetVoteValue", + return l(locale, "pollen.error.vote.invalidCondorcetVoteValue", choiceName, voteValue); } diff --git a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java index 320f20e..e8f78d2 100644 --- a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java +++ b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,8 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -43,9 +43,9 @@ public class CoombsVoteCounting extends AbstractVoteCounting<CoombsVoteCountingS public CoombsVoteCounting() { super(ID, CoombsVoteCountingStrategy.class, - n_("pollen.voteCountingType.coombs"), - n_("pollen.voteCountingType.coombs.shortHelp"), - n_("pollen.voteCountingType.coombs.help") + n("pollen.voteCountingType.coombs"), + n("pollen.voteCountingType.coombs.shortHelp"), + n("pollen.voteCountingType.coombs.help") ); } @@ -59,7 +59,7 @@ public class CoombsVoteCounting extends AbstractVoteCounting<CoombsVoteCountingS public String getVoteValueNotValidMessage(Locale locale, String choiceName, String voteValue) { - return l_(locale, "pollen.error.vote.invalidCoombsVoteValue", + return l(locale, "pollen.error.vote.invalidCoombsVoteValue", choiceName, voteValue); } diff --git a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java index 24e92ed..a18dc21 100644 --- a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java +++ b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,8 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -43,9 +43,9 @@ public class InstantRunoffVoteCounting extends AbstractVoteCounting<InstantRunof public InstantRunoffVoteCounting() { super(ID, InstantRunoffVoteCountingStrategy.class, - n_("pollen.voteCountingType.instantRunoff"), - n_("pollen.voteCountingType.instantRunoff.shortHelp"), - n_("pollen.voteCountingType.instantRunoff.help") + n("pollen.voteCountingType.instantRunoff"), + n("pollen.voteCountingType.instantRunoff.shortHelp"), + n("pollen.voteCountingType.instantRunoff.help") ); } @@ -59,7 +59,7 @@ public class InstantRunoffVoteCounting extends AbstractVoteCounting<InstantRunof public String getVoteValueNotValidMessage(Locale locale, String choiceName, String voteValue) { - return l_(locale, "pollen.error.vote.invalidInstantRunoffVoteValue", + return l(locale, "pollen.error.vote.invalidInstantRunoffVoteValue", choiceName, voteValue); } diff --git a/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java b/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java index 8a1260f..9ace647 100644 --- a/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java +++ b/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -42,9 +42,9 @@ public class NormalVoteCounting extends AbstractVoteCounting<NormalVoteCountingS public NormalVoteCounting() { super(ID, NormalVoteCountingStrategy.class, - n_("pollen.voteCountingType.normal"), - n_("pollen.voteCountingType.normal.shortHelp"), - n_("pollen.voteCountingType.normal.help") + n("pollen.voteCountingType.normal"), + n("pollen.voteCountingType.normal.shortHelp"), + n("pollen.voteCountingType.normal.help") ); } diff --git a/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java b/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java index 53458e5..5b055e0 100644 --- a/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java +++ b/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,7 +27,7 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -42,9 +42,9 @@ public class NumberVoteCounting extends AbstractVoteCounting<NumberVoteCountingS public NumberVoteCounting() { super(ID, NumberVoteCountingStrategy.class, - n_("pollen.voteCountingType.number"), - n_("pollen.voteCountingType.number.shortHelp"), - n_("pollen.voteCountingType.number.help") + n("pollen.voteCountingType.number"), + n("pollen.voteCountingType.number.shortHelp"), + n("pollen.voteCountingType.number.help") ); } diff --git a/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java b/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java index f209ff5..97bb695 100644 --- a/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java +++ b/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java @@ -6,7 +6,7 @@ package org.chorem.pollen.votecounting; * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -27,8 +27,8 @@ import org.chorem.pollen.votecounting.model.ChoiceToVoteRenderType; import java.util.Locale; -import static org.nuiton.i18n.I18n.l_; -import static org.nuiton.i18n.I18n.n_; +import static org.nuiton.i18n.I18n.l; +import static org.nuiton.i18n.I18n.n; /** * Coombs vote counting entry point. @@ -43,9 +43,9 @@ public class PercentageVoteCounting extends AbstractVoteCounting<PercentageVoteC public PercentageVoteCounting() { super(ID, PercentageVoteCountingStrategy.class, - n_("pollen.voteCountingType.percentage"), - n_("pollen.voteCountingType.percentage.shortHelp"), - n_("pollen.voteCountingType.percentage.help") + n("pollen.voteCountingType.percentage"), + n("pollen.voteCountingType.percentage.shortHelp"), + n("pollen.voteCountingType.percentage.help") ); } @@ -91,7 +91,7 @@ public class PercentageVoteCounting extends AbstractVoteCounting<PercentageVoteC @Override public String getTotalVoteValueNotValidMessage(Locale locale) { - return l_(locale, "pollen.error.vote.percentage"); + return l(locale, "pollen.error.vote.percentage"); } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 53ec7cc8b3c0d2d70c353711f2569bd07ba938a8 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 09:38:42 2015 +0100 Update postgresql --- pollen-ui-struts2/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pollen-ui-struts2/pom.xml b/pollen-ui-struts2/pom.xml index 5f3bbbd..75d6e65 100644 --- a/pollen-ui-struts2/pom.xml +++ b/pollen-ui-struts2/pom.xml @@ -207,7 +207,7 @@ </dependency> <dependency> - <groupId>postgresql</groupId> + <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <scope>runtime</scope> </dependency> diff --git a/pom.xml b/pom.xml index 4afa678..b0f8f32 100644 --- a/pom.xml +++ b/pom.xml @@ -288,7 +288,7 @@ </dependency> <dependency> - <groupId>postgresql</groupId> + <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>${postgresqlVersion}</version> </dependency> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit b4a95b9a32fbebc0128272090484611f9a584363 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:06:09 2015 +0100 Update struts, struts-jquery-plugin --- .../src/main/resources/template/jquery/theme.properties | 1 + pollen-ui-struts2/src/main/webapp/js/ckeditor.config.js | 4 +++- pom.xml | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pollen-ui-struts2/src/main/resources/template/jquery/theme.properties b/pollen-ui-struts2/src/main/resources/template/jquery/theme.properties new file mode 100644 index 0000000..db3f7aa --- /dev/null +++ b/pollen-ui-struts2/src/main/resources/template/jquery/theme.properties @@ -0,0 +1 @@ +parent = css_xhtml \ No newline at end of file diff --git a/pollen-ui-struts2/src/main/webapp/js/ckeditor.config.js b/pollen-ui-struts2/src/main/webapp/js/ckeditor.config.js index 6af4a7e..e9e401b 100644 --- a/pollen-ui-struts2/src/main/webapp/js/ckeditor.config.js +++ b/pollen-ui-struts2/src/main/webapp/js/ckeditor.config.js @@ -28,11 +28,13 @@ CKEDITOR.editorConfig = function (config) { // ['Cut', 'Copy', 'Paste', 'PasteText', /*'PasteFromWord'*/, '-', 'Undo', 'Redo', '-', 'Scayt'], // [ 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['Styles', 'Format'], - ['Bold', 'Italic', 'Strike', 'Underline','Strike','Subscript','Superscript'], + ['Bold', 'Italic', 'Strike', 'Underline'/* ,'Subscript', 'Superscript'*/], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'TextColor','BGColor'], // '/', ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar'/*, 'PageBreak'*/, 'Link', 'Unlink', 'Anchor' ] ]; + + config.removePlugins = 'elementspath'; }; \ No newline at end of file diff --git a/pom.xml b/pom.xml index b0f8f32..5b4b521 100644 --- a/pom.xml +++ b/pom.xml @@ -168,8 +168,8 @@ <h2Version>1.3.176</h2Version> <postgresqlVersion>9.4-1205-jdbc41</postgresqlVersion> - <struts2Version>2.3.15.3</struts2Version> - <jqueryPluginVersion>3.5.0</jqueryPluginVersion> + <struts2Version>2.3.24.1</struts2Version> + <jqueryPluginVersion>3.7.1</jqueryPluginVersion> <shiroVersion>1.2.4</shiroVersion> <slf4jVersion>1.7.13</slf4jVersion> <jettyVersion>9.3.6.v20151106</jettyVersion> @@ -207,6 +207,7 @@ </repository> </repositories> + <pluginRepositories> <pluginRepository> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 124bd373650585f228851edca37a2fad38309c1d Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:16:18 2015 +0100 Fix jquery attr/prop change (1.6+) --- pollen-ui-struts2/src/main/webapp/js/createPoll.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pollen-ui-struts2/src/main/webapp/js/createPoll.js b/pollen-ui-struts2/src/main/webapp/js/createPoll.js index e5da729..3be55ba 100644 --- a/pollen-ui-struts2/src/main/webapp/js/createPoll.js +++ b/pollen-ui-struts2/src/main/webapp/js/createPoll.js @@ -559,8 +559,8 @@ jQuery(document).ready(function () { container.removeClass('hidden').addClass('thispoll'). each(undisableAll); - $('[name="poll.pollType"]').attr('checked', false); - $('[name="poll.pollType"][value="' + type + '"]').attr('checked', 'checked'); + $('[name="poll.pollType"]').prop('checked', false); + $('[name="poll.pollType"][value="' + type + '"]').prop('checked', 'checked'); } function changeChoiceType(type) { @@ -573,8 +573,8 @@ jQuery(document).ready(function () { container.removeClass('hidden'). addClass('thischoice').each(undisableAll); - $('[name="poll.choiceType"]').attr('checked', false); - $('[name="poll.choiceType"][value="' + type + '"]').attr('checked', 'checked'); + $('[name="poll.choiceType"]').prop('checked', false); + $('[name="poll.choiceType"][value="' + type + '"]').prop('checked', 'checked'); } $('[name="poll.choiceAddAllowed"]').change(function () { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch pollen-udpate-1.6 in repository pollen_1.x. See http://git.chorem.org/pollen_1.x.git commit 12a68bb5e6e5a72ecff5810ed3420b76b42efad2 Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Sat Nov 14 11:21:40 2015 +0100 Update jfreechart --- pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp | 9 +++------ pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp index 35db237..39b657d 100644 --- a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp +++ b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp @@ -126,16 +126,13 @@ <div class="chartTypeDiv"> <sj:a id='displayChart1' href="#" onclick="return displayCharts(1);"> <img src="<s:url value='/img/rep1.png'/>" - title='<s:text name="pollen.common.chartType-pie"/>' alt="1"/> - </sj:a> + title='<s:text name="pollen.common.chartType-pie"/>' alt="1"/></sj:a> <sj:a id='displayChart2' href="#" onclick="return displayCharts(2);"> <img src="<s:url value='/img/rep2.png'/>" - title='<s:text name="pollen.common.chartType-pie3d"/>' alt="2"/> - </sj:a> + title='<s:text name="pollen.common.chartType-pie3d"/>' alt="2"/></sj:a> <sj:a id='displayChart3' href="#" onclick="return displayCharts(3);"> <img src="<s:url value='/img/rep3.png'/>" - title='<s:text name="pollen.common.chartType-ring"/>' alt="3"/> - </sj:a> + title='<s:text name="pollen.common.chartType-ring"/>' alt="3"/></sj:a> </div> <div class="displayTypeDiv"> diff --git a/pom.xml b/pom.xml index 5b4b521..7554a58 100644 --- a/pom.xml +++ b/pom.xml @@ -358,13 +358,13 @@ <dependency> <groupId>org.jfree</groupId> <artifactId>jfreechart</artifactId> - <version>1.0.14</version> + <version>1.0.19</version> </dependency> <dependency> <groupId>org.jfree</groupId> <artifactId>jcommon</artifactId> - <version>1.0.17</version> + <version>1.0.23</version> </dependency> <!-- Rome (rss) --> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm