Pollen-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 3196 discussions
r3336 - in trunk: pollen-persistence/src/main/java/org/chorem/pollen pollen-persistence/src/main/resources/i18n pollen-ui-struts2 pollen-ui-struts2/src/main/assembly pollen-ui-struts2/src/main/assembly/dist
by tchemit@users.chorem.org 01 May '12
by tchemit@users.chorem.org 01 May '12
01 May '12
Author: tchemit
Date: 2012-05-01 18:58:33 +0200 (Tue, 01 May 2012)
New Revision: 3336
Url: http://chorem.org/repositories/revision/pollen/3336
Log:
refs #538: Improve install documentation
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java
trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties
trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties
trunk/pollen-ui-struts2/pom.xml
trunk/pollen-ui-struts2/src/main/assembly/bin.xml
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java 2012-05-01 16:58:33 UTC (rev 3336)
@@ -32,6 +32,8 @@
import java.io.File;
import java.net.URL;
+import static org.nuiton.i18n.I18n.n_;
+
/**
* All Pollen configuration options.
*
@@ -41,43 +43,43 @@
public enum PollenConfigurationOption implements ApplicationConfig.OptionDef {
/** login for default admin. */
- APPLICATION_URL("siteUrl", "Application url", "", URL.class),
+ APPLICATION_URL("siteUrl", n_("pollen.configuration.siteUrl"), "", URL.class),
/** login for default admin. */
- DATA_DIR("pollen.dataDirectory", "Default directory where to put data", "/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", "login for default admin", "admin", String.class),
+ ADMIN_LOGIN("adminLogin", n_("pollen.configuration.db.login"), "admin", String.class),
/** password for default admin. */
- ADMIN_PASSWORD("adminPassword", "password for default admin", "pollen", String.class),
+ ADMIN_PASSWORD("adminPassword", n_("pollen.configuration.db.password"), "pollen", String.class),
/** email for default admin. */
- ADMIN_EMAIL("adminEmail", "email for default admin", "admin(a)domain.com", String.class),
+ ADMIN_EMAIL("adminEmail", n_("pollen.configuration.adminEmail"), "admin(a)domain.com", String.class),
/** email for contact link. */
- CONTACT_EMAIL("contactEmail", "email for contact link", "", String.class),
+ CONTACT_EMAIL("contactEmail", n_("pollen.configuration.contactEmail"), "", String.class),
/** host for email sending configuration. */
- EMAIL_HOST("email_host", "host for email sending configuration", "smtp", String.class),
+ EMAIL_HOST("email_host", n_("pollen.configuration.emailHost"), "smtp", String.class),
/** port for email sending configuration. */
- EMAIL_PORT("email_port", "port for email sending configuration", "25", String.class),
+ EMAIL_PORT("email_port", n_("pollen.configuration.emailPort"), "25", String.class),
/** from for email sending configuration. */
- EMAIL_FROM("email_from", "from for email sending configuration", "bot(a)pollen.org", String.class),
+ EMAIL_FROM("email_from", n_("pollen.configuration.emailFrom"), "bot(a)pollen.org", String.class),
/** directory to store emails before sending them. */
- EMAIL_DIR("pollen.emails.directory", "directory to store emails before sending them", "${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", "path for feed directory", "${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", "path for uploaded images directory", "${pollen.dataDirectory}/uploadedImages", File.class),
+ IMG_DIR("upImgDir", n_("pollen.configuration.imageDirectory"), "${pollen.dataDirectory}/uploadedImages", File.class),
/** nb votes to display per page. */
- NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage", "nb votes to display per page", "25", int.class),
+ NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage", n_("pollen.configuration.nbVoteByPage"), "25", int.class),
/** Charset of Pollen. */
- CHARSET("pollen.charset", "Charset of Pollen", "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", "Default poll type to use at a new poll creation", 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", "Default vote counting type to use at a new poll creation", VoteCountingType.NORMAL.name(), VoteCountingType.class),
+ DEFAULT_VOTE_COUNTING_TYPE("pollen.default.voteCountingType", n_("pollen.configuration.defaultVoteCountingType"), VoteCountingType.NORMAL.name(), VoteCountingType.class),
/** Default choice type to use at a new poll creation. */
- DEFAULT_CHOICE_TYPE("pollen.default.choiceType", "Default choice type to use at a new poll creation", ChoiceType.TEXT.name(), ChoiceType.class),
+ DEFAULT_CHOICE_TYPE("pollen.default.choiceType", n_("pollen.configuration.defaultChoiceType"), ChoiceType.TEXT.name(), ChoiceType.class),
/** Pollen version. */
- VERSION("pollen.version", "Version de l'application", "", Version.class);
+ VERSION("pollen.version", n_("Version de l'application"), "", Version.class);
/** Configuration key. */
protected final String key;
Modified: trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties
===================================================================
--- trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties 2012-05-01 16:58:33 UTC (rev 3336)
@@ -12,3 +12,20 @@
pollen.exception.user_wrong_password=
pollen.exception.vote_doubloon=
pollen.exception.vote_not_allowed=
+pollen.configuration.siteUrl=Application url
+pollen.configuration.dataDirectory=Directory where to put pollen data
+pollen.configuration.defaultChoiceType=Default choice type to use at a new poll creation
+pollen.configuration.defaultVoteCountingType=Default vote counting type to use at a new poll creation
+pollen.configuration.defaultPollType=Default poll type to use at a new poll creation
+pollen.configuration.charset=Charset of Pollen
+pollen.configuration.nbVoteByPage=nb votes to display per page
+pollen.configuration.imageDirectory=path for uploaded images directory
+pollen.configuration.db.login=login for default admin
+pollen.configuration.db.password=password for default admin
+pollen.configuration.adminEmail=email for default admin
+pollen.configuration.contactEmail=email for contact link
+pollen.configuration.emailHost=host for email sending configuration
+pollen.configuration.emailPort=port for email sending configuration
+pollen.configuration.emailFrom=from for email sending configuration
+pollen.configuration.emaiDirectory=directory to store emails before sending them
+pollen.configuration.feedDirectory=path for feed directory
Modified: trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties
===================================================================
--- trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties 2012-05-01 16:58:33 UTC (rev 3336)
@@ -4,7 +4,7 @@
pollen.exception.participant_exist=La liste %1$s contient déjà un votant nommé %2$s avec un email %3$s
pollen.exception.participant_exist_without_email=La liste %1$s contient déjà un votant nommé %2$s avec aucun email
pollen.exception.poll_exist=
-pollen.exception.poll_not_exist=Il n'y a pas de sondage à cette adresse. Veuillez verifier que vous utilisez le lien correcte et copiez-le complètement dans le champ d'adresse de votre navigateur.
+pollen.exception.poll_not_exist=Il n'y a pas de sondage à cette adresse. Veuillez verifier que vous utilisez le lien correcte et copiez-le complêtement dans le champ d'adresse de votre navigateur.
pollen.exception.smtp_not_available=Impossible d'envoyer un email à %1$s. Serveur smtp indisponible pour l'envoi d'email, veuillez contacter un administrateur.
pollen.exception.user_email_exist=Un utilisateur est déjà enregistré avec cet email.
pollen.exception.user_login_exist=Un utilisateur est déjà enregistré avec cet identifiant.
@@ -12,3 +12,20 @@
pollen.exception.user_wrong_password=Le mot de passe renseigné est incorrect pour l'utilisateur '%1$s'.
pollen.exception.vote_doubloon=
pollen.exception.vote_not_allowed=
+pollen.configuration.siteUrl=Url publique de l'aplication (utilisée dans les emails envoyés)
+pollen.configuration.dataDirectory=Répertoire des données de Pollen
+pollen.configuration.defaultChoiceType=Choix par défaut utilisation lors de la création d'un sondage
+pollen.configuration.defaultVoteCountingType=Type de dépouillement lors de la création d'un sondage
+pollen.configuration.defaultPollType=Type de sondage lors de la création d'un sondage
+pollen.configuration.charset=Encodnig de Pollen
+pollen.configuration.nbVoteByPage=Nombre de votes à afficher par page
+pollen.configuration.imageDirectory=répertoire où sont enregistrés les images
+pollen.configuration.db.login=Login de l'utilisateur par défaut (Utilisateur crée lors du premier lancement de pollen)
+pollen.configuration.db.password=Mot de passe de l'utilisateur par défaut (Utilisateur crée lors du premier lancement de pollen)
+pollen.configuration.adminEmail=Email de l'utilisateur par défaut (Utilisateur crée lors du premier lancement de pollen)
+pollen.configuration.contactEmail=Email pour le lien Contact
+pollen.configuration.emailHost=Serveur d'envoie d'email
+pollen.configuration.emailPort=Port du serveur d'envoi d'email
+pollen.configuration.emailFrom=Email de l'envoyeur dans les emails
+pollen.configuration.emaiDirectory=Répertoire des emails
+pollen.configuration.feedDirectory=Répertoire des flux rss
Modified: trunk/pollen-ui-struts2/pom.xml
===================================================================
--- trunk/pollen-ui-struts2/pom.xml 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-ui-struts2/pom.xml 2012-05-01 16:58:33 UTC (rev 3336)
@@ -328,7 +328,7 @@
<type>jar</type>
</overlay>
</overlays>
- <warName>pollen-embedded-${project.version}.war</warName>
+ <warName>pollen-embedded-${project.version}</warName>
</configuration>
</execution>
</executions>
Modified: trunk/pollen-ui-struts2/src/main/assembly/bin.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/bin.xml 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-ui-struts2/src/main/assembly/bin.xml 2012-05-01 16:58:33 UTC (rev 3336)
@@ -34,7 +34,7 @@
<outputDirectory>/</outputDirectory>
<fileMode>0755</fileMode>
<includes>
- <include>${project.build.finalName}.war</include>
+ <include>pollen-embedded-${project.version}.war</include>
</includes>
</fileSet>
Modified: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat 2012-05-01 16:58:33 UTC (rev 3336)
@@ -37,10 +37,10 @@
set JAVA_COMMAND="%JDK_HOME%\bin\java.exe"
echo java.exe defined to %JAVA_COMMAND%
-set POLLEN_OPTS="-Xms512m -Xmx1024m -pollen.log.dir=./logs"
+set POLLEN_OPTS="-Xms512m -Xmx1024m"
echo java options used : %POLLEN_OPTS%
-%JAVA_COMMAND% "%POLLEN_OPTS%" -jar pollen-embedded-${project.version}.war
+%JAVA_COMMAND% "%POLLEN_OPTS%" -jar pollen-embedded-${project.version}.war --option pollen.log.dir $CURRENTPWD/logs
goto end
:end
Modified: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh 2012-05-01 16:30:50 UTC (rev 3335)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh 2012-05-01 16:58:33 UTC (rev 3336)
@@ -8,6 +8,7 @@
OLDPWD=`pwd`
cd `dirname $0`
CURRENTPWD=`pwd`
-POLLEN_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m -pollen.log.dir=$CURRENTPWD/logs"
-java $POLLEN_OPTS -jar pollen-embedded-${project.version}.war $*
+POLLEN_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m"
+#POLLEN_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m -Jpollen.log.dir=$CURRENTPWD/logs"
+java $POLLEN_OPTS -jar pollen-embedded-${project.version}.war --option pollen.log.dir $CURRENTPWD/logs $*
cd "$OLDPWD"
\ No newline at end of file
1
0
r3335 - in trunk/pollen-ui-struts2: . src/main src/main/assembly src/main/assembly/dist src/main/java/org/chorem/pollen/ui/actions/user src/main/site src/main/site/fr src/main/site/fr/rst src/main/site/rst
by tchemit@users.chorem.org 01 May '12
by tchemit@users.chorem.org 01 May '12
01 May '12
Author: tchemit
Date: 2012-05-01 18:30:50 +0200 (Tue, 01 May 2012)
New Revision: 3335
Url: http://chorem.org/repositories/revision/pollen/3335
Log:
refs #538: Improve install documentation
Added:
trunk/pollen-ui-struts2/src/main/site/
trunk/pollen-ui-struts2/src/main/site/fr/
trunk/pollen-ui-struts2/src/main/site/fr/rst/
trunk/pollen-ui-struts2/src/main/site/fr/rst/index.rst
trunk/pollen-ui-struts2/src/main/site/rst/
trunk/pollen-ui-struts2/src/main/site/rst/index.rst
trunk/pollen-ui-struts2/src/main/site/site_en.xml
trunk/pollen-ui-struts2/src/main/site/site_fr.xml
Modified:
trunk/pollen-ui-struts2/pom.xml
trunk/pollen-ui-struts2/src/main/assembly/bin.xml
trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java
Modified: trunk/pollen-ui-struts2/pom.xml
===================================================================
--- trunk/pollen-ui-struts2/pom.xml 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/pom.xml 2012-05-01 16:30:50 UTC (rev 3335)
@@ -282,33 +282,6 @@
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.nuiton.web.war.JettyLauncher</mainClass>
- </manifest>
- </archive>
- <overlays>
- <overlay>
- <groupId>org.nuiton.web</groupId>
- <artifactId>nuiton-web</artifactId>
- <type>jar</type>
- <includes>
- <include>**/war/Jetty*</include>
- </includes>
- </overlay>
- <overlay>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-runner</artifactId>
- <type>jar</type>
- </overlay>
- </overlays>
- </configuration>
- </plugin>
-
</plugins>
</pluginManagement>
</build>
@@ -327,6 +300,40 @@
<defaultGoal>verify</defaultGoal>
<plugins>
<plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>embedded-war</id>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.nuiton.web.war.JettyLauncher</mainClass>
+ </manifest>
+ </archive>
+ <overlays>
+ <overlay>
+ <groupId>org.nuiton.web</groupId>
+ <artifactId>nuiton-web</artifactId>
+ <type>jar</type>
+ <includes>
+ <include>**/war/Jetty*</include>
+ </includes>
+ </overlay>
+ <overlay>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-runner</artifactId>
+ <type>jar</type>
+ </overlay>
+ </overlays>
+ <warName>pollen-embedded-${project.version}.war</warName>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
Modified: trunk/pollen-ui-struts2/src/main/assembly/bin.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/bin.xml 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/src/main/assembly/bin.xml 2012-05-01 16:30:50 UTC (rev 3335)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Pollen :: UI (struts2)
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2009 - 2012 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
<assembly>
<id>bin</id>
<formats>
@@ -3,10 +26,4 @@
<format>zip</format>
</formats>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
<fileSets>
Property changes on: trunk/pollen-ui-struts2/src/main/assembly/bin.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat 2012-05-01 16:30:50 UTC (rev 3335)
@@ -40,7 +40,7 @@
set POLLEN_OPTS="-Xms512m -Xmx1024m -pollen.log.dir=./logs"
echo java options used : %POLLEN_OPTS%
-%JAVA_COMMAND% "%POLLEN_OPTS%" -jar ${project.build.finalName}.war
+%JAVA_COMMAND% "%POLLEN_OPTS%" -jar pollen-embedded-${project.version}.war
goto end
:end
Property changes on: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties 2012-05-01 16:30:50 UTC (rev 3335)
@@ -1,3 +1,26 @@
+###
+# #%L
+# Pollen :: UI (struts2)
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2009 - 2012 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# #L%
+###
#
# Pollen - v ${project.version} Configuration
#
Property changes on: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh 2012-05-01 16:30:50 UTC (rev 3335)
@@ -9,5 +9,5 @@
cd `dirname $0`
CURRENTPWD=`pwd`
POLLEN_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m -pollen.log.dir=$CURRENTPWD/logs"
-java $POLLEN_OPTS -jar ${project.build.finalName}.war $*
+java $POLLEN_OPTS -jar pollen-embedded-${project.version}.war $*
cd "$OLDPWD"
\ No newline at end of file
Property changes on: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-05-01 15:40:34 UTC (rev 3334)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-05-01 16:30:50 UTC (rev 3335)
@@ -23,7 +23,7 @@
*/
package org.chorem.pollen.ui.actions.user;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
import org.chorem.pollen.services.exceptions.UserNotFoundException;
Added: trunk/pollen-ui-struts2/src/main/site/fr/rst/index.rst
===================================================================
--- trunk/pollen-ui-struts2/src/main/site/fr/rst/index.rst (rev 0)
+++ trunk/pollen-ui-struts2/src/main/site/fr/rst/index.rst 2012-05-01 16:30:50 UTC (rev 3335)
@@ -0,0 +1,28 @@
+.. -
+.. * #%L
+.. * Pollen :: UI (struts2)
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2009 - 2012 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
+.. * the Free Software Foundation, either version 3 of the License, or
+.. * (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Public License for more details.
+.. *
+.. * You should have received a copy of the GNU Affero General Public License
+.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
+.. * #L%
+.. -
+Welcome to Pollen website
+-------------------------
+
+Pollen is web based poll/vote application. It is aimed to small entities that
+want to have a way to manage votes without giving their data to someone.
Property changes on: trunk/pollen-ui-struts2/src/main/site/fr/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/site/rst/index.rst
===================================================================
--- trunk/pollen-ui-struts2/src/main/site/rst/index.rst (rev 0)
+++ trunk/pollen-ui-struts2/src/main/site/rst/index.rst 2012-05-01 16:30:50 UTC (rev 3335)
@@ -0,0 +1,30 @@
+.. -
+.. * #%L
+.. * Pollen :: UI (struts2)
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2009 - 2012 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
+.. * the Free Software Foundation, either version 3 of the License, or
+.. * (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Public License for more details.
+.. *
+.. * You should have received a copy of the GNU Affero General Public License
+.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
+.. * #L%
+.. -
+
+Pollen UI
+---------
+
+Pollen est une application de consultation web. Elle est destinée aux petites entités
+qui veulent un moyen simple de gérer des consultations tout en restant maître de leurs
+données.
Property changes on: trunk/pollen-ui-struts2/src/main/site/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/site/site_en.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/site/site_en.xml (rev 0)
+++ trunk/pollen-ui-struts2/src/main/site/site_en.xml 2012-05-01 16:30:50 UTC (rev 3335)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Pollen
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2009 - 2012 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="${project.url}"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="User">
+ <item name="About" href="./index.html"/>
+ <item name="Configuration" href="./application-config-report.html"/>
+ </menu>
+
+ <menu name="Language">
+ <item name="Français" href="index.html"/>
+ <item name="English" href="../index.html"/>
+ </menu>
+
+ <menu name="Download">
+ <item name="Download"
+ href="http://www.chorem.org/projects/pollen/files"/>
+ </menu>
+
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.chorem.org/public/js/maven-site-chorem.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.url}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
+
Property changes on: trunk/pollen-ui-struts2/src/main/site/site_en.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/site/site_fr.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/site/site_fr.xml (rev 0)
+++ trunk/pollen-ui-struts2/src/main/site/site_fr.xml 2012-05-01 16:30:50 UTC (rev 3335)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Pollen
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2009 - 2012 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="${project.url}"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="A propos" href="./index.html"/>
+ <item name="Configuration" href="./application-config-report.html"/>
+ </menu>
+
+ <menu name="Language">
+ <item name="Français" href="index.html"/>
+ <item name="English" href="../index.html"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item name="Téléchargement"
+ href="http://www.chorem.org/projects/pollen/files"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.chorem.org/public/js/maven-site-chorem.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.url}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
+
Property changes on: trunk/pollen-ui-struts2/src/main/site/site_fr.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
01 May '12
Author: tchemit
Date: 2012-05-01 17:40:34 +0200 (Tue, 01 May 2012)
New Revision: 3334
Url: http://chorem.org/repositories/revision/pollen/3334
Log:
refs #538: Improve install documentation
Added:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java
trunk/pollen-persistence/src/main/resources/META-INF/
trunk/pollen-persistence/src/main/resources/META-INF/services/
trunk/pollen-persistence/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
trunk/pollen-ui-struts2/src/main/assembly/
trunk/pollen-ui-struts2/src/main/assembly/bin.xml
trunk/pollen-ui-struts2/src/main/assembly/dist/
trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties
trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
trunk/src/site/fr/rst/install.rst.vm
Removed:
trunk/src/site/fr/rst/install.rst
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java
trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java
trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties
trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties
trunk/pollen-ui-struts2/pom.xml
trunk/pollen-ui-struts2/src/main/resources/pollen.properties
trunk/pom.xml
Added: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java (rev 0)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,37 @@
+package org.chorem.pollen;
+
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ApplicationConfigProvider;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Application config provider (for site generation).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.3.1
+ */
+public class PollenApplicationConfigProvider implements ApplicationConfigProvider {
+
+ @Override
+ public String getName() {
+ return "pollen";
+ }
+
+ @Override
+ public String getDescription(Locale locale) {
+ return l_(locale, "pollen.application.config");
+ }
+
+ @Override
+ public ApplicationConfig.OptionDef[] getOptions() {
+ return PollenConfigurationOption.values();
+ }
+
+ @Override
+ public ApplicationConfig.ActionDef[] getActions() {
+ return new ApplicationConfig.ActionDef[0];
+ }
+}
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfiguration.java 2012-05-01 15:40:34 UTC (rev 3334)
@@ -39,7 +39,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.Map;
import java.util.Properties;
/**
@@ -63,23 +62,14 @@
public PollenConfiguration(String file, Properties defaultOptions) {
- applicationConfig = new ApplicationConfig();
- applicationConfig.setConfigFileName(file);
-
if (log.isInfoEnabled()) {
log.info(this + " is initializing...");
}
- if (defaultOptions != null) {
- for (Map.Entry<Object, Object> entry : defaultOptions.entrySet()) {
+ applicationConfig = new ApplicationConfig(defaultOptions, file);
- applicationConfig.setDefaultOption(
- String.valueOf(entry.getKey()),
- String.valueOf(entry.getValue())
- );
- }
- }
try {
- applicationConfig.loadDefaultOptions(PollenConfigurationOption.class);
+ applicationConfig.loadDefaultOptions(
+ PollenConfigurationOption.values());
applicationConfig.parse();
} catch (ArgumentsParserException e) {
throw new PollenTechnicalException(
@@ -100,7 +90,8 @@
createDirectory(PollenConfigurationOption.IMG_DIR);
if (log.isDebugEnabled()) {
- log.debug("parsed options in config file" + applicationConfig.getOptions());
+ log.debug("parsed options in config file" +
+ applicationConfig.getOptions());
}
}
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenConfigurationOption.java 2012-05-01 15:40:34 UTC (rev 3334)
@@ -43,7 +43,7 @@
/** login for default admin. */
APPLICATION_URL("siteUrl", "Application url", "", URL.class),
/** login for default admin. */
- DATA_DIR("pollen.dataDirectory", "Default directory where to put datas", "${HOME}/.pollen", File.class),
+ DATA_DIR("pollen.dataDirectory", "Default directory where to put data", "/var/local/pollen/data", File.class),
/** login for default admin. */
ADMIN_LOGIN("adminLogin", "login for default admin", "admin", String.class),
/** password for default admin. */
@@ -123,12 +123,12 @@
@Override
public boolean isTransient() {
- return true;
+ return false;
}
@Override
public boolean isFinal() {
- return true;
+ return false;
}
@Override
Added: trunk/pollen-persistence/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
===================================================================
--- trunk/pollen-persistence/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider (rev 0)
+++ trunk/pollen-persistence/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1 @@
+org.chorem.pollen.PollenApplicationConfigProvider
\ No newline at end of file
Modified: trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties
===================================================================
--- trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_en_GB.properties 2012-05-01 15:40:34 UTC (rev 3334)
@@ -1,3 +1,4 @@
+pollen.application.config=Pollen configuration
pollen.exception.favorite_list_name_exist=
pollen.exception.participant_doubloons=
pollen.exception.participant_exist=
Modified: trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties
===================================================================
--- trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-persistence/src/main/resources/i18n/pollen-persistence_fr_FR.properties 2012-05-01 15:40:34 UTC (rev 3334)
@@ -1,3 +1,4 @@
+pollen.application.config=Configuration de Pollen
pollen.exception.favorite_list_name_exist=La liste %1$s existe déjà pour l'utilisateur %2$s
pollen.exception.participant_doubloons=Les doublons de la liste %1$s ont été ignorés \: %2$s
pollen.exception.participant_exist=La liste %1$s contient déjà un votant nommé %2$s avec un email %3$s
Modified: trunk/pollen-ui-struts2/pom.xml
===================================================================
--- trunk/pollen-ui-struts2/pom.xml 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-ui-struts2/pom.xml 2012-05-01 15:40:34 UTC (rev 3334)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -133,31 +135,31 @@
</dependency>
<dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <scope>provided</scope>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jfree</groupId>
- <artifactId>jcommon</artifactId>
+ <groupId>org.jfree</groupId>
+ <artifactId>jcommon</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-core</artifactId>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-core</artifactId>
</dependency>
-
+
<!-- Provided dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
@@ -185,7 +187,7 @@
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
- <name>Pollen :: UI (strust2)</name>
+ <name>Pollen :: UI (struts2)</name>
<description>Interface Graphique Struts2 pour Pollen</description>
@@ -200,7 +202,8 @@
<i18n.bundleOutputName>pollen-i18n</i18n.bundleOutputName>
<redmine.releaseFiles>
- target/${project.build.finalName}.war
+ target/${project.build.finalName}.war,
+ target/${project.build.finalName}-bin.zip
</redmine.releaseFiles>
</properties>
@@ -310,5 +313,72 @@
</pluginManagement>
</build>
+ <profiles>
+
+ <profile>
+ <id>assembly-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-assemblies</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils-maven-report-plugin</artifactId>
+ <version>${nuitonUtilsVersion}</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>application-config-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ <configuration>
+ <i18nBundleName>${i18n.bundleOutputName}</i18nBundleName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+
+ </profiles>
+
</project>
Added: trunk/pollen-ui-struts2/src/main/assembly/bin.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/bin.xml (rev 0)
+++ trunk/pollen-ui-struts2/src/main/assembly/bin.xml 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,56 @@
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>${project.build.finalName}.war</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>THIRD-PARTY.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/dist</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.sh</exclude>
+ <exclude>**/*.bat</exclude>
+ </excludes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/dist</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <filtered>true</filtered>
+ <includes>
+ <include>**/*.sh</include>
+ <include>**/*.bat</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
Added: trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt (rev 0)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/README.txt 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,38 @@
+===========================
+Pollen - ${project.version}
+===========================
+
+Premier démarrage
+-----------------
+
+Pour démarrer Pollen :
+
+- Il faut avoir une JDK d'installer sur la machine cible.
+
+- la variable JDK_HOME doit être positionnée dans les variables d'environements.
+
+En suite on lance
+
+./pollen.start (sous linux)
+
+ou
+
+pollen.bat (sous windows)
+
+Configuration par défaut
+------------------------
+
+En mode embarqué voici la configuration utilisée par défaut :
+
+- les données sont stoquées dans une base h2 dans le répertoire data/db
+- les resources sont stoquées dans le répertoire data/images
+- le fichier de configuration est pollen.properties
+
+
+Configurer Pollen
+-----------------
+
+Il suffit de modifier la configuration dans le fichier pollen.properties
+
+Pour plus d'infromations consulter le site :
+http://maven-site.chorem.org/pollen/install.html
Added: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat (rev 0)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.bat 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,51 @@
+
+@REM ----------------------------------------------------------------------------
+@REM Pollen Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM ----------------------------------------------------------------------------
+@echo off
+
+if not "%JDK_HOME%" == "" goto OkJHome
+
+echo.
+echo ERROR: JDK_HOME not found in your environment.
+echo Please set the JDK_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:OkJHome
+echo JDK_HOME defined to %JDK_HOME%
+
+if exist "%JDK_HOME%\bin\java.exe" goto doit
+
+echo.
+echo ERROR: JDK_HOME is set to an invalid directory.
+echo JDK_HOME = "%JDK_HOME%"
+echo Please set the JDK_HOME variable in your environment to match the
+echo location of your Java installation
+echo.
+goto error
+
+:error
+set ERROR_CODE=1
+goto end
+
+:doit
+set JAVA_COMMAND="%JDK_HOME%\bin\java.exe"
+echo java.exe defined to %JAVA_COMMAND%
+
+set POLLEN_OPTS="-Xms512m -Xmx1024m -pollen.log.dir=./logs"
+echo java options used : %POLLEN_OPTS%
+
+%JAVA_COMMAND% "%POLLEN_OPTS%" -jar ${project.build.finalName}.war
+goto end
+
+:end
+
+pause
+cmd /C exit /B %ERROR_CODE%
+
+
Added: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties (rev 0)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.properties 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,13 @@
+#
+# Pollen - v ${project.version} Configuration
+#
+# See README.txt for more informations about howto custmize Pollen.
+#
+
+# all data are in stored in data
+pollen.dataDirectory=./data
+
+# public pollen url
+siteUrl=http://localhost:8888
+
+
Added: trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh
===================================================================
--- trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh (rev 0)
+++ trunk/pollen-ui-struts2/src/main/assembly/dist/pollen.sh 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ ! -e $JDK_HOME/bin/java ]; then
+ echo "Do not find $JDK_HOME/bin/java, please add JDK_HOME environnement variable"
+ exit 1
+fi
+
+OLDPWD=`pwd`
+cd `dirname $0`
+CURRENTPWD=`pwd`
+POLLEN_OPTS="$JAVA_OPTS -Xms512m -Xmx10242m -pollen.log.dir=$CURRENTPWD/logs"
+java $POLLEN_OPTS -jar ${project.build.finalName}.war $*
+cd "$OLDPWD"
\ No newline at end of file
Modified: trunk/pollen-ui-struts2/src/main/resources/pollen.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/pollen.properties 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pollen-ui-struts2/src/main/resources/pollen.properties 2012-05-01 15:40:34 UTC (rev 3334)
@@ -24,9 +24,9 @@
#hibernate.show_sql=false
#hibernate.hbm2ddl.auto=update
hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.username=sa
hibernate.connection.password=
-hibernate.connection.driver_class=org.h2.Driver
hibernate.connection.url=jdbc:h2:file:${pollen.dataDirectory}/db/pollendb
# Migration configuration
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/pom.xml 2012-05-01 15:40:34 UTC (rev 3334)
@@ -456,7 +456,7 @@
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<tapestryVersion>5.1.0.5</tapestryVersion>
<nuitonWebVersion>1.11</nuitonWebVersion>
- <nuitonUtilsVersion>2.4.7</nuitonUtilsVersion>
+ <nuitonUtilsVersion>2.4.8-SNAPSHOT</nuitonUtilsVersion>
<h2Version>1.3.166</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<struts2Version>2.3.1.2</struts2Version>
Deleted: trunk/src/site/fr/rst/install.rst
===================================================================
--- trunk/src/site/fr/rst/install.rst 2012-04-30 15:52:41 UTC (rev 3333)
+++ trunk/src/site/fr/rst/install.rst 2012-05-01 15:40:34 UTC (rev 3334)
@@ -1,98 +0,0 @@
-.. -
-.. * #%L
-.. * Pollen
-.. *
-.. * $Id$
-.. * $HeadURL$
-.. * %%
-.. * Copyright (C) 2009 - 2012 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
-.. * the Free Software Foundation, either version 3 of the License, or
-.. * (at your option) any later version.
-.. *
-.. * This program is distributed in the hope that it will be useful,
-.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
-.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-.. * GNU General Public License for more details.
-.. *
-.. * You should have received a copy of the GNU Affero General Public License
-.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
-.. * #L%
-.. -
-Installation
-============
-
-.. Author: Nolwenn Rannou <rannou(a)codelutin.com>
-.. Revision: $Revision$
-.. Date: $Date$
-
-Conteneur Web
--------------
-
-Pour installer l'application il suffit de déployer l'archive war dans un
-conteneur Web comme Tomcat_.
-
-Par défaut une base de donnée H2 est créée dans le répertoire */tmp*. Pour
-modifier ce comportement par défaut il suffit de créer le fichier
-*/etc/pollen.properties* (qui peut aussi être placé dans un répertoire
-*".config/"* de l'utilisateur ($HOME/.config/) ou dans le dossier depuis lequel
-l'application est lancée) et de le remplir avec les propriétés suivantes ::
-
- # Configuration de la base de données
- hibernate.show_sql=false
- hibernate.dialect=org.hibernate.dialect.H2Dialect
- hibernate.connection.username=username
- hibernate.connection.password=password
- hibernate.connection.driver_class=org.h2.Driver
- hibernate.connection.url=jdbc:h2:file://tmp/pollen/pollen
-
- # Répertoire des images transférées
- upImgDir=/tmp/pollen/uploadedImages
-
- # Taille maximal des images transférées (en octets)
- upload.filesize-max=1048576
- upload.requestsize-max=10485760
-
- # Configuration de l'envoi d'emails automatiques
- email_host=smtp.free.fr
- email_port=25
- email_from=bot(a)pollen.org
-
- # Répertoire des flux de syndication (Atom)
- feedDir=/tmp/pollen/feeds
-
- # Adresse du site (utilisée pour les emails de rappel)
- siteUrl=http://www.site.org/pollen/
-
-Pour une base PostgreSQL on aura ::
-
- hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
- hibernate.connection.driver_class=org.postgresql.Driver
- hibernate.default_schema=public
-
-Il peut-être nécessaire de redéployer l'application après avoir modifié ce fichier.
-
-Un utilisateur avec les droits d'administration est créé automatiquement
-(identifiant "admin", mot de passe "pollen"). Par mesure de sécurité il est
-important de supprimer cet utilisateur après avoir créer un autre compte
-administrateur.
-
-Conteneur embarqué
-------------------
-
-Depuis pollen-1.1.1, il est possible de le lancer avec un conteneur embarqué
-seulement en disposant du fichier war.
-
-Pour cela, lancez pollen avec la commande suivante :
-
-::
-
- java -jar pollen-x.x.x.war
-
-Ensuite, ouvrez un navigateur à l'adresse : http://localhost:8080
-
-Vous pouvez aussi utiliser des options de lancement : http://winstone.sourceforge.net/#commandLine
-
-.. _Tomcat: http://tomcat.apache.org/
Copied: trunk/src/site/fr/rst/install.rst.vm (from rev 3333, trunk/src/site/fr/rst/install.rst)
===================================================================
--- trunk/src/site/fr/rst/install.rst.vm (rev 0)
+++ trunk/src/site/fr/rst/install.rst.vm 2012-05-01 15:40:34 UTC (rev 3334)
@@ -0,0 +1,169 @@
+.. -
+.. * #%L
+.. * Pollen
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2009 - 2012 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
+.. * the Free Software Foundation, either version 3 of the License, or
+.. * (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Public License for more details.
+.. *
+.. * You should have received a copy of the GNU Affero General Public License
+.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
+.. * #L%
+.. -
+Installation
+============
+
+.. Author: Nolwenn Rannou <rannou(a)codelutin.com>
+.. Revision: $Revision$
+.. Date: $Date$
+
+Avant-propos
+------------
+
+Types d'installation
+~~~~~~~~~~~~~~~~~~~~
+
+Il existe deux manières pour lancer Pollen:
+
+- en mode embarqué : dans ce mode Pollen possède un conteneur web embarqué,
+ il n'est pas pas nécessaire de posséder un conteneur web.
+
+- en mode serveur : dans ce mode on déploit pollen dans un conteneur web
+ (tomcat, jetty,...) avec une configuration adapté pour un serveur.
+
+Configurer Pollen
+~~~~~~~~~~~~~~~~~
+
+Pour modifier la configuration de Pollen, on doit créer un fichier nommé
+*pollen.properties*.
+
+Pour plus d'information sur les options disponibles,
+rendez-vous sur la `page des options`_.
+
+Stoquage des données
+~~~~~~~~~~~~~~~~~~~~
+
+Pollen utilise une base de données. Par défaut Pollen utilise une base type
+h2.
+
+Lors du premier lancement de Pollen, l'utilisateur admin / admin sera crée dans
+la base de données.
+
+Pour modifier la configuration de la base de données, on modifie dans le
+fichier de configuration les lignes:
+
+::
+
+ hibernate.connection.username=sa
+ hibernate.connection.password=
+
+Pour changer de type de base données, il faut modifier modidifer
+les propriétés suivantes:
+
+::
+ hibernate.dialect=Dialect de la base
+ hibernate.connection.driver_class=Driver de la base
+ hibernate.connection.url=Url de connexion à la base
+
+Voici un tableau d'utilisation pour les bases usuelles:
+
++-------------------------+---------+--------------------------------+-----------------------+------------------------------------------+
++ Type de base de données | dialect | driver | url de connexion +
++-------------------------+---------+--------------------------------+-----------------------+------------------------------------------+
++ H2 | org.hibernate.dialect.H2Dialect | org.h2.Driver | jdbc:h2:file:emplacementBaseH/pollendb +
++ PostgreSql | org.hibernate.dialect.PostgreSQLDialect | org.postgresql.Driver | jdbc:postgresql:pollen +
++-------------------------+---------+--------------------------------+-----------------------+------------------------------------------+
+
+Envoie des emails
+~~~~~~~~~~~~~~~~~
+
+Pour que Pollen puisse envoyer des emails vous devez modifier la configuration:
+
+::
+
+ email_host= Serveur smtp pour envoyer les emails
+ email_port= Port du serveur smtp
+ email_from= Adresse de l'envoyeur de mail
+ siteUrl= Adresse publique de votre instance de pollen (utilisé pour générer les liens d'accès au sondage dans les emails envoyés)
+
+Se connecter à Pollen
+~~~~~~~~~~~~~~~~~~~~~
+
+Un utilisateur avec les droits d'administration est créé automatiquement
+(identifiant *admin*, mot de passe *pollen*). Par mesure de sécurité il est
+important de supprimer cet utilisateur après avoir créer un autre compte
+administrateur.
+
+Installation en mode embarqué
+-----------------------------
+
+- Télécharger l'archive ${project.build.finalName}-bin.zip sur la
+ `page des Téléchargements`.
+- Décompresser l'archive téléchargée.
+- Lancer Pollen via l'un des deux commandes
+
+::
+
+ ./pollen.sh (sous linux)
+
+::
+
+ pollen.bat (sous windows)
+
+Ensuite, une fois Pollen démarré, un navigateur doit s'ouvrir à l'adresse
+suivante
+
+::
+
+ http://localhost:8888
+
+Configuration
+~~~~~~~~~~~~~
+
+En mode embarqué, le fichier de configuration se trouve à la racine du fichier
+décompressé.
+
+Toutes les données sont stoquées dans le répertoire *data*.
+
+Une base h2 est utilisée et stoquée (dans le répertoire *data/db*).
+
+Installation en mode serveur
+----------------------------
+
+- Télécharger le fichier ${project.build.finalName}.war sur la
+ `page des Téléchargements`.
+- Renseigner la configuration (voir section suivante)
+- Deployer le fichier war dans votre conteneur Web comme Tomcat_ ou Jetty_.
+
+Configuration
+~~~~~~~~~~~~~
+
+Il faut créer un fichier de configuration nommé *pollen.properties* qui
+peut se trouver dans l'un des répertoires suivants :
+
+::
+
+ /etc/pollen.properties
+ ~/.config/pollen.properties
+
+Par défaut les données seront stoquées dans le répertoire suivant
+
+::
+
+ /var/local/pollen/data
+
+.. _page des options: ./pollen-ui-struts2/application-config-report.html
+.. _page des Téléchargements: http://www.chorem.org/projects/pollen/files
+.. _Tomcat: http://tomcat.apache.org/
+.. _Jetty: http://eclipse.org/jetty/
Property changes on: trunk/src/site/fr/rst/install.rst.vm
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r3333 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions java/org/chorem/pollen/ui/actions/admin java/org/chorem/pollen/ui/actions/poll java/org/chorem/pollen/ui/actions/user resources/config resources/org/chorem/pollen/ui/actions/user webapp/WEB-INF/decorators
by fdesbois@users.chorem.org 30 Apr '12
by fdesbois@users.chorem.org 30 Apr '12
30 Apr '12
Author: fdesbois
Date: 2012-04-30 17:52:41 +0200 (Mon, 30 Apr 2012)
New Revision: 3333
Url: http://chorem.org/repositories/revision/pollen/3333
Log:
#529 : improve redirect after login
- redirect to home if page is security
- error redirect to the same page and not home (same behavior if login success)
- do not override struts2 methods for messages/errors > rename all methods with Flash keyword
Removed:
trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeletePollAccount.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -232,8 +232,7 @@
return result;
}
- @Override
- public void addActionMessage(String message) {
+ public void addFlashMessage(String message) {
List<String> messages = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_MESSAGES);
if (messages == null) {
messages = Lists.newArrayList(message);
@@ -243,8 +242,7 @@
}
}
- @Override
- public void addActionError(String message) {
+ public void addFlashError(String message) {
List<String> messages = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_ERRORS);
if (messages == null) {
messages = Lists.newArrayList(message);
@@ -254,8 +252,7 @@
}
}
- @Override
- public Collection<String> getActionMessages() {
+ public Collection<String> getFlashMessages() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_MESSAGES);
if (result == null) {
result = Collections.emptyList();
@@ -265,8 +262,7 @@
return result;
}
- @Override
- public Collection<String> getActionErrors() {
+ public Collection<String> getFlashErrors() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_ERRORS);
if (result == null) {
result = Collections.emptyList();
@@ -276,37 +272,32 @@
return result;
}
- @Override
- public boolean hasActionMessages() {
+ public boolean hasFlashMessages() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_MESSAGES);
return CollectionUtils.isNotEmpty(result);
}
- @Override
- public boolean hasActionErrors() {
+ public boolean hasFlashErrors() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_ERRORS);
return CollectionUtils.isNotEmpty(result);
}
- @Override
- public void clearMessages() {
+ public void clearFlashMessages() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_MESSAGES);
if (result != null) {
result.clear();
}
}
- @Override
- public void clearActionErrors() {
+ public void clearFlashErrors() {
List<String> result = getPollenSession().getDynamicData(PollenSession.SESSION_TOKEN_ERRORS);
if (result != null) {
result.clear();
}
}
- @Override
- public boolean hasErrors() {
+ public boolean hasAnyErrors() {
boolean result = super.hasErrors();
- return result || hasActionErrors();
+ return result || hasFlashErrors();
}
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -69,7 +69,7 @@
service.deleteUser(userId);
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.user.deleted", user.getDisplayName()));
result = SUCCESS;
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -79,7 +79,7 @@
try {
newService(UserService.class).createUser(user, true);
- addActionMessage(
+ addFlashMessage(
_("pollen.information.user.created",
user.getDisplayName()));
// remove this user, otherwise it will be reused in the user lists
@@ -109,7 +109,7 @@
try {
service.updateUser(user, null, true);
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.user.updated",
user.getDisplayName()));
@@ -139,7 +139,7 @@
// try {
// service.deleteUser(user.getTopiaId());
// getTransaction().commitTransaction();
-// addActionMessage(
+// addFlashMessage(
// _("pollen.information.user.deleted", user.getDisplayName()));
//
// // remove this user, otherwise it will be reused in the user lists
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -257,9 +257,6 @@
public void prepareFormPage() throws Exception {
- // remove all stuff from session
- getPollenSession().clearDynamicData();
-
pollTypes = decorateToName(PollType.values());
choiceTypes = decorateToName(ChoiceType.values());
voteCountingTypes = decorateToName(VoteCountingType.values());
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -315,16 +315,16 @@
// Messages
if (poll.isClosed()) {
- addActionMessage(_("pollen.information.pollClosed"));
+ addFlashMessage(_("pollen.information.pollClosed"));
} else if (!isPollStarted()) {
- addActionMessage(_("pollen.information.pollNotStarted"));
+ addFlashMessage(_("pollen.information.pollNotStarted"));
} else if (isPollFinished()) {
- addActionMessage(_("pollen.information.pollFinished"));
+ addFlashMessage(_("pollen.information.pollFinished"));
} else if (pollCreator.equals(pollAccount)) {
- addActionMessage(_("pollen.information.vote.creatorUser"));
+ addFlashMessage(_("pollen.information.vote.creatorUser"));
}
if (isPollChoiceRunning()) {
- addActionMessage(_("pollen.information.pollChoiceRunning"));
+ addFlashMessage(_("pollen.information.pollChoiceRunning"));
}
if (log.isInfoEnabled()) {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -52,7 +52,7 @@
service.closePoll(getPollId(), getPollenUserAccount(), getAccountId());
- addActionMessage(_("pollen.information.poll.closed"));
+ addFlashMessage(_("pollen.information.poll.closed"));
return SUCCESS;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -92,7 +92,7 @@
}
if (isVoteStarted()) {
- addActionMessage(_("pollen.information.poll.form.voteStarted"));
+ addFlashMessage(_("pollen.information.poll.form.voteStarted"));
}
return SUCCESS;
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -161,7 +161,7 @@
poll = service.getPollByPollId(pollId);
if (poll == null) {
- addActionError(_("pollen.error.pollNotFound"));
+ addFlashError(_("pollen.error.pollNotFound"));
} else {
if (byGroup == null) {
@@ -182,10 +182,10 @@
}
if (!userAllowed) {
- addActionError(_("pollen.error.userNotAllowed"));
+ addFlashError(_("pollen.error.userNotAllowed"));
} else if (poll.isRunning(serviceContext.getCurrentTime())) {
- addActionMessage(_("pollen.information.pollRunning"));
+ addFlashMessage(_("pollen.information.pollRunning"));
loadResults();
} else {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -275,11 +275,11 @@
if (isEdit()) {
getPollService().updatePoll(poll);
- addActionMessage(_("pollen.information.poll.updated"));
+ addFlashMessage(_("pollen.information.poll.updated"));
} else {
getPollService().createPoll(poll);
- addActionMessage(_("pollen.information.poll.created"));
+ addFlashMessage(_("pollen.information.poll.created"));
}
// remove all stuff from session
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -118,7 +118,7 @@
getPollService().addVoteToPoll(getPoll(), voteCreated);
}
- clearMessages();
+ clearFlashMessages();
// For free Poll, display the update Url (useless if user is logged)
if (PollType.FREE == getPoll().getPollType() && !isUserLoggued()) {
@@ -133,11 +133,11 @@
log.debug(String.format("UpdateURL for poll '%s' and account '%s' = %s", pollId, accountId, updateUrl));
}
- addActionMessage(_("pollen.information.vote.createdWithUpdateUrl", updateUrl));
+ addFlashMessage(_("pollen.information.vote.createdWithUpdateUrl", updateUrl));
} else{
- addActionMessage(_("pollen.information.vote.created"));
+ addFlashMessage(_("pollen.information.vote.created"));
}
return SUCCESS;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteList.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -72,8 +72,8 @@
getTransaction().commitTransaction();
- addActionMessage(_("pollen.information.favoriteList.deleted",
- deletedFavoritedList.getName()));
+ addFlashMessage(_("pollen.information.favoriteList.deleted",
+ deletedFavoritedList.getName()));
result = SUCCESS;
} catch (UserNotFoundException e) {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeletePollAccount.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeletePollAccount.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeletePollAccount.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -77,7 +77,7 @@
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.pollAccount.removedFromFavoriteList",
pollAccount.getVotingId()));
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -23,7 +23,7 @@
*/
package org.chorem.pollen.ui.actions.user;
-import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import org.apache.commons.lang.StringUtils;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
import org.chorem.pollen.services.exceptions.UserNotFoundException;
@@ -39,6 +39,8 @@
public class Login extends PollenActionSupport {
private static final long serialVersionUID = 1L;
+
+ private static final String HOME = "home";
protected String login;
@@ -70,24 +72,39 @@
this.redirectUrl = redirectUrl;
}
- @InputConfig(resultName = "error")
@Override
public String execute() throws Exception {
UserService service = newService(UserService.class);
+
+ if (StringUtils.isBlank(login) || StringUtils.isBlank(password)) {
+ addFlashError(_("pollen.error.user.bad.login.or.password"));
- String result = ERROR;
- try {
- UserAccount userAccount = service.connect(login, password);
- getPollenSession().setUserAccount(userAccount);
- addActionMessage(_("pollen.information.your.are.loggued"));
+ } else {
+ try {
+ UserAccount userAccount = service.connect(login, password);
+
+ getPollenSession().setUserAccount(userAccount);
+ addFlashMessage(_("pollen.information.your.are.loggued"));
+
+ } catch (UserNotFoundException e) {
+ addFlashError(_("pollen.error.user.bad.login.or.password"));
+ } catch (UserInvalidPasswordException e) {
+ addFlashError(_("pollen.error.user.bad.login.or.password"));
+ }
+ }
+
+ String result;
+ if (redirectUrl == null || redirectUrl.contains("/security")) {
+
+ // After security problem, redirect to home
+ result = HOME;
+
+ } else {
+
+ // Stay on the same page identified by redirectUrl
result = SUCCESS;
- } catch (UserNotFoundException e) {
- addActionError(_("pollen.error.user.bad.login.or.password"));
- } catch (UserInvalidPasswordException e) {
- addActionError(_("pollen.error.user.bad.login.or.password"));
}
-
return result;
}
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -53,7 +53,7 @@
public String execute() throws Exception {
if (StringUtils.isBlank(email) || !StringUtil.isEmail(email)) {
- addActionError( _("pollen.error.lostPassword.email"));
+ addFlashError(_("pollen.error.lostPassword.email"));
} else {
@@ -61,10 +61,10 @@
try {
service.lostPassword(email);
- addActionMessage(_("pollen.information.lostPassword.success"));
+ addFlashMessage(_("pollen.information.lostPassword.success"));
} catch (UserNotFoundException e) {
- addActionError(_("pollen.error.lostPassword.user"));
+ addFlashError(_("pollen.error.lostPassword.user"));
}
}
return SUCCESS;
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -105,9 +105,9 @@
favoriteList = service.getFavoriteList(
getPollenUserAccount(), favoriteListId);
} catch (FavoriteListNotFoundException e) {
- addActionError(_("pollen.error.favoriteList.not.found"));
+ addFlashError(_("pollen.error.favoriteList.not.found"));
} catch (FavoriteListNotOwnedByUserException e) {
- addActionError(_("pollen.error.favoriteList.not.owned.by.user"));
+ addFlashError(_("pollen.error.favoriteList.not.owned.by.user"));
}
}
@@ -125,7 +125,7 @@
service.addPollAccountToFavoriteList(favoriteList, pollAccount);
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.pollAccount.addedTofavoriteList",
pollAccount.getVotingId()));
@@ -153,7 +153,7 @@
service.editPollAccountToFavoriteList(favoriteList, pollAccount);
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.pollAccount.updatedTofavoriteList",
pollAccount.getVotingId()));
@@ -178,7 +178,7 @@
service.removePollAccountToFavoriteList(favoriteList, pollAccount);
getTransaction().commitTransaction();
- addActionMessage(
+ addFlashMessage(
_("pollen.information.pollAccount.removedFromFavoriteList",
pollAccount.getVotingId()));
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -143,14 +143,14 @@
}
String result;
- if (hasErrors()) {
+ if (hasAnyErrors()) {
result = INPUT;
} else {
getTransaction().commitTransaction();
- addActionMessage(_("pollen.information.favoriteList.created",
- favoriteList.getName()));
+ addFlashMessage(_("pollen.information.favoriteList.created",
+ favoriteList.getName()));
action = null;
favoriteList = null;
result = SUCCESS;
@@ -167,8 +167,8 @@
favoriteList);
getTransaction().commitTransaction();
- addActionMessage(_("pollen.information.favoriteList.deleted",
- deletedFavoritedList.getName()));
+ addFlashMessage(_("pollen.information.favoriteList.deleted",
+ deletedFavoritedList.getName()));
action = null;
favoriteList = null;
return SUCCESS;
@@ -194,16 +194,16 @@
} catch (ParticipantAlreadyFoundInListException ex) {
// WARNING ?
- addActionError(
+ addFlashError(
_("pollen.error.favoriteList.import.participantExists"
- ,importedAccount.getEmail())
+ , importedAccount.getEmail())
);
}
}
} catch (FavoriteListImportException ex) {
String message = ex.getLocalizedMessage(getLocale());
- addActionError(message);
+ addFlashError(message);
}
}
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-04-30 15:52:41 UTC (rev 3333)
@@ -74,7 +74,7 @@
newService(UserService.class).createUser(user, false);
getPollenSession().setUserAccount(createdUser);
- addActionMessage(_("pollen.information.your.are.loggued"));
+ addFlashMessage(_("pollen.information.your.are.loggued"));
result = SUCCESS;
} catch (UserLoginAlreadyUsedException e) {
addFieldError("user.login", _("pollen.error.user.login.already.used"));
Modified: trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-04-30 15:52:41 UTC (rev 3333)
@@ -34,7 +34,7 @@
<!-- login -->
<action name="login" class="org.chorem.pollen.ui.actions.user.Login">
- <result name="error">/WEB-INF/jsp/home.jsp</result>
+ <result name="home" type="redirectToHome"/>
<result type="redirect2"/>
</action>
Deleted: trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml 2012-04-30 15:52:41 UTC (rev 3333)
@@ -1,43 +0,0 @@
-<!--
- #%L
- Pollen :: UI (strust2)
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2009 - 2012 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
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-<validators>
-
- <field name="login">
-
- <field-validator type="requiredstring">
- <message key="pollen.error.login.required"/>
- </field-validator>
- </field>
-
- <field name="password">
-
- <field-validator type="requiredstring">
- <message key="pollen.error.password.required"/>
- </field-validator>
-
- </field>
-
-</validators>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-04-30 15:52:29 UTC (rev 3332)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-04-30 15:52:41 UTC (rev 3333)
@@ -270,20 +270,20 @@
</noscript>
<%--<div t:type="nuiton/feedback" t:id="borderFeedback" t:autoClear="false"/>--%>
- <s:if test="hasActionMessages()">
+ <s:if test="hasFlashMessages()">
<div class="info_success clearfix">
<ul class="actionMessages fleft">
- <s:iterator value="actionMessages" var="message">
+ <s:iterator value="flashMessages" var="message">
<li><span><s:property value="#message" escapeHtml="false"/></span></li>
</s:iterator>
</ul>
</div>
</s:if>
- <s:if test="hasActionErrors()">
+ <s:if test="hasFlashErrors()">
<div class="info_error clearfix">
<ul class="actionErrors fleft">
- <s:iterator value="actionErrors" var="message">
+ <s:iterator value="flashErrors" var="message">
<li><span><s:property value="#message" escapeHtml="false"/></span></li>
</s:iterator>
</ul>
1
0
Author: fdesbois
Date: 2012-04-30 17:52:29 +0200 (Mon, 30 Apr 2012)
New Revision: 3332
Url: http://chorem.org/repositories/revision/pollen/3332
Log:
fixes #196 : add moderate link for votes. But for the moment the creator can't remove votes or comments.
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java
trunk/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties
trunk/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java
trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties
trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/resume.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -90,7 +90,7 @@
for (Poll poll : polls) {
- PollUrl pollVoteUrl = pollService.getPollVoteUrl(poll);
+ PollUrl pollVoteUrl = pollService.getPollVoteUrl(poll, false);
preventRuleService.onPollToRemind(poll, pollVoteUrl);
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -37,6 +37,7 @@
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.business.persistence.UserAccount;
+import org.chorem.pollen.common.PollType;
import org.chorem.pollen.services.PollenServiceSupport;
import org.nuiton.util.StringUtil;
@@ -124,7 +125,7 @@
}
}
- public void onPollCreated(Poll poll, PollUrl voteURL, PollUrl modifURL) {
+ public void onPollCreated(Poll poll, PollUrl voteURL, PollUrl moderateUrl, PollUrl modifURL) {
URL url = serviceContext.getApplicationURL();
@@ -136,11 +137,21 @@
// Mail au créateur
if (StringUtils.isNotEmpty(poll.getCreator().getEmail())) {
- String subject = l_(locale, "pollen.email.creatorEmail.subject",
- pollTitle);
- String content = l_(locale, "pollen.email.creatorEmail.content",
- pollTitle, voteURL, modifURL);
+
+ String subject, content;
+ if (PollType.FREE == poll.getPollType()) {
+ subject = l_(locale, "pollen.email.createPoll.subject",
+ pollTitle);
+ content = l_(locale, "pollen.email.createPoll.content",
+ pollTitle, voteURL, moderateUrl, modifURL);
+ } else {
+ subject = l_(locale, "pollen.email.createRestrictedPoll.subject",
+ pollTitle);
+ content = l_(locale, "pollen.email.createRestrictedPoll.content",
+ pollTitle, moderateUrl, modifURL);
+ }
+
PollenEmail pollenEmail = createPollenEmail(
poll.getCreator().getEmail(), subject, content);
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -92,7 +92,7 @@
PollService pollService = newService(PollService.class);
- PollUrl pollVoteUrl = pollService.getPollVoteUrl(poll);
+ PollUrl pollVoteUrl = pollService.getPollVoteUrl(poll, false);
PollFeedService pollFeedService = newService(PollFeedService.class);
pollFeedService.onAddComment(commentCreated, pollVoteUrl);
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -197,18 +197,14 @@
Iterable<Choice> choices =
Iterables.transform(source.getChoice(), choiceCreator);
- // Ensure iteration with a new ArrayList instead of TransformingSequentialList
- // from guava Lists#transform() that doesn't support add() method
- result.setChoice(Lists.newArrayList(choices));
+ for (Choice choiceLoaded : choices) {
+ // Reset topiaId for clone case
+ if (clone) {
+ choiceLoaded.setTopiaId(null);
+ }
+ result.addChoice(choiceLoaded);
+ }
-// for (Choice choiceLoaded : source.getChoice()) {
-// Choice choiceEditable = newInstance(choiceDAO);
-// result.addChoice(choiceEditable);
-// // Do not keep choices topiaId, to simplify the update will delete old choices and create new ones
-// PollenBinderHelper.simpleCopy(
-// choiceLoaded, choiceEditable, false);
-// }
-
// -- VotingList -- //
VotingListDAO votingListDAO = getDAO(VotingList.class);
PersonToListDAO personToListDAO = getDAO(PersonToList.class);
@@ -318,12 +314,13 @@
commitTransaction("Could not create poll " + poll.getTitle());
- PollUrl pollVoteUrl = getPollVoteUrl(poll);
+ PollUrl pollVoteUrl = getPollVoteUrl(poll, false);
+ PollUrl pollModerateUrl = getPollVoteUrl(poll, true);
PollUrl pollEditUrl = getPollEditUrl(poll);
// email notification
EmailService emailService = newService(EmailService.class);
- emailService.onPollCreated(result, pollVoteUrl, pollEditUrl);
+ emailService.onPollCreated(result, pollVoteUrl, pollModerateUrl, pollEditUrl);
// feed notification
// XXX-fdesbois-2012-04-12 : if the feed is the same for everybody maybe
@@ -402,12 +399,12 @@
commitTransaction("Could not update poll [" + poll.getTopiaId() + "]");
}
- public PollUrl getPollVoteUrl(Poll poll) {
+ public PollUrl getPollVoteUrl(Poll poll, boolean moderate) {
URL applicationUrl = serviceContext.getApplicationURL();
String baseUrl = applicationUrl + "/poll/votefor/";
PollUri pollUri = PollUri.newPollUri(poll.getPollId());
- if (poll.getPollType() != PollType.FREE) {
+ if (moderate) {
String creatorId = poll.getCreator().getAccountId();
pollUri.setAccountId(creatorId);
}
@@ -976,7 +973,7 @@
// Send notification if necessary
PreventRuleService preventRuleService = newService(PreventRuleService.class);
- PollUrl pollVoteUrl = getPollVoteUrl(pollToUpdate);
+ PollUrl pollVoteUrl = getPollVoteUrl(pollToUpdate, false);
PollUrl modifUrl = getPollEditUrl(pollToUpdate);
preventRuleService.onVoteAdded(poll, pollVoteUrl, modifUrl);
}
@@ -1019,7 +1016,7 @@
result.setName(votingList.getName());
result.setWeight(votingList.getWeight());
- PollUrl voteURL = getPollVoteUrl(poll);
+ PollUrl voteURL = getPollVoteUrl(poll, false);
// Merge PersonToList
List<PersonToList> personToListsUpdated = Lists.newArrayList();
Modified: trunk/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties
===================================================================
--- trunk/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties 2012-04-30 15:52:29 UTC (rev 3332)
@@ -8,8 +8,10 @@
pollen.common.numberVote-blank-votes=Number of blank votes
pollen.common.numberVote-total=Sum of numbers
pollen.common.numberVote-total-votes=Total votes
-pollen.email.creatorEmail.content=You had just created the new poll\: "%s".\nYou can access to this poll by following the links below.\n\nVote page\: \n%s\nEdit page\: \n%s
-pollen.email.creatorEmail.subject=[Pollen] Poll creation (%s)
+pollen.email.createPoll.content=You had just created the new poll\: "%s".\nYou can access to this poll by following the links below.\n\nVote page\: \n%s\nModerate votes page\: \n%s\nEdit page\: \n%s
+pollen.email.createPoll.subject=[Pollen] Poll creation (%s)
+pollen.email.createRestrictedPoll.content=You had just created the new poll\: "%s".\nYou can access to this poll by following the links below.\n\nModerate votes page\: \n%s\nEdit page\: \n%s
+pollen.email.createRestrictedPoll.subject=[Pollen] Restricted poll creation (%s)
pollen.email.lostPassword.content=Hello %1$s. You have just asked for a new password generation for your Pollen account.\n\nLogin\: %2$s\nPassword\: %3$s\n\nYou can now manage your polls by logging on the website \: \n%4$s
pollen.email.lostPassword.subject=[Pollen] Lost password for %s
pollen.email.reminderEmail.content=You have not yet voted for the poll "%s".\nYou can still participate with the identifier %s by following this link\: \n%s
Modified: trunk/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties
===================================================================
--- trunk/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties 2012-04-30 15:52:29 UTC (rev 3332)
@@ -10,8 +10,8 @@
pollen.common.numberVote-total-votes=Nombre total de votes
pollen.email.createPoll.content=Vous venez de créer le sondage "%1$s".\nVous pouvez y accéder en suivant les liens ci-dessous.\n\nPage de vote \: \n%2$s\nModération des votes \: \n%3$s\nPage de modification \: \n%4$s
pollen.email.createPoll.subject=[Pollen] Création d'un sondage (%1$s)
-pollen.email.creatorEmail.content=Vous venez de créer le sondage "%s".\nVous pouvez y accéder en suivant les liens ci-dessous.\n\nPage de vote \: \n%s\nPage de modification \: \n%s
-pollen.email.creatorEmail.subject=[Pollen] Création d'un sondage (%s)
+pollen.email.createRestrictedPoll.content=Vous venez de créer le sondage "%s".\nVous pouvez y accéder en suivant les liens ci-dessous.\n\nModération des votes \: \n%s\nPage de modification \: \n%s
+pollen.email.createRestrictedPoll.subject=[Pollen] Création d'un sondage restreint (%s)
pollen.email.lostPassword.content=Bonjour %1$s. Vous venez de demander la génération d'un nouveau mot de passe d'accès à votre compte Pollen.\n\nIdentifiant \: %2$s\nMot de passe \: %3$s\n\nVous pouvez dès maintenant gérer vos sondages en vous identifiant sur le site \: \n%4$s
pollen.email.lostPassword.subject=[Pollen] Mot de passe perdu du compte %s
pollen.email.reminderEmail.content=Vous n'avez pas encore voté pour le sondage "%s".\nVous pouvez encore y participer avec l'identifiant %s à l'adresse suivante \: \n%s
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -117,6 +117,11 @@
return userAccount != null;
}
+ public boolean isUserAdmin() {
+ UserAccount userAccount = getPollenUserAccount();
+ return userAccount != null && userAccount.isAdministrator();
+ }
+
public static String getApplicationVersion() {
return getPollenApplicationContext().getConfiguration().getVersion().toString();
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -94,7 +94,8 @@
);
map.put("id", poll.getTopiaId());
- map.put("voteId", getVoteId(poll));
+ map.put("voteId", poll.getPollId());
+ map.put("moderateId", poll.getAdminId());
map.put("resultId", getResultId(poll));
map.put("adminId", poll.getAdminId());
@@ -107,7 +108,12 @@
protected Set<String> getPollFunctions(Poll poll) {
Set<String> result = Sets.newHashSet();
- result.add("vote");
+ if (PollType.FREE == poll.getPollType()) {
+
+ // only free poll could have vote action because creator can't vote
+ result.add("vote");
+ }
+ result.add("moderate");
result.add("result");
if (!poll.isClosed()) {
@@ -120,17 +126,6 @@
result.add("delete");
return result;
}
-
- protected String getVoteId(Poll poll) {
- String result;
- if (PollType.FREE == poll.getPollType()) {
- result = poll.getPollId();
-
- } else {
- result = poll.getAdminId();
- }
- return result;
- }
/**
* Retrieve the id for result page depends on {@code poll}.
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -92,7 +92,7 @@
Poll.PROPERTY_END_DATE
);
map.put("id", poll.getTopiaId());
- map.put("voteId", poll.getAdminId());
+ map.put("moderateId", poll.getAdminId());
map.put("resultId", poll.getAdminId());
map.put("adminId", poll.getAdminId());
@@ -106,7 +106,7 @@
protected Set<String> getPollFunctions(Poll poll) {
Set<String> result = Sets.newHashSet();
- result.add("vote");
+ result.add("moderate");
result.add("result");
if (!poll.isClosed()) {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -204,9 +204,13 @@
}
public String getPollVoteUrl() {
- return getPollService().getPollVoteUrl(poll).getUrl();
+ return getPollService().getPollVoteUrl(poll, false).getUrl();
}
+ public String getPollModerateUrl() {
+ return getPollService().getPollVoteUrl(poll, true).getUrl();
+ }
+
public String getPollEditUrl() {
return getPollService().getPollEditUrl(poll).getUrl();
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -371,8 +371,8 @@
return result;
}
- public boolean isModifAllowed(String voteId) {
- return getVoteService().isUpdateAllowed(getPoll(), voteId, getAccountId(), getPollenUserAccount());
+ public boolean isModifAllowed(Vote vote) {
+ return getVoteService().isUpdateAllowed(getPoll(), vote.getTopiaId(), getAccountId(), getPollenUserAccount());
}
public boolean isVoteAllowed() {
@@ -380,8 +380,12 @@
}
public boolean isDeleteCommentAllowed(Comment comment) {
- return isCreatorUser() || getPollCommentService().isCanDeleteComment(comment, getPollAccount(), getPollenUserAccount());
+ return getPollCommentService().isCanDeleteComment(comment, getPollAccount(), getPollenUserAccount());
}
+
+ public boolean isDeleteVoteAllowed(Vote vote) {
+ return isUserAdmin();
+ }
public String escapeLineBreak(String text) {
return text;
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-30 15:52:29 UTC (rev 3332)
@@ -120,20 +120,6 @@
*/
private Map<Integer, VotingList> votingLists;
- /**
- * This message is used in {@code resume.jsp} to display text before vote
- * page url. For a restricted poll, the message is different because the
- * url contains the creator accountId.
- *
- * @return the message to display to explain vote page url depends on
- * {@code pollType}.
- */
- public String getMessagePollVotePage() {
- String result = isFreePoll() ? _("pollen.label.pollVotePage") :
- _("pollen.label.pollVotePage.restricted");
- return result;
- }
-
@Override
public void prepare() throws Exception {
Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-30 15:52:29 UTC (rev 3332)
@@ -36,6 +36,7 @@
pollen.action.pollDelete=Delete the poll
pollen.action.pollEdit=Edit poll
pollen.action.pollExport=Export poll
+pollen.action.pollModerateVote=Administrate votes
pollen.action.pollPersonToListDelete=Delete this voter
pollen.action.pollResult=Display poll results
pollen.action.pollVote=Vote
@@ -237,10 +238,10 @@
pollen.information.your.are.loggued=You are logged.
pollen.label.contact.administrator=Send an email to an administrator
pollen.label.pollEditPage=The link below leads to the page to modify your poll. Save it to be able to modify your poll later if you need it or to close it \:
+pollen.label.pollModerateVotePage=The link below leads to the page to vote for your poll. This access is available only for you as poll's creator \:
pollen.label.pollRegisterPage=If you are a logged user, you can find these links on the page
pollen.label.pollResultPage=The link below leads to the page to count the votes. Save it to be able to count the vote later \:
pollen.label.pollVotePage=The link below leads to the page to vote for your poll. Save it and send it to the people that you want to vote \:
-pollen.label.pollVotePage.restricted=The link below leads to the page to vote for your poll. This access is available only for you as poll's creator \:
pollen.legend.login=Login
pollen.legend.select.favoriteList.to.add=Sélectionner la liste de favoris à ajouter
pollen.legend.select.personList.to.create.votingList=Sélectionner la liste des votant à importer dans le nouveau groupe
Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-30 15:52:29 UTC (rev 3332)
@@ -38,6 +38,7 @@
pollen.action.pollDelete=Supprimer le sondage
pollen.action.pollEdit=Editer le sondage
pollen.action.pollExport=Exporter le sondage
+pollen.action.pollModerateVote=Administrer les votes
pollen.action.pollPersonToListDelete=Supprimer ce votant
pollen.action.pollResult=Afficher les résultats du sondage
pollen.action.pollVote=Voter
@@ -240,10 +241,10 @@
pollen.information.your.are.loggued=Vous êtes connecté.
pollen.label.contact.administrator=Contacter un administrateur
pollen.label.pollEditPage=Le lien ci-dessous mène à la page de modification du sondage. Enregistrez-le pour pouvoir modifier votre sondage au besoin ou le clore \:
+pollen.label.pollModerateVotePage=Le lien ci-dessous mène à la page de vote. Cet accès n'est valable que pour vous en tant que créateur du sondage \:
pollen.label.pollRegisterPage=Si vous êtes un utilisateur identifié, vous pouvez retrouver ces liens dans la page
pollen.label.pollResultPage=Le lien ci-dessous mène à la page de dépouillement. Enregistrez-le pour pouvoir accéder au dépouillement plus tard \:
pollen.label.pollVotePage=Le lien ci-dessous mène à la page de vote. Enregistrez-le et envoyez-le à ceux que vous voulez voir voter \:
-pollen.label.pollVotePage.restricted=Le lien ci-dessous mène à la page de vote. Cet accès n'est valable que pour vous en tant que créateur du sondage \:
pollen.legend.login=Login
pollen.legend.select.favoriteList.to.add=Sélectionner la liste de favoris à ajouter
pollen.legend.select.personList.to.create.votingList=Sélectionner la liste des votant à importer dans le nouveau groupe
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/resume.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/resume.jsp 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/resume.jsp 2012-04-30 15:52:29 UTC (rev 3332)
@@ -28,15 +28,28 @@
<h3><s:property value="poll.title"/> <s:text name="pollen.common.by"/>
<s:property value="poll.creator.votingId"/></h3>
+<s:if test="freePoll">
+ <div style="margin-top: 10px;">
+ <img src="<s:url value='/img/vote.png'/>"
+ alt="<s:text name='pollen.common.voteAction'/>"
+ style="margin-right: 18px;"/>
+ <s:property value="pollen.label.pollVotePage"/>
+ <br/>
+ <s:set name="voteUrl" value="%{pollVoteUrl}"/>
+ <s:a href="%{voteUrl}" cssStyle="margin-left:50px;">
+ <s:property value="voteUrl"/>
+ </s:a>
+ </div>
+</s:if>
<div style="margin-top: 10px;">
- <img src="<s:url value='/img/vote.png'/>"
- alt="<s:text name='pollen.common.voteAction'/>"
- style="margin-right: 18px;"/>
- <s:property value="%{messagePollVotePage}"/>
+ <img src="<s:url value='/img/moderate.png'/>"
+ alt="<s:text name='pollen.action.pollModerateVote'/>"
+ style="margin-right: 20px;"/>
+ <s:text name='pollen.label.pollModerateVotePage'/>
<br/>
- <s:set name="voteUrl" value="%{pollVoteUrl}"/>
- <s:a href="%{voteUrl}" cssStyle="margin-left:50px;">
- <s:property value="voteUrl"/>
+ <s:set name="moderateUrl" value="%{pollModerateUrl}"/>
+ <s:a href="%{moderateUrl}" cssStyle="margin-left:50px;">
+ <s:property value="moderateUrl"/>
</s:a>
</div>
<div style="margin-top: 10px;">
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-04-30 15:52:29 UTC (rev 3332)
@@ -321,7 +321,7 @@
</s:else>
</s:if>
<s:if test="!poll.anonymous">
- <s:if test="isModifAllowed(#vote.topiaId)">
+ <s:if test="isModifAllowed(#vote)">
<s:a action="editVote" namespace="/poll">
<s:param name="pollId" value="%{pollId}"/>
<s:param name="accountId" value="%{#vote.pollAccount.accountId}"/>
@@ -330,7 +330,7 @@
alt="<s:text name="pollen.action.editVote"/>"/>
</s:a>
</s:if>
- <s:if test="creatorUser">
+ <s:if test="isDeleteVoteAllowed(#vote)">
<s:a action="deleteVote" namespace="/poll" href="#"
onclick="return openDeleteVoteDialog('%{#vote.topiaId}');">
<img src="<s:url value="/img/delete.png"/>"
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-30 15:52:29 UTC (rev 3332)
@@ -34,6 +34,9 @@
<s:url id='voteImg' value='/img/vote.png'/>
<s:set id='voteTitle'><s:text name="pollen.action.pollVote"/></s:set>
+<s:url id='moderateImg' value='/img/moderate.png'/>
+<s:set id='moderateTitle'><s:text name="pollen.action.pollModerateVote"/></s:set>
+
<s:url id="resultUrl" action="results/" namespace="/poll"/>
<s:url id='resultImg' value='/img/count.png'/>
<s:set id='resultTitle'><s:text name="pollen.action.pollResult"/></s:set>
@@ -84,6 +87,7 @@
var id = rowObject.pollId;
var voteId = rowObject.voteId;
+ var moderateId = rowObject.moderateId;
var resultId = rowObject.resultId;
var adminId = rowObject.adminId;
@@ -92,6 +96,9 @@
if (cellvalue.indexOf('vote') > -1) {
result += formatLink("${voteUrl}" + voteId, "${voteImg}", "Vote", "${voteTitle}")
}
+ if (cellvalue.indexOf('moderate') > -1) {
+ result += formatLink("${voteUrl}" + moderateId, "${moderateImg}", "Moderate", "${moderateTitle}")
+ }
if (cellvalue.indexOf('result') > -1) {
result += formatLink("${resultUrl}" + resultId, "${resultImg}", "Result", "${resultTitle}")
}
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-04-30 10:45:25 UTC (rev 3331)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-04-30 15:52:29 UTC (rev 3332)
@@ -55,5 +55,5 @@
<sjg:gridColumn name="beginDate" title='%{getText("pollen.common.beginDate")}'/>
<sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
- formatter="pollFunctions" width="180" sortable="false"/>
+ formatter="pollFunctions" width="200" sortable="false"/>
</sjg:grid>
1
0
30 Apr '12
Author: fdesbois
Date: 2012-04-30 12:45:25 +0200 (Mon, 30 Apr 2012)
New Revision: 3331
Url: http://chorem.org/repositories/revision/pollen/3331
Log:
fixes #540 : Add FileAppender and use pollen.log.dir as context path (default to target in maven tomcat6, tomcat7 and jetty embedded modes)
Modified:
trunk/pollen-ui-struts2/pom.xml
trunk/pollen-ui-struts2/src/main/resources/log4j.properties
Modified: trunk/pollen-ui-struts2/pom.xml
===================================================================
--- trunk/pollen-ui-struts2/pom.xml 2012-04-30 10:45:20 UTC (rev 3330)
+++ trunk/pollen-ui-struts2/pom.xml 2012-04-30 10:45:25 UTC (rev 3331)
@@ -246,6 +246,10 @@
<name>siteUrl</name>
<value>http://localhost:8080/pollen</value>
</systemProperty>
+ <systemProperty>
+ <name>pollen.log.dir</name>
+ <value>target</value>
+ </systemProperty>
</systemProperties>
</configuration>
</plugin>
@@ -257,6 +261,7 @@
<path>/pollen</path>
<systemProperties>
<siteUrl>http://localhost:8080/pollen</siteUrl>
+ <pollen.log.dir>target</pollen.log.dir>
</systemProperties>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
@@ -269,6 +274,7 @@
<path>/pollen</path>
<systemProperties>
<siteUrl>http://localhost:8080/pollen</siteUrl>
+ <pollen.log.dir>target</pollen.log.dir>
</systemProperties>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
Modified: trunk/pollen-ui-struts2/src/main/resources/log4j.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/log4j.properties 2012-04-30 10:45:20 UTC (rev 3330)
+++ trunk/pollen-ui-struts2/src/main/resources/log4j.properties 2012-04-30 10:45:25 UTC (rev 3331)
@@ -21,7 +21,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-log4j.rootCategory=ERROR, console
+log4j.rootCategory=ERROR, console, file
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
@@ -30,3 +30,11 @@
log4j.logger.org.chorem.pollen=INFO
log4j.logger.org.chorem.pollen.ui.PollenShiroIsAdministratorFilter=DEBUG
log4j.logger.org.nuiton=INFO
+
+# FileAppender : need to have pollen.log.dir in system properties at application startup
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=${pollen.log.dir}/pollen.log
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=4
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %m%n
1
0
r3330 - trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security
by fdesbois@users.chorem.org 30 Apr '12
by fdesbois@users.chorem.org 30 Apr '12
30 Apr '12
Author: fdesbois
Date: 2012-04-30 12:45:20 +0200 (Mon, 30 Apr 2012)
New Revision: 3330
Url: http://chorem.org/repositories/revision/pollen/3330
Log:
#535 : publicResults check is not necessary for an admin or the poll creator
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java 2012-04-30 10:45:14 UTC (rev 3329)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java 2012-04-30 10:45:20 UTC (rev 3330)
@@ -39,9 +39,15 @@
private static final Log log =
LogFactory.getLog(ResultAccessRequired.class);
+ protected final AdminUserRequired adminFilter;
+
+ protected final PollCreatorRequired pollCreatorFilter;
+
protected final PollAccessRequired pollAccountFilter;
public ResultAccessRequired() {
+ adminFilter = new AdminUserRequired();
+ pollCreatorFilter = new PollCreatorRequired();
pollAccountFilter = new PollAccessRequired();
}
@@ -52,9 +58,20 @@
boolean isAccessAllowed;
- // Must be a valid user
- if (pollAccountFilter.isAccessAllowed(request, response, mappedValue)) {
+ if (adminFilter.isAccessAllowed(request, response, mappedValue)) {
+ // user is connected ans admin, so
+ isAccessAllowed = true;
+
+ }
+ else if (pollCreatorFilter.isAccessAllowed(request, response, mappedValue)) {
+
+ // account is creator
+ isAccessAllowed = true;
+
+ }
+ else if (pollAccountFilter.isAccessAllowed(request, response, mappedValue)) {
+
PollUri pollUri = getPollUri(request);
PollenServiceContext serviceContext =
@@ -82,7 +99,8 @@
isAccessAllowed = false;
}
- } else {
+ }
+ else {
isAccessAllowed = false;
}
1
0
r3329 - in trunk: pollen-persistence/src/main/java/org/chorem/pollen/business/persistence pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json pollen-ui-struts2/src/main/webapp/WEB-INF/jsp
by fdesbois@users.chorem.org 30 Apr '12
by fdesbois@users.chorem.org 30 Apr '12
30 Apr '12
Author: fdesbois
Date: 2012-04-30 12:45:14 +0200 (Mon, 30 Apr 2012)
New Revision: 3329
Url: http://chorem.org/repositories/revision/pollen/3329
Log:
fixes #539 :
- repair problem with id for result page
- improve polls loading and retrieve also PollAccount for participated and invited cases
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -24,7 +24,7 @@
package org.chorem.pollen.business.persistence;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.pollen.entities.PollenDAOHelper;
@@ -33,6 +33,7 @@
import org.nuiton.topia.persistence.TopiaFilterPagerUtil;
import java.util.List;
+import java.util.Map;
public class PollDAOImpl<E extends Poll> extends PollDAOAbstract<E> {
@@ -71,8 +72,9 @@
return result;
}
- public List<E> getInvitedPolls(TopiaFilterPagerUtil.FilterPagerBean pager,
- UserAccount userToUse) throws TopiaException {
+ public Map<Poll, PollAccount> getInvitedPolls(
+ TopiaFilterPagerUtil.FilterPagerBean pager,
+ UserAccount userToUse) throws TopiaException {
Preconditions.checkNotNull(pager);
Preconditions.checkNotNull(userToUse);
@@ -80,33 +82,47 @@
//FIXME Use a query to do this to avoid in memory pagination
String email = userToUse.getEmail();
- List<E> polls = findAll();
- List<E> allPolls = Lists.newLinkedList();
- for (E poll : polls) {
- for (VotingList votingList : poll.getVotingList()) {
- for (PersonToList personToList : votingList
- .getPollAccountPersonToList()) {
- if (!personToList.isHasVoted()) {
- PollAccount pollAccount = personToList
- .getPollAccount();
+ TopiaQuery countQuery = createQuery("p");
+ countQuery.addLeftJoin("p." + Poll.PROPERTY_VOTING_LIST, "v", false);
+ countQuery.addLeftJoin("v." + VotingList.PROPERTY_POLL_ACCOUNT_PERSON_TO_LIST, "l", false);
+ countQuery.addEquals("l." + PersonToList.PROPERTY_POLL_ACCOUNT
+ + "." + PollAccount.PROPERTY_EMAIL, email);
+ long records = countByQuery(countQuery);
+ pager.setRecords((int) records);
+
+ TopiaQuery query = TopiaFilterPagerUtil.addPagerToQuery(countQuery, pager);
- if (pollAccount != null
- && pollAccount.getEmail() != null
- && pollAccount.getEmail().equals(
- email)) {
- allPolls.add(poll);
- }
- }
- }
- }
- }
+ return findAllWithPollAccounts(query,
+ "p",
+ "l." + PersonToList.PROPERTY_POLL_ACCOUNT);
- int records = allPolls.size();
- pager.setRecords(records);
+// List<E> polls = findAll();
+// List<E> allPolls = Lists.newLinkedList();
+// for (E poll : polls) {
+// for (VotingList votingList : poll.getVotingList()) {
+// for (PersonToList personToList : votingList
+// .getPollAccountPersonToList()) {
+// if (!personToList.isHasVoted()) {
+// PollAccount pollAccount = personToList
+// .getPollAccount();
+//
+// if (pollAccount != null
+// && pollAccount.getEmail() != null
+// && pollAccount.getEmail().equals(
+// email)) {
+// allPolls.add(poll);
+// }
+// }
+// }
+// }
+// }
+//
+// int records = allPolls.size();
+// pager.setRecords(records);
+//
+// List<E> result = TopiaFilterPagerUtil.getPageFromList(allPolls, pager);
+// return result;
- List<E> result = TopiaFilterPagerUtil.getPageFromList(allPolls, pager);
- return result;
-
// try {
// PollDAO dao = PollenDAOHelper.getPollDAO(getTransaction());
// TopiaQuery countQuery = dao.createQuery("e");
@@ -126,8 +142,9 @@
// }
}
- public List<E> getParticipatedPolls(TopiaFilterPagerUtil.FilterPagerBean pager,
- UserAccount userToUse) throws TopiaException {
+ public Map<Poll, PollAccount> getParticipatedPolls(
+ TopiaFilterPagerUtil.FilterPagerBean pager,
+ UserAccount userToUse) throws TopiaException {
Preconditions.checkNotNull(pager);
Preconditions.checkNotNull(userToUse);
@@ -144,9 +161,27 @@
TopiaQuery query = TopiaFilterPagerUtil.addPagerToQuery(countQuery, pager);
- List<E> result = findAllByQuery(query);
+ return findAllWithPollAccounts(query,
+ "e." + Vote.PROPERTY_POLL,
+ "e." + Vote.PROPERTY_POLL_ACCOUNT);
+ }
+
+ protected Map<Poll, PollAccount> findAllWithPollAccounts(TopiaQuery query,
+ String pollAlias,
+ String pollAccountAlias)
+ throws TopiaException {
+
+ // Select both poll and pollAccount
+ query.setSelect(pollAlias, pollAccountAlias);
+
+ List<Object[]> queryResults = getContext().findByQuery(query);
+ Map<Poll, PollAccount> result = Maps.newLinkedHashMap();
+ for (Object[] row : queryResults) {
+ Poll poll = (Poll) row[0];
+ PollAccount pollAccount = (PollAccount) row[1];
+ result.put(poll, pollAccount);
+ }
return result;
-
}
public List<E> getRunningPolls(boolean withEndDate) throws TopiaException {
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -467,8 +467,9 @@
}
}
- public List<Poll> getInvitedPolls(TopiaFilterPagerUtil.FilterPagerBean pager,
- UserAccount user) {
+ public Map<Poll, PollAccount> getInvitedPolls(
+ TopiaFilterPagerUtil.FilterPagerBean pager,
+ UserAccount user) {
Preconditions.checkNotNull(pager);
Preconditions.checkNotNull(user);
@@ -480,7 +481,8 @@
Preconditions.checkNotNull(userToUse);
try {
PollDAO pollDao = getDAO(Poll.class);
- List<Poll> result = pollDao.getInvitedPolls(pager, userToUse);
+ Map<Poll, PollAccount> result =
+ pollDao.getInvitedPolls(pager, userToUse);
return result;
} catch (TopiaException e) {
throw new PollenTechnicalException("Could not obtain invited polls", e);
@@ -505,8 +507,9 @@
// }
}
- public List<Poll> getParticipatedPolls(TopiaFilterPagerUtil.FilterPagerBean pager,
- UserAccount user) {
+ public Map<Poll, PollAccount> getParticipatedPolls(
+ TopiaFilterPagerUtil.FilterPagerBean pager,
+ UserAccount user) {
Preconditions.checkNotNull(pager);
Preconditions.checkNotNull(user);
@@ -519,7 +522,8 @@
try {
PollDAO pollDao = getDAO(Poll.class);
- List<Poll> result = pollDao.getParticipatedPolls(pager, userToUse);
+ Map<Poll, PollAccount> result =
+ pollDao.getParticipatedPolls(pager, userToUse);
return result;
} catch (TopiaException e) {
throw new PollenTechnicalException("Could not obtain running polls", e);
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -25,6 +25,7 @@
import com.google.common.collect.Sets;
import org.chorem.pollen.business.persistence.Poll;
+import org.chorem.pollen.common.PollType;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
import org.nuiton.util.beans.Binder;
@@ -91,8 +92,12 @@
Poll.PROPERTY_BEGIN_DATE,
Poll.PROPERTY_END_DATE
);
+
map.put("id", poll.getTopiaId());
+ map.put("voteId", getVoteId(poll));
+ map.put("resultId", getResultId(poll));
map.put("adminId", poll.getAdminId());
+
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
polls[index++] = map;
@@ -115,4 +120,34 @@
result.add("delete");
return result;
}
+
+ protected String getVoteId(Poll poll) {
+ String result;
+ if (PollType.FREE == poll.getPollType()) {
+ result = poll.getPollId();
+
+ } else {
+ result = poll.getAdminId();
+ }
+ return result;
+ }
+
+ /**
+ * Retrieve the id for result page depends on {@code poll}.
+ * It's not necessary to use {@code adminId} if the poll results are public.
+ * But the {@code adminId} is mandatory if the poll is restricted (security).
+ *
+ * @param poll Poll
+ * @return the pollId if results are public or the adminId if not
+ */
+ protected String getResultId(Poll poll) {
+ String result;
+ if (PollType.FREE == poll.getPollType() && poll.isPublicResults()) {
+ result = poll.getPollId();
+
+ } else {
+ result = poll.getAdminId();
+ }
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -24,15 +24,13 @@
package org.chorem.pollen.ui.actions.json;
import com.google.common.collect.Sets;
-import org.chorem.pollen.business.persistence.PersonToList;
+import org.chorem.pollen.bean.PollUri;
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.VotingList;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
import org.nuiton.util.beans.Binder;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -77,15 +75,16 @@
PollService pollService = newService(PollService.class);
- List<Poll> pollList = pollService.getInvitedPolls(pager,
+ Map<Poll, PollAccount> invitedPolls = pollService.getInvitedPolls(pager,
getPollenUserAccount());
- polls = new Map[pollList.size()];
+ polls = new Map[invitedPolls.size()];
Binder<Poll, Poll> binder =
PollenBinderHelper.getSimpleTopiaBinder(Poll.class);
int index = 0;
- for (Poll poll : pollList) {
+ for (Map.Entry<Poll, PollAccount> entry : invitedPolls.entrySet()) {
+ Poll poll = entry.getKey();
Map<String, Object> map = binder.obtainProperties(
poll,
Poll.PROPERTY_TITLE,
@@ -94,10 +93,15 @@
Poll.PROPERTY_BEGIN_DATE,
Poll.PROPERTY_END_DATE
);
- String userEmail = getPollenUserAccount().getEmail();
- map.put("adminId", poll.getAdminId());
- map.put("voteId", getVoteId(poll, userEmail));
+
+ PollAccount account = entry.getValue();
+
+ PollUri pollUri = PollUri.newPollUri(poll.getPollId(), account.getAccountId());
+
map.put("id", poll.getTopiaId());
+ map.put("voteId", pollUri.getUri());
+ map.put("resultId", pollUri.getUri());
+
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
polls[index++] = map;
@@ -115,19 +119,4 @@
}
return result;
}
-
- protected String getVoteId(Poll poll, String userEmail) {
- String result = poll.getPollId();
- for (VotingList list : poll.getVotingList()) {
- for (PersonToList account : list.getPollAccountPersonToList()) {
- PollAccount pollAccount = account.getPollAccount();
- if (userEmail.equals(pollAccount.getEmail())) {
- result += ":" + pollAccount.getAccountId();
- break;
- }
- }
- }
-
- return result;
- }
}
\ No newline at end of file
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -24,12 +24,14 @@
package org.chorem.pollen.ui.actions.json;
import com.google.common.collect.Sets;
+import org.chorem.pollen.bean.PollUri;
import org.chorem.pollen.business.persistence.Poll;
+import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.common.PollType;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
import org.nuiton.util.beans.Binder;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -74,15 +76,16 @@
PollService pollService = newService(PollService.class);
- List<Poll> pollList = pollService.getParticipatedPolls(
- pager, getPollenUserAccount());
+ Map<Poll, PollAccount> participatedPolls =
+ pollService.getParticipatedPolls(pager, getPollenUserAccount());
- polls = new Map[pollList.size()];
+ polls = new Map[participatedPolls.size()];
Binder<Poll, Poll> binder =
PollenBinderHelper.getSimpleTopiaBinder(Poll.class);
int index = 0;
- for (Poll poll : pollList) {
+ for (Map.Entry<Poll, PollAccount> entry : participatedPolls.entrySet()) {
+ Poll poll = entry.getKey();
Map<String, Object> map = binder.obtainProperties(
poll,
Poll.PROPERTY_TITLE,
@@ -91,7 +94,22 @@
Poll.PROPERTY_BEGIN_DATE,
Poll.PROPERTY_END_DATE
);
+
+ PollAccount account = entry.getValue();
+
+ PollUri pollUri = PollUri.newPollUri(poll.getPollId(), account.getAccountId());
+
map.put("id", poll.getTopiaId());
+
+ // Keep accountId to allow vote update
+ map.put("voteId", pollUri.getUri());
+
+ // For Free poll, it's not necessary to keep the accountId
+ String resultId = poll.getPollType() == PollType.FREE
+ ? pollUri.getPollId()
+ : pollUri.getUri();
+ map.put("resultId", resultId);
+
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
polls[index++] = map;
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-04-30 10:45:14 UTC (rev 3329)
@@ -92,7 +92,10 @@
Poll.PROPERTY_END_DATE
);
map.put("id", poll.getTopiaId());
+ map.put("voteId", poll.getAdminId());
+ map.put("resultId", poll.getAdminId());
map.put("adminId", poll.getAdminId());
+
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
polls[index++] = map;
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-27 10:24:54 UTC (rev 3328)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-30 10:45:14 UTC (rev 3329)
@@ -83,19 +83,17 @@
function pollFunctions(cellvalue, options, rowObject) {
var id = rowObject.pollId;
+ var voteId = rowObject.voteId;
+ var resultId = rowObject.resultId;
var adminId = rowObject.adminId;
var result = "";
- if (rowObject['voteId']) {
- id = rowObject['voteId'];
- }
-
if (cellvalue.indexOf('vote') > -1) {
- result += formatLink("${voteUrl}" + id, "${voteImg}", "Vote", "${voteTitle}")
+ result += formatLink("${voteUrl}" + voteId, "${voteImg}", "Vote", "${voteTitle}")
}
if (cellvalue.indexOf('result') > -1) {
- result += formatLink("${resultUrl}" + adminId, "${resultImg}", "Result", "${resultTitle}")
+ result += formatLink("${resultUrl}" + resultId, "${resultImg}", "Result", "${resultTitle}")
}
if (cellvalue.indexOf('edit') > -1) {
result += formatLink("${editUrl}" + adminId, "${editImg}", "Edit", "${editTitle}")
1
0
r3328 - in trunk: pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll pollen-ui-struts2/src/main/resources/i18n
by fdesbois@users.chorem.org 27 Apr '12
by fdesbois@users.chorem.org 27 Apr '12
27 Apr '12
Author: fdesbois
Date: 2012-04-27 12:24:54 +0200 (Fri, 27 Apr 2012)
New Revision: 3328
Url: http://chorem.org/repositories/revision/pollen/3328
Log:
fixes #533 :
- comment author must be the connecter user if exists
- improve creator treatment, the creator can't vote when identified by token (pollUid:creatorAccountUid)
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties
trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-04-26 18:29:22 UTC (rev 3327)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-04-27 10:24:54 UTC (rev 3328)
@@ -362,7 +362,8 @@
* poll. The account must be defined previously using
* {@link PollService#getPollAccountEditable(String, UserAccount, Poll)} to
* have a proper link between userAccount and pollAccount even if not already
- * created in dabase.
+ * created in dabase. The poll creator can't vote. The token is just use
+ * for moderate purpose.
*
* @param poll Poll
* @param accountEditable Account to check
@@ -374,15 +375,24 @@
Preconditions.checkNotNull(accountEditable);
Date now = serviceContext.getCurrentTime();
-
- boolean result = poll.isRunning(now);
- if (poll.getPollType() != PollType.FREE) {
- PersonToListDAO personToListDAO = getDAO(PersonToList.class);
- PersonToList personToList = personToListDAO.findByPollAndAccount(poll, accountEditable);
+ boolean result;
+ if (poll.getCreator().equals(accountEditable)) {
- result &= personToList != null;
- }
+ // The creator user can't vote
+ result = false;
+ } else {
+
+ // The poll must be running and account allowed for restricted poll
+ result = poll.isRunning(now);
+ if (poll.getPollType() != PollType.FREE) {
+
+ PersonToListDAO personToListDAO = getDAO(PersonToList.class);
+ PersonToList personToList = personToListDAO.findByPollAndAccount(poll, accountEditable);
+
+ result &= personToList != null;
+ }
+ }
return result;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-26 18:29:22 UTC (rev 3327)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-04-27 10:24:54 UTC (rev 3328)
@@ -34,6 +34,7 @@
import org.chorem.pollen.business.persistence.Comment;
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.business.persistence.Vote;
import org.chorem.pollen.business.persistence.VoteToChoice;
import org.chorem.pollen.common.ChoiceType;
@@ -256,8 +257,18 @@
public String getCommentAuthor() {
if (commentAuthor == null) {
- // Use current pollAccount name for comment
- commentAuthor = getPollAccount().getVotingId();
+
+ UserAccount user = getPollenUserAccount();
+ if (user == null) {
+
+ // Use current pollAccount name for comment
+ commentAuthor = getPollAccount().getVotingId();
+
+ } else {
+
+ // Connecter user name
+ commentAuthor = user.getDisplayName();
+ }
}
return commentAuthor;
}
@@ -289,11 +300,19 @@
PollFeedService pollFeedService = newService(PollFeedService.class);
feedFileExisting = pollFeedService.isFeedExists(poll);
+
+ PollAccount pollCreator = poll.getCreator();
+ if (getPollenUserAccount() == null) {
- //TODO Deal the case of the not loggued poll (using the pollAccountId
- creatorUser = getPollenUserAccount() != null &&
- getPollenUserAccount().equals(poll.getCreator().getUserAccount());
+ // User is creator if loaded pollAccount is the creator
+ creatorUser = pollCreator.equals(pollAccount);
+
+ } else {
+ // User is creator if the userAccount is the same
+ creatorUser = getPollenUserAccount().equals(pollCreator.getUserAccount());
+ }
+
// Messages
if (poll.isClosed()) {
addActionMessage(_("pollen.information.pollClosed"));
@@ -301,6 +320,8 @@
addActionMessage(_("pollen.information.pollNotStarted"));
} else if (isPollFinished()) {
addActionMessage(_("pollen.information.pollFinished"));
+ } else if (pollCreator.equals(pollAccount)) {
+ addActionMessage(_("pollen.information.vote.creatorUser"));
}
if (isPollChoiceRunning()) {
addActionMessage(_("pollen.information.pollChoiceRunning"));
Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-26 18:29:22 UTC (rev 3327)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-27 10:24:54 UTC (rev 3328)
@@ -233,6 +233,7 @@
pollen.information.user.updated=User %s updated.
pollen.information.vote.created=Vote saved
pollen.information.vote.createdWithUpdateUrl=Vote saved, you can modify it using this address \: <br/> <a href\="%1$s">%1$s</a>
+pollen.information.vote.creatorUser=You are identified as the poll's creator. You can't vote with this URL.
pollen.information.your.are.loggued=You are logged.
pollen.label.contact.administrator=Send an email to an administrator
pollen.label.pollEditPage=The link below leads to the page to modify your poll. Save it to be able to modify your poll later if you need it or to close it \:
Modified: trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-26 18:29:22 UTC (rev 3327)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-27 10:24:54 UTC (rev 3328)
@@ -236,6 +236,7 @@
pollen.information.user.updated=L'utilisateur %s a été mis à jour.
pollen.information.vote.created=Vote enregistré
pollen.information.vote.createdWithUpdateUrl=Vote enregistré, vous pourrez le modifier à l'adresse suivante \: <br/> <a href\="%1$s">%1$s</a>
+pollen.information.vote.creatorUser=Vous êtes identifié comme le créateur du sondage. Vous ne pouvez pas voter avec cette URL.
pollen.information.your.are.loggued=Vous êtes connecté.
pollen.label.contact.administrator=Contacter un administrateur
pollen.label.pollEditPage=Le lien ci-dessous mène à la page de modification du sondage. Enregistrez-le pour pouvoir modifier votre sondage au besoin ou le clore \:
1
0
r3327 - in trunk: . pollen-persistence pollen-services pollen-ui-struts2 pollen-votecounting
by maven-release@users.chorem.org 26 Apr '12
by maven-release@users.chorem.org 26 Apr '12
26 Apr '12
Author: maven-release
Date: 2012-04-26 20:29:22 +0200 (Thu, 26 Apr 2012)
New Revision: 3327
Url: http://chorem.org/repositories/revision/pollen/3327
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pollen-persistence/pom.xml
trunk/pollen-services/pom.xml
trunk/pollen-ui-struts2/pom.xml
trunk/pollen-votecounting/pom.xml
trunk/pom.xml
Modified: trunk/pollen-persistence/pom.xml
===================================================================
--- trunk/pollen-persistence/pom.xml 2012-04-26 18:29:19 UTC (rev 3326)
+++ trunk/pollen-persistence/pom.xml 2012-04-26 18:29:22 UTC (rev 3327)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3-rc3</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pollen-services/pom.xml
===================================================================
--- trunk/pollen-services/pom.xml 2012-04-26 18:29:19 UTC (rev 3326)
+++ trunk/pollen-services/pom.xml 2012-04-26 18:29:22 UTC (rev 3327)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3-rc3</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pollen-ui-struts2/pom.xml
===================================================================
--- trunk/pollen-ui-struts2/pom.xml 2012-04-26 18:29:19 UTC (rev 3326)
+++ trunk/pollen-ui-struts2/pom.xml 2012-04-26 18:29:22 UTC (rev 3327)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3-rc3</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pollen-votecounting/pom.xml
===================================================================
--- trunk/pollen-votecounting/pom.xml 2012-04-26 18:29:19 UTC (rev 3326)
+++ trunk/pollen-votecounting/pom.xml 2012-04-26 18:29:22 UTC (rev 3327)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3-rc3</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-04-26 18:29:19 UTC (rev 3326)
+++ trunk/pom.xml 2012-04-26 18:29:22 UTC (rev 3327)
@@ -15,7 +15,7 @@
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3-rc3</version>
+ <version>1.3-SNAPSHOT</version>
<modules>
<module>pollen-votecounting</module>
@@ -530,11 +530,11 @@
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:http://svn.chorem.org/svn/pollen/tags/pollen-1.3-rc3</connection>
+ <connection>scm:svn:http://svn.chorem.org/svn/pollen/trunk</connection>
<developerConnection>
- scm:svn:http://svn.chorem.org/svn/pollen/tags/pollen-1.3-rc3
+ scm:svn:http://svn.chorem.org/svn/pollen/trunk
</developerConnection>
- <url>http://www.chorem.org/repositories/browse/pollen/tags/pollen-1.3-rc3</url>
+ <url>http://www.chorem.org/repositories/browse/pollen/trunk</url>
</scm>
<distributionManagement>
1
0