Author: fdesbois Date: 2010-03-23 12:15:12 +0100 (Tue, 23 Mar 2010) New Revision: 2955 Log: Last commit for 1.3 snapshot : very unstable version... Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java trunk/pollen-ui/src/main/webapp/ErrorPage.tml Removed: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties trunk/pollen-business/src/main/xmi/pollen.zargo trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -224,7 +224,7 @@ BinderProvider.getBinder( PollAccount.class, PollAccountDTO.class).copy(entity, dto); dto.setId(entity.getTopiaId()); - dto.setAccountId(entity.getAccountId()); + dto.setAccountUId(entity.getAccountId()); return dto; } @@ -275,7 +275,7 @@ dto.setVotingListId(list.getTopiaId()); // vote for a person (pollAccount) } else {/*if (account != null) { must have a pollaccount */ - dto.setPollAccountId(account.getTopiaId()); + //dto.setPollAccountId(account.getTopiaId()); dto.setName(account.getVotingId()); // if (account.getUserAccount() != null) { // dto.setUserId(account.getUserAccount().getTopiaId()); @@ -285,10 +285,12 @@ // Choices for voteValues for (VoteToChoice choice : entity.getChoiceVoteToChoice()) { - ChoiceDTO choiceDTO = - convert(choice.getChoice(), new ChoiceDTO()); - choiceDTO.setValue(choice.getVoteValue()); - dto.addChoice(choiceDTO); +// ChoiceDTO choiceDTO = +// convert(choice.getChoice(), new ChoiceDTO()); +// choiceDTO.setValue(choice.getVoteValue()); +// dto.addChoice(choiceDTO); + dto.setChoiceValue(choice.getChoice().getTopiaId(), + choice.getVoteValue()); } return dto; } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -108,7 +108,7 @@ public PollAccountDTO createPollAccountDTO(PollAccount ePollAccount) { PollAccountDTO dto = new PollAccountDTO(); dto.setId(ePollAccount.getTopiaId()); - dto.setAccountId(ePollAccount.getAccountId()); + dto.setAccountUId(ePollAccount.getAccountId()); dto.setEmail(ePollAccount.getEmail()); dto.setVotingId(ePollAccount.getVotingId()); Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -33,8 +33,6 @@ import org.chorem.pollen.business.persistence.Comment; import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.business.persistence.PreventRule; -import org.chorem.pollen.business.services.ServiceChoice; -import org.chorem.pollen.business.services.ServiceChoiceImpl; import org.chorem.pollen.business.services.ServicePreventRule; import org.chorem.pollen.business.services.ServicePreventRuleImpl; import org.nuiton.topia.TopiaException; @@ -134,50 +132,50 @@ } return results; } + +// /** +// * Persistance des choix d'une entité sondage à partir d'un DTO. +// * +// * @param pollDTO le dto sondage +// * @param ePoll l'entité sondage +// * @deprecated use dao managment instead +// */ +// @Deprecated +// public void persistChoices(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context) +// throws TopiaException, PollenBusinessException { +// +// // mise à jour ou création des choix +// ServiceChoice sChoice = new ServiceChoiceImpl(context); +// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) { +// boolean updated = sChoice.updateChoice(choiceDTO); +// if (!updated) { +// choiceDTO.setId(sChoice.createChoice(choiceDTO)); +// } +// +// if (log.isDebugEnabled()) { +// log.debug("Choice " + choiceDTO.getName() + " (" +// + choiceDTO.getId() + ") updated: " + updated); +// } +// } +// +// // suppression des choix +// boolean validChoice = false; +// Iterator<Choice> itChoice = ePoll.getChoice().iterator(); +// while (itChoice.hasNext()) { +// Choice currentChoice = itChoice.next(); +// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) { +// if (currentChoice.getTopiaId().equals(choiceDTO.getId())) { +// validChoice = true; +// } +// } +// if (!validChoice) { +// sChoice.deleteChoice(currentChoice.getTopiaId()); +// } +// validChoice = false; +// } +// } /** - * Persistance des choix d'une entité sondage à partir d'un DTO. - * - * @param pollDTO le dto sondage - * @param ePoll l'entité sondage - * @deprecated use dao managment instead - */ - @Deprecated - public void persistChoices(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context) - throws TopiaException, PollenBusinessException { - - // mise à jour ou création des choix - ServiceChoice sChoice = new ServiceChoiceImpl(context); - for (ChoiceDTO choiceDTO : pollDTO.getChoices()) { - boolean updated = sChoice.updateChoice(choiceDTO); - if (!updated) { - choiceDTO.setId(sChoice.createChoice(choiceDTO)); - } - - if (log.isDebugEnabled()) { - log.debug("Choice " + choiceDTO.getName() + " (" - + choiceDTO.getId() + ") updated: " + updated); - } - } - - // suppression des choix - boolean validChoice = false; - Iterator<Choice> itChoice = ePoll.getChoice().iterator(); - while (itChoice.hasNext()) { - Choice currentChoice = itChoice.next(); - for (ChoiceDTO choiceDTO : pollDTO.getChoices()) { - if (currentChoice.getTopiaId().equals(choiceDTO.getId())) { - validChoice = true; - } - } - if (!validChoice) { - sChoice.deleteChoice(currentChoice.getTopiaId()); - } - validChoice = false; - } - } - - /** * Persistance des règles de notification d'une entité sondage à partir d'un * DTO. * Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -20,6 +20,7 @@ import java.util.Collection; import java.util.List; +import java.util.Map; import org.chorem.pollen.business.dto.ChoiceDTO; import org.chorem.pollen.business.dto.VoteDTO; import org.chorem.pollen.business.persistence.Choice; @@ -113,11 +114,14 @@ if (eVote.getChoiceVoteToChoice() != null) { DataChoiceConverter choiceConverter = new DataChoiceConverter(); for (VoteToChoice voteToChoice : eVote.getChoiceVoteToChoice()) { - if (voteToChoice.getChoice() != null) { - ChoiceDTO choiceDTO = choiceConverter - .createChoiceDTO(voteToChoice.getChoice()); - choiceDTO.setValue(voteToChoice.getVoteValue()); - voteDTO.getChoiceDTOs().add(choiceDTO); + Choice choice = voteToChoice.getChoice(); + if (choice != null) { +// ChoiceDTO choiceDTO = choiceConverter +// .createChoiceDTO(voteToChoice.getChoice()); +// choiceDTO.setValue(voteToChoice.getVoteValue()); +// voteDTO.getChoiceDTOs().add(choiceDTO); + voteDTO.setChoiceValue(choice.getTopiaId(), + voteToChoice.getVoteValue()); } } } @@ -148,16 +152,46 @@ * * @param voteDTO Le dto vote. * @param eVote L'entité vote. + * @throws TopiaException + * @deprecated must copy this code in serviceVote */ + @Deprecated public void populateChoiceVote(VoteDTO voteDTO, Vote eVote) throws TopiaException { +// +// for (ChoiceDTO choiceDTO : voteDTO.getChoiceDTOs()) { +// choiceDTO.setVoteId(eVote.getTopiaId()); +// } +// +// eVote.setChoiceVoteToChoice(this.getVoteToChoices(voteDTO +// .getChoiceDTOs())); - for (ChoiceDTO choiceDTO : voteDTO.getChoiceDTOs()) { - choiceDTO.setVoteId(eVote.getTopiaId()); + VoteToChoiceDAO dao = + PollenModelDAOHelper.getVoteToChoiceDAO(super.transaction); + + ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(super.transaction); + + for (Map.Entry<String, Integer> choiceValue : + voteDTO.getChoiceValues().entrySet()) { + + // Find existing choice + Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey()); + + // Find existing vote + VoteToChoice voteToChoice = dao.findByProperties( + VoteToChoice.CHOICE, choice, + VoteToChoice.VOTE, eVote); + + // Create new vote if needed + if (voteToChoice == null) { + voteToChoice = dao.create( + VoteToChoice.CHOICE, choice, + VoteToChoice.VOTE, eVote); + } + // Update vote value + voteToChoice.setVoteValue(choiceValue.getValue()); } - eVote.setChoiceVoteToChoice(this.getVoteToChoices(voteDTO - .getChoiceDTOs())); } /** @@ -166,6 +200,7 @@ * @param choiceDTOs La liste des dtos choix * @return la liste d'entités VoteToChoice */ + @Deprecated private List<VoteToChoice> getVoteToChoices(List<ChoiceDTO> choiceDTOs) throws TopiaException { List<VoteToChoice> liste = new ArrayList<VoteToChoice>(); Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -29,20 +29,32 @@ */ public class PollAccountDTO implements Serializable { - private String id = ""; + private String id; - private String accountId = ""; + /** UId of the account used in urls **/ + private String accountUId; - private String votingId = ""; + /** Name of the account **/ + private String votingId; - private String userId = ""; + /** TopiaId of the user linked with the account **/ + private String userId; - private String email = ""; + /** Email of the account **/ + private String email; - private Double weight = 1.; + /** Weight of the account (already defined in the vote) **/ + private Double weight; - private Boolean hasVoted = false; + /** + * Determine if the account has already voted (used for vote page) + * Seems not necessary to manage vote, no constraint define on changing + * existing vote if it's the correct user or account. + **/ + private Boolean hasVoted; + + private String votingListId = ""; private String personListId = ""; @@ -53,10 +65,12 @@ } + @Deprecated public PollAccountDTO(String id) { this.id = id; } + @Deprecated public PollAccountDTO(String votingId, String email, String personListId, String votingListId, String userId) { super(); @@ -75,12 +89,12 @@ this.id = id; } - public String getAccountId() { - return accountId; + public String getAccountUId() { + return accountUId; } - public void setAccountId(String accountId) { - this.accountId = accountId; + public void setAccountUId(String accountUId) { + this.accountUId = accountUId; } public String getVotingId() { @@ -107,10 +121,12 @@ this.email = email; } + @Deprecated public Double getWeight() { return weight; } + @Deprecated public void setWeight(Double weight) { this.weight = weight; } @@ -127,26 +143,32 @@ this.hasVoted = hasVoted; } + @Deprecated public String getVotingListId() { return votingListId; } + @Deprecated public void setVotingListId(String votingListId) { this.votingListId = votingListId; } + @Deprecated public String getPersonListId() { return personListId; } + @Deprecated public void setPersonListId(String personListId) { this.personListId = personListId; } + @Deprecated public List<VoteDTO> getVoteDTOs() { return voteDTOs; } + @Deprecated public void setVoteDTOs(List<VoteDTO> voteDTOs) { this.voteDTOs = voteDTOs; } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -17,8 +17,8 @@ package org.chorem.pollen.business.dto; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; /** * Classe DTO représentant un vote. @@ -43,8 +43,8 @@ /** the vote is anonymous or not **/ private Boolean anonymous = false; - /** topiaId of the account who has voted**/ - private String pollAccountId = ""; + /** account who has voted : only defined if anonymous = false **/ + private String pollAccountId; /** QUICK FIX to have pollAccount votingId **/ private String name; @@ -62,17 +62,20 @@ private String votingListId = ""; /** choices made by this vote **/ - private List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>(); +// private List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>(); + private Map<String, Integer> choiceValues; public VoteDTO() { } + @Deprecated public VoteDTO(String id) { this.id = id; } - public VoteDTO(String pollAccountId, String pollId, String votingListId) { - this.pollAccountId = pollAccountId; + @Deprecated + public VoteDTO(String accountUId, String pollId, String votingListId) { +// this.accountUId = accountUId; this.pollId = pollId; this.votingListId = votingListId; } @@ -93,10 +96,12 @@ this.weight = weight; } + @Deprecated public String getComment() { return comment; } + @Deprecated public void setComment(String comment) { this.comment = comment; } @@ -121,26 +126,32 @@ this.pollAccountId = pollAccountId; } + @Deprecated public String getName() { return name; } + @Deprecated public void setName(String name) { this.name = name; } + @Deprecated public String getUserId() { return userId; } + @Deprecated public void setUserId(String userId) { this.userId = userId; } + @Deprecated public String getPollId() { return pollId; } + @Deprecated public void setPollId(String pollId) { this.pollId = pollId; } @@ -153,19 +164,34 @@ this.votingListId = votingListId; } - public List<ChoiceDTO> getChoiceDTOs() { - return choiceDTOs; + public void setChoiceValue(String choiceId, Integer value) { + getChoiceValues().put(choiceId, value); } - public void setChoiceDTOs(List<ChoiceDTO> choiceDTOs) { - this.choiceDTOs = choiceDTOs; + public Integer getChoiceValue(String choiceId) { + return getChoiceValues().get(choiceId); } - public void addChoice(ChoiceDTO choice) { - if (choiceDTOs == null) { - choiceDTOs = new ArrayList<ChoiceDTO>(); + public Map<String, Integer> getChoiceValues() { + if (choiceValues == null) { + choiceValues = new HashMap<String, Integer>(); } - choiceDTOs.add(choice); + return choiceValues; } +// public List<ChoiceDTO> getChoiceDTOs() { +// return choiceDTOs; +// } +// +// public void setChoiceDTOs(List<ChoiceDTO> choiceDTOs) { +// this.choiceDTOs = choiceDTOs; +// } +// +// public void addChoice(ChoiceDTO choice) { +// if (choiceDTOs == null) { +// choiceDTOs = new ArrayList<ChoiceDTO>(); +// } +// choiceDTOs.add(choice); +// } + } \ No newline at end of file Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -18,7 +18,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.PollenContextImpl; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataUserConverter; import org.chorem.pollen.business.dto.UserDTO; Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -36,7 +36,9 @@ * * @param choice le dto choix * @return l'identifiant du choix + * @deprecated only used for tests or internal */ + @Deprecated public String createChoice(ChoiceDTO choice); /** @@ -44,7 +46,9 @@ * * @param choiceDTO * @return true si le choix a été mise à jours + * @deprecated only used for tests or internal */ + @Deprecated public boolean updateChoice(ChoiceDTO choiceDTO); /** @@ -62,7 +66,9 @@ * * @param choiceId l'identifiant du choix * @return le choix + * @deprecated only used for tests or internal */ + @Deprecated public ChoiceDTO findChoiceById(String choiceId); /** @@ -71,7 +77,9 @@ * @param choiceName le nom du choix * @param pollId l'identifiant du sondage * @return les choix + * @deprecated never used */ + @Deprecated public List<ChoiceDTO> findChoicesByName(String choiceName, String pollId); /** @@ -79,6 +87,8 @@ * * @param properties filtre sur les champs de la table choix * @return les choix du sondage + * @deprecated only used for tests */ + @Deprecated public List<ChoiceDTO> selectChoices(Map<String, Object> properties); } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -21,6 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataPersonListConverter; import org.chorem.pollen.business.converters.DataVotingListConverter; @@ -61,8 +62,8 @@ public ServiceListImpl(PollenContextImplementor context) { this.context = context; - context.getConverter().preparePollAccountConverters(); - context.getConverter().prepareVotingListConverters(); + this.context.getConverter().preparePollAccountConverters(); + this.context.getConverter().prepareVotingListConverters(); } @Override @@ -204,7 +205,7 @@ // Update change in dtos account.setId(eAccount.getTopiaId()); - account.setAccountId(eAccount.getAccountId()); + account.setAccountUId(eAccount.getAccountId()); personList.addPollAccount(account); } catch (Exception eee) { Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -158,5 +158,7 @@ public ChoiceDTO getNewHiddenChoice(ChoiceDTO choice, String votingId); + public void createChoice(PollDTO poll, ChoiceDTO choice); + public void deleteChoice(PollDTO poll, String choiceId); } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -58,7 +58,9 @@ * * @param pollAccountId le compte a creer * @return true si le compte a été supprimer + * @deprecated never used */ + @Deprecated public boolean deletePollAccount(String pollAccountId); /** Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -22,7 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.PollenContextImpl; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataPollAccountConverter; import org.chorem.pollen.business.dto.PollAccountDTO; @@ -105,7 +105,7 @@ // Identifiants du compte String id = UUID.randomUUID().toString(); - pollAccount.setAccountId(id.replaceAll("-", "")); + pollAccount.setAccountUId(id.replaceAll("-", "")); pollAccount.setId(entity.getTopiaId()); converter.populatePollAccountEntity(pollAccount, entity); Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -25,6 +25,7 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.converters.DataPollConverter; import org.chorem.pollen.business.converters.DataVotingListConverter; import org.chorem.pollen.business.dto.ChoiceDTO; @@ -51,7 +52,6 @@ import org.chorem.pollen.business.persistence.VotingList; import org.chorem.pollen.business.persistence.VotingListDAO; import org.chorem.pollen.business.utils.ContextUtil; -import org.chorem.pollen.business.PollenContextImpl; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.persistence.PersonToListDAO; import org.chorem.pollen.common.PollType; @@ -82,13 +82,13 @@ public ServicePollImpl(PollenContextImplementor context) { this.context = context; - context.getConverter().preparePollConverters(); - context.getConverter().prepareChoiceConverters(); - context.getConverter().prepareVotingListConverters(); - context.getConverter().preparePollAccountConverters(); - context.getConverter().preparePreventRuleConverters(); - context.getConverter().prepareVoteConverters(); - context.getConverter().prepareCommentConverters(); + this.context.getConverter().preparePollConverters(); + this.context.getConverter().prepareChoiceConverters(); + this.context.getConverter().prepareVotingListConverters(); + this.context.getConverter().preparePollAccountConverters(); + this.context.getConverter().preparePreventRuleConverters(); + this.context.getConverter().prepareVoteConverters(); + this.context.getConverter().prepareCommentConverters(); } @Override @@ -803,13 +803,51 @@ choice.getName() + "#" + votingId); hiddenChoice.setHidden(true); hiddenChoice.setValue(choice.getValue()); // ?? - hiddenChoice.setPollUId(choice.getPollUId()); - hiddenChoice.setVoteId(choice.getVoteId()); // ?? +// hiddenChoice.setPollUId(choice.getPollUId()); +// hiddenChoice.setVoteId(choice.getVoteId()); // ?? hiddenChoice.setValidate(false); return hiddenChoice; } @Override + public void createChoice(PollDTO poll, ChoiceDTO choice) { + TopiaContext transaction = null; + try { + if (log.isInfoEnabled()) { + log.info("P:[ createChoice ] : pollUId = " + poll.getPollUId() + + " _ choiceName = " + choice.getName() + + " _ choiceDescription = " + choice.getDescription()); + } + transaction = context.getRootContext().beginTransaction(); + + // Get the poll entity corresponding + Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction). + findByTopiaId(poll.getId()); + + // Create the new choice entity + ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction); + Choice eChoice = context.getConverter().convert(choice, + dao.create()); + + // Add the choice in the Poll + ePoll.addChoice(eChoice); + + transaction.commitTransaction(); + + // Update changes in dtos + choice.setId(eChoice.getTopiaId()); + poll.addChoice(choice); + + } catch (Exception eee) { + context.doCatch(transaction, eee, + n_("pollen.error.servicePoll.createChoice"), + poll.getTitle(), poll.getId()); + } finally { + context.doFinally(transaction); + } + } + + @Override public void deleteChoice(PollDTO poll, String choiceId) { TopiaContext transaction = null; try { @@ -819,7 +857,7 @@ } transaction = context.getRootContext().beginTransaction(); - // Find the comment + // Find the choice ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction); Choice eChoice = dao.findByTopiaId(choiceId); Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -22,7 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.PollenContextImpl; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataPreventRuleConverter; import org.chorem.pollen.business.dto.PreventRuleDTO; Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.PollenContextImpl; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataResultConverter; import org.chorem.pollen.business.converters.DataVoteCountingConverter; Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -21,6 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.pollen.business.PollenContext; import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.converters.DataUserConverter; import org.chorem.pollen.business.dto.UserDTO; @@ -30,7 +31,6 @@ import org.chorem.pollen.business.utils.ContextUtil; import org.chorem.pollen.business.utils.MD5; import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.framework.TopiaQuery; import static org.nuiton.i18n.I18n.n_; /** Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -90,4 +90,6 @@ */ public List<VoteDTO> selectVotes(Map<String, Object> properties); + public VoteDTO getNewVote(PollAccountDTO account); + } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -29,14 +29,25 @@ import org.chorem.pollen.business.dto.PollDTO; import org.chorem.pollen.business.dto.UserDTO; import org.chorem.pollen.business.dto.VoteDTO; +import org.chorem.pollen.business.persistence.Choice; +import org.chorem.pollen.business.persistence.ChoiceDAO; +import org.chorem.pollen.business.persistence.PersonToList; +import org.chorem.pollen.business.persistence.PersonToListDAO; 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.PollenModelDAOHelper; +import org.chorem.pollen.business.persistence.UserAccount; import org.chorem.pollen.business.persistence.Vote; import org.chorem.pollen.business.persistence.VoteDAO; +import org.chorem.pollen.business.persistence.VoteToChoice; +import org.chorem.pollen.business.persistence.VoteToChoiceDAO; +import org.chorem.pollen.business.persistence.VotingList; +import org.chorem.pollen.business.persistence.VotingListDAO; import org.chorem.pollen.business.utils.ContextUtil; +import org.chorem.pollen.common.PollType; import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaQuery; import org.nuiton.topia.persistence.TopiaEntity; import static org.nuiton.i18n.I18n.n_; @@ -58,7 +69,7 @@ public ServiceVoteImpl(PollenContextImplementor context) { this.context = context; - context.getConverter().prepareVoteConverters(); + this.context.getConverter().prepareVoteConverters(); } @Override @@ -257,6 +268,7 @@ if (user == null) { return result; } + // Initialize the default account for user if (user.getFirstName() != null && user.getLastName() != null) { result.setVotingId( user.getFirstName() + " " + user.getLastName()); @@ -267,6 +279,8 @@ } else if (user.getLastName() != null) { result.setVotingId(user.getLastName()); } + // Link the new account with the user + result.setUserId(user.getId()); return result; } @@ -349,4 +363,162 @@ ContextUtil.doFinally(transaction); } } + + @Override + public VoteDTO getNewVote(PollAccountDTO account) { + VoteDTO result = new VoteDTO(); + result.setWeight(1.); + result.setPollAccountId(account.getId()); + return result; + } + + private void updateChoiceValues(TopiaContext transaction, + VoteDTO vote, Vote eVote) throws TopiaException { + + VoteToChoiceDAO voteToChoiceDAO = + PollenModelDAOHelper.getVoteToChoiceDAO(transaction); + + ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction); + + for (Map.Entry<String, Integer> choiceValue : + vote.getChoiceValues().entrySet()) { + + // Find existing choice + Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey()); + + // Find existing vote + VoteToChoice voteToChoice = voteToChoiceDAO.findByProperties( + VoteToChoice.CHOICE, choice, + VoteToChoice.VOTE, eVote); + + // Create new vote if needed + if (voteToChoice == null) { + voteToChoice = voteToChoiceDAO.create( + VoteToChoice.CHOICE, choice, + VoteToChoice.VOTE, eVote); + } + // Update vote value + voteToChoice.setVoteValue(choiceValue.getValue()); + } + } + + private PersonToList validateForRestrictedPoll(TopiaContext transaction, + VoteDTO vote, PollAccount eAccount, Poll ePoll) + throws TopiaException { + PersonToList person = null; + if (eAccount == null) { + //throw exception : not allowed + return person; + } else { + PersonToListDAO personDAO = + PollenModelDAOHelper.getPersonToListDAO(transaction); + + String pPoll = + PersonToList.VOTING_LIST + "." + VotingList.POLL; + + TopiaQuery query = personDAO.createQuery(). + add(PersonToList.POLL_ACCOUNT, eAccount). + add(PersonToList.HAS_VOTED, Boolean.FALSE). + add(pPoll, ePoll); + + person = personDAO.findByQuery(query); + if (person == null && !ePoll.getAnonymous()) { + // throw exception : not allowed + return person; + } + } + return person; + } + +// @Override +// public void createOrUpdateVote(VoteDTO vote, PollDTO poll) { +// TopiaContext transaction = null; +// try { +// PollType pollType = poll.getPollType(); +// +// //PollAccountDTO account = vote.getAccount(); +// +// if (log.isInfoEnabled()) { +// log.info("P:[ getNewVote ] : " + +// "accountName = " + account.getVotingId() + +// " _ accountUId = " + account.getAccountUId() + +// " _ pollUId = " + poll.getPollUId() + +// " _ pollType = " + pollType); +// } +// +// transaction = context.getRootContext().beginTransaction(); +// +// VoteDAO dao = PollenModelDAOHelper.getVoteDAO(transaction); +// +// Vote eVote = dao.findByTopiaId(vote.getId()); +// +// if (eVote != null) { +// +// updateChoiceValues(transaction, vote, eVote); +// +// // Don't touch to pollAccount for existing vote +// } else { +// +// Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction). +// findByTopiaId(poll.getId()); +// +// // Retrieve existing account +// PollAccountDAO accountDAO = +// PollenModelDAOHelper.getPollAccountDAO(transaction); +// PollAccount eAccount = +// accountDAO.findByTopiaId(account.getId()); +// +// PersonToList person = null; +// if (pollType.isRestrictedOrGroup()) { +// person = validateForRestrictedPoll(transaction, vote, +// eAccount, ePoll); +// } else { +// if (eAccount == null) { +// // Create new Account +// eAccount = +// accountDAO.create(context.createPollenUrlId()); +// context.getConverter().convert(account, eAccount); +// } +// +// VotingListDAO listDAO = +// PollenModelDAOHelper.getVotingListDAO(transaction); +// +// VotingList list = null; +// if (ePoll.sizeVotingList() == 0) { +// list = listDAO.create(); +// } else { +// list = ePoll.getVotingList().get(0); +// +// } +// } +// +// // Link with existing connected user +// if (account.getUserId() != null) { +// UserAccount user = +// PollenModelDAOHelper.getUserAccountDAO(transaction). +// findByTopiaId(account.getUserId()); +// +// user.addPollAccount(eAccount); +// } +// +// eVote = context.getConverter().convert(vote, dao.create()); +// if (!eVote.getAnonymous()) { +// eVote.setPollAccount(eAccount); +// } +// +// ePoll.addVote(eVote); +// +// +// } +// +// +// +// } catch (Exception eee) { +// context.doCatch(transaction, eee, +// n_("pollen.error.serviceVote.getVote"), +// poll.getTitle(), poll.getId()); +// } finally { +// context.doFinally(transaction); +// } +// } } \ No newline at end of file Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties =================================================================== --- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -7,6 +7,7 @@ pollen.error.serviceList.createAccountForPersonList= pollen.error.serviceList.deleteAccountFromPersonList= pollen.error.servicePoll.addComment= +pollen.error.servicePoll.createChoice= pollen.error.servicePoll.createPoll= pollen.error.servicePoll.delete= pollen.error.servicePoll.deleteChoice= @@ -19,6 +20,7 @@ pollen.error.servicePoll.updatePoll= pollen.error.serviceResults.importPoll= pollen.error.serviceUser.createDefaultAdmin= +pollen.error.serviceVote.getVote= pollen.error.serviceVote.getVotesByPoll=Unable to load votes from poll with uid \= %1$s pollen.error.serviceVote.hasAlreadyVoted=Unable test vote existing for account with votingId \= %1$s and poll with uid \= %2$s pollen.exception.load_configuration= Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties =================================================================== --- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -7,6 +7,7 @@ pollen.error.serviceList.createAccountForPersonList= pollen.error.serviceList.deleteAccountFromPersonList= pollen.error.servicePoll.addComment=Impossible d'ajouter un nouveau commentaire cr\u00E9\u00E9 par %1$s pour le sondage %2$s (%3$s) +pollen.error.servicePoll.createChoice= pollen.error.servicePoll.createPoll=Impossible d'enregistrer le sondage %1$s cr\u00E9\u00E9 par %2$s pollen.error.servicePoll.deleteChoice= pollen.error.servicePoll.deleteComment=Impossible de supprimer le commentaire ayant pour identifiant "%1$s", appartenenant au sondage %2$s (%3$s) @@ -18,6 +19,7 @@ pollen.error.servicePoll.updatePoll=Impossible de mettre \u00E0 jour le sondage %1$s (%2$s) pollen.error.serviceResults.importPoll= pollen.error.serviceUser.createDefaultAdmin=Impossible de cr\u00E9er l'administrateur par d\u00E9faut \: %1$s (%2$s) +pollen.error.serviceVote.getVote= pollen.error.serviceVote.getVotesByPoll= pollen.error.serviceVote.hasAlreadyVoted= pollen.exception.load_configuration=La configuration n'a pas \u00E9t\u00E9 charg\u00E9e correctement \! Veuillez v\u00E9rifier le d\u00E9marrage de l'application. Modified: trunk/pollen-business/src/main/xmi/pollen.zargo =================================================================== --- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 11:15:12 UTC (rev 2955) @@ -1,90 +1,94 @@ -PKO�X<pollen.argo}Tˎ�0��W >�LFU�a�tѪUG�v9pW�1�4�����v2$�����uMe/��B1n��e�Tu'Z�a�T[�!�FB��CSW����)�����C�晼|!���ڞ�@���(<Q�0�M�V�5�� +PKΕv<pollen.argo}Tˎ�0��W >�LFU�a�tѪUG�v9pW�1�4�����v2$�����uMe/��B1n��e�Tu'Z�a�T[�!�FB��CSW����)�����C�晼|!���ڞ�@���(<Q�0�M�V�5�� �F�9F����??��@ �|�sը�D����A/4 -z��z�`�H�-.�-M�{G�S3*<"C}II�(�i��7��rQ#e3eRy�G�$�Rcޑ�R}���y�A��h�+����aT&U`����z�N��j��8���C�qw���;8b�Z7j�J!D{���y�^v`o;(��Z��+����s����vaF87�1ۜ[f3��C�Kʛ���*����eIJ(�Z���&��b�pږ�o����>쿽�E�h8����[�K`[ڹ��Av��PK-��\��筟�� �}���s�A��^z�2�u�RȞ��pF�X������|��b��wc�N���]�>�5������u/tB�L��O�������̎ۖ�<�PKptB�PKO�X<pollen_DC_Pollen.pgml�]k��6���_�۸�O��!J����_��d�d��b�P�j�ﺭ�3����/%�z�E��i���E�m[r7�J����w��e>�-W�x��]9�h1�'������>\���^����~��F�S~�o�����ϣ�䇫�zr��H?�D��r��N�-^N���4����&�p�_�V�p=�{�^n���2��̮~����y�Z�o���KF//}��������DŽ�o����OO��K�q��N�u밋�F�k�D�/����1�ϣ��w���w�e�y�}�a6u�W���oI��"�7#��r|�/���5\?��f����S8_E?���2���^�ϳ��{��5Z�ɯ]�/��������f������e����P��ni�MO����}��q<���/�>��Q�v���x����ŏ�p������w��ٗp�~������e4^���<*L�U6%���!������v����d��/p��;��l��N�ɾA�j`�q9�7�a�F���"�U���!m���VK�R6!�_�o67��WL;4�j��w���_2�� ���f �h -�1���ߓ�30dՈ3���YG���@�8<a.0��=j��8F���?y�����yO�wg�p>��Hc[��c<�Ho&߽��o*�����j={��í��E�����2_����ߝ���e�����>��}`I�q������`B3��g_`:�����qP�0�@�:y6ތ��f�.�*E8rX��{�p��_^������]�s��sص*�9�{� -s�.�q���n!<�a.�5�q~[�x�p��ܦ`��<��l��Qc� -���5�^�/�:��A��~�|���CѸ��� -]����\����QFv.����h-�(�c�˹gu9��K���˕�)�@��3]���9� -���S����2ܒ�'����x�YL�<������A0����%^s���Mk�d���vq�����p6�.?���L�l0�b�~�Zy�� -�0�y�A܄&F�C�{ 7��X�}�*M ��k�؊��ɚ���c�2�� &dT+��51hb��ʦ��41B�qx�80�Ak��!A+�|&������h���!ӚX�<o��*̵�@G�&&�9��^�#B4hs������A��ݧ�hkbȴ&�2��3�W��E1�Z�@� -���N�9UL�t�|4u��=��T1�"�(�C��2 -�U���F�ALD�C��9�u�k�Z}����1m`�ڻE�i�\��h���V��9�qC�=�{6E�ՠ -)�ЖV��G;���3��&|�mϣpQ��W�9�,�,|�Z�b� � -,ܯA��dHh�`��@BBÀ�^B#����u�7#��R`���0{��[����|G�`K�m �j�ޖ8�e[:y:Kgd4��X�:���lF�DC�L��d����g�aȹ������h����\�H<1����2��ު6��Hc�O�>�9�U��-=K91�q�4��#- -ړSq�r�i�C���r��[�3�lcK&w�p�������&9:��ױ�����h�p�[*�X�^����$���_9gЭ0�R�BD�E�����iNy�����vAJ�C��To�o -Ⱥx�PJ�����s<G���1O�S�8�FP�Œ�"�k�k �P�PG�I��j��t3���=D�%�cD~y�h��XG�hYxP 8�C -4|<�W�D3���V��]`E:�{vj�7���|m�(:�C)gp]a���K�Y}����W�,�Fx��2�M�^_2�:L=��u�ȿ��h���a^��dP>��iu�1���ņ��W/9Y����Lq笼��U�8="�W졦�?>�MR��T_TA��NC�2�"�(����6�Q���#��a���\�wm�.�̙�rj�b.�\�W����fDi�����ڊ�{diR���m)�X�3�((���+戱�9рV�ݣ?��"U��@4��g�+�T1���0����@7T̥�WT̑RŜH�%�:�t�b�s�a�٪r�?1[7�F8��]�#ت�V�����!ҋp�Eq�E<�kUs�YfCQ�c����9b�jnK(|o�n�.Bў��Es���><����ő�ֱ�9��%����ʷT���fN��^�C%W�^ho�%RŜ��s����-7��>�_ӱ'�n���H�!%=���==&w3CzK6�!'e��^=�P�m�C+�&i{�"�|_-����jV�)�I�T,ӷ[���z�!�W<�Ck��`�e�A�i��� -=�I;�@�u=�c�\ŋ:=��@��1k��1�G����V��p��ch_��d6T�b��m=��@�a�.�~�[�ÀM��[O���èr7������1��Ck7�zL�J@+T��Vv��yth�W�x<KA�n?6��f�t�b�_o���c�\�?T< -��q]��=����~�'Q�L����d��p����7�$��i��_���ye{i����ȿ�#z��8��߬���/��M<]���.�����Vz������c�_������Ba -�@\+P�y3_�^y �K�W<A��Mp�ײ�B�zXLn�x]�`�j| -�^�VLA����>�`㸻��~&ӯ�D�9�(�au$,$�ң�3��?��n������<3E��+3����;^^0�⪠��|EP��r�o���ݞU���Y{�;�_^�џ8�1��������.�V%���ʲ�Z���S���V�)[���@�`'˒�T���l˓@hcYZ�S����V�3怘��Rhb�%�:�cH5N1��e1�`�"W!]�mw�Ue��.�oF.ƻ�F+�n=���E3��e)"���Uq���lֵ���n2T�1`�(ݢ��a��W&{���y��4�ue��K�+�i�Y=�cI��%����ʷT�|зR�����\4�,��� -ܡ���ƭк���[Z�������ɶ��E�6�ɄM����A�D{���ߌf3�2���{L�2�:�ɪr��xW�L�;b���u,�y��J��e2��e2���P��<���<��0������l�}E�=U��v�� �p���� L�t��c?����Z�˜����̥rw��B���Q�;RE�Jw?�aZ��[K�Z���Ɖ�o-�;Kĭ��D÷��e���Q���! -p������5�1ը�[���d�>Oj��4��yG�����;�]� ���UU��d�p���E���҉���fX�I�F�{1���i���<-(��%�`�k�r�#��B�F{���X��d@�J�J���@*Q+��h5��3�R��4��Z�}|d�ZP*SC��Y�:�t�Pm۪�S\ 0[���r���(��EQ��2�@*X��%@�Y��y{�4A�J��� L����Z���ѮZ�V��hE���t8�nM�P5�����:V��t�d:�:\����@*^�#�#�L��a����lBMj�F@��a�Ú��0=�Mq�[mMUP��2��n���p`c�X7��t)��$*������*~�ݵ��*}9���\���*�_��6RgW����Λ��ҳA����o��)�$>����ԣ�8!S����k�H�PI%����θ�#;�� -��"!B�TBфjۙ6�˄ ��/�h -�1�!��@�8�0�����0��B&��uB!��� 3R0�L��Z�J!� ���3�qU -�B\[�E�jM���Ω���fQ�a:�E!�Tܢ-rL�j�[�s��ǹ��8Q%�<Z���:�*=�QnpUz����5��L2��V�5�L�=�)Фh3��{�k�Z�#�BM��2��p�r -u�Y?���z�r�J� �E!6��z�Љ�8�w�h�vA����f�����*ak�AӰ��ٕ^'���a�u#đmK� ��' o| -�� -�����{P�غ�E�o�l|�+��=g2��I0��a۳���7])vE�b.�\/�Ge9Ϥ����\UzD�u[��G_�2����,UppdŅ�+8X��"1���ض��۞�$r�S��*d -��;����E��f�!�y@�����PH'8ʡ���Ώ�����ͼ��/�l�3 r�� gnW�� �Z���O!�q���Y3��sOE�v2��K�8��t�~Ɠ�x&�Ɛ���ئ�?��I�N��T� -�[p�M�8z�o�t4���-��N"�;%{Nq�j�z�jv5�V̈́'��"���U����_���s���m-��ՈS`�� -?)�KC�&n�n�xm�^�E;�g_M�a�Y56��N��>��"�4{i��W�v�g�},�x������ -R.�0���X@�O�ѭ����E�D,خ`N3Y����$x٘/������i�!�0[�tZ�������\�%KfFXh3z9���E����&�v)�JRz��X�j:�SJ����]O��z8o��R:-I�B�7q��Hץ�d�����@<D�j�i�#��"u,�p��zT�����ыpT����z�k::��2���G<x�C�}���ѷ�����D -]�5���k�Е��4�5G�k+5t� v (�}lv�s���|��n�F@K���]�A�v�9.�g�[��~l����n��vvRY���^�I����5������M�>Y3������q�8�X���n��m�3�-��f�]M�n��k�P�JB-������L�̒�g�tÌ U���}2ᶋUL��p).��˦`�X�$��R$�Hxc��� V��W�U�$V �$��aˡ�bU�H�̊Tit#�E�����[k�g& Ubt#�x���Y>Yׄ*�8Q>����e��#�}����������U��鲿�b��o�6��Yܰ��UJC�.�JC�M�Sq�=`�]UZ�Q�jR -5��`���m5�k�T�)��j���(�x��%ެl9��/��&��E�<��;��.����5'Y�e��J�k���#�{x�6�i�t�Q��z�x�6�9���i�7�eų��M+_����*���mZ7�z����[L�Y�#~��^��6|�/��&b�5� M�Hh�4`����9=�o������&���\2�á��j�&��}88��}����I.�t��%}ͺ9���t� -}k9����g�پ�L��0��q��[���1���8c�i��R��M��K� �X�����?4�s����\�� -�9'�'�) -�d-�ma℞b-�7�l��9U"���e��y}�):w�J��ѹ�kt�!��2�y:t�Ι�_~����1>�shG���y>t����tS��v6w���$^J����S�Q\O�"���b������qތ�c�I��Zj��̼os������r��XA�� -���U� -rK[��l�G�`=�϶��,�m�N��oBk|������Ch�� aоh�ư����IG9����8��}�F+�c�v>pͶ�H�������-���2�К����n� -Rm�a���Tvi��P��@�_�E{���l������<e�;�ԠCt6h��l�����c{�Φ��t6�=)����=>�y��u� �zE�)Фhh��(|���}/]�i5�Ю�����o��[�p��[�6�~$q=l�4���7|U�����@�Տ���]&�mEg�Mߞ�����{��a`�����9� -9��Nߞ�ؐc>d���7]l���ur��ņ�!9�����4F�'���*�T܇�DŽ�]��;�}����������&t2�)d -��)�x�ƊÕt)w7�s�{t�^��s��tN�'����<�3��q:�;I��! - ���s��t�$�����ιL:�4�q��,5W?�z�vN�y�>��9�VD���^� =�7��l��5����l�뀎�&�P�@�ox{��&���� ��M�j�p�,^�r=>w�i�f��m>���at�!��=fs��l�l�����J�H t�j�\���9�s2W�7O��@��o���?'�s�bg��C�_�r=2wбzf��]>�m&g+ٜ:9ېι=�swkf�t��7�������9w�s -�7N��~ӹ��|�y:�t�������*��TqJ��]�?J���5<Զ�s'��Aj<�w�������K��+�h�# -�X���!�*�N��X'��>�g��Y繟I�/ �:@d�Y'�6��HͲ��?�����v�u��r�v���.mZkw�mJB�"�(d�5L<2yď!l -����y��0���=��P>wȬJ���9{�e;����y���l����=�L�o\ȳ�\�V^zJ��'r���ֺ���o���6��`HI���k�k�2����PK�ʜ5RŋPKO�X<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J -@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKO�X<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKO�X< -pollen.xmi�]k��8��>��5�U=S����ҕɖ��[S5I�&��~ κ��'��p�6F`��"1�;����+��{ӫw�����=�(��`���N\w38���샿�l�����z���Ͼ?�����]��.����G�Im��v���'��w��O����}v߿�;�@{&)3Q{P�Y���_f� -w��Ͳ�[|���������n��`��$��u�~߇Q���a��C���G���,C���Oo9�o�����/�F=������B2�/گ�>�q��3�a�>��}.�sQ� �C�������/�A����G~ۯ��ʿZ�@��ǯ/�cz��C�f���9}۟�;淟Ņ�����^DXH� �$}��#ӦN��ݬg�2��\T�sQ�溤ێ��Q�����!p~= -��2\٣>��������=t|�w�ʾ��.��7�aR����^��K;N"���{�ӫ�w0��"�-t���7������{�f��-٦��$��@���,A�;=}V����n��pA�@Ņ���릇$?��^o���~�������x�Y�ݗ�T��T�?��}�N����J¿��~ѯ���_�=�SQJge��8��$خ�bO�M�� D��((���Y�՜oa��|L/�^`/�٤��9���1^"WF{�8o-�Ӎ��c�8O�"��`� ���6e�u5��]�ٯ�Y}���SN�m�'?�O�{�;8����Ē}�$�3DK�$�� K{+�au����|��<a^��ܴU5S�x��qd�dU(O��q_�S�h�A��:��$�|���'�\��(f> -4�t��a��ew��x�_����i�� ��3� ��I�����>��`�>&�&��T%r����2��Qv���.��)���fŠ9����4���?������������\�:��v�ߩޔ=�nv��?WF� �=�KU�F��=Yg��?58gM�r9W��j�I�jQ�M�^$�� --���!�����{�?6��N����iK�+�i��4p���h@L��]״��d�A6C�\�h��&x;?5M&� ��t98��Cqqx<@ǯ��gw�f1n� -{�-��_Qx�Sc7�#$�����s��ֺN(�`����?N��-�g���C�{��o^n��A�+~o��6[�OS��V�ȅы�>�3tQ���nOO a)m\�kY�,���l�][b>P<MS%eQ����������Q�Y̮Du�DI�`.ݓ�F --n$b��4��8�P-b��ę���Uu|���U�5%U�4O�dU��J���F��1���B�LA��� -��{���X֟,4�C��@7���/�t��2r�).n����0��Ck�����a�� -�0D:�%��i�'�[��]z��^�K��fD�%�#�8�H��P������gtWv3����Dӓ\�TP�]b�Ar��E���?5�"w W ��b�b��b���������S�\�*��:�+���Ʃwx���TK�sѹɋ#S�}^:�y�th����(3yѡ��%�z�1�]M1udT1y -"y��AP�҉�����%�s -�����i�~r���"���1�\�A��Nr�HtZ}�QɅ�.n���l����+7�}��rgk��WVq51�����0�{�j��7#�.nF2�R\\I�!%�t� f��u�53(���\;+7b5�vV�/�$i�F3��-'<|c�UF�V��H��r�1֡�����8����9$��GH1�#�7Wl�ÔJ���:Ŧj┉�D��8� [�C�#���@X3@F�v+H>7] ��[I1��.9P�}�!��YcI~͵^a�Cr�����eÔ$��K����)D��f��R�o��qcl�2_;���v�3#e�)�����]�ud�bV�?���7HTnjl�D,.�oa�!v��_�'Q�^w�[U��1�N���0�łT�8D�p(5`m��Xil��O�M��D:�60L�|X�� -ٍ�E�m�QRܲd��"��t;e#a��)<��%b����=H�H*5��ZH}!V��A��b�t6��I�RjH����]��'Z�<)ψ����_.�IF2�����T4������D�H9 3����wv���K��(N>N:�H������ɥS'���,�l8�˔��sU�����69�u`�@�=:y��'?�3�LF���|�,zE�] N�z�[��5AZ6\]vm���Y��@�=�-�pD�����Pjp��@�р���w��s���$��9���G�Ğ|�d&��'�Ӟ�ac���x��B����k��T(w���ʗ J�����7:2>?�_��G�,9*5�IЀ)]�G�l��$T1tIґ�p -��+ -{�8��.>��»,�*���i���Y5<ͳ%[�2j�(l�dGQ���a?�N�0�:��"�|�A�kz@���[�j�j\��g$v|;�ޣ�a��@����'��a -j�9K�%O⌯��fuȪ'� y�R�֎d��(�&�u�,�W�*�e-�JP\�����m�^9(��q�%"�mH��Kܧx�7&�u���pA���TjpC>&�Cs�@n�q2�ꐉI�yrR���i����O9��T����1�r�#炷� ��B��N�[�� -� e�'Im?=��[ȍ|��y�vk�<Uj�����W�����G{�5�D��f4Ɲ�i��0%:R���y��Ԁ���kh���� I��� `�����ɥS'���K.����g���Xi��d�=L�7D��F�x��f�H���h:����]�p��o��@���xt -APN��G�7���>*.No��5�����X;g">���T�CV�&��+d�p6P�d���\@"�!e�b�ŲK -n�J����p�6��GK�=]. ��Ew�|�����;;�ȇ�X�م���I$:V���y}�R�J<#���lL pr`��]62��f|�D�)��=@�JPjpC\p�[������ǎ�zPj�37���_�&p�@,�!3�A�,�R�����H��2�M�K��V���$�0 �q˺�� �ͬJ�kB�E� -��F�u�7�g��^ꄩ�P�C�!DN�7D%W�� -��p�tWS4�Y�CN��J<�J)!܌�@$��# �y(����� ��)�PQI1+�ƨغg�747V������Û��;d�+"���U��M�`�m$^E�X�#�@{��J -nhC�phL;ζ&�1媸D22� �7.5�:4&�8`Ku�dc"�<ӸԀ5����eV������(�?����BQ��QG��ď�$��Iy��B� ����^�sِ�R�^@( ���*vg���)�;�XкX}>��.��.7%��r� -AS���nt9&�;A��ʂA,�1����]���-��t�/i��"�3U��Z��^�8�v�T����#��Pjp�qH�0][���噞c��ާ��C�-��K$'��=���taD.�8t�����X�w}����m<KB��b)Vɪ݈����s�A��u��z�:p;�Kc�gΑ$F�G��o3�̭����\��6��������6���3�0h��Fr���e9���3����H�9̞D��DI�`�������?jM$��b8�h,9��0�H���f ���cT��G�n��pF%s�%1���rO��R����GR -�v*h�MJ��jѫ#wru��5 -��.� ��a�'l�nq+���oz�k����ڐu�HA�ȵ�����&�m#Ѥ��r�W�ў2�QҰ�b�C�Z�lWIl�*�<�)h�δ���7A�@��þ7"� Ϗ>�Q����s���W�d�0ȴYy�J��X�-�V��贼�ēs�����"p+�ċ�ܚnG��[��a��F��ȕ����Ӯʂ�Mi�|���7��@f^p��k����O��HMz��Z�o`o\���r�0��ѫ#�����mv�<K��;.5p��`:I�Rѩǃ�T�4U�qCX/��{��f�Qղ�$��W�·�7�&��sFV��6*z�z����k��m_��h��HMz&9��pgk�xD�;���[�Y`�R\܌C�q���L����S[~���Gd�����^TO瘢B/�5UOV���zH�%؎j�b6Q�l�H7��M�!M8"���f�UȰ�y����U%[Ul�ɨd+d؊&:L��Q����7{'K��^���o�<G��������ˍ�"�RS]C�L�̙F6�T���B�悗�_���%C$�aO��G�����[ר�X�xe�@�%�I$k�¯���b<�,cTLCZ�4�.��d���+�W�ڿye/Cvq]�k��h>X��-7��z�$4�<J��b��HG����Q\<B9AU����T]��������r@��}ǻ>��{sV�m��1m;�U(p)��ӻ��vM��x�� -bx<�!�������O0�_�ͣ.��������]N(U�E��<7�'54ہ*R��j�F��Fq�����z W��m����,��2kͼ����1!�dm�c�8��[�߶�ĝ����۟�b�����g0�l�F}}�ym��]ڵ�T�l#���u�b�i��x�A�G��Bv�)b}�V"���|N2E{Zi<b� -�d��X��� �[����H;���Ί�yj��\�i"=$�nB����~�oD�26��`]o���e�P�|�B �ۼ�>K�����Vzq1������f-�N��Cv�ӑ����';��nZ��G��,�3לf�P=��<����:�ܥ���F�����g�� e'�.��ft�m��l��0tV����yu�R*�>�|h=���gQ!>�5?XC��V���o���ʁ�b��ڱJi��-�\;V+� -�} -�˪f�`@|T�>kͨ�ζ5�(��ޅѝ,8�*�'3�v�u*�g�:{�X;j���o#� � -�z�g> -�U����G�vY1 >*�� -�Vۆ -�y���pY���G��;�_��9����x��,�Q��%R1�Df��(S!?����i0�,�Q��iP^,�Q��% T�oê�h�Z�>SK�/1 -�؉i�ȩX<��.�ʏ�lK���R*?� -�YA�~�/ - -!#K�N��ϤB|����B��@��6����0=V�. - -nSK��6�S|*K��h��ҨМ5V�.ܧ��v1h��[��rˠb��n�0�p��V������ɪ�kR1yMF�]�%�w���]Ґfj-�+���T�N�Q�rY^�ҥT|T�\��f�Y�T���)��s�#V�#�VNJ -o��Uo����w��ˢ"Tn]��C���P\,��ˀ��T�o�m�$�{�.i��ȌG��Ӽ"�4�ˀQ�*J�A�U���*p1PbS����×���7<n��>�9\�hs��)(����BnU��E�E�jv �.�^���b�$�v��(I����Kr7.6��SS����F�#ă����PL�j�m\��qa�����]m�z�Q�L�l.*˄F�2�]�����((q`W���AA��x�8(����_�.��;��)�*�Weu����࣠Dk�?���d�x�����m=�AAU<����pPP�G���L#��~��ˮk�@sRȞl��胼�.�\��y�%�ܥ�L��#��$��X����� -�b��F��#g%�@�'A���S���ԥ�F��cW�$�<�̔؛����H~�=-�S_�ﳧet�#���=o$���z����eI0w��������L�2���G�~ ������Qϧ�@��Fe��ld2�F.�|��������:3̚�i���DA����0�Q�g;�t虊 -�Q�<ՓU�Fm��NO�$0ry"��LO�85�c���E"�ۛ������� ��?�}���PK��t���PKO�X<ptB�pollen.argoPKO�X<�ʜ5RŋGpollen_DC_Pollen.pgmlPKO�X<4�[-m��pollen.todoPKO�X<7Rp:B�pollen_profile.profilePKO�X<��t��� -pollen.xmiPK1�4 \ No newline at end of file +z��z�`�H�-.�-M�{G�S3*<"C}II�(�i��7��rQ#e3eRy�G�$�Rcޑ�R}���y�A��h�+����aT&U`����z�N��j��8���C�qw���;8b�Z7j�J!D{���y�^v`o;(��Z��+����s����vaF87�1ۜ[f3��C�Kʛ���*����eIJ(�Z���&��b�pږ�o����>쿽�E�h8����[�K`[ڹ��Av��PK-��\��筟�� �}���s�A��^z�2�u�RȞ��pF�X������|��b��wc�N���]�>�5������u/tB�L��O�������̎ۖ�<�PKptB�PKΕv<pollen_DC_Pollen.pgml�]k��6���_�-,�SWE|��:�5�W$�F�i`0T����U�;������D^R�Mˌ,�Lْ�xxyux������t�%�/&�����.�l��&�����?}�/���������?>>^������ۧ���W���_�0J���u�[:_��q��e��&�x�\-��r2��b9_ +��yr��\���Ow�x��__���^^��%�//��/< ��"�<� ���·���yo����c� +��,~I�_����c:�&�������t�����d�m���O�ߒ���D�go�7��_���k�|�<YL����x�H~X,�y�.��&�'�����k2��_��^ȿ=�!^.���2����{������}q����oz�L�|�+?�i:��y�Lv�a��Iʗ���\�8����>��?~�:�|�����+?�ߛ'�e<O�҄\�����8�������n�:-��^�}�9�����=�oF��v\^� +qX������FtU bhHk��mg��e_)�P��7ۛry�5�M����%��`c*#@�H� �d%s���A��Y5�]��,�?��q q�0��4�d�A��ß<�3�Wp�<M�Ż�e<��_侭x�1���7��^L�7���j��<M��z��%3�(�_�e��!���;Y~�˘���y�}�][ǒ���"��_8�P�L��l�5�� ������g��p��f� +���#�y���nw��k<_��߾qs> +7n�N�9Oz�Xn�Թ9�����-����e��:��ok`#n۔�㿳�b��M:?hLF��zwͻ��K�L�i�����3�̶�F������\����~K�fG�%G�,9�\��e�y�-9��K��ɒ˦�钫�S^rE�W�� ���!S4ϺA8@�~J�������������7�xf�2��&5p�wԣ���%]r���Mk��d��6F�v�O� ��7����-��n灪o(T��D�QL� +M��7�8�@~�="�&V� +�41$hb���c+Z�O$k����UhbȢ&&��UM�L:�������'��dnhb�����J�&�\C�&Vu&�L��I�5����@C�5������䔛kk��MLps#37G$���uO+O�0� +zH +�1�ĐmM,g��e�\ל,�����T ��w�m.�Ωb�E��G�EW�G��!@�,B��A��4�WMff +1��k�,D�}�_���k:7T����h����^��4�/��p4����pdܴ�;�{7E�ՠ +)����ЎG/�ل����C~���$��b�`N �=���g�U<n`�a +�T��>�����$��<�4���,���������Pܩx��38�%[��hK�P����Q������Z8C0 �ь�͢��,E3Jf d +n3�̠e>�C�e`d����2r�5�\�e�$C�#�z(#K���0��F��BJ����rnm�X�a�cd��ʉ�m˩�k1��4ӡPS+1u�-�l7��&��Yp���������8��\p�_�\6 +\�m�K�����d���+���X�^�H�HV�@�9G�9�*_X +\H@c@�E���#]��x�z�) ��އ�x?&����9��{��g��E���>TTF� ցk ��P�P'�Q�C=�P��@u�g��K��ډ�����q�L�ɼ�H8�}4|8M��0���V��.0#��ֽ;7���f:M�6�]�ء�s��g�dzt��%]->��d��;Kğ�-� +}���K�S'���x������,V�e#��[M%D7�|��d��F���-'� [97�p"��3� g�o�r�����]V$5���E��w�g�Ze�ӷ��!�o>i��#?�l�5=W�]�2�+)s6���˘+8��sa�P�����_(r6c��<p*c�T2�8�e[*"�rv��]��jKGϘ#�2�D��1w��4��Dʘ+��h5��'̘#R�\F�0��?��Ϙ��d̑JƜ�H�-�ڑt=c�s�a��B[�O�����'t��v�õ��C��9��q��<\yS�v�Z�\e��P$�De����8k��͚[�0�,7��ho��Is��><�r����[�r�T�-���˭z�6g�H9s�5���ϙ�_�3�"]"e�I9O� +����s�d��c���t�Wn#=�T�{������gI�aY�r�I��cJY�N�1T��0I�+%�u�jKG�c�]=�d@6�S9M�m=���1P�8_�z��cP�hؿ��cr�5z��1L�`I�����|����z=������������ �Z=���ÝR����d��� �3G���1�z˪�{���1(btp�����5�����ki��k�Q'P�1�*ը����S +���%/�p�����P�{���C6���t5&������Q|���G%ﹾ���K:J�gZdw�?�M�vn�z��M>I/|���W�������T�G��?���ȇ�d>N���7�}'��>qϷ��K�Β����^�J��&���1�xzZ$��J��u� �����.'�ܑ�ߑ���� ��&��k9�{�i=�F7�Y��z�S��>@/g'��E��P�s�u�}Gq?�������P��aw$l$�ʣ�3��?��n������tg�����l���7��df�]A��Ŏ@�� +�o���]�U���Y{�{�_^�1y�1���D��Ї���p�N���ʲ�[��S,����W�أǁ��N��ф���lǃ@hcY٤S���P�� c@L�b)4��\��ч�����IJ�B���+���G��U}���������x�ר����Z[Z4:XV<��K�C��� �f]��P�_o&Cu���-Ɓf�}eV�lVZp�+Mn]Y}�R � +���+�cA�J�&��J�ޢ��0�o�`} +��)�hZY����}+� +[)2�ue��[Z�c$���Ѻ��E�6�Ʉ"���b/}��hf�س�l�$�w�c;��ձL��e��]�v��v!j%�c���'Vz-�t/����Zح�1�n�1�π�(fн(fC��5��X1̠�1L�3�H��0����y�~�/+-��ˍ��ߏ��K;��p��ɝ�&wDG�*w�?�=�~�,�k���g,X'����$�~l��Y�ז�?h,p�%��h_C��*�;���Ac�Q?�����82����i7�!�]'w��AZyw ��N�`�r#vW$�4`w9�)�?�dͰ��5��k1���i%�s*=-���e��`Rh�� �Ԅ�HZJP��%�Id/E��p�NQ��������Ij�����A�qͣ���7��U��DW�,C�J����nU�)�kV�MW[{9J���!/�VM$%�I^� �y�r���i����U�A�U* +R����c����Z�Њ(�,8����dZY�����)\�2ה.����z�6y-���d��<�lx�iU�Ά Ԥj� +vg�S��g�)N}�ͩ�*9UV6��eU�ll���ɟ.W�D���#�������؉ND��a��kg��� +���gɲ���ٕ����{3X~6H�-73E�$$C��z���1d�X�~� ���Ғ?��w��.:�U�=�H��5�P4��v��M��2a�@�K� �dnȄ�8�0$�:`�(��� s�52!ǿ� +�$�O���I�eB�_���:���hU"�]\���������$��B�ŝR#���)͢2 +�t($��+��b,rL�j������UBi�yPa`���]qS �+�S�*W�g\���k�A&�em�5�L���h���@1�3�5],M�ϡ�z���c�k�9��j������ˡ/+�6�����#t�mB' +�ޭWӮ� +�P�`w�mW�6+ag� iػ��J����r�]-�8�mi�3���p�]-��ط��$خA�s�j1D��_�*�z�+����$X.yE���'���7C��V�e����<�l!晥��A�ʏ�b��E|���u+�I��JGV�8`9���]�����`@��"��z����N!��d�)8�$r�S(����}�s�x'��;��$�Np�]I�������/�n�3sr�'g�*�k-�B䈧��r_C��;iēt.�H�ΦC��>Vn1�x��l�1�o�[d�(�ϵޤx����� +���E�8�b�e��p�Uo��;���8űo5���C�i5x9�)"M����5�Ɍ��'S9�?r�6N���S=��@���'G|�=b�,B����p�k}y��x��|Q4Q��fz�!m���}��Y�i���@�vX6��1��%Y>��=(H5��bEa��~��2�`��9�Ax�l#��GF��1fC�z"aҧ�l���\��iEN/5��f��s1�,;3�B�����Ԛ�. �6ٮK�T��+�ǪFPә�R:��t��8���� ����J�"�n�(�R���K�Y�����@<D�j鹇#�l<��p��zT��E��1�pT����z�k::��r7 +]�p�C�s�����k�;�&j��Z��k�c�r�y�ך�Zk+5t� v���������*�u�z��V4��5��)��vs��^g�[��(���n��6v����]��$H�DY�_�� _N¦y����i�>iv\.� +���u���cƸ%�눽O��2���M�{��XE����q���;w�v�aք*рj�>��p��*&�UT8��S�eSpD�b�XE)���Q@��r�ub��U�+��vز+9�J+R1�"U��H@6ޭ>�E����IB���Hl�!�v҄O�5��*N�ϦC�y��T{�b.T1�B�z��h��t-n���D�JZo�6���6�a]��� +)�`+�2n������ev�gi�FM�s��jDk�>I+�z�nCh�^ˤdO l�p�t�"l<Kg�^��bϖ���kC�hQ�-ܪ��`���MYs�XV��"��>ٮH}���F7��N�3�7�o>Z����&7��8�ֻ��v�i���k��_%p��M�_��~��:��ot���+0ܖ���`;�DL��<��M����>��A� +����䰰�K8���\M"Ɉ�(�ˇ���mڇu�OM�p��CH_�,�k����i�^�kl:��` +@�=��ez�h�U����Y��?���L;t��o���_NƦ�/t��Ѩ�/oN� +n��y�=xqHif{n#/{���e�t�ӉxJ>���l�G��s{O��:���F��^/cاsQ��}��২ ��s�0�*R����|�:���RG��9��t�T'�R"=�������z�$!\oDK�.�W?`�{3ȏUC$�k�EG3�-�v��{�^9���d��.��P�[*}�����({t�=ێ�=dX�e�^��oBk|�ܨ{��!4��0�������=p�+M:�~D�{��H��~M���*8�v�sd�-��s����Vvh�s��9�r�T�i��8:��]�a:T=0�n1.{����ϑ/6�]l��?G��ԠC\lP���ʛ�,���<(���A���kr������?�7{]g8�%��@=�P��O�͑^�m/S��p������[��6�����ц�/��TϹ�$k�s����n6ޯ0��J�Q{U&�)?Yl��$��x��t�LޮGm�3�Nߞ"ِ#~����$r���9��� +9�g��=A�!ǼN��o98����i*� +9��1!u��Ŏ�G�m:G�':�5<� +C +Y-uʱޱQS1��sHY1ܐ���ѹ}&Vz���N�9s�5O���9�y:g�tw�ΙC4 �O�p��M�m�9�:��t�i��J�;Xi����7윌�}2�ws�RD���� g��nNQl�?k�wcRl����&���|�@r����&����� q���&LU:\9��܌��uZ�]>w[�E>��k�����[�]�}6Gϛ��J�H t�j��\���9z�d�>n��ў�5��6��N2�cEeoB�_�r32�ױzv��]1�mg�lN�mH��3�sw{f�t�?o:w�����9��s +�N���sw��p�t���\�m�9�O�Ug���7�f�6M�kx�m����)���xH�?E�]!���{f���]$��q�}�Uz���Nr?s�O���s?��_�M&�4���N�?c�N�e��6�M����/��b��\;�Cm�}�4���ڔ��%4 +Q�2kd�c���[W��������=�m_>�ϬJ���9w�e;��f�y}m�}6��al��k6�.�{.[+/=%��9w�bk�������?� +��m0�$r��5D��5~�^��PK���NIŋPKΕv<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J +@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKΕv<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKΕv< +pollen.xmi�]k��8��>��5�U=S����ҕɖm쭩��R�L�~ κ��'���q�F`��"1�;����+��{ӫw�����=�(��`���N\w38���샿�l�����z���Ͼ?�����]��>����G�I���n���G��w��O����Cv߇�@4���h<(ڃd�֛/3I���?�f��-�A����l��w7t��0H@���:��(I�]F�0���1�^�#Ll�x�����Oo9�o�����/�F=������B2�/گ�>�1tg�3�a�>��}.�sQ� �C�������/�A����G~ۯ��ʿZ�@�㧯/�cz��C�g���9}۟/;淟Ņ����ӓ�EXH� �$}��#ӦΏ�ݬg�2��\T�sQ�溤ێ��Q�����!py���Y|��Q���������:��;�Ke�{`��?�0)}���Ϗ��'p.�=���U6{�In����_�����o��� +�M3{uŖlS��Q +�v� +�[K� ߝ�>���7��pAN@Ņ���릇$?�^n���~�������x���ݗ�T��T�?��}�N����J¿�>���_?�?`w٧�����q=I�]#Ğj���A�x9QPV��Y�՜oa�|L/�^`/٤��9���1^"WF{�8o-���=�c�8O�"��`� ���6e�u5�7��]��/�Y���SN�m�'?�OG{�;8����[�%��I�'���Y�A��V��|9���|Cy¼��i�j:��� �����" +�P�,5��K�2�� 9FuȗI��1AO��&CQ�|h�� +@G�6���q�����;��g'<����T�& +�w�o �A����}��D;�T�S�ȹ7�����'�-���?�p�ǣ�����D�C��"�^��vD�?��� +p���ڇ�zS����p(�\�g��8/U�ٗ�d�Y3������5���\u��j��^$I� DU7Qz��k���^����K����j��.���?d���X״Ӏ�i���р��#��i��F�l���Ѡ�M,��~j�L^��rp�Ç$����X +@����w�f1n� +{�-��_Qx<Pc7�#$�����s��֦N(�`����?N��-����C�\z��o�n��E�+~oO�.[�OS��V�ȅѳ�>�3tQ�v���O a)m\�kY�,���l�][b>P<MS%eQ�7��������Q�Y̮Du�DI��^�'K�Z�H�z�4��8�P-b��ę���Uu|���U�5%U�4O�dU��J���F��1���B�LA��� +��{���X֟,4�C��@7���/�t��2r�).n����2��Ck�����a�� +�0D:�%��i�'�[����f�9��V�̈�K�3Gqv��=2����mV]�Q33�� +M3W��ơ0�����Y\��UZ_��(rr�0R���-CHt3�F��r��!iZ*:���b������Y���7:��R�4�;��-�L)�o�ܿUjСyk"쓦�̼E�e4C�����t5�ԑ�-Rż)��M;����@�J'�ƫ#S�:�ێA{�� a�'7��Y�'��k��_i�ް���UT�ݲ��x�r�B9G���+7�}�rgke��Vq&1�����0<{{*���R.i�1��Q\\5�!Ռt� }�\;��CfP�!ӹvVn�j��[��n�I2~�f��Z:Nx��'j����Ò"9��ʙwX�0����"���O8��T�C!��k���\,S*����"욪�S&�Z�lol��(.Na-'*H>?] �鐱AR���K��2A��DH6k�X�_s-�W�`���ki�ks�0%���d�!h����Eg��R�o��Y�� �ō��A���Ό���8��[t�1fŬ�v��o��>�� ҉X\���C�N�N�L��ȷ�R�5bڝb��a��Pp8���Pj�ڒѱ�ؼ�� 3�.�t�-_����R��_�e[�EGIq˒�kЊ:�휍�����O��;�# $w$��r�����Um�F<��r{��DҤ(z}��ɟ��'O�3�e�'�ŗ��G�рLf,f�!��a4��5<��('d�bqq`���DS}ɞ���Ig! u����#��`�$и�%� +�|��~(��7���&�,�j�g/���~�IV���e�1��Rʉ�Rr+"�`�&�@�F��ˮ-��c��j���#�q]G�#2��� ���&5���Y��f#���ُZ'����>�$�䪒�TpƟ0N{��������v�7��s�:��)�̗�A\����e��'N����ȑ�#G�7I0E�K�h���ښ�*�.I:�N���E���G�C�%�g0Rx���O��8?A�UQ� ���y�d밦���q�Av��:K����YS��l��o;(5`M��z�]�R�Aʟ"�����ob��{�j�+*Pm�h�0EA3LAE��E���I���t�b�Y��$�|Rj���т0��R�$��\��8#�JV�����\ �����`�sL�+�e:n�D��C� +IB�X�c)��/���$b��q�.H���J +n��Dz�BcN�M4N�B21�#ON*5�T�> +���0�_�)瞐Ju<��5FV�|�\�V3A7]�Iqж0���$���G�|���/��^��P��9��{���]Ύq�'ZcO$lFc���7?� +S�#��o��J +X[+�f�ƺɉ���L�F��� ��\j0uhܼ��؉�C6�9 +`���=L��TjpC4�:�O��,I0 �MG��V���뼃��`�-�h��t��!��X����� ��G��i�-����p3��b�@�7���u��ؤy��R�Jc�l��H�:d�lR��Xv�� +qA�t9��f��d)|���$R��.����^\���cg����c:�0�r^:�D�*�� ��YjpC�g$���� N�,]w��F>܌ϐH�#���S J +n�^ᖀ$��32������̍���W�� �<'�x�b�<ˠ�����h�@:����o�v�U��8 0Leܲ�)2�w3���Pq��B��Qv����~��:a* �d@��A�� +�Aɕ���j64���Fb���f���R@J7c( w�H&@J(5�92�kh�@5TGTR�J�1*���� +͍U�`�!��f4"�Y� �xUjp�y�t��WQ&��H<� �R�ڐ@4ӎ���_~L�*.�L�L9&��K +����Ƨ���R2٘ �4.5`�h*gc��}��r60���?��q�PԦu��B�%��8��iRf��jBq�����\6dG����@�#����Y0�:|���/�.E�ϵ�˵��MIr��?DC����o]� �N�緲`�t��6�Ar�c�kG��$��sڪ��@�Liz��i��1N��$�xGq���w3��dR7L�Ve3�Ay����q��9a��|����@lj=���C���]��8�4i�p=V�]_�&��`ϒ�n�X�C�j7"����\8a@'�c��ܼ �N�Ҙ��s$���<��� s�-:�3@#F~���9�߲=h`������ h���kg`Y�#����3@02R{�'Q�Q�68� !�`��+���q�Z��%'<�F~I�:��,�w�r�*��(�m?.�dι#�: �T��Y*w���HJ��*a���ޤ� +���:r'W|[��!~��:��!��� +�-Nxre73��c�MOrm��^�.)H�6��ޤ�m%��7"�@���4�S3J6[�yh]k��*�M[E#�g�2�ڙVq2��#�~0�{#�������$n:����x0@��L��'����rj% �N�{O<9�,0H�*/�I��ʭ�v䉺�|&�o��\��9�=��,8ߔv�7���� +�Hq# +d��ۿ��:X�ĩ�����9�5��ƵN��+�3���:2���i����53K1� +M3��d�5$ϒ����W�8�t0��i�����t�b������Yj�B����e7I����o�o�M�#�猬"mT����%2��mߗV۾ +� +����Lr.���֤�B�;���[lX`�R\܌C�q���L����S[~����W�^Zug +�Gڍ��#R\\-��Z6���R�H������㩪�u��St�8��غb�MF[#CV<(�5�i����7y'K��\���m�<G�I'��S�ˍ�"�RS]C�L�̙F6T�T$�wк��e�W�/py�$kQ����Aqq�؛Hv؊F}�ĆG*�J�A�"f�g3p�O!K������ˮ-��-D�Je=���o^�Ð]\�c);�,]��Ԓ����uK�g/��(.���v��c�*���EV��}>���]���pٽ�+g���1j��U(o)��ӻ��vM�{�B��t(�&8>�(���x�]��������࿀�=?�_)��$R%]L�s�RC��"�/�����`��o��K�p5���ٺm����-[/frn{L�xu[�X;�m��ӷm�q�A���9��O_1Q����t�_��>�@�>��Q�?�����3M��� +�X�����cMOr!;���w+��h>'��=-�4�a���ܱ �l�s�{���)E�I����rgE�<�CJ�� +�?!JF�B?�7�3F[o���7}VԲ���?h��mX�l^�AW���J/.���~ճЬ��i�}�Π@v:Rvu���d�_�M�Az�(ԑ��♛k�.��O�#�j��#A�]��Zj��XK�Z +Rv���nG��V����#5�bR�d��¼:m)_Z +> +��B�賨�E�����A~����[��X9�Q�];�)�� �%�k�zmQ!�5��ϢAsY����gm�F�A|�*'r� +�Ɍ�� +���^*֎�2��ۊ4�o˪��ه�BcU|}D7�Q�]V�� +�m˪ն�Boޢ�6\V�x��Q����%b�/?�&����h�?K`��b�T?���'�T�Obs��D7Kd�p�D�Kd��gI�۲*>|��Ī�Ԓ�KL�A1vb9r*�z���!����/���O�BwVк�ˇBC��R����3�:dD��P�7P��Mi%?*L�U��B���R��M��J�ҫ2��4*4g�U��F�i��]���h��2����[<L*�~�u���"�a�j��TL^��dkI��]�:y�4��ZK��{�1U�S|T�\�׳t).�%��j֊�p� +�bO?����:V�Zk*��kV��k*V�5�<,��P�u���Bq��+/��P!��������="#3 �N�2�08Ҥ.jD��( �V��ê��@�M�[�_.J��5����p1P���¦��斒 +A�U���V`Tt��%D��z�る��T\�}$Z�b�$�v/�ݸ��NM BlZ[��.JrB1a�}��q1P�ƅ�GN +.t�e�EG�2���L�,%�v9�N+˓���� +\�/%~;|���ࠠ*x�pP�'�X{�0��T�^���ۋ����$��R�qPP������U �8���#�AAU��2ypP����%>/��i�I!{�a����\sI~�Ֆr�Z2��@�2`A��#+ �]2��H�����OM~Xk�R�Z��]���3Sbofv�#�}���N}q$�Ϟ�ѩ��������`���A��c� $����߿�gP'3����9���6�nVD���m"y�i����L��� rz���k�@�0k��)��J/�{C��G�^�ҡg**�DI�TOV�QO:=ɒ���]�0�3=1P��h���S��no������N$0H������O�PK�F&$��PKΕv<ptB�pollen.argoPKΕv<���NIŋGpollen_DC_Pollen.pgmlPKΕv<4�[-m��pollen.todoPKΕv<7Rp:Bypollen_profile.profilePKΕv<�F&$�� +�pollen.xmiPK1�4 \ No newline at end of file Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java =================================================================== --- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -1,163 +0,0 @@ -/* *##% Pollen - * Copyright (C) 2009 CodeLutin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. ##%*/ - -package org.chorem.pollen.business.services; - -import org.chorem.pollen.business.PollenBusinessException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.TestManager; -import org.chorem.pollen.business.dto.ChoiceDTO; -import org.chorem.pollen.business.utils.ContextUtil; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Tests de la gestion des choix. - * - * @author enema - * @version $Id$ - */ -public class ServiceChoiceImplTest { - private ServiceChoiceImpl instance; - - /** log. */ - private static final Log log = LogFactory - .getLog(ServiceChoiceImplTest.class); - - public ServiceChoiceImplTest() { - } - - @BeforeClass - public static void setUpClass() throws Exception { - TestManager.start("ServiceChoiceImplTest"); - } - - @AfterClass - public static void tearDownClass() throws Exception { - TestManager.stop(); - } - - @Before - public void setUp() { - instance = new ServiceChoiceImpl(TestManager.getContext()); - } - - @After - public void tearDown() { - } - - /** - * Test of createChoice method, of class ServiceChoiceImpl. - */ - @Test - public void testCreateChoice() { - ChoiceDTO choice = new ChoiceDTO(); - choice.setDescription("Test_CreateChoice"); - choice.setValidate(false); - choice.setName("Test_CreateChoice"); - choice.setValue(3); - String result = instance.createChoice(choice); - if (log.isDebugEnabled()) { - log.debug("result: " + result); - } - assertTrue(result.length() > 0); - } - - /** - * Test of createChoices method, of class ServiceChoiceImpl. - */ - @Test - public void testCreateChoices() { - /* Couvert par le test unitaire sur Poll - List<ChoiceDTO> choices = null; - String pollId = ""; - TopiaContext trans = null; - ChoiceImpl instance = new ChoiceImpl(); - boolean expResult = false; - boolean result = instance.createChoices(choices, pollId, trans); - assertEquals(expResult, result); - */ - } - - /** - * Test of updateChoice method, of class ServiceChoiceImpl. - */ - @Test - public void testUpdateChoice() { - ChoiceDTO dto = new ChoiceDTO(); - dto.setDescription("test_UpdateChoice"); - dto.setName("test_UpdateChoice"); - dto.setValidate(false); - String choiceId = instance.createChoice(dto); - dto.setId(choiceId); - dto.setDescription("update description"); - boolean result = instance.updateChoice(dto); - assertTrue(result); - } - - /** - * Test of deleteChoice method, of class ServiceChoiceImpl. - */ - @Test - public void testDeleteChoice() { - ChoiceDTO dto = new ChoiceDTO(); - dto.setDescription("Test_DeletePoll"); - dto.setName("Test_DeletePoll"); - dto.setValidate(false); - String choiceId = instance.createChoice(dto); - dto.setId(choiceId); - boolean result = instance.deleteChoice(choiceId); - assertTrue(result); - } - - /** - * Test of findChoiceById method, of class ServiceChoiceImpl. - */ - @Test - public void testFindChoiceById() { - ChoiceDTO dto = new ChoiceDTO(); - dto.setDescription("test findChoiceById"); - dto.setName("test findChoiceById"); - dto.setValidate(false); - String choiceId = instance.createChoice(dto); - ChoiceDTO result = instance.findChoiceById(choiceId); - String resultId = result.getId(); - assertEquals(choiceId, resultId); - } - - /** - * Test of selectChoices method, of class ServiceChoiceImpl. - */ - @Test - public void testSelectChoices() { - ChoiceDTO dto = new ChoiceDTO(); - dto.setDescription("test selectChoices"); - dto.setName("test selectChoices"); - dto.setValidate(false); - String choiceId = instance.createChoice(dto); - List<ChoiceDTO> result = instance.selectChoices(null); - assertTrue(result.size() > 1); - } -} \ No newline at end of file Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java =================================================================== --- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -138,7 +138,7 @@ /** EXEC METHOD **/ instance.createAccountInPersonList(dto, account); - Assert.assertNotNull(account.getAccountId()); + Assert.assertNotNull(account.getAccountUId()); Assert.assertNotNull(account.getId()); Assert.assertEquals(1, dto.getPollAccounts().size()); Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java =================================================================== --- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -26,7 +26,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.business.PollenContextImpl; import org.chorem.pollen.business.TestData; import org.chorem.pollen.business.TestManager; import org.chorem.pollen.business.dto.ChoiceDTO; @@ -34,6 +33,8 @@ import org.chorem.pollen.business.dto.PollDTO; import org.chorem.pollen.business.dto.UserDTO; import org.chorem.pollen.business.dto.VoteDTO; +import org.chorem.pollen.business.persistence.Choice; +import org.chorem.pollen.business.persistence.ChoiceDAO; import org.chorem.pollen.business.persistence.Comment; import org.chorem.pollen.business.persistence.CommentDAO; import org.chorem.pollen.business.persistence.Poll; @@ -47,7 +48,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.util.beans.BinderProvider; /** * Tests du service de gestion des sondages. @@ -120,7 +120,8 @@ dto.setChoices(choices); - final String result = instance.createPoll(dto); + instance.createPoll(dto); + final String result = dto.getId(); if (log.isDebugEnabled()) { log.debug("result: " + result); } @@ -368,7 +369,7 @@ dto.setPollType(PollType.FREE); dto.setChoiceType(ChoiceType.TEXT); dto.setVoteCounting(VoteCountingType.NORMAL); - String pollId = instance.createPoll(dto); + instance.createPoll(dto); List<PollDTO> result = instance.selectPolls(null); assertTrue(result.size() > 0); } @@ -403,8 +404,8 @@ poll.setPollType(PollType.FREE); poll.setChoiceType(ChoiceType.TEXT); poll.setVoteCounting(VoteCountingType.NORMAL); - final String id = instance.createPoll(poll); - poll.setId(id); + instance.createPoll(poll); + final String pollId = poll.getId(); /** EXEC METHOD **/ final CommentDTO comment = new CommentDTO(); @@ -426,7 +427,7 @@ Comment result = dao.findByTopiaId(comment.getId()); Assert.assertNotNull(result); Assert.assertNotNull(result.getPoll()); - Assert.assertEquals(id, result.getPoll().getTopiaId()); + Assert.assertEquals(pollId, result.getPoll().getTopiaId()); } }; @@ -448,8 +449,7 @@ poll.setPollType(PollType.FREE); poll.setChoiceType(ChoiceType.TEXT); poll.setVoteCounting(VoteCountingType.NORMAL); - String id = instance.createPoll(poll); - poll.setId(id); + instance.createPoll(poll); final CommentDTO comment = new CommentDTO(); comment.setAuthor("Jack Pot"); @@ -491,8 +491,7 @@ poll.setPollType(PollType.RESTRICTED); poll.setChoiceType(ChoiceType.TEXT); poll.setVoteCounting(VoteCountingType.NORMAL); - String id = instance.createPoll(poll); - poll.setId(id); + instance.createPoll(poll); PollAccountDTO account = new PollAccountDTO(); account.setVotingId("toto"); @@ -500,4 +499,120 @@ // TODO } + + /** + * Test of getNewPoll method, of class ServicePollImpl. + */ + //@Test + public void testGetNewPoll_0args() { + System.out.println("getNewPoll"); + } + + /** + * Test of getNewPoll method, of class ServicePollImpl. + */ + //@Test + public void testGetNewPoll_PollDTO() { + System.out.println("getNewPoll"); + } + + /** + * Test of getPoll method, of class ServicePollImpl. + */ + //@Test + public void testGetPoll() { + System.out.println("getPoll"); + } + + /** + * Test of getComments method, of class ServicePollImpl. + */ + //@Test + public void testGetComments() { + System.out.println("getComments"); + } + + /** + * Test of getNewHiddenChoice method, of class ServicePollImpl. + */ + //@Test + public void testGetNewHiddenChoice() throws IOException { + TestManager.start("testGetNewHiddenChoice"); + instance = new ServicePollImpl(TestManager.getContext()); + + // TODO + + //ChoiceDTO choice = instance.getNewHiddenChoice(null, null) + } + + /** + * Test of createChoice method, of class ServicePollImpl. + * @throws IOException + */ + @Test + public void testCreateChoice() throws IOException { + TestManager.start("testCreateChoice"); + instance = new ServicePollImpl(TestManager.getContext()); + + /** PREPARE DATA **/ + PollDTO poll = instance.getNewPoll(); + poll.setTitle("createChoice"); + poll.setPollType(PollType.FREE); + poll.setChoiceType(ChoiceType.TEXT); + poll.setVoteCounting(VoteCountingType.NORMAL); + instance.createPoll(poll); + + /** EXEC METHOD **/ + ChoiceDTO choice = new ChoiceDTO(); + choice.setName("CHOICE1"); + choice.setDescription("description"); + + // No constraint for creation + instance.createChoice(poll, choice); + + Assert.assertNotNull(choice.getId()); + Assert.assertEquals(1, poll.getChoices().size()); + Assert.assertEquals("CHOICE1", poll.getChoices().get(0).getName()); + } + + /** + * Test of deleteChoice method, of class ServicePollImpl. + * @throws Exception + */ + @Test + public void testDeleteChoice() throws Exception { + TestManager.start("testDeleteChoice"); + instance = new ServicePollImpl(TestManager.getContext()); + + /** PREPARE DATA **/ + PollDTO poll = instance.getNewPoll(); + poll.setTitle("createChoice"); + poll.setPollType(PollType.FREE); + poll.setChoiceType(ChoiceType.TEXT); + poll.setVoteCounting(VoteCountingType.NORMAL); + instance.createPoll(poll); + + final ChoiceDTO choice = new ChoiceDTO(); + choice.setName("CHOICE1"); + choice.setDescription("description"); + instance.createChoice(poll, choice); + + /** EXEC METHOD **/ + instance.deleteChoice(poll, choice.getId()); + + Assert.assertEquals(0, poll.getChoices().size()); + + // Test if the choice entity not exist anymore in database + TestData test = new TestData() { + + @Override + protected void test() throws Exception { + ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction); + Choice result = dao.findByTopiaId(choice.getId()); + Assert.assertNull(result); + } + }; + + test.execute(); + } } Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -0,0 +1,49 @@ + +package org.chorem.pollen.ui.base; + +import org.apache.commons.fileupload.FileUploadException; +import org.apache.tapestry5.annotations.InjectPage; +import org.apache.tapestry5.ioc.Messages; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.apache.tapestry5.ioc.annotations.Symbol; +import org.apache.tapestry5.upload.services.UploadSymbols; +import org.chorem.pollen.ui.pages.ErrorPage; +import org.chorem.pollen.ui.utils.UnitConverter; + +/** + * AbstractUploadPage + * + * Created: 22 mars 2010 + * + * @author fdesbois + * @version $Revision$ + * + * Mise a jour: $Date$ + * par : $Author$ + */ +public class AbstractUploadPage { + + @InjectPage + private ErrorPage errorPage; + + @Inject + private Messages messages; + + /** Tailles maximales des fichiers uploadés */ + @Inject + @Symbol(UploadSymbols.FILESIZE_MAX) + private int fileSizeMax; + + @Inject + @Symbol(UploadSymbols.REQUESTSIZE_MAX) + private int requestSizeMax; + + Object onUploadException(FileUploadException eee) { + String fSize = UnitConverter.getFormattedFileSize(fileSizeMax); + String rSize = UnitConverter.getFormattedFileSize(requestSizeMax); + errorPage.addError( + messages.format("pollen.ui.error.upload", fSize, rSize)); + return errorPage; + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL" Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -135,7 +135,7 @@ public String getAdminId() { PollAccountDTO creator = servicePollAccount.findPollAccountById(poll .getCreatorId()); - return poll.getPollUId() + ":" + creator.getAccountId(); + return poll.getPollUId() + ":" + creator.getAccountUId(); } /** Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -24,6 +24,7 @@ import java.util.Locale; import org.apache.tapestry5.BindingConstants; +import org.apache.tapestry5.Block; import org.apache.tapestry5.annotations.Component; import org.apache.tapestry5.annotations.IncludeStylesheet; import org.apache.tapestry5.annotations.InjectComponent; @@ -178,6 +179,10 @@ return feedContext; } + public FeedBack getFeedBack() { + return feedback; + } + /** * Methode appelée lorsque l'utilisateur s'identifie. L'utilisateur est * retrouvé grâce au service d'authentification. Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -114,4 +114,8 @@ errorMessages.add(message); } } + + public boolean getHasErrors() { + return !errorMessages.isEmpty(); + } } \ No newline at end of file Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -1,19 +1,15 @@ package org.chorem.pollen.ui.data; -import java.io.File; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.fileupload.FileUploadException; -import org.apache.tapestry5.StreamResponse; +import org.apache.commons.lang.StringUtils; +import org.apache.tapestry5.Block; import org.apache.tapestry5.upload.services.UploadedFile; -import org.chorem.pollen.business.PollenProperty; import org.chorem.pollen.business.dto.ChoiceDTO; +import org.chorem.pollen.business.dto.PollDTO; import org.chorem.pollen.common.ChoiceType; -import org.chorem.pollen.ui.utils.ImageUtil; -import org.nuiton.util.DateUtils; +import org.chorem.pollen.ui.services.ServiceImage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,29 +56,41 @@ } - public ChoiceField(ChoiceDTO dto, ChoiceType type) { + public ChoiceField(PollDTO poll) { + switch (poll.getChoiceType()) { + case DATE: + setDateType(); + break; + case TEXT: + setTextType(); + break; + case IMAGE: + setImageType(poll.getPollUId()); + } + } + + public ChoiceField(PollDTO poll, ChoiceDTO dto) { + this(poll); if (log.isDebugEnabled()) { - log.debug("Instanciate ChoiceField : type = " + type + + log.debug("Instanciate ChoiceField : " + + "type = " + poll.getChoiceType() + " _ name = " + dto.getName()); } - switch (type) { + switch (poll.getChoiceType()) { case DATE: - setDateType(); setDate(new Date(Long.parseLong(dto.getName()))); break; case TEXT: - setTextType(); setText(dto.getName()); break; case IMAGE: - setImageType(dto.getPollUId()); setImageFileName(dto.getName()); } setDescription(dto.getDescription()); setHidden(dto.getHidden()); setId(dto.getId()); setValidate(dto.getValidate()); - setPollUId(dto.getPollUId()); +// setPollUId(dto.getPollUId()); setName(dto.getName()); //setValue(dto.getValue()); //setVoteId(dto.getVoteId()); @@ -159,6 +167,10 @@ image = null; } + public ChoiceType getType() { + return type; + } + public void setDate(Date date) { this.date = date; } @@ -170,14 +182,16 @@ public void setImage(UploadedFile image) throws FileUploadException { if (image != null) { this.image = image; - if (!image.getContentType().equals("image") || - !image.getContentType().equals("IMAGE")) { - throw new FileUploadException("wrong type for image upload"); + String contentType = StringUtils.lowerCase(image.getContentType()); + if (!contentType.contains("image")) { + throw new FileUploadException("wrong type " + + image.getContentType() + " for image upload " + + image.getFileName()); } } } - public UploadedFile getImage() throws ParseException { + public UploadedFile getImage() { return image; } @@ -212,12 +226,13 @@ * correspond to the image file name ; * - TEXT : the text becomes the choice name. * </pre> + * @param serviceImage used to save the image */ - public void saveName() { + public void saveName(ServiceImage serviceImage) { String name = ""; switch (type) { case DATE: - name = String.valueOf(date.getTime()); + name = String.valueOf(getDate().getTime()); break; case IMAGE: // // Get directory to save the image using the context from @@ -238,7 +253,7 @@ // if (log.isDebugEnabled()) { // log.debug("save name for image : " + file.getName()); // } - //name = serviceImage.saveImage(getImage(), getImageDir()); + name = serviceImage.saveImage(getImage(), getImageDir()); break; case TEXT: name = getText(); Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -0,0 +1,33 @@ + +package org.chorem.pollen.ui.pages; + +import org.apache.tapestry5.annotations.InjectComponent; +import org.chorem.pollen.ui.components.Border; +import org.chorem.pollen.ui.data.AddressBar; +import org.chorem.pollen.ui.data.AddressBarItem; + +/** + * Error + * + * Created: 22 mars 2010 + * + * @author fdesbois + * @version $Revision$ + * + * Mise a jour: $Date$ + * par : $Author$ + */ +public class ErrorPage { + + @InjectComponent + private Border border; + + public void addError(String message) { + border.getFeedBack().addError(message); + } + + public AddressBarItem[] getAddress() { + return new AddressBar().getItems(); + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL" Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -103,7 +103,7 @@ * @return l'identifiant. */ public String getAdminId() { - return poll.getPollUId() + ":" + creator.getAccountId(); + return poll.getPollUId() + ":" + creator.getAccountUId(); } void onActivate() { Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -103,7 +103,7 @@ * @return l'identifiant. */ public String getAdminId() { - return poll.getPollUId() + ":" + creator.getAccountId(); + return poll.getPollUId() + ":" + creator.getAccountUId(); } void onActivate() { Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -103,7 +103,7 @@ * @return l'identifiant. */ public String getAdminId() { - return poll.getPollUId() + ":" + creator.getAccountId(); + return poll.getPollUId() + ":" + creator.getAccountUId(); } void onActivate() { Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -824,7 +824,7 @@ PollDTO poll, Messages messages) { PollAccountDTO creator = servicePollAccount.findPollAccountById(poll.getCreatorId()); String voteURL = siteURL + "poll/VoteFor/" + poll.getPollUId(); - String modifURL = siteURL + "poll/Modification/" + poll.getPollUId() + ":" + creator.getAccountId(); + String modifURL = siteURL + "poll/Modification/" + poll.getPollUId() + ":" + creator.getAccountUId(); Map<String, String> data = new HashMap<String, String>(); data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST)); data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT)); @@ -848,7 +848,7 @@ List<Map<String, String>> mailList = new ArrayList<Map<String, String>>(); for (PollAccountDTO account : list.getPollAccountDTOs()) { if (account.getEmail() != null) { - String accountVoteURL = voteURL + ":" + account.getAccountId(); + String accountVoteURL = voteURL + ":" + account.getAccountUId(); /*data.put("to", account.getEmail()); data.put("title", messages.format("votingEmail_subject", Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -543,7 +543,7 @@ // Mails aux votants for (PollAccountDTO account : modifiedAccounts) { if (account.getEmail() != null) { - String accountVoteURL = voteURL + ":" + account.getAccountId(); + String accountVoteURL = voteURL + ":" + account.getAccountUId(); data.put("to", account.getEmail()); data.put("title", messages.format("votingEmail_subject", poll @@ -609,7 +609,7 @@ } if (id.split(":", 2).length == 2) { String creatorId = id.split(":", 2)[1]; - if (creatorId.equals(creator.getAccountId())) { + if (creatorId.equals(creator.getAccountUId())) { userAllowed = true; } } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -482,7 +482,7 @@ userAllowed = true; } else if (id.split(":", 2).length == 2) { String creatorId = id.split(":", 2)[1]; - if (creatorId.equals(creator.getAccountId())) { + if (creatorId.equals(creator.getAccountUId())) { userAllowed = true; } } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -26,6 +26,7 @@ import java.util.Locale; import java.util.Map; +import org.apache.commons.fileupload.FileUploadException; import org.apache.tapestry5.BindingConstants; import org.apache.tapestry5.Block; import org.apache.tapestry5.ComponentResources; @@ -37,6 +38,7 @@ import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry5.annotations.IncludeStylesheet; import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.annotations.Persist; @@ -49,7 +51,6 @@ import org.apache.tapestry5.ioc.Messages; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.upload.services.UploadedFile; -import org.chenillekit.tapestry.core.components.DateTimeField; import org.chorem.pollen.business.PollenBusinessException; import org.chorem.pollen.business.PollenBusinessException.PollenExceptionType; import org.chorem.pollen.business.PollenProperty; @@ -64,7 +65,6 @@ import org.chorem.pollen.business.dto.ResultListDTO; import org.chorem.pollen.business.dto.UserDTO; import org.chorem.pollen.business.dto.VoteDTO; -import org.chorem.pollen.business.services.ServiceChoice; import org.chorem.pollen.business.services.ServicePoll; import org.chorem.pollen.business.services.ServicePollAccount; import org.chorem.pollen.business.services.ServiceResults; @@ -73,10 +73,10 @@ import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; import org.chorem.pollen.common.VoteCountingType; +import org.chorem.pollen.ui.base.AbstractUploadPage; import org.chorem.pollen.ui.base.ContextLink; import org.chorem.pollen.ui.components.Border; import org.chorem.pollen.ui.components.FeedBack; -import org.chorem.pollen.ui.components.ImageContextLink; import org.chorem.pollen.ui.components.Pager; import org.chorem.pollen.ui.data.AddressBar; import org.chorem.pollen.ui.data.ChoiceField; @@ -87,7 +87,6 @@ import org.chorem.pollen.ui.data.uio.ImageChoiceUIO; import org.chorem.pollen.ui.services.ServiceImage; import org.chorem.pollen.ui.utils.FeedUtil; -import org.chorem.pollen.ui.utils.ImageUtil; import org.slf4j.Logger; /** @@ -99,7 +98,7 @@ */ @IncludeStylesheet({"context:css/vote.css", "context:css/lightbox.css"}) @IncludeJavaScriptLibrary({"${tapestry.scriptaculous}/builder.js","context:js/lightbox.js"}) -public class VoteForPoll { +public class VoteForPoll extends AbstractUploadPage { @Inject private Logger log; @@ -129,10 +128,10 @@ // @Component(id = "pollAccountName") // private TextField nameField; - /** Composant DateTimeField pour les choix du sondage */ - @SuppressWarnings("unused") - @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" }) - private DateTimeField dateDTF; +// /** Composant DateTimeField pour les choix du sondage */ +// @SuppressWarnings("unused") +// @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" }) +// private DateTimeField dateDTF; /** Locale courante */ @Inject @@ -203,10 +202,10 @@ // @Property // private PollAccountDTO pollAccount; - /** Nouveau choix de type texte */ - @Property - @Persist - private ChoiceDTO newChoice; +// /** Nouveau choix de type texte */ +// @Property +// @Persist +// private ChoiceDTO newChoice; /** Nouveau choix de type date */ @Property @@ -228,8 +227,6 @@ private ServicePollAccount servicePollAccount; @Inject private ServiceResults serviceResults; - @Inject - private ServiceChoice serviceChoice; /** * Composant pour la gestion des flux RSS @@ -245,20 +242,20 @@ return feedContext; } - /** - * Composant pour la gestion des upload d'images - */ - @InjectComponent - private ImageContextLink imgContext; +// /** +// * Composant pour la gestion des upload d'images +// */ +// @InjectComponent +// private ImageContextLink imgContext; +// +// /** +// * Context to get images for choices. +// * @return an ImageContextLink defined in .tml file +// */ +// public ImageContextLink getImgContext() { +// return imgContext; +// } - /** - * Context to get images for choices. - * @return an ImageContextLink defined in .tml file - */ - public ImageContextLink getImgContext() { - return imgContext; - } - @InjectComponent private FeedBack voteFeedback; @@ -662,13 +659,13 @@ private ChoiceDTO currentVoteChoice; public char setCurrentVoteChoice() { - currentVoteChoice = null; - for (ChoiceDTO choice : vote.getChoiceDTOs()) { - if (choice.getId().equals(choiceOfPoll.getId())) { - currentVoteChoice = choice; - break; - } - } +// currentVoteChoice = null; +// for (ChoiceDTO choice : vote.getChoiceDTOs()) { +// if (choice.getId().equals(choiceOfPoll.getId())) { +// currentVoteChoice = choice; +// break; +// } +// } return 0; } @@ -827,8 +824,8 @@ .replace(' ', '_')); getPoll().getChoices().add(newImageChoice); //File imgFile = getImgContext().getImageDir(); // dir set in getImgContext() - File imgFile = getImgContext().getImageDir(); // dir set in getImgContext() - ImageUtil.saveImage(newImageChoice, imgFile); +// File imgFile = getImgContext().getImageDir(); // dir set in getImgContext() +// ImageUtil.saveImage(newImageChoice, imgFile); choiceName = newImageChoice.getName(); choiceDesc = newImageChoice.getDescription(); } @@ -848,33 +845,16 @@ // return poll == null; // } - public boolean isPollStarted() throws PollenBusinessException { - Date now = new Date(); - return getPoll().getBeginDate() == null || getPoll().getBeginDate().before(now); - } - public boolean isPollFinished() throws PollenBusinessException { - Date now = new Date(); - return getPoll().getEndDate() != null && getPoll().getEndDate().before(now); - } - public boolean isPollChoiceOrVoteStarted() throws PollenBusinessException { return isPollChoiceStarted() || isPollStarted(); } - public boolean isPollRunning() throws PollenBusinessException { - return isPollStarted() && !isPollFinished() && !getPoll().isClosed(); - } - // public boolean isDescNull() { // return choiceOfPoll.getDescription() == null // || "".equals(choiceOfPoll.getDescription()); // } - /** Retourne vrai si le champs pollAccount doit apparaître. */ - public boolean isAccountFieldDisplayed() throws PollenBusinessException { - return !getPoll().isAnonymous() || isRestrictedPoll() || isGroupPoll(); - } public boolean isFreePoll() throws PollenBusinessException { return getPoll().getPollType() == PollType.FREE; @@ -1085,7 +1065,7 @@ if (poll != null) { // Initialisations pour les formulaires - newChoice = new ChoiceDTO(); +// newChoice = new ChoiceDTO(); newDateChoice = new DateChoiceUIO(); newImageChoice = new ImageChoiceUIO(); } else { @@ -1096,6 +1076,22 @@ return poll; } + public boolean isPollStarted() throws PollenBusinessException { + Date now = new Date(); + return getPoll().getBeginDate() == null || + getPoll().getBeginDate().before(now); + } + + public boolean isPollFinished() throws PollenBusinessException { + Date now = new Date(); + return getPoll().getEndDate() != null && + getPoll().getEndDate().before(now); + } + + public boolean isPollRunning() throws PollenBusinessException { + return isPollStarted() && !isPollFinished() && !getPoll().isClosed(); + } + /** * Use a PollAccount to represent the current session user. * The existing account is used if accountUId is present in the uri. @@ -1142,6 +1138,57 @@ return userExists && user.getId().equals(getPoll().getUserId()); } + /************** PAGER *****************************************************/ + + @InjectComponent + private Pager pager; + + private Integer page; + + @Persist + private Integer nbVotesPerPage; + + public int getPage() { + if (page == null) { + page = pager.getFirstPage(); + } + return page; + } + + @Log + public void setPage(int page) { + this.page = page; + } + + /** + * Get the number of votes to display per page from configuration. + * + * @return the number of votes to display per page + */ + public int getNbVotesPerPage() { + if (nbVotesPerPage == null) { + nbVotesPerPage = getPagerRange(); + } + return nbVotesPerPage; + } + + public void setNbVotesPerPage(int nbVotesPerPage) { + this.nbVotesPerPage = nbVotesPerPage; + } + + public int getPagerRange() { + return Integer.parseInt( + pollen.getProperty(PollenProperty.NB_VOTES_PER_PAGE)); + } + + public String getNoPagerText() throws PollenBusinessException { + if (getPoll().getNbVotes() == 0) { + return messages.get("pollen.ui.vote.noVote"); + } + return messages.format("pollen.ui.vote.noPager", + getPoll().getNbVotes()); + } + /************** CHOICES ***************************************************/ private List<ChoiceField> choices; @@ -1158,7 +1205,18 @@ @Inject private Block choiceDate; + private ChoiceField newChoice; + @Inject + private Block newChoiceText; + + @Inject + private Block newChoiceImage; + + @Inject + private Block newChoiceDate; + + @Inject private ComponentResources resources; @Inject @@ -1179,8 +1237,7 @@ } choices = new ArrayList<ChoiceField>(); for (ChoiceDTO curr : getPoll().getChoices()) { - ChoiceField field = new ChoiceField(curr, - getPoll().getChoiceType()); + ChoiceField field = new ChoiceField(getPoll(), curr); choices.add(field); } } @@ -1245,7 +1302,54 @@ boolean thumb) { return serviceImage.createImageStream(src, imageDir, thumb); } + + /** + * Delegator : Retrieve the newChoice to create a choice in the poll + * using the addChoice form. + * + * @return a ChoiceField to manage different choice type + * @throws PollenBusinessException + */ + public ChoiceField getNewChoice() throws PollenBusinessException { + if (newChoice == null) { + newChoice = new ChoiceField(getPoll()); +// switch (getPoll().getChoiceType()) { +// case DATE: +// newChoice = ChoiceField.getChoiceDate(); +// break; +// case IMAGE: +// newChoice = ChoiceField.getChoiceImage( +// getPoll().getPollUId()); +// break; +// case TEXT: +// default: +// newChoice = ChoiceField.getChoiceText(); +// } + // Don't know what validate is + newChoice.setValidate(true); + } + return newChoice; + } + /** + * Retrieve the block to display for input choiceName depends on + * choice type. + * + * @return the block to display + * @throws PollenBusinessException + */ +// public Block getNewChoiceBlock() throws PollenBusinessException { +// switch(getPoll().getChoiceType()) { +// case IMAGE: +// return newChoiceImage; +// case DATE: +// return newChoiceDate; +// case TEXT: +// default: +// return newChoiceText; +// } +// } + public boolean isPollChoiceRunning() throws PollenBusinessException { return getPoll().isChoiceAddAllowed() && isPollChoiceStarted(); } @@ -1265,7 +1369,7 @@ return started && !ended; } - public boolean canDeleteChoice() throws PollenBusinessException { + public boolean getCanDeleteChoice() throws PollenBusinessException { return isPollChoiceRunning() && isCreatorUser(); } @@ -1274,7 +1378,7 @@ */ void onActionFromDeleteChoice(String choiceId) throws PollenBusinessException { - if (canDeleteChoice()) { + if (getCanDeleteChoice()) { servicePoll.deleteChoice(getPoll(), choiceId); // Reset choices (ChoiceField list) to retrieve the updated one // from poll @@ -1282,57 +1386,24 @@ } } - /************** PAGER *****************************************************/ - - @InjectComponent - private Pager pager; - - private Integer page; - - @Persist - private Integer nbVotesPerPage; - - public int getPage() { - if (page == null) { - page = pager.getFirstPage(); - } - return page; + public boolean getCanAddChoice() throws PollenBusinessException { + return isPollChoiceRunning(); } - @Log - public void setPage(int page) { - this.page = page; - } - /** - * Get the number of votes to display per page from configuration. - * - * @return the number of votes to display per page + * SUCCESS EVENT :: add a new choice from addChoice form. + * + * @throws PollenBusinessException */ - public int getNbVotesPerPage() { - if (nbVotesPerPage == null) { - nbVotesPerPage = getPagerRange(); + void onSuccessFromAddChoice() throws PollenBusinessException { + if (getCanAddChoice()) { + // No validation done on choice with existing name + // Save name depends on choice type + newChoice.saveName(serviceImage); + servicePoll.createChoice(getPoll(), newChoice); } - return nbVotesPerPage; } - public void setNbVotesPerPage(int nbVotesPerPage) { - this.nbVotesPerPage = nbVotesPerPage; - } - - public int getPagerRange() { - return Integer.parseInt( - pollen.getProperty(PollenProperty.NB_VOTES_PER_PAGE)); - } - - public String getNoPagerText() throws PollenBusinessException { - if (getPoll().getNbVotes() == 0) { - return messages.get("pollen.ui.vote.noVotes"); - } - return messages.format("pollen.ui.vote.noPager", - getPoll().getNbVotes()); - } - /************** VOTES *****************************************************/ private List<VoteDTO> votes; @@ -1340,6 +1411,8 @@ @Property private int voteIndex; + private VoteDTO currentVote; + /** * Retrieve votes of the current poll from business module. * The votes are ordered by creation date, only the ones to display are @@ -1356,10 +1429,47 @@ return votes; } + public VoteDTO getCurrentVote() { + if (currentVote == null) { + currentVote = serviceVote.getNewVote(getPollAccount()); + } + return currentVote; + } + + /** + * Retourne vrai si le champs pollAccount doit apparaître. + * + * FD-20100322 :: + * Strange behavior ? why testing pollType (restricted or group) to + * display accountField ?!? Even it's anonymous, the field appears for + * restricted poll ?!? + * + * @return + * @throws PollenBusinessException + * @deprecated strange method + */ + @Deprecated + public boolean isAccountFieldDisplayed() throws PollenBusinessException { + return !getPoll().isAnonymous() || isRestrictedPoll() || isGroupPoll(); + } + + public void setChoiceValue(Integer value) { + getCurrentVote().setChoiceValue(choice.getId(), value); + } + + public Integer getChoiceValue() { + return getCurrentVote().getChoiceValue(choice.getId()); + } + + public boolean getCanVote() throws PollenBusinessException { + return isPollRunning(); + } + public boolean canEditVote() throws PollenBusinessException { // If the current account exist from uri and equals to the current vote String newAccountId = getPollAccount().getId(); - if (newAccountId != null && newAccountId.equals(vote.getPollAccountId())) { + if (newAccountId != null && + newAccountId.equals(vote.getPollAccountId())) { return true; // If the connected user is an admin } else if (userExists && user.isAdministrator()) { Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -74,7 +74,7 @@ for (VotingListDTO list : poll.getVotingListDTOs()) { for (PollAccountDTO account : list.getPollAccountDTOs()) { if (account.getEmail().equals(user.getEmail())) { - return poll.getPollUId() + ":" + account.getAccountId(); + return poll.getPollUId() + ":" + account.getAccountUId(); } } } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -34,8 +34,6 @@ import org.chorem.pollen.business.PollenContextImplementor; import org.chorem.pollen.business.services.ServiceAuth; import org.chorem.pollen.business.services.ServiceAuthImpl; -import org.chorem.pollen.business.services.ServiceChoice; -import org.chorem.pollen.business.services.ServiceChoiceImpl; import org.chorem.pollen.business.services.ServiceList; import org.chorem.pollen.business.services.ServiceListImpl; import org.chorem.pollen.business.services.ServicePoll; @@ -123,12 +121,6 @@ return new ServiceVoteImpl(context); } - /** Will be divided between serviceVote and servicePoll **/ - public static ServiceChoice buildServiceChoice( - @InjectService("PollenContext") PollenContextImplementor context) { - return new ServiceChoiceImpl(context); - } - public static ServiceImage buildServiceImage( @InjectService("PollenContext") PollenContextImplementor context) { return new ServiceImageImpl(context); Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -146,7 +146,7 @@ for (PollAccountDTO account : list.getPollAccountDTOs()) { if (account.getEmail() != null) { String accountVoteURL = voteURL + ":" - + account.getAccountId(); + + account.getAccountUId(); data.put("to", account.getEmail()); data.put("title", messages.format( Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -117,7 +117,7 @@ } dir.mkdirs(); } - String filename = tmpfile.getFileName(); + String filename = tmpfile.getFileName().replace(' ', '_'); File image = new File(dir, filename); tmpfile.write(image); Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties =================================================================== --- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -43,5 +43,23 @@ pollen.ui.choice.delete.confirm=Are you sure you want to delete this choice ? pollen.ui.choice.delete.title=Delete this choice -pollen.ui.vote.noVotes=Aucune personne n'a encore particip\u00E9 au sondage -pollen.ui.vote.noPager=%d existing votes \ No newline at end of file +pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00E9 au sondage +pollen.ui.vote.noPager=%$1d existing votes +pollen.ui.choice.datePattern=MM/dd/yyyy h:mm a +pollen.ui.choice.add.title=Adding a choice +pollen.ui.choice.add.submit=Add +pollen.ui.error.upload=An error occurred while uploading files. Maximum size allowed is %$1s per file, and %$2s total. + +# Tapestry messages for VoteForPoll.tml +# FORM:: addChoice +choiceDescription-label=Description +choiceText-label=Choice +addChoice-choiceText-required-message=You must provide a choice. +choiceDate-label=Date and time +addChoice-choiceDate-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? +addChoice-choiceDate-regexp-message=Date does not match pattern 12/31/2000 12:59 AM. +addChoice-choiceDate-required-message=You must provide a choice. +choiceImage-label=Image +addChoice-choiceImage-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ +addChoice-choiceImage-regexp-message=The image must be a JPG, GIF or PNG file. +addChoice-choiceImage-required-message=You must provide a choice. \ No newline at end of file Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties =================================================================== --- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -43,5 +43,23 @@ pollen.ui.choice.delete.confirm=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer ce choix ? pollen.ui.choice.delete.title=Supprimer ce choix -pollen.ui.vote.noVotes=Aucune personne n'a encore particip\u00E9 au sondage -pollen.ui.vote.noPager=%d votes existants +pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00E9 au sondage +pollen.ui.vote.noPager=%1$d votes existants +pollen.ui.choice.datePattern=dd/MM/yyyy HH:mm +pollen.ui.choice.add.title=Ajout d'un choix +pollen.ui.choice.add.submit=Ajouter +pollen.ui.error.upload=Une erreur s'est produite lors du transfert des fichiers. La taille maximale autoris\u00E9e est de %1$s par fichier et %2$s au total. + +# Tapestry messages for VoteForPoll.tml +# FORM:: addChoice +choiceDescription-label=Description +choiceText-label=Choix +addChoice-choiceText-required-message=Vous devez saisir un choix. +choiceDate-label=Date et heure +addChoice-choiceDate-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? +addChoice-choiceDate-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59. +addChoice-choiceDate-required-message=Vous devez saisir un choix. +choiceImage-label=Image +addChoice-choiceImage-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ +addChoice-choiceImage-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG. +addChoice-choiceImage-required-message=Vous devez saisir un choix. Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-23 11:15:12 UTC (rev 2955) @@ -161,8 +161,10 @@ <noscript> <t:feedback t:id="errorJs" /> </noscript> - <t:feedback t:id="borderFeedback" /> - <t:body /> + <t:feedback t:id="borderFeedback" /> + <t:unless t:test="feedBack.hasErrors"> + <t:body /> + </t:unless> </div> </div> Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -23,22 +23,22 @@ #vote-noPagerText=%d existing votes #choices -addChoice=Adding a choice -textName-label=Choice * -textName-required-message=You must provide a choice. -textDesc-label=Description -imgFile-label=Image * -imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ -imgFile-regexp-message=The image must be a JPG, GIF or PNG file. -imgFile-required-message=You must provide a choice. -imgDesc-label=Description -dateDTF-label=Date and time * -dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? -dateDTF-regexp-message=Date does not match pattern 12/31/2000 12:59 AM. -dateDTF-required-message=You must provide a choice. -dateDesc-label=Description -DTF-pattern=MM/dd/yyyy h:mm a -submitChoice=Add +#addChoice=Adding a choice +#textName-label=Choice * +#textName-required-message=You must provide a choice. +#textDesc-label=Description +#imgFile-label=Image * +#imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ +#imgFile-regexp-message=The image must be a JPG, GIF or PNG file. +#imgFile-required-message=You must provide a choice. +#imgDesc-label=Description +#dateDTF-label=Date and time * +#dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? +#dateDTF-regexp-message=Date does not match pattern 12/31/2000 12:59 AM. +#dateDTF-required-message=You must provide a choice. +#dateDesc-label=Description +#DTF-pattern=MM/dd/yyyy h:mm a +#submitChoice=Add #comments comments=Comments about the poll Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties 2010-03-23 11:15:12 UTC (rev 2955) @@ -24,21 +24,21 @@ #choices addChoice=Ajout d'un choix -textName-label=Choix * -textName-required-message=Vous devez saisir un choix. -textDesc-label=Description -imgFile-label=Image * -imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ -imgFile-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG. -imgFile-required-message=Vous devez saisir un choix. -imgDesc-label=Description -dateDTF-label=Date et heure * -dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? -dateDTF-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59. -dateDTF-required-message=Vous devez saisir un choix. -dateDesc-label=Description -DTF-pattern=dd/MM/yyyy HH:mm -submitChoice=Ajouter +#textName-label=Choix * +#textName-required-message=Vous devez saisir un choix. +#textDesc-label=Description +#imgFile-label=Image * +#imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ +#imgFile-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG. +#imgFile-required-message=Vous devez saisir un choix. +#imgDesc-label=Description +#dateDTF-label=Date et heure * +#dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? +#dateDTF-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59. +#dateDTF-required-message=Vous devez saisir un choix. +#dateDesc-label=Description +#DTF-pattern=dd/MM/yyyy HH:mm +#submitChoice=Ajouter #comments comments=Commentaires \u00E0 propos du sondage Added: trunk/pollen-ui/src/main/webapp/ErrorPage.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/ErrorPage.tml (rev 0) +++ trunk/pollen-ui/src/main/webapp/ErrorPage.tml 2010-03-23 11:15:12 UTC (rev 2955) @@ -0,0 +1,4 @@ +<t:border t:address="address" t:pageLogo="literal:Index" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> + +</t:border> Modified: trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-03-23 11:15:12 UTC (rev 2955) @@ -64,7 +64,8 @@ </p:else> </t:if> <th t:type="loop" t:source="choices" t:value="choice" t:volatile="true"> - <t:unless test="choice.hidden"> + <t:unless test="choice.hidden"> + <!-- Blocks for each choice type --> <t:block t:id="choiceText"> <span class="desc">${choice.text}</span> </t:block> @@ -76,6 +77,7 @@ <t:block t:id="choiceDate"> <t:output value="choice.date" format="dateFormat"/> </t:block> + <!-- Display choice with or whithout description --> <t:if t:test="choice.description"> <span t:type="ck/Tooltip" t:value="choice.description" t:effect="blind"> <t:delegate to="choiceBlock" /> @@ -84,7 +86,8 @@ <t:delegate to="choiceBlock" /> </p:else> </t:if> - <t:if test="canDeleteChoice()"> + <t:if test="canDeleteChoice"> + <!-- Action to delete the choice --> <t:actionlink t:id="deleteChoice" context="choice.id" t:mixins="confirm" t:message="message:pollen.ui.choice.delete.confirm"> <img src="${asset:context:img/delete.png}" title="message:pollen.ui.choice.delete.title" @@ -94,39 +97,39 @@ </t:unless> </th> </tr> - </thead><!-- - <t:if test="pollRunning">--> -<!-- <tfoot> + </thead> + <t:if test="canVote"> + <tfoot> <tr> <t:if test="accountFieldDisplayed"> <th id="voterName"> - <t:textField t:value="pollAccount.votingId" t:id="pollAccountName" t:validate="required"/> + <input t:type="textfield" t:id="pollAccountName" value="pollAccount.votingId" t:validate="required"/> </th> <p:else> <th></th> </p:else> </t:if> <t:loop t:source="choices" t:value="choice" volatile="true"> - <t:if test="!choiceOfVote.hidden"> + <t:if test="!choice.hidden"> <th> - <t:if test="isNormalVoteCounting()"> - <t:checkbox t:value="addChoice" /> + <t:if test="poll.voteCounting.normal"> + <input t:type="checkbox" value="addChoice" /> </t:if> - <t:if test="isPercentageVoteCounting()"> - <t:textField t:value="choiceOfVote.value" size="3" t:validate="required, min=0, max=100"/>% + <t:if test="poll.voteCounting.percentage"> + <t:textField t:value="currentVote.getChoiceValues(choice.id)" size="3" t:validate="required, min=0, max=100"/>% </t:if> - <t:if test="isCondorcetVoteCounting()"> + <t:if test="poll.voteCounting.condorcet"> <t:textField t:id="condorcetInput" t:value="choiceOfVote.value" size="3" t:nulls="zero" t:validate="min=0, max=99"/> </t:if> - <t:if test="isNumberVoteCounting()"> + <t:if test="poll.voteCounting.number"> <t:textField t:value="addNumberVote" size="3" /> </t:if> </th> </t:if> </t:loop> </tr> - </tfoot>--> - <!--</t:if>--> + </tfoot> + </t:if> <tbody> <t:unless t:test="poll.anonymous"> <t:loop t:source="votes" t:value="vote" t:rowIndex="voteIndex" volatile="true"> @@ -229,47 +232,50 @@ <!--</t:zone>--> - <!-- Ajout de choix --> - <t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUId"/> - <t:if test="${pollChoiceRunning}"> - <h4>${message:addChoice}</h4> + <!-- Ajout de choix --> + <!--<t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUId"/>--> + <t:if test="canAddChoice"> + <h4>${message:pollen.ui.choice.add.title}</h4> <div id="choiceFormDiv"> - <t:form t:id="choiceForm"> - <t:formfragment t:id="textChoiceFragment" visible="textType"> - <t:label for="textName" /> - <br/> - <t:textfield t:id="textName" t:value="newChoice.name" t:validate="required"/> - <br/> - <t:label for="textDesc" /> - <br/> - <t:textfield t:id="textDesc" t:value="newChoice.description" /> - </t:formfragment> - <t:formfragment t:id="dateChoiceFragment" visible="dateType"> - <t:label for="dateDTF" /> - <br/> - <input t:id="dateDTF" t:value="newDateChoice.date" t:validate="required, regexp" datePattern="${message:DTF-pattern}"/> - <br/> - <t:label for="dateDesc" /> - <br/> - <t:textfield t:id="dateDesc" t:value="newDateChoice.description" /> - </t:formfragment> - <t:formfragment t:id="imgChoiceFragment" visible="imageType"> - <t:label for="imgFile" /> - <br/> - <input t:type="upload" t:id="imgFile" t:value="newImageChoice.img" t:validate="required, regexp" /> - <br/> - <t:label for="imgDesc" /> - <br/> - <t:textfield t:id="imgDesc" t:value="newImageChoice.description" /> - </t:formfragment> - <t:submit t:id="submitChoiceForm" t:value="${message:submitChoice}" /> + <t:form t:id="addChoice"> + <t:if t:test="newChoice.type.date"> + <label t:type="label" for="choiceDate" />*<br /> + <input t:type="ck/dateTimeField" t:id="choiceDate" value="newChoice.date" + t:timePicker="true" t:timePickerAdjacent="true" t:validate="required, regexp" + t:datePattern="message:pollen.ui.choice.datePattern"/> + </t:if> + <t:if t:test="newChoice.type.image"> + <label t:type="label" for="choiceImage" />*<br /> + <input t:type="upload" t:id="choiceImage" t:value="newChoice.image" t:validate="required, regexp" /> + </t:if> + <t:if t:test="newChoice.type.text"> + <label t:type="label" for="choiceText" />*<br /> + <input t:type="textfield" t:id="choiceText" value="newChoice.text" t:validate="required"/> + </t:if> +<!-- <t:delegate t:to="newChoiceBlock" /><br /> + <t:block t:id="newChoiceDate"> + <label t:type="label" for="choiceDate" />*<br /> + <input t:type="ck/dateTimeField" t:id="choiceDate" value="newChoice.date" + t:timePicker="true" t:timePickerAdjacent="true" t:validate="required, regexp" + t:datePattern="message:pollen.ui.choice.datePattern"/> + </t:block> + <t:block t:id="newChoiceImage"> + <label t:type="label" for="choiceImage" />*<br /> + <input t:type="upload" t:id="choiceImage" t:value="newChoice.image" t:validate="required, regexp" /> + </t:block> + <t:block t:id="newChoiceText"> + <label t:type="label" for="choiceText" />*<br /> + <input t:type="textfield" t:id="choiceText" value="newChoice.text" t:validate="required"/> + </t:block>--> + <label t:type="label" for="choiceDescription" /><br /> + <input t:type="textfield" t:id="choiceDescription" value="newChoice.description" /> + <input t:type="submit" value="message:pollen.ui.choice.add.submit" /> </t:form> </div> </t:if> - <!-- Ajout de commentaires --> - + <!-- Ajout de commentaires --> <h3>${message:comments}</h3> <t:zone t:id="commentZone" show="show" update="show"> <div id="commentsDiv"> Modified: trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-03-23 11:15:12 UTC (rev 2955) @@ -10,7 +10,7 @@ <t:grid t:id="pollsGrid" t:source="polls" t:row="poll" model="pollsModel" t:inPlace="true" t:rowsPerPage="10" t:pagerPosition="bottom" t:rowClass="prop:evenodd.next"> <p:functionsCell> - <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollId"> + <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollUId"> <img src="${asset:context:img/vote.png}" title="${message:vote-help}" alt="${message:vote}" /> </t:PageLink> <t:PageLink t:page="poll/results" t:context="adminId"> @@ -21,18 +21,18 @@ <t:PageLink t:page="poll/modification" t:context="adminId"> <img src="${asset:context:img/edit.png}" title="${message:edit-help}" alt="${message:edit}" /> </t:PageLink> - <t:ActionLink t:id="close" t:context="poll.pollId"> + <t:ActionLink t:id="close" t:context="poll.pollUId"> <img src="${asset:context:img/close.png}" title="${message:close-help}" alt="${message:close}" /> </t:ActionLink> </t:unless> - <t:ActionLink t:id="export" t:context="poll.pollId"> + <t:ActionLink t:id="export" t:context="poll.pollUId"> <img src="${asset:context:img/export.png}" title="${message:export-help}" alt="${message:export}" /> </t:ActionLink> - <t:PageLink t:page="poll/creation" t:context="poll.pollId"> + <t:PageLink t:page="poll/creation" t:context="poll.pollUId"> <img src="${asset:context:img/copy.png}" title="${message:copy-help}" alt="${message:copy}" /> </t:PageLink> - <t:ActionLink t:id="deletePoll" t:context="poll.pollId"> + <t:ActionLink t:id="deletePoll" t:context="poll.pollUId"> <img src="${asset:context:img/delete.png}" title="${message:delete-help}" alt="${message:delete}" /> </t:ActionLink> </p:functionsCell> Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java =================================================================== --- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -18,4 +18,16 @@ public enum ChoiceType { TEXT, DATE, IMAGE; + + public boolean isText() { + return this.equals(TEXT); + } + + public boolean isDate() { + return this.equals(DATE); + } + + public boolean isImage() { + return this.equals(IMAGE); + } } Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java =================================================================== --- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -19,6 +19,22 @@ public enum PollType { FREE, RESTRICTED, GROUP; + public boolean isFree() { + return this.equals(FREE); + } + + public boolean isRestricted() { + return this.equals(RESTRICTED); + } + + public boolean isGroup() { + return this.equals(GROUP); + } + + public boolean isRestrictedOrGroup() { + return isRestricted() || isGroup(); + } + public static boolean isGroupType(String value) { return GROUP.name().equals(value); } Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java =================================================================== --- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-23 10:38:12 UTC (rev 2954) +++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-23 11:15:12 UTC (rev 2955) @@ -18,4 +18,20 @@ public enum VoteCountingType { NORMAL, PERCENTAGE, CONDORCET, NUMBER; + + public boolean isNormal() { + return this.equals(NORMAL); + } + + public boolean isPercentage() { + return this.equals(PERCENTAGE); + } + + public boolean isCondorcet() { + return this.equals(CONDORCET); + } + + public boolean isNumber() { + return this.equals(NUMBER); + } }