Pollen-commits
Threads by month
- ----- 2026 -----
- August
- July
- 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
July 2012
- 1 participants
- 16 discussions
r3586 - in trunk: 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/java/org/chorem/pollen/ui/security pollen-ui-struts2/src/main/resources/i18n pollen-ui-struts2/src/main/webapp/WEB-INF/jsp
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-08-01 00:07:31 +0200 (Wed, 01 Aug 2012)
New Revision: 3586
Url: http://chorem.org/repositories/revision/pollen/3586
Log:
refs #718: Can not vote to an invited poll when I am its creatorfrom createdPoll page (admin can always access vote page)
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.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/security/PollVoteAccessRequired.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/pollListHelper.jsp
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 22:07:31 UTC (rev 3586)
@@ -236,7 +236,8 @@
public String isCanAccessVote(Poll poll,
String accountId,
- AccountIdRole accountIdRole) {
+ AccountIdRole accountIdRole,
+ UserAccount userAccount) {
if (AccountIdRole.CREATOR == accountIdRole) {
@@ -244,6 +245,11 @@
return null;
}
+ if (userAccount != null && userAccount.isAdministrator()) {
+ // pollen admin can always access vote page
+ return null;
+ }
+
if (poll.isPublicResults()) {
// with public results, everybody can access to vote page (but
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-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-07-31 22:07:31 UTC (rev 3586)
@@ -112,12 +112,26 @@
}
boolean canVote = securityService.isCanVote(poll, null, null, getPollenUserAccount());
+
if (canVote) {
result.add("vote");
} else {
- result.add("novote");
+
+ // try to see if can access vote
+
+ String canAccessVote = securityService.isCanAccessVote(
+ poll, null, null, getPollenUserAccount());
+
+ if (canAccessVote == null) {
+ result.add("accessVote");
+ } else {
+
+ // noaccess at all to vote page
+ result.add("novote");
+ }
}
+
result.add("summary");
return result;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java 2012-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java 2012-07-31 22:07:31 UTC (rev 3586)
@@ -107,7 +107,7 @@
// check now poll votes can be displayed
String errorMessage = securityService.isCanAccessVote(
- poll, pollUri.getAccountId(), accountIdRole);
+ poll, pollUri.getAccountId(), accountIdRole, null);
if (errorMessage != null) {
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-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-07-31 22:07:31 UTC (rev 3586)
@@ -55,6 +55,7 @@
pollen.action.pollResult.help=vote count and display results for this poll
pollen.action.pollSummary=Poll summary
pollen.action.pollVote=Vote
+pollen.action.pollAccessVote=Show votes
pollen.action.pollVotingListDelete=Delete the voting list
pollen.action.pollVotingListEdit=Edit that voting list
pollen.action.register=Register
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-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-07-31 22:07:31 UTC (rev 3586)
@@ -55,6 +55,7 @@
pollen.action.pollResult.help=Dépouiller et afficher les résultats du sondage
pollen.action.pollSummary=Résumé du sondage
pollen.action.pollVote=Voter
+pollen.action.pollAccessVote=Accèder aux votes
pollen.action.pollVotingListDelete=Supprimer le groupe de votants
pollen.action.pollVotingListEdit=Editer ce groupe de votants
pollen.action.register=S'enregistrer
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-07-31 21:29:01 UTC (rev 3585)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-07-31 22:07:31 UTC (rev 3586)
@@ -32,6 +32,7 @@
<s:url id="voteUrl" action="votefor/" namespace="/poll"/>
<s:url id='voteImg' value='/img/vote.png'/>
<s:set id='voteTitle'><s:text name="pollen.action.pollVote"/></s:set>
+<s:set id='accessVoteTitle'><s:text name="pollen.action.pollAccessVote"/></s:set>
<s:url id='blankImg' value='/img/blank.png'/>
@@ -85,6 +86,9 @@
if (cellvalue.indexOf('novote') > -1) {
result += "<image src='${blankImg}'>";
}
+ if (cellvalue.indexOf('accessVote') > -1) {
+ result += formatLink("${voteUrl}" + voteId, "${voteImg}", "Vote", "${accessVoteTitle}")
+ }
if (cellvalue.indexOf('moderate') > -1) {
result += formatLink("${voteUrl}" + moderateId, "${moderateImg}", "Moderate", "${moderateTitle}")
}
1
0
r3585 - in trunk: pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 23:29:01 +0200 (Tue, 31 Jul 2012)
New Revision: 3585
Url: http://chorem.org/repositories/revision/pollen/3585
Log:
refs #718 (administrator can admin all polls from participated and invited poll table pages"
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.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
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 21:16:32 UTC (rev 3584)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 21:29:01 UTC (rev 3585)
@@ -51,6 +51,12 @@
*/
public class SecurityService extends PollenServiceSupport {
+ public boolean isPollAdmin(Poll poll, UserAccount pollenUserAccount) {
+ boolean result = pollenUserAccount != null && pollenUserAccount.isAdministrator() ||
+ isPollCreator(poll, null, pollenUserAccount);
+ return result;
+ }
+
public boolean isPollCreator(Poll poll, String accountId,
UserAccount pollenUserAccount) {
@@ -227,6 +233,7 @@
return null;
}
+
public String isCanAccessVote(Poll poll,
String accountId,
AccountIdRole accountIdRole) {
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-07-31 21:16:32 UTC (rev 3584)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-07-31 21:29:01 UTC (rev 3585)
@@ -120,13 +120,9 @@
} else {
result.add("noresult");
}
-// if (poll.isPublicResults()) {
-//
-// // only if results are public
-// result.add("result");
-// }
- boolean canAdminResult = securityService.isPollCreator(
- poll, null, getPollenUserAccount());
+
+ boolean canAdminResult = securityService.isPollAdmin(
+ poll, getPollenUserAccount());
if (canAdminResult) {
result.add("summary");
}
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-07-31 21:16:32 UTC (rev 3584)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-07-31 21:29:01 UTC (rev 3585)
@@ -124,10 +124,13 @@
// only if results are public
result.add("result");
+ } else {
+ result.add("noresult");
+
}
- boolean canAdminResult = securityService.isPollCreator(
- poll, null, getPollenUserAccount());
+ boolean canAdminResult = securityService.isPollAdmin(
+ poll, getPollenUserAccount());
if (canAdminResult) {
result.add("summary");
}
1
0
r3584 - in trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions: . user
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 23:16:32 +0200 (Tue, 31 Jul 2012)
New Revision: 3584
Url: http://chorem.org/repositories/revision/pollen/3584
Log:
add missing file header = svn properties
Modified:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java 2012-07-31 21:14:04 UTC (rev 3583)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java 2012-07-31 21:16:32 UTC (rev 3584)
@@ -3,7 +3,7 @@
* #%L
* Pollen :: UI (struts2)
* $Id$
- * $HeadURL:$
+ * $HeadURL$
* %%
* Copyright (C) 2009 - 2012 CodeLutin
* %%
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java 2012-07-31 21:14:04 UTC (rev 3583)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java 2012-07-31 21:16:32 UTC (rev 3584)
@@ -1,4 +1,26 @@
package org.chorem.pollen.ui.actions.user;
+/*
+ * #%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%
+ */
import com.google.common.base.Preconditions;
import com.opensymphony.xwork2.Preparable;
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java 2012-07-31 21:14:04 UTC (rev 3583)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java 2012-07-31 21:16:32 UTC (rev 3584)
@@ -1,4 +1,26 @@
package org.chorem.pollen.ui.actions.user;
+/*
+ * #%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%
+ */
import org.chorem.pollen.business.persistence.PersonList;
import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java 2012-07-31 21:14:04 UTC (rev 3583)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java 2012-07-31 21:16:32 UTC (rev 3584)
@@ -1,4 +1,26 @@
package org.chorem.pollen.ui.actions.user;
+/*
+ * #%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%
+ */
import com.google.common.base.Preconditions;
import com.opensymphony.xwork2.Preparable;
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
1
0
r3583 - in trunk: pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/resources/i18n pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 23:14:04 +0200 (Tue, 31 Jul 2012)
New Revision: 3583
Url: http://chorem.org/repositories/revision/pollen/3583
Log:
fixes #719: Poll cr?\195?\169ation date in table list
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.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/user/createdList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
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-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-07-31 21:14:04 UTC (rev 3583)
@@ -135,6 +135,8 @@
} else {
map.put(Poll.PROPERTY_END_DATE, decorateDate(poll.getEndDate()));
}
+ map.put(Poll.TOPIA_CREATE_DATE,
+ decorateDateTime(poll.getTopiaCreateDate()));
String addingchoiceText;
if (poll.isChoiceAddAllowed()) {
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-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-07-31 21:14:04 UTC (rev 3583)
@@ -81,6 +81,7 @@
pollen.common.commentAuthor=Name
pollen.common.commentText=Comment
pollen.common.comments=Comments about this poll
+pollen.common.createDate=Create date
pollen.common.csvImport=CSV import
pollen.common.datePattern=
pollen.common.datePickerPattern=mm/dd/yy
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-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-07-31 21:14:04 UTC (rev 3583)
@@ -81,6 +81,7 @@
pollen.common.commentAuthor=Nom
pollen.common.commentText=Commentaire
pollen.common.comments=Commentaire à propos du sondage
+pollen.common.createDate=Date de création
pollen.common.csvImport=Import CSV
pollen.common.datePattern=
pollen.common.datePickerPattern=dd/mm/yy
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-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-07-31 21:14:04 UTC (rev 3583)
@@ -69,11 +69,14 @@
<sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
<sjg:gridColumn name="description"
title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices"
+ <sjg:gridColumn name="topiaCreateDate" width="115"
+ title='%{getText("pollen.common.createDate")}'/>
+ <sjg:gridColumn name="addingChoices" sortable="false"
title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate"
+ <sjg:gridColumn name="beginDate" width="100"
title='%{getText("pollen.common.beginDate")}'/>
- <sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
+ <sjg:gridColumn name="endDate" width="100"
+ title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-07-31 21:14:04 UTC (rev 3583)
@@ -53,11 +53,14 @@
<sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
<sjg:gridColumn name="description"
title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices"
+ <sjg:gridColumn name="topiaCreateDate" width="115"
+ title='%{getText("pollen.common.createDate")}'/>
+ <sjg:gridColumn name="addingChoices" sortable="false"
title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate"
+ <sjg:gridColumn name="beginDate" width="100"
title='%{getText("pollen.common.beginDate")}'/>
- <sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
+ <sjg:gridColumn name="endDate" width="100"
+ title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-07-31 20:43:25 UTC (rev 3582)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-07-31 21:14:04 UTC (rev 3583)
@@ -53,11 +53,14 @@
<sjg:gridColumn name="title" title='%{getText("pollen.common.title")}'/>
<sjg:gridColumn name="description"
title='%{getText("pollen.common.description")}'/>
- <sjg:gridColumn name="addingChoices"
+ <sjg:gridColumn name="topiaCreateDate" width="115"
+ title='%{getText("pollen.common.createDate")}'/>
+ <sjg:gridColumn name="addingChoices" sortable="false"
title='%{getText("pollen.common.addingChoices")}'/>
- <sjg:gridColumn name="beginDate"
+ <sjg:gridColumn name="beginDate" width="100"
title='%{getText("pollen.common.beginDate")}'/>
- <sjg:gridColumn name="endDate" title='%{getText("pollen.common.endDate")}'/>
+ <sjg:gridColumn name="endDate" width="100"
+ title='%{getText("pollen.common.endDate")}'/>
<sjg:gridColumn name="functions" title='%{getText("pollen.common.functions")}'
formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
1
0
Author: tchemit
Date: 2012-07-31 22:43:25 +0200 (Tue, 31 Jul 2012)
New Revision: 3582
Url: http://chorem.org/repositories/revision/pollen/3582
Log:
fixes #716: Restricted and public in same time
fixes #717: Restricted and authentication user
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.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/poll/AbstractVoteAction.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.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/security/PollResultAccessRequired.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.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/summary.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
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java
===================================================================
--- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -47,6 +47,22 @@
return result;
}
+ public E getRestrictedPollAccount(String pollId,
+ UserAccount userAccount) throws TopiaException {
+
+ Preconditions.checkNotNull(pollId);
+ Preconditions.checkNotNull(userAccount);
+
+ TopiaQuery query = new TopiaQuery(PersonToList.class, "p").
+ addFrom(Poll.class, "poll").
+ setSelect("p." + PersonToList.PROPERTY_POLL_ACCOUNT).
+ addWhere("poll." + Poll.PROPERTY_POLL_ID, TopiaQuery.Op.EQ, pollId).
+ addWhere("p." + PersonToList.PROPERTY_POLL_ACCOUNT + "." + PollAccount.PROPERTY_EMAIL, TopiaQuery.Op.EQ, userAccount.getEmail()).
+ addInElements("p", "poll." + Poll.PROPERTY_VOTING_LIST + "." + VotingList.PROPERTY_POLL_ACCOUNT_PERSON_TO_LIST);
+ E result = findByQuery(query);
+ return result;
+ }
+
public List<E> getFavoriteListUsers(PersonList favoriteList,
TopiaFilterPagerUtil.FilterPagerBean pager) throws TopiaException {
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -206,16 +206,44 @@
return null;
}
+ public String isCanAccessResult(Poll poll) {
+
+ // check now poll results can be displayed
+
+ boolean publicResults = poll.isPublicResults();
+ boolean continuousResults = poll.isContinuousResults();
+
+ if (!continuousResults && !poll.isClosed()) {
+
+ // results are not continuous and poll is not closed
+ return n_("pollen.security.error.poll.not.closed.and.results.not.continuous");
+ }
+
+ if (!publicResults) {
+
+ // poll results are private, only poll admin can see results
+ return n_("pollen.security.error.poll.result.private.and.access.not.granted");
+ }
+
+ return null;
+ }
public String isCanAccessVote(Poll poll,
String accountId,
AccountIdRole accountIdRole) {
if (AccountIdRole.CREATOR == accountIdRole) {
- // poll admin can alwyas access vote page
+ // poll admin can always access vote page
return null;
}
+ if (poll.isPublicResults()) {
+
+ // with public results, everybody can access to vote page (but
+ // can not vote for a non free poll)
+ return null;
+ }
+
boolean pollIsFree = PollType.FREE == poll.getPollType();
if (pollIsFree && poll.getCreator().getAccountId().equals(accountId)) {
@@ -233,7 +261,8 @@
public boolean isCanVote(Poll poll,
String accountId,
- AccountIdRole accountIdRole) {
+ AccountIdRole accountIdRole,
+ UserAccount userAccount) {
Date now = serviceContext.getCurrentTime();
@@ -253,6 +282,21 @@
if (!pollIsFree && AccountIdRole.RESTRICTED_VOTER != accountIdRole) {
// on none free poll, only restricted user can vote
+
+ if (userAccount != null) {
+
+ // try to find restricted user by user account
+ PollAccountDAO dao = getDAO(PollAccount.class);
+
+ boolean restrictPollAccountId = isRestrictPollAccountId(dao, poll.getPollId(), userAccount);
+
+ if (restrictPollAccountId) {
+
+ // ok admin is also restricted user of this poll
+ return true;
+ }
+
+ }
return false;
}
@@ -419,6 +463,20 @@
}
}
+ private boolean isRestrictPollAccountId(PollAccountDAO dao, String pollId, UserAccount userAccount) {
+ try {
+
+ PollAccount result =
+ dao.getRestrictedPollAccount(pollId, userAccount);
+
+ return result != null;
+
+ } catch (TopiaException e) {
+ throw new PollenTechnicalException(
+ "Could not check pollAccount existence from poll '" +
+ pollId + "' and account '" + userAccount.getEmail() + "'", e);
+ }
+ }
// /**
// * Vote is allowed if {@code poll} is running and {@code pollAccount} is
// * defined in the {@code poll} restricted list if it's not a {@link PollType#FREE}
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -26,10 +26,12 @@
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
+import org.chorem.pollen.services.impl.SecurityService;
import org.nuiton.util.beans.Binder;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* Obtain created polls to put in grid for the connected user.
@@ -84,12 +86,40 @@
Map<String, Object> map = pollService.pollToMap(poll, binder);
-// map.put("voteId", poll.getPollId());
+ map.put("voteId", poll.getPollId());
+ map.put("resultId", poll.getPollId());
map.put("adminId", poll.getAdminId());
- map.put("functions", Sets.newHashSet("summary"));
+ map.put("functions", getPollFunctions(poll));
polls[index++] = map;
}
return SUCCESS;
}
+ protected Set<String> getPollFunctions(Poll poll) {
+ Set<String> result = Sets.newHashSet();
+
+ SecurityService securityService = getSecurityService();
+
+ String canAccessResult =
+ securityService.isCanAccessResult(poll);
+
+ if (canAccessResult == null) {
+
+ // only if results are public
+ result.add("result");
+ } else {
+ result.add("noresult");
+ }
+
+ boolean canVote = securityService.isCanVote(poll, null, null, getPollenUserAccount());
+ if (canVote) {
+ result.add("vote");
+ } else {
+ result.add("novote");
+ }
+
+ result.add("summary");
+ return result;
+ }
+
}
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -29,6 +29,7 @@
import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
+import org.chorem.pollen.services.impl.SecurityService;
import org.nuiton.util.beans.Binder;
import java.util.List;
@@ -94,6 +95,7 @@
map.put("voteId", pollUri.getUri());
map.put("resultId", pollUri.getUri());
+ map.put("adminId", poll.getAdminId());
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
@@ -105,11 +107,29 @@
protected Set<String> getPollFunctions(Poll poll) {
Set<String> result = Sets.newHashSet();
result.add("vote");
- if (poll.isPublicResults()) {
+ SecurityService securityService = getSecurityService();
+
+ String canAccessResult =
+ securityService.isCanAccessResult(poll);
+
+ if (canAccessResult == null) {
+
// only if results are public
result.add("result");
+ } else {
+ result.add("noresult");
}
+// if (poll.isPublicResults()) {
+//
+// // only if results are public
+// result.add("result");
+// }
+ boolean canAdminResult = securityService.isPollCreator(
+ poll, null, getPollenUserAccount());
+ if (canAdminResult) {
+ result.add("summary");
+ }
return result;
}
}
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -30,6 +30,7 @@
import org.chorem.pollen.common.PollType;
import org.chorem.pollen.entities.PollenBinderHelper;
import org.chorem.pollen.services.impl.PollService;
+import org.chorem.pollen.services.impl.SecurityService;
import org.nuiton.util.beans.Binder;
import java.util.List;
@@ -101,6 +102,7 @@
? pollUri.getPollId()
: pollUri.getUri();
map.put("resultId", resultId);
+ map.put("adminId", poll.getAdminId());
Set<String> functions = getPollFunctions(poll);
map.put("functions", functions);
@@ -112,11 +114,23 @@
private Set<String> getPollFunctions(Poll poll) {
Set<String> result = Sets.newHashSet();
result.add("vote");
- if (poll.isPublicResults()) {
+ SecurityService securityService = getSecurityService();
+
+ String canAccessResult =
+ securityService.isCanAccessResult(poll);
+
+ if (canAccessResult == null) {
+
// only if results are public
result.add("result");
}
+
+ boolean canAdminResult = securityService.isPollCreator(
+ poll, null, getPollenUserAccount());
+ if (canAdminResult) {
+ result.add("summary");
+ }
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -477,7 +477,8 @@
}
voteAllowed = getSecurityService().isCanVote(poll,
accountId,
- accountIdRole);
+ accountIdRole,
+ getPollenUserAccount());
}
// is can display result link ?
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -88,6 +88,17 @@
return url.getUrl();
}
+ public String getShowVoteUrl() {
+ PollUrl url = getPollUrlService().getPollVoteUrl(poll);
+ if (poll.getPollType() == PollType.FREE) {
+
+ // can removed accountId only for free poll
+ //FIXME Should found out in ohter case the accountId (if exists for the connected id) if no accountId is given
+ getSecurityService().removeAccountIdWhenConnected(url, getPollenUserAccount());
+ }
+ return url.getUrl();
+ }
+
public String getModerateUrl() {
PollUrl url = getPollUrlService().getPollModerateUrl(poll);
getSecurityService().removeAccountIdWhenConnected(url, getPollenUserAccount());
@@ -122,6 +133,10 @@
return getSecurityService().isCanClosePoll(poll, accountIdRole);
}
+ public boolean isCanShowVote() {
+ return poll.isPublicResults() && !isCanVote();
+ }
+
public boolean isCanShowResult() {
String errorMessage = getSecurityService().isCanAccessResult(
poll, accountIdRole);
@@ -131,11 +146,17 @@
public boolean isCanVote() {
String accountId = getAccountId();
if (accountIdRole == SecurityService.AccountIdRole.CREATOR) {
- accountId = null;
+
+ if (poll.getPollType() != PollType.FREE) {
+
+ } else {
+ accountId = null;
+ }
}
return getSecurityService().isCanVote(poll,
accountId,
- accountIdRole);
+ accountIdRole,
+ getPollenUserAccount());
}
@Override
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -66,10 +66,13 @@
addFlashWarning(_("pollen.information.pollNotStarted"));
} else if (isPollFinished()) {
addFlashWarning(_("pollen.information.pollFinished"));
+ } else if (!isVoteAllowed()) {
+ addFlashWarning(_("pollen.information.pollCanNotVote"));
}
if (isPollChoiceRunning()) {
addFlashMessage(_("pollen.information.pollChoiceRunning"));
}
+
}
@Override
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollResultAccessRequired.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollResultAccessRequired.java 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollResultAccessRequired.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -76,7 +76,6 @@
response,
mappedValue);
-
boolean withAccountId = pollUri.isAccountIdNotBlank();
if (withAccountId) {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/PollVoteAccessRequired.java 2012-07-31 20:43:25 UTC (rev 3582)
@@ -60,7 +60,7 @@
serviceContext.newService(SecurityService.class);
// get sane poll
- final Poll poll = getPollIdSane(pollUri, serviceContext, request);
+ Poll poll = getPollIdSane(pollUri, serviceContext, request);
boolean isAccessAllowed = poll != null;
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-07-31 20:43:25 UTC (rev 3582)
@@ -59,6 +59,7 @@
pollen.action.pollVotingListEdit=Edit that voting list
pollen.action.register=Register
pollen.action.send=Send
+pollen.action.showVoteAction.help=Share this link with people who can't vote but still can see votes
pollen.action.summaryPoll=Goto administration page of the poll
pollen.action.validate=Submit
pollen.action.voteAction.help=Share this link with people to vote
@@ -280,6 +281,7 @@
pollen.information.pollAccount.removedFromFavoriteList=Member '<strong>%s</strong>' removed from favorite list.
pollen.information.pollAccount.updated=Your account was updated.
pollen.information.pollAccount.updatedTofavoriteList=Member '<strong>%s</strong>' updated in favorite list.
+pollen.information.pollCanNotVote=You are not authorize to vote, but still can you can access to votes (public results poll)
pollen.information.pollChoiceRunning=Adding choices is allowed.
pollen.information.pollClosed=This poll is closed. You can not vote anymore.
pollen.information.pollFinished=This poll is finished. You can not vote anymore.
@@ -302,6 +304,7 @@
pollen.label.pollModerateVotePage=Moderate your poll
pollen.label.pollRegisterPage=If you are a logged user, you can find these links on the page
pollen.label.pollResultPage=Count votes
+pollen.label.pollShowVotePage=See vote on your poll
pollen.label.pollVotePage=Vote on your poll
pollen.legend.attachPoll=Attach an anonymous poll to your user account
pollen.legend.login=Login
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-07-31 20:43:25 UTC (rev 3582)
@@ -59,6 +59,7 @@
pollen.action.pollVotingListEdit=Editer ce groupe de votants
pollen.action.register=S'enregistrer
pollen.action.send=Envoyer
+pollen.action.showVoteAction.help=Partager ce lien avec ceuw qui ne peuvent voter mais peuvent quand même voir les votes
pollen.action.summaryPoll=Aller sur la page d'administration du sondage
pollen.action.validate=Valider
pollen.action.voteAction.help=Partager ce lien avec ceux que vous voulez voir voter
@@ -281,6 +282,7 @@
pollen.information.pollAccount.removedFromFavoriteList=Le membre '<strong>%s</strong>' a été supprimé de la liste des favoris.
pollen.information.pollAccount.updated=Votre compte a bien été mis à jour.
pollen.information.pollAccount.updatedTofavoriteList=Le membre '<strong>%s</strong>' a été mise à jour dans la liste des favoris.
+pollen.information.pollCanNotVote=Vous n'êtes pas autorisé à voter, mais vous pouvez cependant accéder au votes (sondage à resultats publics)
pollen.information.pollChoiceRunning=L'ajout de choix est possible.
pollen.information.pollClosed=Ce sondage est clos. Vous ne pouvez plus voter.
pollen.information.pollFinished=Ce sondage est terminé. Vous ne pouvez plus voter.
@@ -303,6 +305,7 @@
pollen.label.pollModerateVotePage=Modérer le sondage
pollen.label.pollRegisterPage=Si vous êtes un utilisateur identifié, vous pouvez retrouver ces liens dans la page
pollen.label.pollResultPage=Dépouiller le sondage
+pollen.label.pollShowVotePage=Voir les votes
pollen.label.pollVotePage=Voter
pollen.legend.attachPoll=Attacher un sondage anonyme à votre compte
pollen.legend.login=Login
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/summary.jsp 2012-07-31 20:43:25 UTC (rev 3582)
@@ -106,6 +106,19 @@
</span>
</div>
</s:if>
+<s:elseif test="canShowVote">
+ <div class="ui-widget-content-green ui-corner-all">
+ <img src="<s:url value='/img/vote.png'/>" class="imgAction"
+ alt="<s:text name='pollen.action.showVoteAction.help'/>"
+ title="<s:text name='pollen.action.showVoteAction.help'/>"/>
+ <s:a href="%{showVoteUrl}">
+ <strong><s:text name="pollen.label.pollShowVotePage"/></strong>
+ </s:a>
+ <span class="fright url" id='showVoteUrl'>
+ <s:property value="%{showVoteUrl}"/>
+ </span>
+ </div>
+</s:elseif>
<%--Show Results--%>
<s:if test="canShowResult">
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-07-31 20:43:25 UTC (rev 3582)
@@ -85,15 +85,18 @@
if (cellvalue.indexOf('novote') > -1) {
result += "<image src='${blankImg}'>";
}
- if (cellvalue.indexOf('summary') > -1) {
- result += formatLink("${summaryUrl}" + adminId, "${summaryImg}", "Moderate", "${summaryTitle}")
- }
if (cellvalue.indexOf('moderate') > -1) {
result += formatLink("${voteUrl}" + moderateId, "${moderateImg}", "Moderate", "${moderateTitle}")
}
if (cellvalue.indexOf('result') > -1) {
result += formatLink("${resultUrl}" + resultId, "${resultImg}", "Result", "${resultTitle}")
}
+ if (cellvalue.indexOf('noresult') > -1) {
+ result += "<image src='${blankImg}'>";
+ }
+ if (cellvalue.indexOf('summary') > -1) {
+ result += formatLink("${summaryUrl}" + adminId, "${summaryImg}", "Moderate", "${summaryTitle}")
+ }
if (cellvalue.indexOf('edit') > -1) {
result += formatLink("${editUrl}" + adminId, "${editImg}", "Edit", "${editTitle}")
}
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-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/createdList.jsp 2012-07-31 20:43:25 UTC (rev 3582)
@@ -75,7 +75,7 @@
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="65" sortable="false"/>
+ formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
<br/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/invitedList.jsp 2012-07-31 20:43:25 UTC (rev 3582)
@@ -59,5 +59,5 @@
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="55" sortable="false"/>
+ formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-07-31 19:43:13 UTC (rev 3581)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/participatedList.jsp 2012-07-31 20:43:25 UTC (rev 3582)
@@ -59,5 +59,5 @@
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="55" sortable="false"/>
+ formatter="pollFunctions" width="75" sortable="false"/>
</sjg:grid>
1
0
r3581 - trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 21:43:13 +0200 (Tue, 31 Jul 2012)
New Revision: 3581
Url: http://chorem.org/repositories/revision/pollen/3581
Log:
fix hql request
Modified:
trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java
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-07-31 16:53:17 UTC (rev 3580)
+++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java 2012-07-31 19:43:13 UTC (rev 3581)
@@ -92,8 +92,8 @@
Preconditions.checkNotNull(pager);
Preconditions.checkNotNull(user);
- String hql = "SELECT p, l.pollAccount FROM PollImpl p, " +
- "LEFT JOIN p.votingList v, " +
+ String hql = "SELECT p, l.pollAccount FROM PollImpl p " +
+ "LEFT JOIN p.votingList v " +
"LEFT JOIN v.pollAccountPersonToList l " +
"WHERE l.pollAccount.email = :email";
List<Pair<Poll, PollAccount>> result = findAllWithPollAccounts(
1
0
r3580 - in trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions: . admin poll
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 18:53:17 +0200 (Tue, 31 Jul 2012)
New Revision: 3580
Url: http://chorem.org/repositories/revision/pollen/3580
Log:
review PageSkin usage (once for all\!)
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/PollenActionSupportForEdition.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.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/AbstractPollUriIdAction.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/AttachPoll.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/SummaryPoll.java
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-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupport.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -119,15 +119,26 @@
private transient SecurityService securityService;
- public PageSkin getSkin() {
- return PageSkin.INDEX;
+ private final PageSkin skin;
+
+ public PollenActionSupport() {
+ // by default use the index skin
+ this(PageSkin.INDEX);
}
- public String getPageLogo() {
+ public PollenActionSupport(PageSkin skin) {
+ this.skin = skin;
+ }
+
+ public final PageSkin getSkin() {
+ return skin;
+ }
+
+ public final String getPageLogo() {
return getSkin().getCssSuffix();
}
- public String getJqueryTheme() {
+ public final String getJqueryTheme() {
return getSkin().getTheme();
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java 2012-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -2,8 +2,8 @@
/*
* #%L
* Pollen :: UI (struts2)
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2009 - 2012 CodeLutin
* %%
@@ -32,8 +32,8 @@
private static final long serialVersionUID = 1L;
- @Override
- public final PageSkin getSkin() {
- return PageSkin.EDITION;
+ public PollenActionSupportForEdition() {
+ super(PageSkin.EDITION);
}
+
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java 2012-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -2,7 +2,7 @@
/*
* #%L
* Pollen :: UI (struts2)
- * $Id:$
+ * $Id$
* $HeadURL:$
* %%
* Copyright (C) 2009 - 2012 CodeLutin
@@ -32,8 +32,8 @@
private static final long serialVersionUID = 1L;
- @Override
- public final PageSkin getSkin() {
- return PageSkin.VOTE;
+ public PollenActionSupportForVote() {
+ super(PageSkin.VOTE);
}
+
}
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-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -58,10 +58,6 @@
return getUser();
}
-// public UserAccount getDeleteUser() {
-// return getUser();
-// }
-
public String getAction() {
return action;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java 2012-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -25,6 +25,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.pollen.bean.PollUri;
+import org.chorem.pollen.ui.actions.PageSkin;
import org.chorem.pollen.ui.actions.PollenActionSupport;
import org.chorem.pollen.ui.converters.PollUriConverter;
@@ -53,6 +54,13 @@
private int page;
+ protected AbstractPollUriIdAction() {
+ }
+
+ protected AbstractPollUriIdAction(PageSkin skin) {
+ super(skin);
+ }
+
public final PollUri getUriId() {
return pollUri;
}
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-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -170,6 +170,10 @@
*/
private transient HttpServletRequest request;
+ protected AbstractVoteAction() {
+ super(PageSkin.VOTE);
+ }
+
/**
* @return {@code true} if moderation is possible, {@code false} otherwise
* @since 1.4
@@ -177,11 +181,6 @@
public abstract boolean isModerate();
@Override
- public PageSkin getSkin() {
- return PageSkin.VOTE;
- }
-
- @Override
public void setParameters(Map<String, String[]> parameters) {
this.parameters = parameters;
}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AttachPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AttachPoll.java 2012-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AttachPoll.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -39,9 +39,8 @@
private static final long serialVersionUID = 1L;
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
+ public AttachPoll() {
+ super(PageSkin.EDITION);
}
@Override
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-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultForPoll.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -131,9 +131,8 @@
@Inject(required = true)
private UrlHelper urlHelper;
- @Override
- public PageSkin getSkin() {
- return PageSkin.RESULT;
+ public ResultForPoll() {
+ super(PageSkin.RESULT);
}
public Poll getPoll() {
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java 2012-07-31 16:21:30 UTC (rev 3579)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SummaryPoll.java 2012-07-31 16:53:17 UTC (rev 3580)
@@ -64,16 +64,15 @@
*/
private transient HttpServletRequest request;
+ public SummaryPoll() {
+ super(PageSkin.EDITION);
+ }
+
@Override
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
public Poll getPoll() {
return poll;
}
1
0
r3579 - in trunk/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/admin java/org/chorem/pollen/ui/actions/poll java/org/chorem/pollen/ui/actions/user resources resources/config resources/i18n resources/org/chorem/pollen webapp/WEB-INF/jsp/user webapp/js
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 18:21:30 +0200 (Tue, 31 Jul 2012)
New Revision: 3579
Url: http://chorem.org/repositories/revision/pollen/3579
Log:
fixes #715: Import voting users list doesn't work
remove bad action as CRUD prefer to have one class per action (avoid introduce bad state design)
Added:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
Removed:
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/ManageFavoriteLists.java
trunk/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/
trunk/pollen-ui-struts2/src/main/resources/validators.xml
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/poll/AbstractPollForm.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.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/Register.java
trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml
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/user/edit.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp
trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js
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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -24,7 +24,6 @@
import com.google.common.base.Preconditions;
import org.apache.commons.lang3.StringUtils;
-import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -63,8 +63,7 @@
import org.chorem.pollen.services.impl.PollService;
import org.chorem.pollen.services.impl.PreventRuleService;
import org.chorem.pollen.ui.actions.FileUploadAware;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
import org.chorem.pollen.ui.converters.DateConverter;
import org.chorem.pollen.votecounting.strategy.VoteCountingStrategy;
import org.chorem.pollen.votecounting.strategy.VoteCountingStrategyProvider;
@@ -90,7 +89,7 @@
* @author fdesbois <desbois(a)codelutin.com>
* $Id$
*/
-public abstract class AbstractPollForm extends PollenActionSupport implements Preparable, ParameterAware, FileUploadAware, ServletRequestAware {
+public abstract class AbstractPollForm extends PollenActionSupportForEdition implements Preparable, ParameterAware, FileUploadAware, ServletRequestAware {
private static final long serialVersionUID = 1L;
@@ -575,11 +574,6 @@
this.parameters.putAll(parameters);
}
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
public boolean isInformationsError() {
return informationsError;
}
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -0,0 +1,207 @@
+package org.chorem.pollen.ui.actions.user;
+/*
+ * #%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%
+ */
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang3.StringUtils;
+import org.chorem.pollen.business.persistence.PersonList;
+import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.services.exceptions.FavoriteListAlreadyExistException;
+import org.chorem.pollen.services.exceptions.FavoriteListImportException;
+import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
+import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
+import org.chorem.pollen.services.impl.FavoriteService;
+import org.chorem.pollen.ui.actions.FileUploadAware;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * To create a new favorite list.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class CreateFavoriteList extends PollenActionSupportForEdition implements FileUploadAware {
+
+ private static final long serialVersionUID = 1L;
+
+ protected PersonList createFavoriteList;
+
+ protected File csvImport;
+
+ protected String csvImportContentType;
+
+ protected String csvImportFileName;
+
+ protected String ldapImport;
+
+ @Override
+ public void addFile(int index, File file) {
+ csvImport = file;
+ }
+
+ @Override
+ public void addFileContentType(int index, String contentType) {
+ csvImportContentType = contentType;
+ }
+
+ @Override
+ public void addFileName(int index, String fileName) {
+ csvImportFileName = fileName;
+ }
+
+ public void setLdapImport(String ldapImport) {
+ this.ldapImport = ldapImport;
+ }
+
+ public PersonList getCreateFavoriteList() {
+ if (createFavoriteList == null) {
+ createFavoriteList = getFavoriteService().newFavoriteList();
+ }
+ return createFavoriteList;
+ }
+
+ public String getLdapImport() {
+ return ldapImport;
+ }
+
+ public String getAction() {
+ return "create";
+ }
+
+ @Override
+ public void validate() {
+
+ if (StringUtils.isBlank(getCreateFavoriteList().getName())) {
+ addFieldError("createFavoriteList.name",
+ _("pollen.error.favoriteListName.required"));
+ }
+
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ Preconditions.checkNotNull(createFavoriteList);
+ Preconditions.checkNotNull(createFavoriteList.getName());
+
+ int nbImports = 0;
+ try {
+ PersonList personList =
+ getFavoriteService().createFavoriteList(getPollenUserAccount(),
+ createFavoriteList.getName());
+
+ if (csvImportFileName != null) {
+
+ nbImports = addImportFromCsv(personList);
+ }
+
+ if (StringUtils.isNotBlank(ldapImport)) {
+
+ nbImports = addImportFromLDAP(personList);
+ }
+
+ } catch (FavoriteListAlreadyExistException ex) {
+ addFieldError("createFavoriteList.name",
+ _("pollen.error.favoriteList.already.used"));
+ }
+
+ String result;
+ if (hasAnyErrors()) {
+ result = INPUT;
+
+ } else {
+ getTransaction().commitTransaction();
+
+ if (nbImports > 0) {
+ addFlashMessage(_("pollen.information.favoriteList.imported",
+ createFavoriteList.getName(), nbImports));
+ } else {
+
+ addFlashMessage(_("pollen.information.favoriteList.created",
+ createFavoriteList.getName()));
+ }
+ createFavoriteList = null;
+ result = SUCCESS;
+ }
+ return result;
+ }
+
+ protected int addImportFromCsv(PersonList personList) throws FavoriteListNotFoundException {
+
+ int nbImports = 0;
+
+ try {
+ List<PollAccount> importedAccounts = getFavoriteService().importFromCsvfile(
+ csvImportFileName, csvImport);
+
+ nbImports = addImport(importedAccounts, personList);
+
+ } catch (FavoriteListImportException ex) {
+ String message = ex.getLocalizedMessage(getLocale());
+ addFlashError(message);
+ }
+ return nbImports;
+ }
+
+ protected int addImportFromLDAP(PersonList personList) throws FavoriteListNotFoundException {
+
+ int nbImports = 0;
+
+ try {
+ List<PollAccount> importedAccounts = getFavoriteService().importFromLDAP(
+ ldapImport);
+
+ nbImports = addImport(importedAccounts, personList);
+
+ } catch (FavoriteListImportException ex) {
+ String message = ex.getLocalizedMessage(getLocale());
+ addFlashError(message);
+ }
+ return nbImports;
+ }
+
+ protected int addImport(List<PollAccount> importedAccounts,
+ PersonList list)
+ throws FavoriteListNotFoundException {
+
+ FavoriteService favoriteService = getFavoriteService();
+
+ for (PollAccount importedAccount : importedAccounts) {
+ try {
+ favoriteService.addPollAccountToFavoriteList(list, importedAccount);
+
+ } catch (ParticipantAlreadyFoundInListException ex) {
+ // WARNING ?
+ addFlashError(
+ _("pollen.error.favoriteList.import.participantExists"
+ , importedAccount.getEmail())
+ );
+ }
+ }
+
+ return importedAccounts.size();
+ }
+}
\ No newline at end of file
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteList.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -0,0 +1,124 @@
+package org.chorem.pollen.ui.actions.user;
+
+import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.struts2.interceptor.ParameterAware;
+import org.chorem.pollen.business.persistence.PersonList;
+import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
+import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
+import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
+import org.nuiton.util.StringUtil;
+
+import java.util.Map;
+
+/**
+ * Creates a new {@link PollAccount} inside a selected {@link PersonList}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class CreateFavoriteListVoter extends PollenActionSupportForEdition implements Preparable, ParameterAware {
+
+ private static final long serialVersionUID = 1L;
+
+ private Map<String, String[]> parameters;
+
+ protected PersonList favoriteList;
+
+ protected PollAccount pollAccount;
+
+ public PollAccount getCreatePollAccount() {
+ return getPollAccount();
+ }
+
+ public PersonList getFavoriteList() {
+ return favoriteList;
+ }
+
+ public String getFavoriteListId() {
+ return favoriteList.getTopiaId();
+ }
+
+ public String getAction() {
+ return "create";
+ }
+
+ @Override
+ public void prepare() throws Exception {
+
+ String[] favoriteListIds = parameters.get("favoriteListId");
+ Preconditions.checkNotNull(favoriteListIds);
+ Preconditions.checkArgument(favoriteListIds.length == 1);
+ String favoriteListId = favoriteListIds[0];
+
+ try {
+ favoriteList = getFavoriteService().getFavoriteList(
+ getPollenUserAccount(), favoriteListId);
+ } catch (FavoriteListNotFoundException e) {
+ addFlashError(_("pollen.error.favoriteList.not.found"));
+ } catch (FavoriteListNotOwnedByUserException e) {
+ addFlashError(_("pollen.error.favoriteList.not.owned.by.user"));
+ }
+ }
+
+ @Override
+ public void validate() {
+
+ PollAccount account = getCreatePollAccount();
+
+ if (StringUtils.isBlank(account.getVotingId())) {
+ addFieldError("createPollAccount.votingId",
+ _("pollen.error.pollAccount.votingId.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("createPollAccount.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("createPollAccount.email",
+ _("pollen.error.email.invalid"));
+ }
+
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ Preconditions.checkNotNull(favoriteList);
+ Preconditions.checkNotNull(pollAccount);
+
+ String result = INPUT;
+
+ try {
+
+ getFavoriteService().addPollAccountToFavoriteList(
+ favoriteList, pollAccount);
+
+ addFlashMessage(
+ _("pollen.information.pollAccount.addedTofavoriteList",
+ pollAccount.getVotingId()));
+
+ pollAccount = null;
+ result = SUCCESS;
+ } catch (ParticipantAlreadyFoundInListException e) {
+ addFieldError("createPollAccount.email",
+ _("pollen.error.favoriteList.participant.already.found.in.list"));
+ }
+ return result;
+ }
+
+ protected PollAccount getPollAccount() {
+ if (pollAccount == null) {
+ pollAccount = getFavoriteService().newPollAccountForFavoriteList();
+ }
+ return pollAccount;
+ }
+
+ @Override
+ public void setParameters(Map<String, String[]> parameters) {
+ this.parameters = parameters;
+ }
+}
\ No newline at end of file
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/CreateFavoriteListVoter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java (from rev 3573, 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/DeleteFavoriteListVoter.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -0,0 +1,83 @@
+/*
+ * #%L
+ * Pollen :: UI (struts2)
+ * $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%
+ */
+package org.chorem.pollen.ui.actions.user;
+
+import com.google.common.base.Preconditions;
+import org.chorem.pollen.business.persistence.PersonList;
+import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.services.impl.FavoriteService;
+import org.chorem.pollen.ui.actions.PollenActionSupport;
+
+/**
+ * Delete a selected favorite list for the connected user.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.3
+ */
+public class DeleteFavoriteListVoter extends PollenActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String favoriteListId;
+
+ protected String pollAccountId;
+
+ protected String redirectUrl;
+
+ public void setRedirectUrl(String redirectUrl) {
+ this.redirectUrl = redirectUrl;
+ }
+
+ public void setFavoriteListId(String favoriteListId) {
+ this.favoriteListId = favoriteListId;
+ }
+
+ public void setPollAccountId(String pollAccountId) {
+ this.pollAccountId = pollAccountId;
+ }
+
+ public String getRedirectUrl() {
+ return redirectUrl;
+ }
+
+ public String execute() throws Exception {
+
+ Preconditions.checkNotNull(pollAccountId);
+
+ FavoriteService service = getFavoriteService();
+
+ PersonList favoriteList = service.getEntityById(PersonList.class,
+ favoriteListId);
+
+ PollAccount pollAccount = service.getEntityById(PollAccount.class,
+ pollAccountId);
+
+ service.removePollAccountToFavoriteList(favoriteList, pollAccount);
+
+ addFlashMessage(
+ _("pollen.information.pollAccount.removedFromFavoriteList",
+ pollAccount.getVotingId()));
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeleteFavoriteListVoter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: 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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/DeletePollAccount.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -1,83 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.user;
-
-import com.google.common.base.Preconditions;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.services.impl.FavoriteService;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-/**
- * Delete a selected favorite list for the connected user.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class DeletePollAccount extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- protected String favoriteListId;
-
- protected String pollAccountId;
-
- protected String redirectUrl;
-
- public void setRedirectUrl(String redirectUrl) {
- this.redirectUrl = redirectUrl;
- }
-
- public void setFavoriteListId(String favoriteListId) {
- this.favoriteListId = favoriteListId;
- }
-
- public void setPollAccountId(String pollAccountId) {
- this.pollAccountId = pollAccountId;
- }
-
- public String getRedirectUrl() {
- return redirectUrl;
- }
-
- public String execute() throws Exception {
-
- Preconditions.checkNotNull(pollAccountId);
-
- FavoriteService service = getFavoriteService();
-
- PersonList favoriteList = service.getEntityById(PersonList.class,
- favoriteListId);
-
- PollAccount pollAccount = service.getEntityById(PollAccount.class,
- pollAccountId);
-
- service.removePollAccountToFavoriteList(favoriteList, pollAccount);
-
- addFlashMessage(
- _("pollen.information.pollAccount.removedFromFavoriteList",
- pollAccount.getVotingId()));
-
- return SUCCESS;
- }
-}
Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -27,8 +27,7 @@
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserInvalidPasswordException;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
import org.nuiton.util.StringUtil;
/**
@@ -37,26 +36,21 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.3
*/
-public class Edit extends PollenActionSupport {
+public class Edit extends PollenActionSupportForEdition {
private static final long serialVersionUID = 1L;
- protected UserAccount user;
+ protected UserAccount pollenUserAccount;
protected String newPassword;
protected String newPassword2;
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
- public UserAccount getUser() {
- if (user == null) {
- user = getUserService().getNewUser();
+ public UserAccount getPollenUserAccount() {
+ if (pollenUserAccount == null) {
+ pollenUserAccount = getUserService().getNewUser();
}
- return user;
+ return pollenUserAccount;
}
public String getNewPassword() {
@@ -75,10 +69,12 @@
this.newPassword2 = newPassword2;
}
+ @Override
public String input() throws Exception {
- UserAccount userAccount = getPollenUserAccount();
- user = getUserService().getEntityById(UserAccount.class,
- userAccount.getTopiaId());
+ UserAccount userAccount = super.getPollenUserAccount();
+ pollenUserAccount = getUserService().getEntityById(
+ UserAccount.class,
+ userAccount.getTopiaId());
return INPUT;
}
@@ -86,24 +82,29 @@
@Override
public void validate() {
- if (StringUtils.isBlank(user.getLogin())) {
- addFieldError("user.login", _("pollen.error.login.required"));
+ if (StringUtils.isBlank(pollenUserAccount.getLogin())) {
+ addFieldError("pollenUserAccount.login",
+ _("pollen.error.login.required"));
}
- if (StringUtils.isBlank(user.getPassword())) {
- addFieldError("user.password", _("pollen.error.password.required"));
+ if (StringUtils.isBlank(pollenUserAccount.getPassword())) {
+ addFieldError("pollenUserAccount.password",
+ _("pollen.error.password.required"));
}
if (StringUtils.isNotBlank(getNewPassword())) {
if (ObjectUtils.notEqual(getNewPassword(), getNewPassword2())) {
- addFieldError("newPassword", _("pollen.error.passwords.not.equals"));
+ addFieldError("newPassword",
+ _("pollen.error.passwords.not.equals"));
}
}
- if (StringUtils.isBlank(user.getEmail())) {
- addFieldError("user.email", _("pollen.error.email.required"));
- } else if (!StringUtil.isEmail(user.getEmail())) {
- addFieldError("user.email", _("pollen.error.email.invalid"));
+ if (StringUtils.isBlank(pollenUserAccount.getEmail())) {
+ addFieldError("pollenUserAccount.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(pollenUserAccount.getEmail())) {
+ addFieldError("pollenUserAccount.email",
+ _("pollen.error.email.invalid"));
}
}
@@ -111,25 +112,30 @@
public String execute() throws Exception {
// let's push back admin property to user to save
- user.setAdministrator(
- getPollenUserAccount().isAdministrator());
+ pollenUserAccount.setAdministrator(
+ super.getPollenUserAccount().isAdministrator());
String result = INPUT;
try {
UserAccount updatedUser =
- getUserService().updateUser(user, newPassword, false);
+ getUserService().updateUser(pollenUserAccount,
+ newPassword, false);
// push back user to session
getPollenSession().setUserAccount(updatedUser);
+
+ addFlashMessage(_("pollen.information.pollAccount.updated"));
result = SUCCESS;
} catch (UserEmailAlreadyUsedException e) {
- addFieldError("user.email", _("pollen.error.user.email.already.used"));
+ addFieldError("pollenUserAccount.email",
+ _("pollen.error.user.email.already.used"));
} catch (UserInvalidPasswordException e) {
- addFieldError("user.password", _("pollen.error.user.invalid.password"));
+ addFieldError("pollenUserAccount.password",
+ _("pollen.error.user.invalid.password"));
}
// reset password
- user.setPassword(null);
+ pollenUserAccount.setPassword(null);
newPassword = newPassword2 = null;
return result;
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -0,0 +1,48 @@
+package org.chorem.pollen.ui.actions.user;
+
+import org.chorem.pollen.business.persistence.PersonList;
+import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
+import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
+
+/**
+ * Edit a given {@link PersonList}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class EditFavoriteList extends PollenActionSupportForEdition {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String favoriteListId;
+
+ protected PersonList favoriteList;
+
+ public void setFavoriteListId(String favoriteListId) {
+ this.favoriteListId = favoriteListId;
+ }
+
+ public PersonList getFavoriteList() {
+ return favoriteList;
+ }
+
+ public String getFavoriteListId() {
+ return favoriteList.getTopiaId();
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ try {
+ favoriteList = getFavoriteService().getFavoriteList(
+ getPollenUserAccount(), favoriteListId);
+ } catch (FavoriteListNotFoundException e) {
+ addFlashError(_("pollen.error.favoriteList.not.found"));
+ } catch (FavoriteListNotOwnedByUserException e) {
+ addFlashError(_("pollen.error.favoriteList.not.owned.by.user"));
+ }
+ return SUCCESS;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteList.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -0,0 +1,120 @@
+package org.chorem.pollen.ui.actions.user;
+
+import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.struts2.interceptor.ParameterAware;
+import org.chorem.pollen.business.persistence.PersonList;
+import org.chorem.pollen.business.persistence.PollAccount;
+import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
+import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
+import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
+import org.nuiton.util.StringUtil;
+
+import java.util.Map;
+
+/**
+ * Edits a {@link PollAccount} inside a selected {@link PersonList}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class EditFavoriteListVoter extends PollenActionSupportForEdition implements Preparable, ParameterAware {
+
+ private static final long serialVersionUID = 1L;
+
+ private Map<String, String[]> parameters;
+
+ protected PersonList favoriteList;
+
+ protected PollAccount editPollAccount;
+
+ public PollAccount getEditPollAccount() {
+ if (editPollAccount == null) {
+ editPollAccount = getFavoriteService().newPollAccountForFavoriteList();
+ }
+ return editPollAccount;
+ }
+
+ public PersonList getFavoriteList() {
+ return favoriteList;
+ }
+
+ public String getFavoriteListId() {
+ return favoriteList.getTopiaId();
+ }
+
+ public String getAction() {
+ return "edit";
+ }
+
+ @Override
+ public void prepare() throws Exception {
+
+ String[] favoriteListIds = parameters.get("favoriteListId");
+ Preconditions.checkNotNull(favoriteListIds);
+ Preconditions.checkArgument(favoriteListIds.length == 1);
+ String favoriteListId = favoriteListIds[0];
+
+ try {
+ favoriteList = getFavoriteService().getFavoriteList(
+ getPollenUserAccount(), favoriteListId);
+ } catch (FavoriteListNotFoundException e) {
+ addFlashError(_("pollen.error.favoriteList.not.found"));
+ } catch (FavoriteListNotOwnedByUserException e) {
+ addFlashError(_("pollen.error.favoriteList.not.owned.by.user"));
+ }
+ }
+
+ @Override
+ public void validate() {
+
+ PollAccount account = getEditPollAccount();
+
+ if (StringUtils.isBlank(account.getVotingId())) {
+ addFieldError("editPollAccount.votingId",
+ _("pollen.error.pollAccount.votingId.required"));
+ }
+
+ if (StringUtils.isBlank(account.getEmail())) {
+ addFieldError("editPollAccount.email",
+ _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(account.getEmail())) {
+ addFieldError("editPollAccount.email",
+ _("pollen.error.email.invalid"));
+ }
+
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ Preconditions.checkNotNull(favoriteList);
+ Preconditions.checkNotNull(editPollAccount);
+
+ String result = INPUT;
+
+ try {
+
+ getFavoriteService().editPollAccountToFavoriteList(
+ favoriteList, editPollAccount);
+
+ addFlashMessage(
+ _("pollen.information.pollAccount.updatedTofavoriteList",
+ editPollAccount.getVotingId()));
+
+ editPollAccount = null;
+ result = SUCCESS;
+ } catch (ParticipantAlreadyFoundInListException e) {
+ addFieldError("editPollAccount.email",
+ _("pollen.error.favoriteList.participant.already.found.in.list"));
+ }
+ return result;
+ }
+
+ @Override
+ public void setParameters(Map<String, String[]> parameters) {
+ this.parameters = parameters;
+ }
+}
\ No newline at end of file
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/EditFavoriteListVoter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -31,8 +31,7 @@
import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
import org.nuiton.util.StringUtil;
import java.util.Map;
@@ -43,17 +42,12 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.3
*/
-public class ManageFavoriteList extends PollenActionSupport implements Preparable, ParameterAware {
+public class ManageFavoriteList extends PollenActionSupportForEdition implements Preparable, ParameterAware {
private static final long serialVersionUID = 1L;
private Map<String, String[]> parameters;
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
protected String action;
// protected String favoriteListId;
Deleted: 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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -1,210 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.user;
-
-import com.google.common.base.Preconditions;
-import org.apache.commons.lang3.StringUtils;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.services.FavoriteListImport;
-import org.chorem.pollen.services.exceptions.FavoriteListAlreadyExistException;
-import org.chorem.pollen.services.exceptions.FavoriteListImportException;
-import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
-import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
-import org.chorem.pollen.services.impl.FavoriteListImportCSV;
-import org.chorem.pollen.services.impl.FavoriteListImportLDAP;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * Manage favorite lists of a connected user.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class ManageFavoriteLists extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- protected PersonList favoriteList;
-
- protected File csvImport;
-
- protected String csvImportContentType;
-
- protected String csvImportFileName;
-
- protected String ldapImport;
-
- protected String action;
-
- public void setCsvImport(File csvImport) {
- this.csvImport = csvImport;
- }
-
- public void setCsvImportContentType(String csvImportContentType) {
- this.csvImportContentType = csvImportContentType;
- }
-
- public void setCsvImportFileName(String csvImportFileName) {
- this.csvImportFileName = csvImportFileName;
- }
-
- public String getLdapImport() {
- return ldapImport;
- }
-
- public void setLdapImport(String ldapImport) {
- this.ldapImport = ldapImport;
- }
-
- public PersonList getCreateFavoriteList() {
- return getFavoriteList();
- }
-
- public PersonList getDeleteFavoriteList() {
- return getFavoriteList();
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
- @Override
- public void validate() {
-
- if ("create".equals(action)) {
-
- if( StringUtils.isBlank(getCreateFavoriteList().getName())) {
- addFieldError("createFavoriteList.name",
- _("pollen.error.favoriteListName.required"));
- }
- }
- }
-
- public String create() throws Exception {
-
- Preconditions.checkNotNull(favoriteList);
- Preconditions.checkNotNull(favoriteList.getName());
-
- try {
- PersonList personList =
- getFavoriteService().createFavoriteList(getPollenUserAccount(),
- favoriteList.getName());
-
- if (csvImportFileName != null) {
-
- FavoriteListImport importService = newService(FavoriteListImportCSV.class);
-
- addImport(importService, csvImport.getAbsolutePath(), personList);
- }
-
- if (StringUtils.isNotBlank(ldapImport)) {
-
- FavoriteListImport importService = newService(FavoriteListImportLDAP.class);
-
- addImport(importService, ldapImport, personList);
- }
-
- } catch (FavoriteListAlreadyExistException ex) {
- addFieldError("createFavoriteList.name",
- _("pollen.error.favoriteList.already.used"));
- }
-
- String result;
- if (hasAnyErrors()) {
- result = INPUT;
-
- } else {
- getTransaction().commitTransaction();
-
- addFlashMessage(_("pollen.information.favoriteList.created",
- favoriteList.getName()));
- action = null;
- favoriteList = null;
- result = SUCCESS;
- }
- return result;
- }
-
- public String delete() throws Exception {
-
- Preconditions.checkNotNull(favoriteList);
-
- PersonList deletedFavoritedList =
- getFavoriteService().deleteFavoriteList(getPollenUserAccount(),
- favoriteList);
- getTransaction().commitTransaction();
-
- addFlashMessage(_("pollen.information.favoriteList.deleted",
- deletedFavoritedList.getName()));
- action = null;
- favoriteList = null;
- return SUCCESS;
- }
-
- protected PersonList getFavoriteList() {
- if (favoriteList == null) {
- favoriteList = getFavoriteService().newFavoriteList();
- }
- return favoriteList;
- }
-
- protected void addImport(FavoriteListImport service, String url, PersonList list)
- throws FavoriteListNotFoundException {
-
- List<PollAccount> importedAccounts;
- try {
- importedAccounts = service.execute(url);
-
- for (PollAccount importedAccount : importedAccounts) {
- try {
- getFavoriteService().addPollAccountToFavoriteList(list, importedAccount);
-
- } catch (ParticipantAlreadyFoundInListException ex) {
- // WARNING ?
- addFlashError(
- _("pollen.error.favoriteList.import.participantExists"
- , importedAccount.getEmail())
- );
- }
- }
-
- } catch (FavoriteListImportException ex) {
- String message = ex.getLocalizedMessage(getLocale());
- 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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-07-31 16:21:30 UTC (rev 3579)
@@ -27,8 +27,7 @@
import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException;
import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
+import org.chorem.pollen.ui.actions.PollenActionSupportForEdition;
import org.nuiton.util.StringUtil;
/**
@@ -37,19 +36,19 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.3
*/
-public class Register extends PollenActionSupport {
+public class Register extends PollenActionSupportForEdition {
private static final long serialVersionUID = 1L;
- protected UserAccount user;
+ protected UserAccount pollenUserAccount;
protected String password2;
- public UserAccount getUser() {
- if (user == null) {
- user = getUserService().getNewUser();
+ public UserAccount getPollenUserAccount() {
+ if (pollenUserAccount == null) {
+ pollenUserAccount = getUserService().getNewUser();
}
- return user;
+ return pollenUserAccount;
}
public String getPassword2() {
@@ -61,33 +60,28 @@
}
@Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
- @Override
public void validate() {
- if (StringUtils.isBlank(user.getLogin())) {
- addFieldError("user.login", _("pollen.error.login.required"));
+ if (StringUtils.isBlank(pollenUserAccount.getLogin())) {
+ addFieldError("pollenUserAccount.login", _("pollen.error.login.required"));
}
- if (StringUtils.isBlank(user.getPassword())) {
- addFieldError("user.password", _("pollen.error.password.required"));
+ if (StringUtils.isBlank(pollenUserAccount.getPassword())) {
+ addFieldError("pollenUserAccount.password", _("pollen.error.password.required"));
}
if (StringUtils.isBlank(getPassword2())) {
addFieldError("password2", _("pollen.error.password2.required"));
}
- if (ObjectUtils.notEqual(getPassword2(), user.getPassword())) {
+ if (ObjectUtils.notEqual(getPassword2(), pollenUserAccount.getPassword())) {
addFieldError("password2", _("pollen.error.passwords.not.equals"));
}
- if (StringUtils.isBlank(user.getEmail())) {
- addFieldError("user.email", _("pollen.error.email.required"));
- } else if (!StringUtil.isEmail(user.getEmail())) {
- addFieldError("user.email", _("pollen.error.email.invalid"));
+ if (StringUtils.isBlank(pollenUserAccount.getEmail())) {
+ addFieldError("pollenUserAccount.email", _("pollen.error.email.required"));
+ } else if (!StringUtil.isEmail(pollenUserAccount.getEmail())) {
+ addFieldError("pollenUserAccount.email", _("pollen.error.email.invalid"));
}
}
@@ -96,21 +90,21 @@
String result = INPUT;
try {
- UserAccount createdUser = getUserService().createUser(user, false);
+ UserAccount createdUser = getUserService().createUser(pollenUserAccount, false);
getPollenSession().setUserAccount(createdUser);
addFlashMessage(_("pollen.information.your.are.loggued"));
result = SUCCESS;
} catch (UserLoginAlreadyUsedException e) {
- addFieldError("user.login", _("pollen.error.user.login.already.used"));
+ addFieldError("pollenUserAccount.login", _("pollen.error.user.login.already.used"));
} catch (UserEmailAlreadyUsedException e) {
- addFieldError("user.email", _("pollen.error.user.email.already.used"));
+ addFieldError("pollenUserAccount.email", _("pollen.error.user.email.already.used"));
}
// if error go back to input
// reset password
- user.setPassword(null);
+ pollenUserAccount.setPassword(null);
password2 = null;
return result;
Modified: trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-07-31 16:21:30 UTC (rev 3579)
@@ -56,7 +56,7 @@
</action>
<!-- show user account -->
- <action name="show" class="org.chorem.pollen.ui.actions.user.Show">
+ <action name="show" class="org.chorem.pollen.ui.actions.PollenActionSupportForEdition">
<result>/WEB-INF/jsp/user/show.jsp</result>
</action>
@@ -82,15 +82,15 @@
<!-- show favorite lists -->
<action name="favoriteLists" method="input"
- class="org.chorem.pollen.ui.actions.user.ManageFavoriteLists">
+ class="org.chorem.pollen.ui.actions.PollenActionSupportForEdition">
<interceptor-ref name="pollenBasicStack"/>
<result name="input">/WEB-INF/jsp/user/favoriteLists.jsp</result>
<result>/WEB-INF/jsp/user/favoriteLists.jsp</result>
</action>
<!-- create favorite list -->
- <action name="createFavoriteList" method="create"
- class="org.chorem.pollen.ui.actions.user.ManageFavoriteLists">
+ <action name="createFavoriteList"
+ class="org.chorem.pollen.ui.actions.user.CreateFavoriteList">
<interceptor-ref name="pollenParamsPrepareParamsStack"/>
<result name="input">/WEB-INF/jsp/user/favoriteLists.jsp</result>
<result>/WEB-INF/jsp/user/favoriteLists.jsp</result>
@@ -110,23 +110,23 @@
</action>
<!-- edit favorite list -->
- <action name="editFavoriteList" method="input"
- class="org.chorem.pollen.ui.actions.user.ManageFavoriteList">
+ <action name="editFavoriteList"
+ class="org.chorem.pollen.ui.actions.user.EditFavoriteList">
<interceptor-ref name="pollenParamsPrepareParamsStack"/>
- <result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result>
+ <result>/WEB-INF/jsp/user/favoriteList.jsp</result>
</action>
<!-- add poll account to favorite list -->
- <action name="addPollAccount" method="create"
- class="org.chorem.pollen.ui.actions.user.ManageFavoriteList">
+ <action name="addPollAccount"
+ class="org.chorem.pollen.ui.actions.user.CreateFavoriteListVoter">
<interceptor-ref name="pollenParamsPrepareParamsStack"/>
<result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result>
<result>/WEB-INF/jsp/user/favoriteList.jsp</result>
</action>
<!-- edit poll account to favorite list -->
- <action name="editPollAccount" method="edit"
- class="org.chorem.pollen.ui.actions.user.ManageFavoriteList">
+ <action name="editPollAccount"
+ class="org.chorem.pollen.ui.actions.user.EditFavoriteListVoter">
<interceptor-ref name="pollenParamsPrepareParamsStack"/>
<result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result>
<result>/WEB-INF/jsp/user/favoriteList.jsp</result>
@@ -140,7 +140,7 @@
<!-- remove poll account from a favorite list -->
<action name="deletePollAccount"
- class="org.chorem.pollen.ui.actions.user.DeletePollAccount">
+ class="org.chorem.pollen.ui.actions.user.DeleteFavoriteListVoter">
<interceptor-ref name="pollenParamsPrepareParamsStack"/>
<result type="redirect2"/>
</action>
@@ -157,21 +157,21 @@
<!-- display createds polls -->
<action name="createdList"
- class="org.chorem.pollen.ui.actions.poll.CreatedList">
+ class="org.chorem.pollen.ui.actions.PollenActionSupportForEdition">
<interceptor-ref name="pollenBasicStack"/>
<result>/WEB-INF/jsp/user/createdList.jsp</result>
</action>
<!-- display invited polls -->
<action name="invitedList"
- class="org.chorem.pollen.ui.actions.poll.InvitedList">
+ class="org.chorem.pollen.ui.actions.PollenActionSupportForVote">
<interceptor-ref name="pollenBasicStack"/>
<result>/WEB-INF/jsp/user/invitedList.jsp</result>
</action>
<!-- display participated polls -->
<action name="participatedList"
- class="org.chorem.pollen.ui.actions.poll.ParticipatedList">
+ class="org.chorem.pollen.ui.actions.PollenActionSupportForVote">
<interceptor-ref name="pollenBasicStack"/>
<result>/WEB-INF/jsp/user/participatedList.jsp</result>
</action>
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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-07-31 16:21:30 UTC (rev 3579)
@@ -92,7 +92,7 @@
pollen.common.email=Em@il
pollen.common.endChoiceDate=End choice date
pollen.common.endDate=End date
-pollen.common.favoriteList.csvImport.help=The file to upload is a text file that contains one row per participant.<br/><br/>The first line must be <strong>votingId,email</strong>, then each next ones will define the participant's name and his email separated by a comma.<br/><br/>Here is an example \:<br/>
+pollen.common.favoriteList.csvImport.help=The file to upload is a text file that contains one row per participant.<br/><br/>Each line must begin by the email of voter.<br/><br/>It can be followed by the voter Id (precede by a space).<br/><br/>If no voterId is given, then the email will be used.<br/><br/>Here is an example\:
pollen.common.firstName=First name
pollen.common.functions=Functions
pollen.common.group=group
@@ -165,7 +165,7 @@
pollen.error.email.invalid=The email doesn't have the good format
pollen.error.email.required=You must provide an email
pollen.error.favoriteList.already.used=List name already used
-pollen.error.favoriteList.import.participantExists=The email '%1$s' is already used in the list
+pollen.error.favoriteList.import.participantExists=The email '<strong>%s</strong>' is already used in the list
pollen.error.favoriteList.not.found=Favorite list not found
pollen.error.favoriteList.not.owned.by.user=You are not owner of this favorite list
pollen.error.favoriteList.participant.already.found.in.list=Member with same email already exists in favorite list
@@ -213,7 +213,7 @@
pollen.error.pollId.empty=Poll id is mandatory
pollen.error.pollNotFound=The poll with given id does not exist.
pollen.error.pollTabErrorFound=Some errors were found on this tab, please fix them to finalize the poll creation.
-pollen.error.user.alreadyVoted=Someone has already used the name %s to vote.
+pollen.error.user.alreadyVoted=Someone has already used the name '<strong>%s</strong>' to vote.
pollen.error.user.bad.login.or.password=Login or password invalid.
pollen.error.user.email.already.used=This email is already used
pollen.error.user.invalid.email=Invalid e-mail
@@ -263,29 +263,31 @@
pollen.information.confirmDeletePollChoice=Confir to delete choice %s
pollen.information.confirmDeletePollVote=Confirm delete of vote of %s
pollen.information.confirmDeleteUser=Confirm delete of user\:
-pollen.information.favoriteList.created=Favorite list %s created.
-pollen.information.favoriteList.deleted=Favorite list %s deleted.
+pollen.information.favoriteList.created=Favorite list '<strong>%s</strong>' created.
+pollen.information.favoriteList.deleted=Favorite list '<strong>%s</strong>' deleted.
+pollen.information.favoriteList.imported=Favorite list '<strong>%s</strong>' created and %s voter were imported into it.
pollen.information.irreversible.operation=Be ware, this operation is irreversible.
pollen.information.lostPassword=You will receive a new password to the given email
pollen.information.lostPassword.success=An e-mail was sent with your new password. You can change it on your user account page.
pollen.information.moderate.page=From this page you can moderate votes and comments, but not vote.
pollen.information.need.login=You must be logged to access this page. Please fill the form below.
-pollen.information.poll.attached=Poll '%s' attached to your user account.
-pollen.information.poll.closed=Poll '%s' closed.
-pollen.information.poll.created=Poll '%s' created.
+pollen.information.poll.attached=Poll '<strong>%s</strong>' attached to your user account.
+pollen.information.poll.closed=Poll '<strong>%s</strong>' closed.
+pollen.information.poll.created=Poll '<strong>%s</strong>' created.
pollen.information.poll.form.voteStarted=Votes are started, some options can't be updated.
-pollen.information.poll.updated=Poll '%s' modified.
-pollen.information.pollAccount.addedTofavoriteList=Member '%s' was added to favorite list.
-pollen.information.pollAccount.removedFromFavoriteList=Member '%s' was removed from favorite list.
-pollen.information.pollAccount.updatedTofavoriteList=Member '%s' was updated in favorite list.
+pollen.information.poll.updated=Poll '<strong>%s</strong>' modified.
+pollen.information.pollAccount.addedTofavoriteList=Member '<strong>%s</strong>' added to favorite list.
+pollen.information.pollAccount.removedFromFavoriteList=Member '<strong>%s</strong>' removed from favorite list.
+pollen.information.pollAccount.updated=Your account was updated.
+pollen.information.pollAccount.updatedTofavoriteList=Member '<strong>%s</strong>' updated in favorite list.
pollen.information.pollChoiceRunning=Adding choices is allowed.
pollen.information.pollClosed=This poll is closed. You can not vote anymore.
pollen.information.pollFinished=This poll is finished. You can not vote anymore.
pollen.information.pollNotStarted=This poll has not started yet.
pollen.information.pollRunning=The poll is not finished. Results may change.
-pollen.information.user.created=User %s created.
-pollen.information.user.deleted=User %s deleted.
-pollen.information.user.updated=User %s updated.
+pollen.information.user.created=User'<strong>%s</strong>' created.
+pollen.information.user.deleted=User '<strong>%s</strong>' deleted.
+pollen.information.user.updated=User '<strong>%s</strong>' 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.
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-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-07-31 16:21:30 UTC (rev 3579)
@@ -92,7 +92,7 @@
pollen.common.email=Em@il
pollen.common.endChoiceDate=Date de fin des choix
pollen.common.endDate=Date de fin
-pollen.common.favoriteList.csvImport.help=Le fichier à importer doit être un fichier texte contenant une ligne par participant.<br/><br/>La première ligne doit contenir <strong>votingId,email</strong>, ensuite chacune des suivantes définira le nom du participant et son email séparés par une virgule.<br/><br/>Voici un exemple \:<br/>
+pollen.common.favoriteList.csvImport.help=Le fichier à importer doit être un fichier texte contenant une ligne par participant.<br/><br/>Chaque ligne doit commencer par le courriel du votant.<br/><br/>On peut ensuite ajouter à la suite un nom de votant (précédé d'un espace).<br/><br/>Si le nom du votant n'est pas renseigné alors le courreil sera utilisé.<br/><br/>Voici un exemple \:
pollen.common.firstName=Prénom
pollen.common.functions=Fonctions
pollen.common.group=groupes
@@ -264,29 +264,31 @@
pollen.information.confirmDeletePollChoice=Confirmer la suppression du choix %s
pollen.information.confirmDeletePollVote=Confirmer la suppression du vote de %s
pollen.information.confirmDeleteUser=Confirmer la suppression de l'utilisateur \:
-pollen.information.favoriteList.created=La liste %s a été créée.
-pollen.information.favoriteList.deleted=La liste %s a été supprimée.
+pollen.information.favoriteList.created=Liste de votants '<strong>%s</strong>' créée.
+pollen.information.favoriteList.deleted=Liste de votants '<strong>%s</strong>' supprimée.
+pollen.information.favoriteList.imported=Liste de votants '<strong>%s</strong>' créée et %s votants y ont été importés.
pollen.information.irreversible.operation=Attention, Cette opération est irréversible.
pollen.information.lostPassword=Vous allez recevoir un nouveau mot de passe sur l'e-mail suivant
pollen.information.lostPassword.success=Un e-mail vous a été envoyé avec votre nouveau mot de passe. Vous pouvez le changer sur la page d'édition de votre compte.
pollen.information.moderate.page=A partir de cette page vous pouvez modérer les votes et les commentaires mais pas voter.
pollen.information.need.login=Vous devez être identifié pour pouvoir accéder à cette page. Veuillez remplir le formulaire ci-dessous.
-pollen.information.poll.attached=Sondage '%s' rattaché à votre compte.
-pollen.information.poll.closed=Sondage '%s' clos.
-pollen.information.poll.created=Sondage '%s' créé.
+pollen.information.poll.attached=Sondage '<strong>%s</strong>' rattaché à votre compte.
+pollen.information.poll.closed=Sondage '<strong>%s</strong>' clos.
+pollen.information.poll.created=Sondage '<strong>%s</strong>' créé.
pollen.information.poll.form.voteStarted=Les votes ont commencé, certaines options ne sont pas modifiables.
-pollen.information.poll.updated=Sondage '%s' mise à jour.
-pollen.information.pollAccount.addedTofavoriteList=Le membre %s a été ajoutée à la liste des favoris.
-pollen.information.pollAccount.removedFromFavoriteList=Le membre %s a été supprimé de la liste des favoris.
-pollen.information.pollAccount.updatedTofavoriteList=Le membre %s a été mise à jour dans la liste des favoris.
+pollen.information.poll.updated=Sondage '<strong>%s</strong>' mise à jour.
+pollen.information.pollAccount.addedTofavoriteList=Le membre '<strong>%s</strong>' a été ajouté à la liste des favoris.
+pollen.information.pollAccount.removedFromFavoriteList=Le membre '<strong>%s</strong>' a été supprimé de la liste des favoris.
+pollen.information.pollAccount.updated=Votre compte a bien été mis à jour.
+pollen.information.pollAccount.updatedTofavoriteList=Le membre '<strong>%s</strong>' a été mise à jour dans la liste des favoris.
pollen.information.pollChoiceRunning=L'ajout de choix est possible.
pollen.information.pollClosed=Ce sondage est clos. Vous ne pouvez plus voter.
pollen.information.pollFinished=Ce sondage est terminé. Vous ne pouvez plus voter.
pollen.information.pollNotStarted=Ce sondage n'a pas encore commencé.
pollen.information.pollRunning=Ce sondage n'est pas terminé. Les résultats peuvent encore changer.
-pollen.information.user.created=L'utilisateur %s a été créé.
-pollen.information.user.deleted=L'utilisateur %s a été supprimé.
-pollen.information.user.updated=L'utilisateur %s a été mis à jour.
+pollen.information.user.created=Utilisateur '<strong>%s</strong>' a été créé.
+pollen.information.user.deleted=Utilisateur '<strong>%s</strong>' a été supprimé.
+pollen.information.user.updated=Utilisateur '<strong>%s</strong>' 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.
Deleted: trunk/pollen-ui-struts2/src/main/resources/validators.xml
===================================================================
--- trunk/pollen-ui-struts2/src/main/resources/validators.xml 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/resources/validators.xml 2012-07-31 16:21:30 UTC (rev 3579)
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- Pollen :: UI (struts2)
- $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 Config 1.0//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
-<validators>
- <!-- default validators from XWork framework -->
- <validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
- <validator name="long" class="com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator"/>
- <validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
- <validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
- <validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
- <validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
- <validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/>
- <validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/>
- <validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/>
- <validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
- <validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
-
- <!-- default nuiton-validator validators -->
- <validator name="nfieldexpression" class="org.nuiton.validator.xwork2.field.NuitonFieldExpressionValidator"/>
- <validator name="nrequired" class="org.nuiton.validator.xwork2.field.SkipableRequiredFieldValidator"/>
- <validator name="nrequiredstring" class="org.nuiton.validator.xwork2.field.SkipableRequiredStringFieldValidator"/>
-
- <!-- Pollen validators -->
-
-</validators>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp 2012-07-31 16:21:30 UTC (rev 3579)
@@ -34,9 +34,10 @@
<fieldset>
<legend><s:text name="pollen.fieldset.connexionInformation"/></legend>
- <s:hidden key="user.topiaId" label=""/>
- <s:textfield name="user.login" key="pollen.common.login" required="true"/>
- <s:password name="user.password" key="pollen.common.password"
+ <s:hidden key="pollenUserAccount.topiaId" label=""/>
+ <s:textfield name="pollenUserAccount.login" key="pollen.common.login"
+ required="true"/>
+ <s:password name="pollenUserAccount.password" key="pollen.common.password"
required="true"/>
<s:password name="newPassword" key="pollen.common.newPassword"/>
<s:password name="newPassword2" key="pollen.common.newPassword2"/>
@@ -45,9 +46,12 @@
<fieldset>
<legend><s:text name="pollen.fieldset.userInformation"/></legend>
- <s:textfield name="user.email" key="pollen.common.email" required="true"/>
- <s:textfield name="user.firstName" key="pollen.common.firstName"/>
- <s:textfield name="user.lastName" key="pollen.common.lastName"/>
+ <s:textfield name="pollenUserAccount.email" key="pollen.common.email"
+ required="true"/>
+ <s:textfield name="pollenUserAccount.firstName"
+ key="pollen.common.firstName"/>
+ <s:textfield name="pollenUserAccount.lastName"
+ key="pollen.common.lastName"/>
</fieldset>
<br/>
<s:submit action="edit" key="pollen.action.validate" align="center"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-07-31 16:21:30 UTC (rev 3579)
@@ -52,8 +52,6 @@
var editImg = '<s:url value='/img/edit.png'/>';
var editTitle = '<s:text name="pollen.action.editFavoriteList"/>';
var deleteImg = '<s:url value='/img/delete.png'/>';
- var csvHelp = "<div><s:text name='pollen.common.favoriteList.csvImport.help'/>" +
- "<br/><img src=\"<s:url value="/img/import_csv_help.png"/>\"/></div>";
jQuery(document).ready(function () {
@@ -61,6 +59,15 @@
});
</script>
+<s:set name='csvHelp'>
+ <div><s:text name='pollen.common.favoriteList.csvImport.help'/>
+ <br/>
+<pre style="background-color: #ffffff;color: #000000;">
+ email1(a)domain.org voterId1
+ email2(a)domain.org
+</pre>
+ </div>
+</s:set>
<sjg:grid id="favoriteLists" dataType="json" href='%{loadFavoriteLists}'
gridModel="favoriteLists" sortable="true" pager="true"
pagerButtons="true" pagerInput="true" navigator="true"
@@ -86,14 +93,16 @@
<s:form id='createForm' method="POST" namespace="/user"
cssClass="hidden favoriteForm" enctype="multipart/form-data">
- <s:hidden name="action" value="create"/>
<fieldset>
<legend>
<s:text name="pollen.fieldset.userFavoriteList.toCreate"/>
</legend>
<s:textfield key="createFavoriteList.name" required="true" size="40"
label="%{getText('pollen.common.name')}"/>
- <s:file key="csvImport" label="%{getText('pollen.common.csvImport')}"/>
+ <s:file id='csvImport' key="csvImport[0]"
+ label="%{getText('pollen.common.csvImport')}"
+ tooltip="%{csvHelp}"
+ tooltipIconPath="/img/tooltip.png"/>
<s:textfield key="ldapImport" label="%{getText('pollen.common.ldapImport')}"
size="40"/>
</fieldset>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp 2012-07-31 16:21:30 UTC (rev 3579)
@@ -29,13 +29,14 @@
<s:text name="pollen.title.register"/>
</h1>
-<s:form method="POST" key="registerForm">
+<s:form method="POST">
<fieldset>
<legend><s:text name="pollen.fieldset.connexionInformation"/></legend>
- <s:textfield name="user.login" key="pollen.common.login" required="true"/>
- <s:password name="user.password" key="pollen.common.password"
+ <s:textfield name="pollenUserAccount.login" key="pollen.common.login"
+ required="true"/>
+ <s:password name="pollenUserAccount.password" key="pollen.common.password"
required="true"/>
<s:password name="password2" key="pollen.common.password2" required="true"/>
</fieldset>
@@ -43,9 +44,12 @@
<fieldset>
<legend><s:text name="pollen.fieldset.userInformation"/></legend>
- <s:textfield name="user.email" key="pollen.common.email" required="true"/>
- <s:textfield name="user.firstName" key="pollen.common.firstName"/>
- <s:textfield name="user.lastName" key="pollen.common.lastName"/>
+ <s:textfield name="pollenUserAccount.email" key="pollen.common.email"
+ required="true"/>
+ <s:textfield name="pollenUserAccount.firstName"
+ key="pollen.common.firstName"/>
+ <s:textfield name="pollenUserAccount.lastName"
+ key="pollen.common.lastName"/>
</fieldset>
<br/>
<s:submit action="register" key="pollen.action.register" align="center"/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp 2012-07-31 16:21:30 UTC (rev 3579)
@@ -34,17 +34,17 @@
<fieldset>
<legend><s:text name="pollen.fieldset.connexionInformation"/></legend>
- <s:hidden key="user.topiaId" label=""/>
- <s:label name="user.login" key="pollen.common.login"/>
+ <s:hidden key="pollenUserAccount.topiaId" label=""/>
+ <s:label name="pollenUserAccount.login" key="pollen.common.login"/>
</fieldset>
<fieldset>
<legend><s:text name="pollen.fieldset.userInformation"/></legend>
- <s:label name="user.email" key="pollen.common.email"/>
- <s:label name="user.firstName" value="%{user.firstName}"
+ <s:label name="pollenUserAccount.email" key="pollen.common.email"/>
+ <s:label name="pollenUserAccount.firstName" value="%{pollenUserAccount.firstName}"
key="pollen.common.firstName"/>
- <s:label name="user.lastName" value="%{user.lastName}"
+ <s:label name="pollenUserAccount.lastName" value="%{pollenUserAccount.lastName}"
key="pollen.common.lastName"/>
</fieldset>
<br/>
Modified: trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js 2012-07-31 16:19:27 UTC (rev 3578)
+++ trunk/pollen-ui-struts2/src/main/webapp/js/favoriteLists.js 2012-07-31 16:21:30 UTC (rev 3579)
@@ -56,11 +56,9 @@
$('#createForm').show();
});
- $('[name=csvImport]').tipTip({
- content : csvHelp,
- maxWidth : '340px',
- defaultPosition : 'right'
- });
+ $('img[src$="tooltip.png"]').addClass("tooltip");
+ $('.tooltip').tipTip({ maxWidth:'340px',
+ defaultPosition:'right' });
}
function favoriteListsFunctions(cellvalue, options, rowObject) {
1
0
r3578 - in trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions: poll user
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 18:19:27 +0200 (Tue, 31 Jul 2012)
New Revision: 3578
Url: http://chorem.org/repositories/revision/pollen/3578
Log:
add new bases action (with different skin) to avoid creating classes only for this)
Removed:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/InvitedList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java
Deleted: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java 2012-07-31 16:18:40 UTC (rev 3577)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java 2012-07-31 16:19:27 UTC (rev 3578)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.poll;
-
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-/**
- * Display list of created polls.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class CreatedList extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-}
Deleted: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/InvitedList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/InvitedList.java 2012-07-31 16:18:40 UTC (rev 3577)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/InvitedList.java 2012-07-31 16:19:27 UTC (rev 3578)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.poll;
-
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-/**
- * Display the list of invited polls for the connected user.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class InvitedList extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public PageSkin getSkin() {
- return PageSkin.VOTE;
- }
-}
Deleted: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java 2012-07-31 16:18:40 UTC (rev 3577)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java 2012-07-31 16:19:27 UTC (rev 3578)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.poll;
-
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-/**
- * Display list of participated polls.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class ParticipatedList extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public PageSkin getSkin() {
- return PageSkin.VOTE;
- }
-}
Deleted: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java 2012-07-31 16:18:40 UTC (rev 3577)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java 2012-07-31 16:19:27 UTC (rev 3578)
@@ -1,48 +0,0 @@
-/*
- * #%L
- * Pollen :: UI (struts2)
- * $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%
- */
-package org.chorem.pollen.ui.actions.user;
-
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.ui.actions.PageSkin;
-import org.chorem.pollen.ui.actions.PollenActionSupport;
-
-/**
- * Show user account.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.3
- */
-public class Show extends PollenActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public PageSkin getSkin() {
- return PageSkin.EDITION;
- }
-
- public UserAccount getUser() {
- return getPollenUserAccount();
- }
-
-}
1
0
r3577 - trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 18:18:40 +0200 (Tue, 31 Jul 2012)
New Revision: 3577
Url: http://chorem.org/repositories/revision/pollen/3577
Log:
add new bases action (with different skin) to avoid creating classes only for this)
Added:
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java
trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java 2012-07-31 16:18:40 UTC (rev 3577)
@@ -0,0 +1,39 @@
+package org.chorem.pollen.ui.actions;
+/*
+ * #%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%
+ */
+
+/**
+ * Abase support action with predefine edition skin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class PollenActionSupportForEdition extends PollenActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public final PageSkin getSkin() {
+ return PageSkin.EDITION;
+ }
+}
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForEdition.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
===================================================================
--- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java (rev 0)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java 2012-07-31 16:18:40 UTC (rev 3577)
@@ -0,0 +1,39 @@
+package org.chorem.pollen.ui.actions;
+/*
+ * #%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%
+ */
+
+/**
+ * Abase support action with predefine vote skin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class PollenActionSupportForVote extends PollenActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public final PageSkin getSkin() {
+ return PageSkin.VOTE;
+ }
+}
Property changes on: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PollenActionSupportForVote.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
r3576 - in trunk/pollen-services: . src/main/java/org/chorem/pollen/services src/main/java/org/chorem/pollen/services/exceptions src/main/java/org/chorem/pollen/services/impl src/main/resources/i18n src/test/java/org/chorem/pollen/services/impl
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 18:17:34 +0200 (Tue, 31 Jul 2012)
New Revision: 3576
Url: http://chorem.org/repositories/revision/pollen/3576
Log:
refs #715: Import voting users list doesn't work (review and fix csv import + remove 3 classes :)
Removed:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java
Modified:
trunk/pollen-services/pom.xml
trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.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-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java
Modified: trunk/pollen-services/pom.xml
===================================================================
--- trunk/pollen-services/pom.xml 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/pom.xml 2012-07-31 16:17:34 UTC (rev 3576)
@@ -84,10 +84,6 @@
<artifactId>nuiton-utils</artifactId>
</dependency>
<dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>nuiton-csv</artifactId>
- </dependency>
- <dependency>
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
</dependency>
Deleted: trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * Pollen :: Services
- * $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%
- */
-package org.chorem.pollen.services;
-
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.services.exceptions.FavoriteListImportException;
-import org.chorem.pollen.services.impl.FavoriteListImportCSV;
-import org.chorem.pollen.services.impl.FavoriteListImportLDAP;
-
-import java.util.List;
-
-/**
- * Used to import a favorite List or a List of {@link PollAccount} from a given
- * source url (file, external service, ...)
- * <p/>
- * Created: 16/04/12
- *
- * @author fdesbois <desbois(a)codelutin.com>
- * @see FavoriteListImportLDAP
- * @see FavoriteListImportCSV
- * @since 1.3
- */
-public interface FavoriteListImport {
-
- /**
- * Execute the import from given {@code url}. This will returned the
- * successful list of {@link PollAccount} instanciated during import. No
- * database save is done here, only the extraction from an input url to
- * a list of entities to manage.
- *
- * @param url Url of the file or service that contains data to import
- * @return the List of PollAccount imported
- * @throws FavoriteListImportException for any import error
- */
- public List<PollAccount> execute(String url)
- throws FavoriteListImportException;
-}
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -22,8 +22,6 @@
*/
package org.chorem.pollen.services.exceptions;
-import org.chorem.pollen.services.FavoriteListImport;
-
import java.util.Locale;
import static org.nuiton.i18n.I18n._;
@@ -31,7 +29,7 @@
import static org.nuiton.i18n.I18n.n_;
/**
- * Exception during {@link FavoriteListImport#execute(String)} error. There is
+ * Exception during favorite list import. There is
* always a cause from librairies used for import.
*
* @author fdesbois <desbois(a)codelutin.com>
Deleted: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -1,184 +0,0 @@
-/*
- * #%L
- * Pollen :: Services
- * $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%
- */
-package org.chorem.pollen.services.impl;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.PollenTechnicalException;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.services.FavoriteListImport;
-import org.chorem.pollen.services.PollenServicePredicates;
-import org.chorem.pollen.services.PollenServiceSupport;
-import org.chorem.pollen.services.exceptions.FavoriteListImportException;
-import org.nuiton.util.StringUtil;
-import org.nuiton.util.csv.Import;
-import org.nuiton.util.csv.ImportModel;
-import org.nuiton.util.csv.ImportRuntimeException;
-import org.nuiton.util.csv.ImportableColumn;
-import org.nuiton.util.csv.ModelBuilder;
-import org.nuiton.util.csv.ValueParser;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.Reader;
-import java.text.ParseException;
-import java.util.List;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Implementation of {@link FavoriteListImport} as a service for CSV import.
- * Nuiton-CSV is used to manage the {@link Import} using a specific {@link
- * ImportModel} for pollen. Empty rows (no votingId or no email) are ignored.
- * <p/>
- * Created: 16/04/12
- *
- * @author fdesbois <desbois(a)codelutin.com>
- * @since 1.3
- */
-public class FavoriteListImportCSV extends PollenServiceSupport implements FavoriteListImport {
-
- private static final Log log = LogFactory.getLog(FavoriteListImportCSV.class);
-
- private static final ValueParser<String> EMAIL_PARSER = new ValueParser<String>() {
-
- @Override
- public String parse(String value) throws ParseException {
- if (value != null && !StringUtil.isEmail(value)) {
- throw new ParseException(_("pollen.error.email.invalid"), 0);
- }
- return value;
- }
- };
-
- protected class FavoriteListImportModel implements ImportModel<PollAccount> {
-
- @Override
- public char getSeparator() {
- return ',';
- }
-
- @Override
- public void pushCsvHeaderNames(List<String> headerNames) {
- }
-
- @Override
- public PollAccount newEmptyInstance() {
- return newInstance(getDAO(PollAccount.class));
- }
-
- @Override
- public Iterable<ImportableColumn<PollAccount, Object>> getColumnsForImport() {
- ModelBuilder modelBuilder = new ModelBuilder();
- modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_VOTING_ID,
- PollAccount.PROPERTY_VOTING_ID);
- modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_EMAIL,
- PollAccount.PROPERTY_EMAIL,
- EMAIL_PARSER);
- return modelBuilder.getColumnsForImport();
- }
- }
-
- @Override
- public List<PollAccount> execute(String url) throws FavoriteListImportException {
-
- List<PollAccount> results;
- Reader reader = null;
- try {
- reader = new FileReader(new File(url));
-
- Import<PollAccount> csvImport = Import.newImport(new FavoriteListImportModel(), reader);
-
- // Filter on empty account (without email or votingId)
- results = Lists.newArrayList(
- Iterables.filter(csvImport,
- PollenServicePredicates.POLL_ACCOUNT_NOT_EMPTY)
- );
-
- if (log.isInfoEnabled()) {
- log.info(results.size() + " comptes importés.");
- }
-
- } catch (FileNotFoundException ex) {
- throw new PollenTechnicalException(ex);
-
- } catch (ImportRuntimeException ex) {
- if (log.isDebugEnabled()) {
- log.debug("Error during CSV import", ex);
- }
- throw new FavoriteListImportException("CSV", ex);
-
- } finally {
- IOUtils.closeQuietly(reader);
- }
- return results;
- }
-
-// @Override
-// public List<PollAccount> execute(String url) throws FavoriteListImportException {
-//
-// List<PollAccount> results;
-// Reader reader = null;
-// try {
-// reader = new FileReader(new File(url));
-//
-// // Définition de la stratégie de mapping
-// ColumnPositionMappingStrategy<PollAccountImpl> strat =
-// new ColumnPositionMappingStrategy<PollAccountImpl>();
-//
-// String[] columns = new String[] {
-// PollAccount.PROPERTY_VOTING_ID,
-// PollAccount.PROPERTY_EMAIL
-// };
-//
-// strat.setType(PollAccountImpl.class);
-// strat.setColumnMapping(columns);
-//
-// // Parsing du fichier CSV
-// CsvToBean<PollAccountImpl> csv = new CsvToBean<PollAccountImpl>();
-// List<PollAccount> importedData = Lists.<PollAccount>newArrayList(csv.parse(strat, reader));
-//
-// // Suppression des comptes null
-// results = Lists.newArrayList(
-// Iterables.filter(importedData,
-// PollenServicePredicates.POLL_ACCOUNT_NOT_EMPTY)
-// );
-//
-// if (log.isInfoEnabled()) {
-// log.info(results.size() + " comptes importés.");
-// }
-//
-// } catch (Exception ex) {
-// log.warn("Error during CSV import", ex);
-// throw new FavoriteListImportException(ex);
-//
-// } finally {
-// IOUtils.closeQuietly(reader);
-// }
-// return results;
-// }
-}
Deleted: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -1,121 +0,0 @@
-/*
- * #%L
- * Pollen :: Services
- * $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%
- */
-package org.chorem.pollen.services.impl;
-
-import com.google.common.collect.Lists;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.services.FavoriteListImport;
-import org.chorem.pollen.services.PollenServiceSupport;
-import org.chorem.pollen.services.exceptions.FavoriteListImportException;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * LDAP Import of {@link PollAccount}. The behavior is the same than the one
- * from pollen 1.2.x
- * <p/>
- * TODO-fdesbois-2012-04-17 : tests and documentation
- * <p/>
- * Created: 16/04/12
- *
- * @author fdesbois <desbois(a)codelutin.com>
- * @since 1.3
- */
-public class FavoriteListImportLDAP extends PollenServiceSupport implements FavoriteListImport {
-
- private static final Log log = LogFactory.getLog(FavoriteListImportLDAP.class);
-
- @Override
- public List<PollAccount> execute(String url) throws FavoriteListImportException {
-
- long start = System.nanoTime();
-
- List<PollAccount> results = Lists.newArrayList();
- try {
-
- // Initialisation du contexte
- Properties env = new Properties();
-// if (server != null) {
-// env.put(Context.INITIAL_CONTEXT_FACTORY,
-// "com.sun.jndi.ldap.LdapCtxFactory");
-// env.put(Context.PROVIDER_URL, "ldap://" + server + "/");
-// }
- DirContext ictx = new InitialDirContext(env);
-
- // Recherche en profondeur
- SearchControls control = new SearchControls();
- control.setSearchScope(SearchControls.SUBTREE_SCOPE);
-
- // Création des comptes avec les résultats de la recherche
- NamingEnumeration<SearchResult> e = ictx.search(url, null,
- control);
- while (e.hasMore()) {
- SearchResult r = e.next();
-
- if (log.isDebugEnabled()) {
- log.debug("Result: " + r.getName() + "(object: "
- + r.getClassName() + ")");
- }
-
- Attribute nameAttr = r.getAttributes().get("cn");
- Attribute emailAttr = r.getAttributes().get("mail");
-
- if (nameAttr != null) {
- PollAccountDAO dao = getDAO(PollAccount.class);
- PollAccount account = newInstance(dao);
- account.setVotingId(nameAttr.get().toString());
- account.setEmail(emailAttr.get().toString());
- results.add(account);
-
- if (log.isDebugEnabled()) {
- log.debug("New account - name: "
- + nameAttr.get().toString() + ", email: "
- + emailAttr.get().toString());
- }
- }
- }
- } catch (NamingException ex) {
- log.error("Exception de nommage lors de l'import depuis LDAP", ex);
- throw new FavoriteListImportException("LDAP", ex);
- }
-
- long duration = (System.nanoTime() - start) / 1000000000;
- if (log.isInfoEnabled()) {
- log.info(results.size() + " comptes importés en " + duration
- + " sec.");
- }
-
- return results;
- }
-}
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -23,7 +23,11 @@
package org.chorem.pollen.services.impl;
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.chorem.pollen.PollenTechnicalException;
import org.chorem.pollen.business.persistence.PersonList;
import org.chorem.pollen.business.persistence.PersonListDAO;
@@ -33,6 +37,7 @@
import org.chorem.pollen.business.persistence.UserAccountDAO;
import org.chorem.pollen.services.PollenServiceSupport;
import org.chorem.pollen.services.exceptions.FavoriteListAlreadyExistException;
+import org.chorem.pollen.services.exceptions.FavoriteListImportException;
import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException;
import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException;
import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException;
@@ -41,11 +46,31 @@
import org.chorem.pollen.services.exceptions.UserNotFoundException;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.persistence.TopiaFilterPagerUtil;
+import org.nuiton.util.StringUtil;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
import java.util.List;
+import java.util.Locale;
+import java.util.Properties;
+import static org.nuiton.i18n.I18n.l_;
+
public class FavoriteService extends PollenServiceSupport {
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(FavoriteService.class);
+
public List<PersonList> getFavoriteLists(UserAccount user,
TopiaFilterPagerUtil.FilterPagerBean pager) {
@@ -338,6 +363,134 @@
}
}
+ public List<PollAccount> importFromCsvfile(String filename,
+ File file) throws FavoriteListImportException {
+
+ List<PollAccount> results = Lists.newArrayList();
+ Locale locale = getLocale();
+ PollAccountDAO dao = getDAO(PollAccount.class);
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new FileReader(file));
+ String line;
+ int lineNumber = 0;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (StringUtils.isBlank(line) || line.startsWith("#")) {
+
+ // comment line
+ continue;
+ }
+ lineNumber++;
+
+ int spaceIndex = line.indexOf(' ');
+ String email;
+ String votingId;
+ if (spaceIndex == -1) {
+ // only email
+ email = line;
+ votingId = line;
+ } else {
+ // email + votingId
+ email = line.substring(0, spaceIndex);
+ votingId = line.substring(spaceIndex);
+ }
+ email = email.trim();
+ votingId = votingId.trim();
+
+ if (!StringUtil.isEmail(email)) {
+
+ // email is not valid
+ String error = l_(locale, "pollen.error.import.invalid.email", lineNumber, email);
+ throw new FavoriteListImportException(filename, error, null);
+ }
+
+ PollAccount account = newInstance(dao);
+ account.setEmail(email);
+ account.setVotingId(votingId);
+ results.add(account);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info(results.size() + " comptes importés.");
+ }
+ reader.close();
+
+ } catch (FileNotFoundException ex) {
+ // should never happens ?
+ throw new PollenTechnicalException(ex);
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not close reader", e);
+ }
+ } finally {
+ IOUtils.closeQuietly(reader);
+ }
+ return results;
+ }
+
+ public List<PollAccount> importFromLDAP(String url) throws FavoriteListImportException {
+
+ long start = System.nanoTime();
+
+ List<PollAccount> results = Lists.newArrayList();
+ try {
+
+ // Initialisation du contexte
+ Properties env = new Properties();
+// if (server != null) {
+// env.put(Context.INITIAL_CONTEXT_FACTORY,
+// "com.sun.jndi.ldap.LdapCtxFactory");
+// env.put(Context.PROVIDER_URL, "ldap://" + server + "/");
+// }
+ DirContext ictx = new InitialDirContext(env);
+
+ // Recherche en profondeur
+ SearchControls control = new SearchControls();
+ control.setSearchScope(SearchControls.SUBTREE_SCOPE);
+
+ // Création des comptes avec les résultats de la recherche
+ NamingEnumeration<SearchResult> e = ictx.search(url, null,
+ control);
+ while (e.hasMore()) {
+ SearchResult r = e.next();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Result: " + r.getName() + "(object: "
+ + r.getClassName() + ")");
+ }
+
+ Attribute nameAttr = r.getAttributes().get("cn");
+ Attribute emailAttr = r.getAttributes().get("mail");
+
+ if (nameAttr != null) {
+ PollAccountDAO dao = getDAO(PollAccount.class);
+ PollAccount account = newInstance(dao);
+ account.setVotingId(nameAttr.get().toString());
+ account.setEmail(emailAttr.get().toString());
+ results.add(account);
+
+ if (log.isDebugEnabled()) {
+ log.debug("New account - name: "
+ + nameAttr.get().toString() + ", email: "
+ + emailAttr.get().toString());
+ }
+ }
+ }
+ } catch (NamingException ex) {
+ log.error("Exception de nommage lors de l'import depuis LDAP", ex);
+ throw new FavoriteListImportException("LDAP", ex);
+ }
+
+ long duration = (System.nanoTime() - start) / 1000000000;
+ if (log.isInfoEnabled()) {
+ log.info(results.size() + " comptes importés en " + duration
+ + " sec.");
+ }
+
+ return results;
+ }
+
public PersonList newFavoriteList() {
PersonListDAO dao = getDAO(PersonList.class);
PersonList personList = newInstance(dao);
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-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/resources/i18n/pollen-services_en_GB.properties 2012-07-31 16:17:34 UTC (rev 3576)
@@ -25,8 +25,8 @@
pollen.email.voteEmail.subject=[Pollen] Vote reporting (%s)
pollen.email.votingEmail.content=A new poll has been created\: "%s".\nYou can participate with the identifier %s by following this link\: \n%s
pollen.email.votingEmail.subject=[Pollen] Invitation to vote (%s)
-pollen.error.email.invalid=The email doesn't have the good format
pollen.error.import=Error during %1$s import \: %2$s
+pollen.error.import.invalid.email=At line %s, Email format is not valid '%s'
pollen.feed.addChoiceContent=
pollen.feed.addChoiceTitle=
pollen.feed.addCommentContent=%s
@@ -47,5 +47,4 @@
pollen.security.error.poll.free.creatorId.can.not.vote=Using a creator Id does not allow you to vote.
pollen.security.error.poll.not.closed.and.results.not.continuous=The poll is not closed and results are not continuous
pollen.security.error.poll.not.free.and.access.not.granted=You can not access to this non free poll
-pollen.security.error.poll.not.running.can.not.vote=You can not vote (poll is finished or not began).
pollen.security.error.poll.result.private.and.access.not.granted=Results of the poll are private and you do not have credentials to see them
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-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/main/resources/i18n/pollen-services_fr_FR.properties 2012-07-31 16:17:34 UTC (rev 3576)
@@ -25,8 +25,8 @@
pollen.email.voteEmail.subject=[Pollen] Notification de vote (%s)
pollen.email.votingEmail.content=Un nouveau sondage a été créé \: "%s".\nVous pouvez y participer avec l'identifiant %s à l'adresse suivante \: \n%s
pollen.email.votingEmail.subject=[Pollen] Invitation au vote (%s)
-pollen.error.email.invalid=Email non valide
pollen.error.import=Erreur pendant l'import %1$s \: %2$s
+pollen.error.import.invalid.email=A la ligne %s, le courriel n'est pas valide '%s'
pollen.feed.addChoiceContent=
pollen.feed.addChoiceTitle=
pollen.feed.addCommentContent=%s
@@ -47,5 +47,4 @@
pollen.security.error.poll.free.creatorId.can.not.vote=L'utlisation du creatorId ne permet de voter.
pollen.security.error.poll.not.closed.and.results.not.continuous=Vous n'avez pas accès aux résultats de ce sondage (résultats non continus et sondage non fermé)
pollen.security.error.poll.not.free.and.access.not.granted=Vous n'avez pas accès à ce sondage restreint
-pollen.security.error.poll.not.running.can.not.vote=Vous n'êtes pas autorisé à voter (sondage terminé ou pas encore commencé).
pollen.security.error.poll.result.private.and.access.not.granted=Vous n'avez pas accès aux résultats privés de ce sondage
Modified: trunk/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java
===================================================================
--- trunk/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java 2012-07-31 14:19:29 UTC (rev 3575)
+++ trunk/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java 2012-07-31 16:17:34 UTC (rev 3576)
@@ -22,13 +22,19 @@
*/
package org.chorem.pollen.services.impl;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.commons.io.FileUtils;
+import org.chorem.pollen.PollenTechnicalException;
+import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.services.AbstractPollenServiceTest;
+import org.chorem.pollen.services.exceptions.FavoriteListImportException;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+import java.io.File;
+import java.util.List;
+
/**
* Tests the {@link FavoriteService}.
*
@@ -38,8 +44,6 @@
@Ignore
public class FavoriteServiceTest extends AbstractPollenServiceTest {
- /** Logger. */
- private static final Log log = LogFactory.getLog(FavoriteServiceTest.class);
@Override
@Before
@@ -105,4 +109,77 @@
}
+ @Test(expected = PollenTechnicalException.class)
+ public void executeImportCsvFileNotFound() throws Exception {
+
+ File importFile = getCsvImportFile();
+
+ FavoriteService service = newService(FavoriteService.class);
+
+ service.importFromCsvfile(importFile.getName(), importFile);
+ }
+
+ @Test(expected = FavoriteListImportException.class)
+ public void executeImportCsvInvalidEmail() throws Exception {
+
+ FavoriteService service = newService(FavoriteService.class);
+
+ File importFile = getCsvImportFile();
+
+ String importContent = "badEmail@ voterId";
+
+ FileUtils.write(importFile, importContent);
+
+ service.importFromCsvfile(importFile.getName(), importFile);
+ }
+
+ @Test
+ public void executeImportCsvEmptyContent() throws Exception {
+
+ FavoriteService service = newService(FavoriteService.class);
+
+ File importFile = getCsvImportFile();
+
+ String importContent = "";
+ FileUtils.write(importFile, importContent);
+
+ List<PollAccount> importedAccount = service.importFromCsvfile(importFile.getName(), importFile);
+
+ Assert.assertNotNull(importedAccount);
+ Assert.assertTrue(importedAccount.isEmpty());
+ }
+
+ @Test
+ public void executeImportCsv() throws Exception {
+
+ FavoriteService service = newService(FavoriteService.class);
+
+ File importFile = getCsvImportFile();
+
+ String importContent = "myemail(a)mydomain.uk voterId \n\t\t myemail2(a)mydomain.uk\r\r\n#Comment\n\n ";
+ FileUtils.write(importFile, importContent);
+
+ List<PollAccount> importedAccount = service.importFromCsvfile(importFile.getName(), importFile);
+
+ Assert.assertNotNull(importedAccount);
+ Assert.assertEquals(2, importedAccount.size());
+ assertPollAccount(importedAccount.get(0), "myemail(a)mydomain.uk", "voterId");
+ assertPollAccount(importedAccount.get(1), "myemail2(a)mydomain.uk", "myemail2(a)mydomain.uk");
+ }
+
+ protected void assertPollAccount(PollAccount pollAccount,
+ String expectedEmail,
+ String expectedVotingId) {
+ Assert.assertNotNull(pollAccount);
+ Assert.assertEquals(expectedEmail, pollAccount.getEmail());
+ Assert.assertEquals(expectedVotingId, pollAccount.getVotingId());
+
+ }
+
+ protected File getCsvImportFile() {
+ File temporaryDirectory = fakeContext.getConfiguration().getTemporaryDirectory();
+ File importFile = new File(temporaryDirectory, "import.csv");
+ return importFile;
+ }
+
}
1
0
r3575 - trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 16:19:29 +0200 (Tue, 31 Jul 2012)
New Revision: 3575
Url: http://chorem.org/repositories/revision/pollen/3575
Log:
fixes #722: Can not delete a user
Modified:
trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp
Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp
===================================================================
--- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp 2012-07-31 12:52:15 UTC (rev 3574)
+++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteUser.jsp 2012-07-31 14:19:29 UTC (rev 3575)
@@ -30,7 +30,7 @@
<fieldset class="ui-widget-content ui-corner-all">
<s:hidden key="redirectUrl" label=''/>
- <s:hidden key="userId" value='%{#user.topiaId}' label=''/>
+ <s:hidden key="userId" value='%{user.topiaId}' label=''/>
<s:text name="pollen.information.confirmDeleteUser"/>
<div align="center" style="padding-top: 1em;">
1
0
r3574 - trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl
by tchemit@users.chorem.org 31 Jul '12
by tchemit@users.chorem.org 31 Jul '12
31 Jul '12
Author: tchemit
Date: 2012-07-31 14:52:15 +0200 (Tue, 31 Jul 2012)
New Revision: 3574
Url: http://chorem.org/repositories/revision/pollen/3574
Log:
fixes #721: Can't change my account profile
Modified:
trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java
Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java
===================================================================
--- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java 2012-07-31 10:54:49 UTC (rev 3573)
+++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java 2012-07-31 12:52:15 UTC (rev 3574)
@@ -23,6 +23,7 @@
package org.chorem.pollen.services.impl;
import com.google.common.base.Preconditions;
+import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -177,7 +178,8 @@
// In case of email change, check if an other user has not already
// the new email
// existing user found
- if (dao.isUserExist(user)) {
+ if (ObjectUtils.notEqual(user.getEmail(), userToUpdate.getEmail())
+ && dao.isUserExist(user)) {
throw new UserEmailAlreadyUsedException();
}
1
0
Author: tchemit
Date: 2012-07-31 12:54:49 +0200 (Tue, 31 Jul 2012)
New Revision: 3573
Url: http://chorem.org/repositories/revision/pollen/3573
Log:
refs #590: Refactor votecounting module (javadoc + some improvments)
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/VoteForPoll.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceIdAble.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceScore.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java
trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategy.java
trunk/pollen-votecounting-api/src/test/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategyProviderTest.java
trunk/pollen-votecounting-strategy-borda/src/main/java/org/chorem/pollen/votecounting/strategy/BordaStrategy.java
trunk/pollen-votecounting-strategy-condorcet/src/main/java/org/chorem/pollen/votecounting/strategy/CondorcetStrategy.java
trunk/pollen-votecounting-strategy-coombs/src/main/java/org/chorem/pollen/votecounting/strategy/CoombsStrategy.java
trunk/pollen-votecounting-strategy-instant-runoff/src/main/java/org/chorem/pollen/votecounting/strategy/InstantRunoffStrategy.java
trunk/pollen-votecounting-strategy-normal/src/main/java/org/chorem/pollen/votecounting/strategy/NormalStrategy.java
trunk/pollen-votecounting-strategy-number/src/main/java/org/chorem/pollen/votecounting/strategy/NumberStrategy.java
trunk/pollen-votecounting-strategy-percentage/src/main/java/org/chorem/pollen/votecounting/strategy/PercentageStrategy.java
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-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -439,7 +439,7 @@
public String getChoiceFragment() {
VoteCountingStrategy strategy = getVoteCountingStrategy(poll);
String result =
- "displayVote_" + strategy.getRenderType().name() + ".jsp";
+ "displayVote_" + strategy.getVoteValueEditorType().name() + ".jsp";
return result;
}
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-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -102,7 +102,7 @@
int nbVotes = 0;
int totalValues = 0;
- VoteCountingStrategy voteCountingStrategy =
+ VoteCountingStrategy strategy =
getVoteCountingStrategy(getPoll());
boolean voteValid = true;
@@ -111,7 +111,7 @@
Integer value = voteToChoice.getVoteValue();
// check if vote is null ?
- boolean voteNull = voteCountingStrategy.isVoteValueNull(value);
+ boolean voteNull = strategy.isVoteValueNull(value);
if (voteNull) {
// null vote, can skip his validation
@@ -119,7 +119,7 @@
}
// check if vote value is valid ?
- boolean valid = voteCountingStrategy.isVoteValueValid(value);
+ boolean valid = strategy.isVoteValueValid(value);
if (valid) {
@@ -130,31 +130,11 @@
// not a valid vote value, mark it and skip other fields validation
String validMessage =
- voteCountingStrategy.getVoteValueNotValidMessage();
- addFieldError("vote.choices", _(validMessage));
+ strategy.getVoteValueNotValidMessage(getLocale());
+ addFieldError("vote.choices", validMessage);
voteValid = false;
break;
}
-
-// // XXX-fdesbois-2012-04-11 : for a VoteCountingType#NUMBER the difference between 0 and null value could be important
-// if (isCondorcetVoteCounting()) {
-// if (value > 0) {
-//
-// // for condorcet vote, must be strictly greater than 0
-// // see http://chorem.org/issues/574
-// // see http://chorem.org/issues/576
-// nbVotes++;
-// totalValues += value;
-// } else {
-//
-// addFieldError("vote.choices",
-// _("pollen.error.vote.invalidCondorcetVoteValue"));
-// }
-// // for other vote type, value must be > 0
-// } else if (value != 0) {
-// nbVotes++;
-// totalValues += value;
-// }
}
if (voteValid) {
@@ -166,20 +146,15 @@
}
// check that total vote value is ok
- if (!voteCountingStrategy.isTotalVoteValueValid(totalValues)) {
+ if (!strategy.isTotalVoteValueValid(totalValues)) {
// not valid
- String errorMessage = voteCountingStrategy.getTotalVoteValueNotValidMessage();
- addFieldError("vote.choices", _(errorMessage));
+ String errorMessage = strategy.getTotalVoteValueNotValidMessage(getLocale());
+ addFieldError("vote.choices", errorMessage);
}
}
-// // check for percentage that the sum of all values equals 100
-// if (isPercentageVoteCounting() && totalValues != 100) {
-// addFieldError("vote.choices", _("pollen.error.vote.percentage"));
-// }
}
- // @InputConfig(methodName = PREPARE_VOTE_PAGE)
@Override
public String execute() throws Exception {
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceIdAble.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceIdAble.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceIdAble.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -25,7 +25,7 @@
import com.google.common.base.Function;
/**
- * To mark any object with identify a choice via the {@link #getChoiceId()}
+ * To mark any object that identify a choice via the {@link #getChoiceId()}
* method.
*
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceScore.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceScore.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/ChoiceScore.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -59,13 +59,14 @@
}
public void addScoreValue(double scoreToAdd) {
+ BigDecimal newScoreValue;
if (scoreValue == null) {
- setScoreValue(BigDecimal.valueOf(scoreToAdd));
+ newScoreValue = BigDecimal.valueOf(scoreToAdd);
} else {
- setScoreValue(scoreValue.add(BigDecimal.valueOf(scoreToAdd)));
+ newScoreValue = scoreValue.add(BigDecimal.valueOf(scoreToAdd));
}
-
+ setScoreValue(newScoreValue);
}
public void setScoreValue(BigDecimal scoreValue) {
@@ -74,15 +75,18 @@
@Override
public int compareTo(ChoiceScore o) {
- BigDecimal v1 = scoreValue;
- BigDecimal v2 = o.scoreValue;
- if (v1 == null) {
- v1 = new BigDecimal(-1);
- }
- if (v2 == null) {
- v2 = new BigDecimal(-1);
- }
- int i = v1.subtract(v2).intValue();
- return i;
+ int i1 = scoreValue == null ? -1 : scoreValue.intValue();
+ int i2 = o.scoreValue == null ? -1 : o.scoreValue.intValue();
+ return i1 - i2;
+// BigDecimal v1 = scoreValue;
+// BigDecimal v2 = o.scoreValue;
+// if (v1 == null) {
+// v1 = new BigDecimal(-1);
+// }
+// if (v2 == null) {
+// v2 = new BigDecimal(-1);
+// }
+// int i = v1.subtract(v2).intValue();
+// return i;
}
}
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -56,7 +56,11 @@
GroupOfVoter result = new GroupOfVoter();
result.setVoterId(voterId);
result.setWeight(weight);
- result.setVoteForChoices(voteForChoices);
+ if (voters != null) {
+ for (VoteForChoice voteForChoice : voteForChoices) {
+ result.addVoteForChoice(voteForChoice);
+ }
+ }
result.setVoters(voters);
return result;
}
@@ -102,11 +106,6 @@
getVoteForChoices().add(voteForChoice);
}
- @Override
- public void setVoteForChoices(Set<VoteForChoice> voteForChoices) {
- this.voteForChoices = voteForChoices;
- }
-
public void setVoters(Set<Voter> voters) {
this.voters = voters;
}
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/SimpleVoter.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -49,7 +49,11 @@
SimpleVoter result = new SimpleVoter();
result.setVoterId(voterId);
result.setWeight(weight);
- result.setVoteForChoices(voteForChoices);
+ if (voteForChoices != null) {
+ for (VoteForChoice voteForChoice : voteForChoices) {
+ result.addVoteForChoice(voteForChoice);
+ }
+ }
return result;
}
@@ -86,9 +90,4 @@
this.weight = weight;
}
- @Override
- public void setVoteForChoices(Set<VoteForChoice> voteForChoices) {
- this.voteForChoices = voteForChoices;
- }
-
}
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/Voter.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -25,25 +25,52 @@
import java.util.Set;
/**
- * A voter (says a physical person which votes on a poll).
+ * A voter (can be a physical voter or a group of voters).
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.5
*/
public interface Voter {
+ /**
+ * Gets the voter unique id.
+ *
+ * @return the unique id of the voter.
+ */
String getVoterId();
+ /**
+ * Gets the weight of the voter.
+ *
+ * @return the weight to apply for this voter.
+ */
double getWeight();
+ /**
+ * Gets all the vote for choices registred for this voter.
+ *
+ * @return all the vote values registred for this voter
+ */
+ Set<VoteForChoice> getVoteForChoices();
+
+ /**
+ * Register a new vote value for this voter.
+ *
+ * @param voteForChoice new vote value to register for this voter
+ */
void addVoteForChoice(VoteForChoice voteForChoice);
- Set<VoteForChoice> getVoteForChoices();
-
+ /**
+ * Sets the voter id.
+ *
+ * @param voterId the new voter id to set
+ */
void setVoterId(String voterId);
+ /**
+ * Sets the voter weight.
+ *
+ * @param weight the new weight to set
+ */
void setWeight(double weight);
-
- void setVoteForChoices(Set<VoteForChoice> voteForChoices);
-
}
Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategy.java
===================================================================
--- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -66,25 +66,94 @@
*/
VoteCountingResult votecount(Set<Voter> voter);
+ /**
+ * Get the value to display for a given vote value in the vote page.
+ *
+ * @param voteValue the vote value to display
+ * @return the string representation of a vote value
+ */
String getDisplayVoteValue(Integer voteValue);
+ /**
+ * Test if the given value is a vote value (says users has filled it).
+ *
+ * @param voteValue the vote value to test
+ * @return {@code true} if the given value is persisted.
+ */
boolean isChoiceInVote(Integer voteValue);
+ /**
+ * Get the vote counting strategy name to display in UI.
+ *
+ * @param locale the locale used to render the strategy name
+ * @return the localized vote counting strategy name
+ */
String getStrategyName(Locale locale);
+ /**
+ * Get the vote counting strategy help to display in UI.
+ *
+ * @param locale the locale used to render the strategy name
+ * @return the localized vote counting strategy help
+ */
String getStrategyHelp(Locale locale);
+ /**
+ * Tests if the given vote value is valid.
+ *
+ * @param voteValue the vote value to test
+ * @return {@code true} if the given vote value is valid, {@code false}
+ * otherwise.
+ */
boolean isVoteValueValid(Integer voteValue);
- String getVoteValueNotValidMessage();
+ /**
+ * If a vote value is not valid, gets the localized message of the error.
+ *
+ * @param locale the locale used to render the error message
+ * @return the localized validation message
+ */
+ String getVoteValueNotValidMessage(Locale locale);
+ /**
+ * Tests if the total values of a vote is valid.
+ *
+ * @param totalValues the given total values
+ * @return {@code true} if the total values of a vote is valid,
+ * {@code false} otherwhise.
+ */
boolean isTotalVoteValueValid(int totalValues);
- String getTotalVoteValueNotValidMessage();
+ /**
+ * If the total values of a vote is not valid, gets the localized error
+ * message.
+ *
+ * @param locale the locale used to render the error message
+ * @return the localized validation message
+ */
+ String getTotalVoteValueNotValidMessage(Locale locale);
+ /**
+ * Tests if a given vote value is null or not.
+ *
+ * @param value the vote value to test
+ * @return {@code true} if the given vote value is null (or considered as
+ * null), {@code false} otherwise.
+ */
boolean isVoteValueNull(Integer value);
- ChoiceToVoteRenderType getRenderType();
+ /**
+ * Gets the type of editor used to render a vote value.
+ *
+ * @return the type of editor used to render a vote value.
+ * @see ChoiceToVoteRenderType
+ */
+ ChoiceToVoteRenderType getVoteValueEditorType();
+ /**
+ * @return {@code true} if display results by choice.
+ * @deprecated since 1.5 (result will be offered by the strategy it-self).
+ */
+ @Deprecated
boolean isDisplayResultsByChoice();
}
Modified: trunk/pollen-votecounting-api/src/test/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategyProviderTest.java
===================================================================
--- trunk/pollen-votecounting-api/src/test/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategyProviderTest.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-api/src/test/java/org/chorem/pollen/votecounting/strategy/VoteCountingStrategyProviderTest.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -36,7 +36,6 @@
protected static VoteCountingStrategyProvider provider;
-
@BeforeClass
public static void beforeClass() throws Exception {
provider = new VoteCountingStrategyProvider();
Modified: trunk/pollen-votecounting-strategy-borda/src/main/java/org/chorem/pollen/votecounting/strategy/BordaStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-borda/src/main/java/org/chorem/pollen/votecounting/strategy/BordaStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-borda/src/main/java/org/chorem/pollen/votecounting/strategy/BordaStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -30,9 +30,11 @@
import org.chorem.pollen.votecounting.model.Voter;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import static org.nuiton.i18n.I18n.l_;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -64,14 +66,14 @@
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total value, so no message
return null;
}
@Override
- public String getVoteValueNotValidMessage() {
- return n_("pollen.error.vote.invalidBordaVoteValue");
+ public String getVoteValueNotValidMessage(Locale locale) {
+ return l_(locale, "pollen.error.vote.invalidBordaVoteValue");
}
@Override
@@ -80,7 +82,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
Modified: trunk/pollen-votecounting-strategy-condorcet/src/main/java/org/chorem/pollen/votecounting/strategy/CondorcetStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-condorcet/src/main/java/org/chorem/pollen/votecounting/strategy/CondorcetStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-condorcet/src/main/java/org/chorem/pollen/votecounting/strategy/CondorcetStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -37,9 +37,11 @@
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import static org.nuiton.i18n.I18n.l_;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -71,14 +73,14 @@
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total value, so no message
return null;
}
@Override
- public String getVoteValueNotValidMessage() {
- return n_("pollen.error.vote.invalidCondorcetVoteValue");
+ public String getVoteValueNotValidMessage(Locale locale) {
+ return l_(locale, "pollen.error.vote.invalidCondorcetVoteValue");
}
@Override
@@ -87,7 +89,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
Modified: trunk/pollen-votecounting-strategy-coombs/src/main/java/org/chorem/pollen/votecounting/strategy/CoombsStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-coombs/src/main/java/org/chorem/pollen/votecounting/strategy/CoombsStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-coombs/src/main/java/org/chorem/pollen/votecounting/strategy/CoombsStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -36,10 +36,12 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
+import static org.nuiton.i18n.I18n.l_;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -71,14 +73,14 @@
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total value, so no message
return null;
}
@Override
- public String getVoteValueNotValidMessage() {
- return n_("pollen.error.vote.invalidCoombsVoteValue");
+ public String getVoteValueNotValidMessage(Locale locale) {
+ return l_(locale, "pollen.error.vote.invalidCoombsVoteValue");
}
@Override
@@ -87,7 +89,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
Modified: trunk/pollen-votecounting-strategy-instant-runoff/src/main/java/org/chorem/pollen/votecounting/strategy/InstantRunoffStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-instant-runoff/src/main/java/org/chorem/pollen/votecounting/strategy/InstantRunoffStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-instant-runoff/src/main/java/org/chorem/pollen/votecounting/strategy/InstantRunoffStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -35,10 +35,12 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
+import static org.nuiton.i18n.I18n.l_;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -72,14 +74,14 @@
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total value, so no message
return null;
}
@Override
- public String getVoteValueNotValidMessage() {
- return n_("pollen.error.vote.invalidInstantRunoffVoteValue");
+ public String getVoteValueNotValidMessage(Locale locale) {
+ return l_(locale, "pollen.error.vote.invalidInstantRunoffVoteValue");
}
@Override
@@ -88,7 +90,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
Modified: trunk/pollen-votecounting-strategy-normal/src/main/java/org/chorem/pollen/votecounting/strategy/NormalStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-normal/src/main/java/org/chorem/pollen/votecounting/strategy/NormalStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-normal/src/main/java/org/chorem/pollen/votecounting/strategy/NormalStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -28,6 +28,7 @@
import org.chorem.pollen.votecounting.model.VoteForChoice;
import org.chorem.pollen.votecounting.model.Voter;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -89,7 +90,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.CHECKBOX;
}
@@ -111,13 +112,13 @@
}
@Override
- public String getVoteValueNotValidMessage() {
+ public String getVoteValueNotValidMessage(Locale locale) {
// no validation on not null vote value, so no message
return null;
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total values, so no message
return null;
}
Modified: trunk/pollen-votecounting-strategy-number/src/main/java/org/chorem/pollen/votecounting/strategy/NumberStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-number/src/main/java/org/chorem/pollen/votecounting/strategy/NumberStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-number/src/main/java/org/chorem/pollen/votecounting/strategy/NumberStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -28,6 +28,7 @@
import org.chorem.pollen.votecounting.model.VoteForChoice;
import org.chorem.pollen.votecounting.model.Voter;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -89,7 +90,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
@@ -111,13 +112,13 @@
}
@Override
- public String getTotalVoteValueNotValidMessage() {
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
// no validation on total values, so no message
return null;
}
@Override
- public String getVoteValueNotValidMessage() {
+ public String getVoteValueNotValidMessage(Locale locale) {
// no validation on not null vote value, so no message
return null;
}
Modified: trunk/pollen-votecounting-strategy-percentage/src/main/java/org/chorem/pollen/votecounting/strategy/PercentageStrategy.java
===================================================================
--- trunk/pollen-votecounting-strategy-percentage/src/main/java/org/chorem/pollen/votecounting/strategy/PercentageStrategy.java 2012-07-31 07:16:34 UTC (rev 3572)
+++ trunk/pollen-votecounting-strategy-percentage/src/main/java/org/chorem/pollen/votecounting/strategy/PercentageStrategy.java 2012-07-31 10:54:49 UTC (rev 3573)
@@ -28,9 +28,11 @@
import org.chorem.pollen.votecounting.model.VoteForChoice;
import org.chorem.pollen.votecounting.model.Voter;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import static org.nuiton.i18n.I18n.l_;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -89,7 +91,7 @@
}
@Override
- public ChoiceToVoteRenderType getRenderType() {
+ public ChoiceToVoteRenderType getVoteValueEditorType() {
return ChoiceToVoteRenderType.TEXTFIELD;
}
@@ -110,14 +112,14 @@
}
@Override
- public String getVoteValueNotValidMessage() {
+ public String getVoteValueNotValidMessage(Locale locale) {
// no validation on not null vote value, so no message
return null;
}
@Override
- public String getTotalVoteValueNotValidMessage() {
- return n_("pollen.error.vote.percentage");
+ public String getTotalVoteValueNotValidMessage(Locale locale) {
+ return l_(locale, "pollen.error.vote.percentage");
}
public void addVoterChoices(Voter voter,
1
0
Author: tchemit
Date: 2012-07-31 09:16:34 +0200 (Tue, 31 Jul 2012)
New Revision: 3572
Url: http://chorem.org/repositories/revision/pollen/3572
Log:
fixes #720: Updates to nuiton-utils 2.5.2 + fix developer and contributors time zone in pom
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-07 19:41:27 UTC (rev 3571)
+++ trunk/pom.xml 2012-07-31 07:16:34 UTC (rev 3572)
@@ -46,7 +46,7 @@
<email>chatellier at codelutin.com</email>
<organization>CodeLutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -57,7 +57,7 @@
<email>chemit at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>lead</role>
<role>developer</role>
@@ -69,7 +69,7 @@
<email>couteau at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
<role>technical writer</role>
@@ -81,7 +81,7 @@
<email>desbois at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -92,7 +92,7 @@
<email>morin at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -105,7 +105,7 @@
<email>nemawan(a)hotmail.com</email>
<organization>ALMA - Code Lutin</organization>
<organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Chef de Projet</role>
<role>Analyste</role>
@@ -117,7 +117,7 @@
<email>tpoulit(a)gmail.com</email>
<organization>ALMA - Code Lutin</organization>
<organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Analyste</role>
<role>Développeur</role>
@@ -128,7 +128,7 @@
<email>benouna66(a)gmail.com</email>
<organization>ALMA - Code Lutin</organization>
<organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Analyste</role>
<role>Développeur</role>
@@ -139,7 +139,7 @@
<email>zhykos(a)gmail.com</email>
<organization>ALMA - Code Lutin</organization>
<organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Architecte</role>
<role>Développeur</role>
@@ -150,7 +150,7 @@
<email>eddahbi(a)gmail.com</email>
<organization>ALMA - Code Lutin</organization>
<organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Architecte</role>
<role>Développeur</role>
@@ -161,7 +161,7 @@
<email>rannou at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Concepteur</role>
<role>Développeur</role>
@@ -183,7 +183,7 @@
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<nuitonWebVersion>1.11</nuitonWebVersion>
- <nuitonUtilsVersion>2.5</nuitonUtilsVersion>
+ <nuitonUtilsVersion>2.5.2</nuitonUtilsVersion>
<h2Version>1.3.167</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<struts2Version>2.3.4</struts2Version>
1
0
Author: tchemit
Date: 2012-07-07 21:41:27 +0200 (Sat, 07 Jul 2012)
New Revision: 3571
Url: http://chorem.org/repositories/revision/pollen/3571
Log:
updates to mavenpom 3.3.4
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-06-26 07:36:22 UTC (rev 3570)
+++ trunk/pom.xml 2012-07-07 19:41:27 UTC (rev 3571)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.3.4</version>
</parent>
<groupId>org.chorem</groupId>
1
0