r3623 - in trunk: pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote pollen-ui-struts2/src/main/resources/i18n pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll pollen-ui-struts2/src/test/resources pollen-ui-struts2/src/test/resources/its pollen-ui-struts2/src/test/resources/its/pollVoteVisibility pollen-ui-struts2/src/test/resources/its/
Author: tchemit Date: 2012-08-24 00:56:27 +0200 (Fri, 24 Aug 2012) New Revision: 3623 Url: http://chorem.org/repositories/revision/pollen/3623 Log: refs #742: Option to allow all users to show voting of others users (test for anonymous poll) + improve service code (remove none public api) Added: trunk/pollen-ui-struts2/src/test/resources/its/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/README.txt trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/db/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/db/pollendb.h2.db trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/emails/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/87cb5b1529374ac0b8c6b7f0b98e169c.xml trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/cacb52f4d49047b7a7aa24ec528fcc87.xml trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/fdd43f4c8d614a9aa48047804583508a.xml trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/tmp/ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/uploadedImages/ 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/SecurityService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/SummaryPoll.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.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/vote.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-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -95,8 +95,6 @@ * @param userAccount Optinal User account to attach to the creator * @param clone Flag to copy or not ids in case of poll cloning * @return the Poll ready for edition (no longer linked to the topia context) - * @see #getNewPoll(UserAccount) - * @see #getNewPollCopy(String, UserAccount, boolean) */ public Poll getPollEditable(String pollUid, UserAccount userAccount, @@ -106,11 +104,118 @@ if (StringUtils.isEmpty(pollUid)) { // creates a new poll - result = getNewPoll(userAccount); + PollDAO pollDAO = getDAO(Poll.class); + result = newInstance(pollDAO); + + PollenConfiguration configuration = getConfiguration(); + + // default values from configuration + result.setChoiceType(configuration.getDefaultChoiceType()); + result.setVoteCountingType(configuration.getDefaultVoteCountingType()); + result.setPollType(configuration.getDefaultPollType()); + result.setPollVoteVisibility(configuration.getDefaultPollVoteVisibility()); + result.setPollCommentVisibility(configuration.getDefaultPollCommentVisibility()); + + // Initialize creator of the poll + PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); + PollAccount creator = newInstance(pollAccountDAO); + + if (userAccount != null) { + + // Link the creator with the user + creator.setVotingId(userAccount.getDisplayName()); + creator.setEmail(userAccount.getEmail()); + creator.setUserAccount(userAccount); + } + result.setCreator(creator); } else { // obtains a copy of an existing poll - result = getNewPollCopy(pollUid, userAccount, clone); + + // load for sure existing poll + Poll poll = getExistingPollByPollId(pollUid); + + PollDAO pollDAO = getDAO(Poll.class); + result = newInstance(pollDAO); + + PollenBinderHelper.simpleCopy(poll, result, !clone); + if (clone) { + // reset id for clone case + result.setPollId(null); + } + + // -- Creator -- // + PollAccount creatorLoaded = poll.getCreator(); + PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); + PollAccount creatorEditable = newInstance(pollAccountDAO); + result.setCreator(creatorEditable); + + PollenBinderHelper.simpleCopy(creatorLoaded, creatorEditable, !clone); + if (clone) { + // reset id for clone case + creatorEditable.setAccountId(null); + } + + if (creatorEditable.getUserAccount() == null) { + // use the incoming userAccount + creatorEditable.setUserAccount(userAccount); + } + + // -- Choice -- // + Function<Choice, Choice> choiceCreator = + PollenServiceFunctions.newChoiceCreator(poll.getChoiceType()); + Iterable<Choice> choices = + Iterables.transform(poll.getChoice(), choiceCreator); + + for (Choice choiceLoaded : choices) { + if (clone) { + // reset id for clone case + choiceLoaded.setTopiaId(null); + } + result.addChoice(choiceLoaded); + } + + // -- VotingList -- // + VotingListDAO votingListDAO = getDAO(VotingList.class); + PersonToListDAO personToListDAO = getDAO(PersonToList.class); + for (VotingList votingListLoaded : poll.getVotingList()) { + VotingList votingListEditable = newInstance(votingListDAO); + result.addVotingList(votingListEditable); + // Do not keep votingLists topiaId, to simplify the update will delete old votingLists and create new ones + PollenBinderHelper.simpleCopy( + votingListLoaded, votingListEditable, false); + + for (PersonToList personToListLoaded : votingListLoaded.getPollAccountPersonToList()) { + PersonToList personToListEditable = newInstance(personToListDAO); + votingListEditable.addPollAccountPersonToList(personToListEditable); + // Do not keep personToLists topiaId, to simplify the update will delete old personToLists and create new ones + PollenBinderHelper.simpleCopy( + personToListLoaded, personToListEditable, false); + + PollAccount personLoaded = personToListLoaded.getPollAccount(); + PollAccount personEditable = newInstance(pollAccountDAO); + personToListEditable.setPollAccount(personEditable); + // copy the person, keeping topiaId is useless because we have the link with PersonToList + PollenBinderHelper.simpleCopy( + personLoaded, personEditable, false); + if (clone) { + // reset id for clone case + personEditable.setAccountId(null); + } + } + } + + // -- PreventRule -- // + PreventRuleDAO preventRuleDAO = getDAO(PreventRule.class); + for (PreventRule preventRuleLoaded : poll.getPreventRule()) { + PreventRule preventRuleEditable = newInstance(preventRuleDAO); + PollenBinderHelper.simpleCopy( + preventRuleLoaded, preventRuleEditable, !clone); + result.addPreventRule(preventRuleEditable); + } + + // Load votes to have the correct size used to check if vote is started + result.setVote(poll.getVote()); } return result; } @@ -415,19 +520,12 @@ public Poll getExistingPollByPollId(String pollId) throws PollNotFoundException { - Preconditions.checkNotNull(pollId); - try { - PollDAO dao = getDAO(Poll.class); - Poll result = dao.findByPollId(pollId); + Poll result = getPollByPollId(pollId); - if (result == null) { - throw new PollNotFoundException(); - } - return result; - } catch (TopiaException e) { - throw new PollenTechnicalException( - "Could not find poll with pollId '" + pollId + "'", e); + if (result == null) { + throw new PollNotFoundException(); } + return result; } /** @@ -485,7 +583,9 @@ if (pollAccountLoaded != null) { // copy the loaded pollAccount - result = copyPollAccount(pollAccountLoaded); + result = newInstance(dao); + PollenBinderHelper.copy("", pollAccountLoaded, result, true); + result.setUserAccount(pollAccountLoaded.getUserAccount()); // Don't remove or update userAccount link if already set if (withUserAccount && result.getUserAccount() == null) { @@ -499,173 +599,14 @@ if (result == null) { // create a new pollAccount linked to given userAccount (if not null) - result = getNewPollAccount(userAccount); + result = newInstance(dao); + String votingId = userAccount != null ? userAccount.getDisplayName() : ""; + result.setVotingId(votingId); + result.setUserAccount(userAccount); } return result; } - /** - * Build a new Poll instance with given {@code user} as creator - * - * @param user Build a new Poll instance with given {@code user} as creator - * @return Build a new Poll instance with given {@code user} as creator - */ - protected Poll getNewPoll(UserAccount user) { - - PollDAO pollDAO = getDAO(Poll.class); - Poll result = newInstance(pollDAO); - - PollenConfiguration configuration = getConfiguration(); - - // default values from configuration - result.setChoiceType(configuration.getDefaultChoiceType()); - result.setVoteCountingType(configuration.getDefaultVoteCountingType()); - result.setPollType(configuration.getDefaultPollType()); - result.setPollVoteVisibility(configuration.getDefaultPollVoteVisibility()); - result.setPollCommentVisibility(configuration.getDefaultPollCommentVisibility()); - - // Initialize creator of the poll - PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); - PollAccount creator = newInstance(pollAccountDAO); - - if (user != null) { - - // Link the creator with the user - creator.setVotingId(user.getDisplayName()); - creator.setEmail(user.getEmail()); - creator.setUserAccount(user); - } - result.setCreator(creator); - - return result; - } - - /** - * Obtains a copy of an existing poll given his {@code pollUid}. - * <p/> - * If flag {@code clone} is setted to {@code true}, then all id will - * be removed (pollId, accountId, topiaId). - * - * @param pollUid the {@link Poll#getPollId()} of the poll to copy - * @param userAccount optional incoming user account to link to the - * {@link Poll#getCreator()} - * @param clone flag to clone or not the copy of the poll (if setted - * to {@code true} then all id will be removed). - * @return the copy of the poll - * @throws PollNotFoundException if poll was not found - */ - protected Poll getNewPollCopy(String pollUid, - UserAccount userAccount, - boolean clone) throws PollNotFoundException { - - // pollUid can not be blank - Preconditions.checkState(StringUtils.isNotBlank(pollUid)); - - // load for sure existing poll - Poll poll = getExistingPollByPollId(pollUid); - - PollDAO pollDAO = getDAO(Poll.class); - Poll result = newInstance(pollDAO); - - PollenBinderHelper.simpleCopy(poll, result, !clone); - if (clone) { - // reset id for clone case - result.setPollId(null); - } - - // -- Creator -- // - PollAccount creatorLoaded = poll.getCreator(); - PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); - PollAccount creatorEditable = newInstance(pollAccountDAO); - result.setCreator(creatorEditable); - - PollenBinderHelper.simpleCopy(creatorLoaded, creatorEditable, !clone); - if (clone) { - // reset id for clone case - creatorEditable.setAccountId(null); - } - - if (creatorEditable.getUserAccount() == null) { - // use the incoming userAccount - creatorEditable.setUserAccount(userAccount); - } - - // -- Choice -- // - Function<Choice, Choice> choiceCreator = - PollenServiceFunctions.newChoiceCreator(poll.getChoiceType()); - Iterable<Choice> choices = - Iterables.transform(poll.getChoice(), choiceCreator); - - for (Choice choiceLoaded : choices) { - if (clone) { - // reset id for clone case - choiceLoaded.setTopiaId(null); - } - result.addChoice(choiceLoaded); - } - - // -- VotingList -- // - VotingListDAO votingListDAO = getDAO(VotingList.class); - PersonToListDAO personToListDAO = getDAO(PersonToList.class); - for (VotingList votingListLoaded : poll.getVotingList()) { - VotingList votingListEditable = newInstance(votingListDAO); - result.addVotingList(votingListEditable); - // Do not keep votingLists topiaId, to simplify the update will delete old votingLists and create new ones - PollenBinderHelper.simpleCopy( - votingListLoaded, votingListEditable, false); - - for (PersonToList personToListLoaded : votingListLoaded.getPollAccountPersonToList()) { - PersonToList personToListEditable = newInstance(personToListDAO); - votingListEditable.addPollAccountPersonToList(personToListEditable); - // Do not keep personToLists topiaId, to simplify the update will delete old personToLists and create new ones - PollenBinderHelper.simpleCopy( - personToListLoaded, personToListEditable, false); - - PollAccount personLoaded = personToListLoaded.getPollAccount(); - PollAccount personEditable = newInstance(pollAccountDAO); - personToListEditable.setPollAccount(personEditable); - // copy the person, keeping topiaId is useless because we have the link with PersonToList - PollenBinderHelper.simpleCopy( - personLoaded, personEditable, false); - if (clone) { - // reset id for clone case - personEditable.setAccountId(null); - } - } - } - - // -- PreventRule -- // - PreventRuleDAO preventRuleDAO = getDAO(PreventRule.class); - for (PreventRule preventRuleLoaded : poll.getPreventRule()) { - PreventRule preventRuleEditable = newInstance(preventRuleDAO); - PollenBinderHelper.simpleCopy( - preventRuleLoaded, preventRuleEditable, !clone); - result.addPreventRule(preventRuleEditable); - } - - // Load votes to have the correct size used to check if vote is started - result.setVote(poll.getVote()); - - return result; - } - - protected PollAccount copyPollAccount(PollAccount source) { - PollAccountDAO dao = getDAO(PollAccount.class); - PollAccount result = newInstance(dao); - PollenBinderHelper.copy("", source, result, true); - result.setUserAccount(source.getUserAccount()); - return result; - } - - public PollAccount getNewPollAccount(UserAccount userAccount) { - PollAccountDAO dao = getDAO(PollAccount.class); - PollAccount result = newInstance(dao); - String votingId = userAccount != null ? userAccount.getDisplayName() : ""; - result.setVotingId(votingId); - result.setUserAccount(userAccount); - return result; - } - public void deletePoll(String pollId) throws PollNotFoundException { // can not have an null nor empty pollId @@ -1094,4 +1035,166 @@ } } + +// /** +// * Build a new Poll instance with given {@code user} as creator +// * +// * @param user Build a new Poll instance with given {@code user} as creator +// * @return Build a new Poll instance with given {@code user} as creator +// */ +// protected Poll getNewPoll(UserAccount user) { +// +// PollDAO pollDAO = getDAO(Poll.class); +// Poll result = newInstance(pollDAO); +// +// PollenConfiguration configuration = getConfiguration(); +// +// // default values from configuration +// result.setChoiceType(configuration.getDefaultChoiceType()); +// result.setVoteCountingType(configuration.getDefaultVoteCountingType()); +// result.setPollType(configuration.getDefaultPollType()); +// result.setPollVoteVisibility(configuration.getDefaultPollVoteVisibility()); +// result.setPollCommentVisibility(configuration.getDefaultPollCommentVisibility()); +// +// // Initialize creator of the poll +// PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); +// PollAccount creator = newInstance(pollAccountDAO); +// +// if (user != null) { +// +// // Link the creator with the user +// creator.setVotingId(user.getDisplayName()); +// creator.setEmail(user.getEmail()); +// creator.setUserAccount(user); +// } +// result.setCreator(creator); +// +// return result; +// } +// +// /** +// * Obtains a copy of an existing poll given his {@code pollUid}. +// * <p/> +// * If flag {@code clone} is setted to {@code true}, then all id will +// * be removed (pollId, accountId, topiaId). +// * +// * @param pollUid the {@link Poll#getPollId()} of the poll to copy +// * @param userAccount optional incoming user account to link to the +// * {@link Poll#getCreator()} +// * @param clone flag to clone or not the copy of the poll (if setted +// * to {@code true} then all id will be removed). +// * @return the copy of the poll +// * @throws PollNotFoundException if poll was not found +// */ +// protected Poll getNewPollCopy(String pollUid, +// UserAccount userAccount, +// boolean clone) throws PollNotFoundException { +// +// // pollUid can not be blank +// Preconditions.checkState(StringUtils.isNotBlank(pollUid)); +// +// // load for sure existing poll +// Poll poll = getExistingPollByPollId(pollUid); +// +// PollDAO pollDAO = getDAO(Poll.class); +// Poll result = newInstance(pollDAO); +// +// PollenBinderHelper.simpleCopy(poll, result, !clone); +// if (clone) { +// // reset id for clone case +// result.setPollId(null); +// } +// +// // -- Creator -- // +// PollAccount creatorLoaded = poll.getCreator(); +// PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); +// PollAccount creatorEditable = newInstance(pollAccountDAO); +// result.setCreator(creatorEditable); +// +// PollenBinderHelper.simpleCopy(creatorLoaded, creatorEditable, !clone); +// if (clone) { +// // reset id for clone case +// creatorEditable.setAccountId(null); +// } +// +// if (creatorEditable.getUserAccount() == null) { +// // use the incoming userAccount +// creatorEditable.setUserAccount(userAccount); +// } +// +// // -- Choice -- // +// Function<Choice, Choice> choiceCreator = +// PollenServiceFunctions.newChoiceCreator(poll.getChoiceType()); +// Iterable<Choice> choices = +// Iterables.transform(poll.getChoice(), choiceCreator); +// +// for (Choice choiceLoaded : choices) { +// if (clone) { +// // reset id for clone case +// choiceLoaded.setTopiaId(null); +// } +// result.addChoice(choiceLoaded); +// } +// +// // -- VotingList -- // +// VotingListDAO votingListDAO = getDAO(VotingList.class); +// PersonToListDAO personToListDAO = getDAO(PersonToList.class); +// for (VotingList votingListLoaded : poll.getVotingList()) { +// VotingList votingListEditable = newInstance(votingListDAO); +// result.addVotingList(votingListEditable); +// // Do not keep votingLists topiaId, to simplify the update will delete old votingLists and create new ones +// PollenBinderHelper.simpleCopy( +// votingListLoaded, votingListEditable, false); +// +// for (PersonToList personToListLoaded : votingListLoaded.getPollAccountPersonToList()) { +// PersonToList personToListEditable = newInstance(personToListDAO); +// votingListEditable.addPollAccountPersonToList(personToListEditable); +// // Do not keep personToLists topiaId, to simplify the update will delete old personToLists and create new ones +// PollenBinderHelper.simpleCopy( +// personToListLoaded, personToListEditable, false); +// +// PollAccount personLoaded = personToListLoaded.getPollAccount(); +// PollAccount personEditable = newInstance(pollAccountDAO); +// personToListEditable.setPollAccount(personEditable); +// // copy the person, keeping topiaId is useless because we have the link with PersonToList +// PollenBinderHelper.simpleCopy( +// personLoaded, personEditable, false); +// if (clone) { +// // reset id for clone case +// personEditable.setAccountId(null); +// } +// } +// } +// +// // -- PreventRule -- // +// PreventRuleDAO preventRuleDAO = getDAO(PreventRule.class); +// for (PreventRule preventRuleLoaded : poll.getPreventRule()) { +// PreventRule preventRuleEditable = newInstance(preventRuleDAO); +// PollenBinderHelper.simpleCopy( +// preventRuleLoaded, preventRuleEditable, !clone); +// result.addPreventRule(preventRuleEditable); +// } +// +// // Load votes to have the correct size used to check if vote is started +// result.setVote(poll.getVote()); +// +// return result; +// } + +// protected PollAccount copyPollAccount(PollAccount source) { +// PollAccountDAO dao = getDAO(PollAccount.class); +// PollAccount result = newInstance(dao); +// PollenBinderHelper.copy("", source, result, true); +// result.setUserAccount(source.getUserAccount()); +// return result; +// } + +// public PollAccount getNewPollAccount(UserAccount userAccount) { +// PollAccountDAO dao = getDAO(PollAccount.class); +// PollAccount result = newInstance(dao); +// String votingId = userAccount != null ? userAccount.getDisplayName() : ""; +// result.setVotingId(votingId); +// result.setUserAccount(userAccount); +// return result; +// } } 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-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/SecurityService.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -23,6 +23,7 @@ package org.chorem.pollen.services.impl; import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.chorem.pollen.PollenTechnicalException; @@ -31,6 +32,7 @@ import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.business.persistence.PollAccount; import org.chorem.pollen.business.persistence.PollAccountDAO; +import org.chorem.pollen.business.persistence.PollVoteVisibility; import org.chorem.pollen.business.persistence.UserAccount; import org.chorem.pollen.business.persistence.Vote; import org.chorem.pollen.services.PollenServiceSupport; @@ -38,6 +40,7 @@ import java.util.Date; import java.util.EnumSet; +import java.util.List; import java.util.Set; import static org.chorem.pollen.PollenUserSecurityContext.PollenUserSecurityRole; @@ -157,6 +160,7 @@ } if (securityContext.isAdmin()) { + // pollen admin can always access vote page return null; } @@ -188,6 +192,13 @@ return false; } + if (securityContext.isWithAccountId() && + securityContext.getAccountId().equals(poll.getCreator().getAccountId())) { + + // user can not vote with his creator accountId (must use a new one) + return false; + } + if (!poll.isPollFree() && !securityContext.isRestrictedVoter()) { // on none free poll, only restricted user can vote @@ -198,6 +209,28 @@ return true; } + public boolean isCanVoteFromSummary(PollenUserSecurityContext securityContext) { + + Poll poll = securityContext.getPoll(); + + Date now = serviceContext.getCurrentTime(); + + if (!poll.isRunning(now)) { + + // poll is not running, can not vote + return false; + } + + if (!poll.isPollFree() && !securityContext.isRestrictedVoter()) { + + // on none free poll, only restricted user can vote + return false; + } + + // ok can vote + return true; + } + public boolean isCanModifyVote(PollenUserSecurityContext securityContext, String voteId) { @@ -353,6 +386,47 @@ return result; } + public List<Vote> filterVotes(Poll poll, + List<Vote> allVotes, + PollenUserSecurityContext userSecurityContext) { + List<Vote> result = null; + + PollVoteVisibility voteVisibility = poll.getPollVoteVisibility(); + switch (voteVisibility) { + + case NOBODY: + + // no votes visible to anybody + break; + case CREATOR_ONLY: + + if (userSecurityContext.isAdmin() || + userSecurityContext.isCreator()) { + // only admin or creator can see votes + result = allVotes; + } + break; + case PARTICIPANT_ONLY: + + if (userSecurityContext.isRestrictedVoter() || + userSecurityContext.isVoter()) { + // only participant or voter can see votes + result = allVotes; + } + break; + case EVERYBODY: + + // no restriction, everybody can sse votes + result = allVotes; + break; + } + + if (result == null) { + result = Lists.newArrayList(); + } + return result; + } + protected boolean isPollCreator(Poll poll, String accountId, UserAccount userAccount) { @@ -432,5 +506,4 @@ "from poll '" + pollId + "'", e); } } - } Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -57,27 +57,27 @@ /** Logger. */ private static final Log log = LogFactory.getLog(VoteService.class); - public Vote getNewVote(Poll poll, PollAccount account) { +// public Vote getNewVote(Poll poll, PollAccount account) { +// +// Preconditions.checkNotNull(poll); +// +// VoteDAO voteDAO = getDAO(Vote.class); +// VoteToChoiceDAO voteToChoiceDAO = getDAO(VoteToChoice.class); +// +// Vote result = newInstance(voteDAO); +// result.setPollAccount(account); +// result.setWeight(1.); +// +// // Prepare the List of VoteToChoice with Poll's choices +// for (Choice choice : poll.getChoice()) { +// VoteToChoice element = newInstance(voteToChoiceDAO); +// element.setChoice(choice); +// result.addChoiceVoteToChoice(element); +// } +// +// return result; +// } - Preconditions.checkNotNull(poll); - - VoteDAO voteDAO = getDAO(Vote.class); - VoteToChoiceDAO voteToChoiceDAO = getDAO(VoteToChoice.class); - - Vote result = newInstance(voteDAO); - result.setPollAccount(account); - result.setWeight(1.); - - // Prepare the List of VoteToChoice with Poll's choices - for (Choice choice : poll.getChoice()) { - VoteToChoice element = newInstance(voteToChoiceDAO); - element.setChoice(choice); - result.addChoiceVoteToChoice(element); - } - - return result; - } - public Vote getVoteEditable(Poll poll, PollAccount accountEditable) { Preconditions.checkNotNull(poll); @@ -128,7 +128,18 @@ result.setChoiceVoteToChoice(voteToChoices); } else { - result = getNewVote(poll, accountEditable); + + result = newInstance(dao); + result.setPollAccount(accountEditable); + result.setWeight(1.); + + VoteToChoiceDAO voteToChoiceDAO = getDAO(VoteToChoice.class); + // Prepare the List of VoteToChoice with Poll's choices + for (Choice choice : poll.getChoice()) { + VoteToChoice element = newInstance(voteToChoiceDAO); + element.setChoice(choice); + result.addChoiceVoteToChoice(element); + } } // Retrieve weight for Restricted Poll with existing account @@ -153,7 +164,6 @@ String pollAccountId = pollAccount.getTopiaId(); PollAccount pollAccountLoaded; - if (pollAccountId == null) { // Create new account Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/SummaryPoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/SummaryPoll.java 2012-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/admin/SummaryPoll.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -112,7 +112,7 @@ } public boolean isCanVote() { - return getSecurityService().isCanVote(getUserSecurityContext()); + return getSecurityService().isCanVoteFromSummary(getUserSecurityContext()); } @Override Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java 2012-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -87,13 +87,6 @@ private boolean feedFileExisting; /** - * Is user the poll's creator ? - * - * @since 1.3 - */ - private boolean creatorUser; - - /** * Loaded poll account (from the pollUri). * * @since 1.3 @@ -101,20 +94,6 @@ private PollAccount pollAccount; /** - * Is vote allowed for current user? - * - * @since 1.3 - */ - private boolean voteAllowed; - - /** - * Is current user can go to results. - * - * @since 1.4 - */ - private boolean resultAllowed; - - /** * All votes for the poll. * * @since 1.3 @@ -299,7 +278,8 @@ } public boolean isCreatorOrAdmin() { - return creatorUser || isUserAdmin(); + return getUserSecurityContext().isCreator() || + getUserSecurityContext().isAdmin(); } public boolean isAccountFieldDisplayed() { @@ -360,11 +340,11 @@ } public boolean isVoteAllowed() { - return voteAllowed; + return !isModerate() && getSecurityService().isCanVote(getUserSecurityContext()); } public boolean isResultAllowed() { - return resultAllowed; + return getSecurityService().isCanAccessResult(getUserSecurityContext()); } public String getPollCreatorName() { @@ -431,64 +411,63 @@ public String prepareVotePage() throws Exception { - boolean moderate = isModerate(); - + // load poll loadPoll(); // Current poll account loadPollAccount(); - // All votes + // Get all votes // TODO no pagination for the moment, need to retrieve the correct page depends on current pollAccount - votes = getVoteService().getAllVotes(poll); + List<Vote> allVotes = getVoteService().getAllVotes(poll); - // is vote allowed ? - if (moderate) { + // only keep possible votes for current user security context + votes = getSecurityService().filterVotes(poll, + allVotes, + getUserSecurityContext()); - // while moderate vote, no way to vote - voteAllowed = false; + if (isVoteAllowed()) { - } else { - voteAllowed = getSecurityService().isCanVote(getUserSecurityContext()); - } - - // is can display result link ? - resultAllowed = getSecurityService().isCanAccessResult(getUserSecurityContext()); - - if (voteAllowed) { - // load modifiable vote vote = getVoteService().getVoteEditable(poll, pollAccount); } - // load poll results - PollResultList pollResultList = - getPollResultsService().getResults(poll); + if (isResultAllowed()) { - results = pollResultList.getPollResults(); + // load poll results + PollResultList pollResultList = + getPollResultsService().getResults(poll); - if (log.isDebugEnabled()) { - for (PollResult res : results) { - log.debug(res.getName() + ": " + res.getValue() - + ", (voteCounting=" + res.getVoteCountingType() - + ", byGroup=" + res.isByGroup() + ")"); + results = pollResultList.getPollResults(); + + if (log.isDebugEnabled()) { + for (PollResult res : results) { + log.debug(res.getName() + ": " + res.getValue() + + ", (voteCounting=" + res.getVoteCountingType() + + ", byGroup=" + res.isByGroup() + ")"); + } } } - // load comments - comments = getPollCommentService().getAllComments(poll.getPollId()); + if (isCommentAllowed()) { + // load comments + comments = getPollCommentService().getAllComments(poll.getPollId()); + } + feedFileExisting = getPollFeedService().isFeedExists(poll); - creatorUser = getUserSecurityContext().isCreator(); - if (log.isInfoEnabled()) { Date now = serviceContext.getCurrentTime(); log.info("pollChoiceOrVoteStarted = " + isPollChoiceOrVoteStarted()); log.info("pollChoiceRunning = " + isPollChoiceRunning()); log.info("pollRunning = " + poll.isRunning(now)); log.info("accountFieldDisplayed = " + isAccountFieldDisplayed()); - log.info("creatorUser = " + creatorUser); + log.info("creatorOrAdminUser = " + isCreatorOrAdmin()); + log.info("isVoteAllowed = " + isVoteAllowed()); + log.info("isCommentAllowed = " + isCommentAllowed()); + log.info("isResultAllowed = " + isResultAllowed()); + log.info("pollVoteVisibility = " + poll.getPollVoteVisibility()); } return INPUT; } @@ -518,28 +497,7 @@ protected void loadPoll() throws PollNotFoundException { -// setPollUri(getUserSecurityContext().getPollUri()); - poll = getUserSecurityContext().getPoll(); - -// // Ensure uri for poll and pollAccount loading -// PollUri pollUri = getPollUri(); -// if (pollUri == null) { -// String[] values = getParameters().get(PARAM_POLL_URI); -// pollUri = PollUriConverter.convertFromString(values); -// setPollUri(pollUri); -// } -// -// String pollId = pollUri.getPollId(); -// if (StringUtils.isNotEmpty(pollId)) { -// poll = getPollService().getExistingPollByPollId(pollId); -// } -//// Preconditions.checkNotNull(poll, -//// "Can't load poll with id = [" + pollId + "]"); -//// -//// if (log.isDebugEnabled()) { -//// log.debug("Poll TopiaId: " + poll.getTopiaId()); -//// } } } Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java 2012-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java 2012-08-23 22:56:27 UTC (rev 3623) @@ -27,9 +27,11 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.pollen.PollenUserSecurityContext; import org.chorem.pollen.bean.PollUrl; import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.business.persistence.PollVoteVisibility; import org.chorem.pollen.business.persistence.Vote; import org.chorem.pollen.business.persistence.VoteToChoice; import org.chorem.pollen.services.impl.VoteService; @@ -59,15 +61,63 @@ prepareVotePage(); // Messages - if (getPoll().isClosed()) { + Poll poll = getPoll(); + + PollenUserSecurityContext securityContext = getUserSecurityContext(); + + if (poll.isClosed()) { addFlashWarning(_("pollen.information.pollClosed")); } else if (!isPollStarted()) { addFlashWarning(_("pollen.information.pollNotStarted")); } else if (isPollFinished()) { addFlashWarning(_("pollen.information.pollFinished")); } else if (!isVoteAllowed()) { - addFlashWarning(_("pollen.information.pollCanNotVote")); + + // check crator does not try to vote with his creator id + if (securityContext.isCreator() && securityContext.isWithAccountId()) { + + if (poll.getCreator().getAccountId().equals(securityContext.getAccountId())) { + + // only participant can see votes + addFlashWarning(_("pollen.information.canNotvotewithCreatorAccountId")); + } + } else { + + addFlashWarning(_("pollen.information.pollCanNotVote")); + } } + + if (isVoteAllowed()) { + + PollVoteVisibility voteVisibility = poll.getPollVoteVisibility(); + switch (voteVisibility) { + + case NOBODY: + // anonymous poll (nobody can see votes) + addFlashWarning(_("pollen.information.voteNotVisible.anonymousPoll")); + break; + case CREATOR_ONLY: + if (!securityContext.isAdmin()) { + + // only creator can see votes + addFlashWarning(_("pollen.information.voteNotVisible.onlyCreator")); + } + break; + case PARTICIPANT_ONLY: + if (!securityContext.isVoter() || securityContext.isRestrictedVoter()) { + + // only participant can see votes + addFlashWarning(_("pollen.information.voteNotVisible.onlyParticipant")); + } + break; + case EVERYBODY: + // free to everybody + break; + } + } else { + + + } if (isPollChoiceRunning()) { addFlashMessage(_("pollen.information.pollChoiceRunning")); } @@ -191,7 +241,7 @@ // For free Poll, display the update Url (useless if user is logged or // not using a modify url) if (poll.isPollFree() && - !isUserLoggued() && + (!isUserLoggued() || vote.isAnonymous()) && StringUtils.isBlank(getUserSecurityContext().getAccountId())) { String pollId = poll.getPollId(); 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-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-08-23 22:56:27 UTC (rev 3623) @@ -260,6 +260,7 @@ pollen.fieldset.vote.options=Votes pollen.fieldset.vote.options.help=Configure votes of the poll pollen.image.not.loaded=Image not loaded +pollen.information.canNotvotewithCreatorAccountId=You are not authorized to vote with your creator account Id pollen.information.choice.deleted=Choice deleted. pollen.information.comment.added=Comment added. pollen.information.comment.deleted=Comment deleted. @@ -303,6 +304,9 @@ pollen.information.vote.createdWithUpdateUrl=Vote saved, you can modify it using this address\: <br/> <a href\="%1$s">%1$s</a> pollen.information.vote.creatorUser=You are identified as the poll's creator. You can't vote with this URL. pollen.information.vote.deleted=Vote deleted. +pollen.information.voteNotVisible.anonymousPoll=Votes are not visible\: Anonymous poll +pollen.information.voteNotVisible.onlyCreator=Votes are not visible\: Only creator (or admin) can see votes +pollen.information.voteNotVisible.onlyParticipant=Votes are not visible\: Only participant (or voter) can see votes pollen.information.your.are.loggued=You are logged. pollen.label.contact.administrator=Send an email to an administrator pollen.label.pollClonePage=Clone your poll 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-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-08-23 22:56:27 UTC (rev 3623) @@ -261,6 +261,7 @@ pollen.fieldset.vote.options=Les votes pollen.fieldset.vote.options.help=Configurer les votes du sondage pollen.image.not.loaded=Image non chargée +pollen.information.canNotvotewithCreatorAccountId=Vous n'êtes pas autorisé à voter avec votre identifiant de créateur pollen.information.choice.deleted=Choix supprimé. pollen.information.comment.added=Commentaire ajouté. pollen.information.comment.deleted=Commentaire supprimé. @@ -304,6 +305,9 @@ pollen.information.vote.createdWithUpdateUrl=Vote enregistré, vous pourrez le modifier à l'adresse suivante \: <br/> <a href\="%1$s">%1$s</a> pollen.information.vote.creatorUser=Vous êtes identifié comme le créateur du sondage. Vous ne pouvez pas voter avec cette URL. pollen.information.vote.deleted=Vote supprimé. +pollen.information.voteNotVisible.anonymousPoll=Votes non visibles \: Sondage anonyme +pollen.information.voteNotVisible.onlyCreator=Votes non visibles \: Seul le créateur (ou administrateur) peut les voir +pollen.information.voteNotVisible.onlyParticipant=Votes non visibles \: Seul les participants peuvent les voir pollen.information.your.are.loggued=Vous êtes connecté. pollen.label.contact.administrator=Contacter un administrateur pollen.label.pollClonePage=Cloner le sondage Modified: trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp =================================================================== --- trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-08-23 22:55:11 UTC (rev 3622) +++ trunk/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-08-23 22:56:27 UTC (rev 3623) @@ -173,6 +173,9 @@ <s:form id="voteForm" validate="true"> <s:hidden key="pollUri" label=''/> +<s:if test="poll.anonymous"> + <s:hidden key="vote.anonymous" label="" value='true'/> +</s:if> <table id="poll"> <thead> <tr> Added: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/README.txt =================================================================== --- trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/README.txt (rev 0) +++ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/README.txt 2012-08-23 22:56:27 UTC (rev 3623) @@ -0,0 +1,37 @@ +================ +PollVoteVibility +================ + +Pour tester la portée des votes (http://chorem.org/issues/742) + +anonymous free poll +------------------- + +by not connected user +~~~~~~~~~~~~~~~~~~~~~ + +admin cacb52f4d49047b7a7aa24ec528fcc87:e814ba6e25174d5983ad796c400520f5 (peut voter) +vote anonyme cacb52f4d49047b7a7aa24ec528fcc87:56acbf87f3c049c2adc757ef1da88ee1 (a,b) +vote creator (interdit) +vote user cacb52f4d49047b7a7aa24ec528fcc87:c54a12ffde5d44a4ad9e609aa644fc80 (a) (sondage non present dans sondages participes) +vote admin cacb52f4d49047b7a7aa24ec528fcc87:15500943e49842c88d6ceeefaa62e2ed (b) (sondage non present dans sondages participes) + +by connected user +~~~~~~~~~~~~~~~~~ + +admin fdd43f4c8d614a9aa48047804583508a:9a8e8523f1ba404f8fde45d1844c59ac (peut voter) +vote anonyme fdd43f4c8d614a9aa48047804583508a:07dc154dce514d368441eaa9f27d21e0 (a,b) +vote creator (interdit connecté ou pas) +vote user fdd43f4c8d614a9aa48047804583508a:e67a14d729c7440ebe4a55d589cba515 (a) (sondage non present dans sondages participes) +vote admin fdd43f4c8d614a9aa48047804583508a:29993520034a41168def96f908d2696b (b) (sondage non present dans sondages participes) +sondage crées (sondage present, peut voter) + +by admin user +~~~~~~~~~~~~~ + +admin 87cb5b1529374ac0b8c6b7f0b98e169c:65a3caf0bf204226bfcd259c69e56ca8 (peut voter) +vote anonyme 87cb5b1529374ac0b8c6b7f0b98e169c:a0ff6892a28b4a65809b16cd8903245e (a,b) +vote creator (interdit connecté ou pas) +vote user 87cb5b1529374ac0b8c6b7f0b98e169c:fd47e01378354fcaa220a4ffd0974417 (a) (sondage non present dans sondages participes) +vote admin 87cb5b1529374ac0b8c6b7f0b98e169c:010f05042ff3485c834d1ecdc4d17f1e (b) (sondage non present dans sondages participes) +sondage crées (sondage present, peut voter) Property changes on: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/README.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/db/pollendb.h2.db =================================================================== (Binary files differ) Property changes on: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/db/pollendb.h2.db ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/87cb5b1529374ac0b8c6b7f0b98e169c.xml =================================================================== --- trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/87cb5b1529374ac0b8c6b7f0b98e169c.xml (rev 0) +++ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/87cb5b1529374ac0b8c6b7f0b98e169c.xml 2012-08-23 22:56:27 UTC (rev 3623) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> + <title>Pollen : anonymous free poll (by admin user)</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c" /> + <subtitle>sondage anonyme libre (tout le monde peut voter mais personne ne voit les votes) créé par un administrateur</subtitle> + <entry> + <title /> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c</id> + <updated>2012-08-23T22:28:04Z</updated> + <published>2012-08-23T22:28:04Z</published> + <summary type="text" /> + <dc:creator /> + <dc:date>2012-08-23T22:28:04Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c</id> + <updated>2012-08-23T22:28:59Z</updated> + <published>2012-08-23T22:28:59Z</published> + <summary type="text">Poll result: a=1, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:28:59Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c</id> + <updated>2012-08-23T22:29:49Z</updated> + <published>2012-08-23T22:29:49Z</published> + <summary type="text">Poll result: a=2, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:29:49Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/87cb5b1529374ac0b8c6b7f0b98e169c" /> + <author> + <name /> + </author> + <updated>2012-08-23T22:34:35Z</updated> + <published>2012-08-23T22:34:35Z</published> + <summary type="text">Poll result: a=2, b=2</summary> + <dc:date>2012-08-23T22:34:35Z</dc:date> + </entry> +</feed> + Property changes on: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/87cb5b1529374ac0b8c6b7f0b98e169c.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/cacb52f4d49047b7a7aa24ec528fcc87.xml =================================================================== --- trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/cacb52f4d49047b7a7aa24ec528fcc87.xml (rev 0) +++ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/cacb52f4d49047b7a7aa24ec528fcc87.xml 2012-08-23 22:56:27 UTC (rev 3623) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> + <title>Pollen : anonymous free poll (by not connected user)</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87" /> + <subtitle>sondage anonyme libre (tout le monde peut voter mais personne ne voit les votes) créé par un utilisateur anonyme</subtitle> + <entry> + <title /> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87</id> + <updated>2012-08-23T22:19:42Z</updated> + <published>2012-08-23T22:19:42Z</published> + <summary type="text" /> + <dc:creator /> + <dc:date>2012-08-23T22:19:42Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87</id> + <updated>2012-08-23T22:20:28Z</updated> + <published>2012-08-23T22:20:28Z</published> + <summary type="text">Poll result: a=1, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:20:28Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87</id> + <updated>2012-08-23T22:21:23Z</updated> + <published>2012-08-23T22:21:23Z</published> + <summary type="text">Poll result: a=2, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:21:23Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/cacb52f4d49047b7a7aa24ec528fcc87" /> + <author> + <name /> + </author> + <updated>2012-08-23T22:22:09Z</updated> + <published>2012-08-23T22:22:09Z</published> + <summary type="text">Poll result: a=2, b=2</summary> + <dc:date>2012-08-23T22:22:09Z</dc:date> + </entry> +</feed> + Property changes on: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/cacb52f4d49047b7a7aa24ec528fcc87.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/fdd43f4c8d614a9aa48047804583508a.xml =================================================================== --- trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/fdd43f4c8d614a9aa48047804583508a.xml (rev 0) +++ trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/fdd43f4c8d614a9aa48047804583508a.xml 2012-08-23 22:56:27 UTC (rev 3623) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> + <title>Pollen : anonymous free poll (by connected user)</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a" /> + <subtitle>sondage anonyme libre (tout le monde peut voter mais personne ne voit les votes) créé par un utilisateur connecté</subtitle> + <entry> + <title /> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a</id> + <updated>2012-08-23T22:23:36Z</updated> + <published>2012-08-23T22:23:36Z</published> + <summary type="text" /> + <dc:creator /> + <dc:date>2012-08-23T22:23:36Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a</id> + <updated>2012-08-23T22:24:13Z</updated> + <published>2012-08-23T22:24:13Z</published> + <summary type="text">Poll result: a=1, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:24:13Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a" /> + <author> + <name /> + </author> + <id>http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a</id> + <updated>2012-08-23T22:25:09Z</updated> + <published>2012-08-23T22:25:09Z</published> + <summary type="text">Poll result: a=2, b=1</summary> + <dc:creator /> + <dc:date>2012-08-23T22:25:09Z</dc:date> + </entry> + <entry> + <title>New vote from 'Anonymous voter'</title> + <link rel="alternate" href="http://localhost:8080/pollen/poll/votefor/fdd43f4c8d614a9aa48047804583508a" /> + <author> + <name /> + </author> + <updated>2012-08-23T22:26:18Z</updated> + <published>2012-08-23T22:26:18Z</published> + <summary type="text">Poll result: a=2, b=2</summary> + <dc:date>2012-08-23T22:26:18Z</dc:date> + </entry> +</feed> + Property changes on: trunk/pollen-ui-struts2/src/test/resources/its/pollVoteVisibility/feeds/fdd43f4c8d614a9aa48047804583508a.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native
participants (1)
-
tchemit@users.chorem.org