Pollen-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
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