r3001 - in trunk: . pollen-business/src/main/java/org/chorem/pollen pollen-business/src/main/java/org/chorem/pollen/entity pollen-business/src/main/java/org/chorem/pollen/service pollen-business/src/main/resources/i18n pollen-business/src/main/xmi pollen-ui pollen-ui/src/main/java/org/chorem/pollen/ui/components pollen-ui/src/main/java/org/chorem/pollen/ui/data pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll pollen-ui/src/main/java/org/chorem/pollen/ui/services pollen-ui/src/main/we
Author: fdesbois Date: 2010-05-19 14:59:57 +0200 (Wed, 19 May 2010) New Revision: 3001 Url: http://chorem.org/repositories/revision/pollen/3001 Log: Create models to simplify lists managment in PollForm Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantListModel.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantsListener.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollFormModel.java Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.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-ui/pom.xml trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/SubForm.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java trunk/pollen-ui/src/main/webapp/poll/PollForm.tml trunk/pom.xml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,24 +1,24 @@ +package org.chorem.pollen; -package org.chorem.pollen; import static org.nuiton.i18n.I18n.n_; /** * PollenBusinessException - * + * <p/> * Created: 24 févr. 2010 * * @author fdesbois * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * <p/> + * Mise a jour: $Date$ + * par : $Author$ */ public class PollenBusinessException extends Exception { private static final long serialVersionUID = 1L; protected PollenExceptionType type; - + protected Object[] args; public PollenBusinessException(PollenExceptionType type, Object... args) { @@ -28,42 +28,48 @@ } public PollenBusinessException(Throwable exception, - PollenExceptionType type, Object... args) { + PollenExceptionType type, Object... args) { super(type.getMessage(), exception); this.args = args; this.type = type; } public enum PollenExceptionType { - /** Exception when poll is not found in data **/ + + /** Exception when poll is not found in data * */ POLL_NOT_EXIST(n_("pollen.exception.poll_not_exist")), - /** Exception when user login exists in data **/ + /** Exception when user login exists in data * */ USER_LOGIN_EXIST(n_("pollen.exception.user_login_exist")), - /** Exception when user email exists in data **/ + /** Exception when user email exists in data * */ USER_EMAIL_EXIST(n_("pollen.exception.user_email_exist")), - /** Exception when user is not found in data **/ + /** Exception when user is not found in data * */ USER_NOT_EXIST(n_("pollen.exception.user_not_exist")), - /** Exception when password is not valid for some user **/ + /** Exception when password is not valid for some user * */ USER_WRONG_PASSWORD(n_("pollen.exception.user_wrong_password")), - /** Exception when stmp server is not available **/ + /** Exception when stmp server is not available * */ SMTP_NOT_AVAILABLE(n_("pollen.exception.smtp_not_available")), - /** Exception when favorite list name is already defined for user **/ + /** Exception when favorite list name is already defined for user * */ FAVORITE_LIST_NAME_EXIST( n_("pollen.exception.favorite_list_name_exist")), /** - * Exception when participant name ($2) and email ($3) are - * already defined for the current list ($1). - **/ + * Exception when participant name ($2) and email ($3) are already + * defined for the current list ($1). + */ PARTICIPANT_EXIST(n_("pollen.exception.participant_exist")), - + /** * Exception when favorite participant name ($2) with no email is * already defined for the current list ($1). - **/ + */ PARTICIPANT_EXIST_WITHOUT_EMAIL( n_("pollen.exception.participant_exist_without_email")), - /** Exception when poll already exist at creation **/ - POLL_EXIST(n_("pollen.exception.poll_exist")); + /** Exception when poll already exist at creation * */ + POLL_EXIST(n_("pollen.exception.poll_exist")), + /** + * Exception when doubloons ($2) are found when adding participants in a + * list ($1). + */ + PARTICIPANT_DOUBLOONS(n_("pollen.exception.participant_doubloons")); private String message; Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/FavoriteListImpl.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -13,7 +13,7 @@ */ public class FavoriteListImpl extends FavoriteListAbstract { - @Override + @Override public Collection<Participant> getParticipants() { Collection<Participant> results = new ArrayList<Participant>(); for (FavoriteParticipant account : getFavoriteParticipant()) { @@ -26,23 +26,26 @@ public void setParticipants(Collection<Participant> participants) throws PollenBusinessException { setFavoriteParticipant(new ArrayList<FavoriteParticipant>()); - for (Participant participant : participants) { - addParticipant(participant); - } + ParticipantHelper.setParticipants(this, participants); } - protected void addParticipant(Participant participant) - throws PollenBusinessException { + @Override + public String addParticipant(Participant participant) { String name = participant.getName(); String email = participant.getEmail(); - - ParticipantHelper.checkParticipantExist(this, name, email); + String error = + ParticipantHelper.checkParticipantExist(this, name, email); + if (error != null) { + return error; + } + FavoriteParticipant favorite = new FavoriteParticipantImpl(); favorite.setName(participant.getName()); favorite.setEmail(participant.getEmail()); favorite.setWeight(participant.getWeight()); favorite.setFavoriteList(this); addFavoriteParticipant(favorite); + return null; } } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ParticipantHelper.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,7 +1,11 @@ package org.chorem.pollen.entity; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.pollen.PollenBusinessException; +import java.util.Collection; + /** * Helper classes for common Participant manipulations. * @@ -12,6 +16,8 @@ */ public class ParticipantHelper { + private static final Log log = LogFactory.getLog(ParticipantHelper.class); + /** * Check the existence of participant from a {@code list}. The existence is * tested on {@code name} and {@code email}. The {@code email} can be null. @@ -19,12 +25,11 @@ * @param list ParticipantList which contains a list of Participant * @param name Name of the participant to check * @param email Email of the participant to check - * @throws PollenBusinessException if name and email correspond to an - * existing participant in the list. + * @return an error code if participant already exist : simply the + * concatenation of name and email. */ - public static void checkParticipantExist( - ParticipantList list, String name, String email) - throws PollenBusinessException { + public static String checkParticipantExist( + ParticipantList list, String name, String email) { for (Participant participant : list.getParticipants()) { boolean emailNull = (email == null && participant.getEmail() == null); boolean emailCheck = emailNull || @@ -32,16 +37,48 @@ if (name != null && name.equals(participant.getName()) && emailCheck) { if (emailNull) { - throw new PollenBusinessException( - PollenBusinessException.PollenExceptionType.PARTICIPANT_EXIST_WITHOUT_EMAIL, - list.getName(), name); + return name; } else { - throw new PollenBusinessException( - PollenBusinessException.PollenExceptionType.PARTICIPANT_EXIST, - list.getName(), name, email); + return name + " (" + email + ")"; } } } + return null; } + /** + * Set the {@code participants} in the {@code list}. Doubloons can be found + * during adding process. An exception will be thrown in case of doubloons. + * + * @param list where participants will be added + * @param participants to add to the list + * @throws PollenBusinessException for doubloons case + */ + public static void setParticipants(ParticipantList list, + Collection<Participant> participants) + throws PollenBusinessException { + if (log.isDebugEnabled()) { + log.debug("Set participants for list : " + list.getName()); + } + StringBuilder doubloons = new StringBuilder(); + String separator = ", "; + for (Participant participant : participants) { + // Add the participant to the list + String doubloon = list.addParticipant(participant); + // Check error doubloon + if (doubloon != null) { + doubloons.append(separator).append(doubloon); + } else if (log.isDebugEnabled()) { + log.debug("Participant added : " + participant.getName() + + " _ " + participant.getEmail()); + } + } + // If doubloons are found, throw an exception + if (!doubloons.toString().isEmpty()) { + throw new PollenBusinessException( + PollenBusinessException.PollenExceptionType.PARTICIPANT_DOUBLOONS, + list.getName(), doubloons.substring(separator.length())); + } + } + } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollAccountImpl.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,6 +1,7 @@ package org.chorem.pollen.entity; -import org.chorem.pollen.PollenBinderHelper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.pollen.PollenBusinessException; import java.util.ArrayList; @@ -14,6 +15,8 @@ */ public class PollAccountImpl extends PollAccountAbstract { + private static final Log log = LogFactory.getLog(PollAccountImpl.class); + @Override public Collection<Participant> getParticipants() { // for a simple account, will return null @@ -25,34 +28,37 @@ for (PollAccount account : getChild()) { results.add(account); } - } + } return results; } @Override public void setParticipants(Collection<Participant> participants) throws PollenBusinessException { - if (!list) { + if (!list) { throw new UnsupportedOperationException( "Unable to set participants from a child account"); } setChild(new ArrayList<PollAccount>()); - for (Participant participant : participants) { - addParticipant(participant); - } + ParticipantHelper.setParticipants(this, participants); } - protected void addParticipant(Participant participant) - throws PollenBusinessException { + @Override + public String addParticipant(Participant participant) { String name = participant.getName(); String email = participant.getEmail(); - ParticipantHelper.checkParticipantExist(this, name, email); + String error = + ParticipantHelper.checkParticipantExist(this, name, email); + if (error != null) { + return error; + } PollAccount account = new PollAccountImpl(); account.setName(name); account.setEmail(email); account.setWeight(participant.getWeight()); addChild(account); + return null; } } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,10 +1,5 @@ - package org.chorem.pollen.service; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import org.apache.commons.collections.CollectionUtils; import org.chorem.pollen.PollenBinderHelper; import org.chorem.pollen.PollenBusinessException; @@ -26,18 +21,21 @@ import org.chorem.pollen.entity.UserAccount; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; -import org.nuiton.topia.persistence.util.TopiaEntityBinder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + /** * ServicePoll - * + * <p/> * Created: 23 mars 2010 * * @author fdesbois * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * <p/> + * Mise a jour: $Date$ + * par : $Author$ */ public class ServicePollImpl extends ServicePollAbstract { @@ -54,7 +52,7 @@ @Override protected void treateError(TopiaContext transaction, Exception eee, - String message, Object... args) throws PollenException { + String message, Object... args) throws PollenException { context.treateError(transaction, eee, message, args); } @@ -88,11 +86,11 @@ } @Override - protected void executeCreatePoll(TopiaContext transaction, - List<Object> errorArgs, Poll poll, Collection<ParticipantList> lists) + protected void executeCreatePoll(TopiaContext transaction, + List<Object> errorArgs, Poll poll, Collection<ParticipantList> lists) throws TopiaException, - IllegalArgumentException, - PollenBusinessException { + IllegalArgumentException, + PollenBusinessException { errorArgs.add(poll.getTitle()); errorArgs.add(poll.getUid()); @@ -178,7 +176,7 @@ } // Create accounts only on first participant list results = createPersonAccounts(accountDAO, - lists.iterator().next()); + lists.iterator().next()); break; case GROUP: if (CollectionUtils.isEmpty(lists)) { @@ -189,7 +187,7 @@ for (ParticipantList list : lists) { // Create the accountList PollAccount accountList = accountDAO.create( - context.createPollenUrlId()); + context.createPollenUrlId()); accountList.setList(true); accountList.setName(list.getName()); @@ -206,7 +204,7 @@ } protected List<PollAccount> createPersonAccounts(PollAccountDAO dao, - ParticipantList list) + ParticipantList list) throws TopiaException { List<PollAccount> results = new ArrayList<PollAccount>(); @@ -234,7 +232,7 @@ for (Choice choice : source) { Choice newChoice = dao.create(); PollenBinderHelper.getSimpleTopiaBinder(Choice.class). - copy(choice, newChoice); + copy(choice, newChoice); results.add(newChoice); } return results; @@ -242,7 +240,7 @@ @Override protected void executeUpdatePoll(TopiaContext transaction, - Poll poll) throws TopiaException { + Poll poll) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @@ -266,19 +264,19 @@ @Override protected void executeCreateUpdateVote(TopiaContext transaction, - PollAccount person) throws TopiaException { + PollAccount person) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override - protected void executeDeleteVote(TopiaContext transaction, Poll poll, - PollAccount person) throws TopiaException { + protected void executeDeleteVote(TopiaContext transaction, Poll poll, + PollAccount person) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override - protected Poll executeGetPollForUpdate(TopiaContext transaction, - String pollUId) throws PollenBusinessException, TopiaException { + protected Poll executeGetPollForUpdate(TopiaContext transaction, + String pollUId) throws PollenBusinessException, TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @@ -296,33 +294,33 @@ @Override protected List<Poll> executeGetPollsByUser(TopiaContext transaction, - UserAccount user) throws TopiaException { + UserAccount user) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override protected List<Comment> executeGetComments(TopiaContext transaction, - Poll poll, int startIndex, int endIndex) + Poll poll, int startIndex, int endIndex) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override protected List<PollAccount> executeGetVotes(TopiaContext transaction, - Poll poll, int startIndex, int endIndex) + Poll poll, int startIndex, int endIndex) throws TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override - protected Poll executeGetPollForResults(TopiaContext transaction, - String pollUId) throws PollenBusinessException, TopiaException { + protected Poll executeGetPollForResults(TopiaContext transaction, + String pollUId) throws PollenBusinessException, TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @Override - protected Poll executeGetPollForVote(TopiaContext transaction, - String pollUId) throws PollenBusinessException, TopiaException { + protected Poll executeGetPollForVote(TopiaContext transaction, + String pollUId) throws PollenBusinessException, TopiaException { throw new UnsupportedOperationException("Not supported yet."); } @@ -337,6 +335,7 @@ @Override protected Participant executeGetNewPollParticipant() { PollAccount participant = new PollAccountImpl(); + participant.setWeight(1.); return participant; } 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-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-05-19 12:59:57 UTC (rev 3001) @@ -81,6 +81,7 @@ pollen.exception.favorite_participant_exist= pollen.exception.favorite_participant_exist_without_email= pollen.exception.load_configuration= +pollen.exception.participant_doubloons= pollen.exception.participant_exist= pollen.exception.participant_exist_without_email= pollen.exception.poll_exist= 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-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-05-19 12:59:57 UTC (rev 3001) @@ -78,6 +78,7 @@ pollen.error.serviceVote.hasAlreadyVoted= pollen.exception.favorite_list_name_exist=La liste %1$s existe d\u00E9j\u00E0 pour l'utilisateur %2$s pollen.exception.load_configuration=La configuration n'a pas \u00E9t\u00E9 charg\u00E9e correctement \! Veuillez v\u00E9rifier le d\u00E9marrage de l'application. +pollen.exception.participant_doubloons=Les doublons de la liste %1$s ont \u00E9t\u00E9 ignor\u00E9s \: %2$s pollen.exception.participant_exist=La liste %1$s contient d\u00E9j\u00E0 un votant nomm\u00E9 %2$s avec un email %3$s pollen.exception.participant_exist_without_email=La liste %1$s contient d\u00E9j\u00E0 un votant nomm\u00E9 %2$s avec aucun email pollen.exception.poll_exist= Modified: trunk/pollen-business/src/main/xmi/pollen.zargo =================================================================== (Binary files differ) Modified: trunk/pollen-ui/pom.xml =================================================================== --- trunk/pollen-ui/pom.xml 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-ui/pom.xml 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,201 +1,209 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <!-- ************************************************************* --> - <!-- *** POM Relationships *************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> - <parent> - <groupId>org.chorem</groupId> - <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.chorem</groupId> + <artifactId>pollen</artifactId> + <version>2.0-SNAPSHOT</version> + </parent> - <groupId>org.chorem.pollen</groupId> - <artifactId>pollen-ui</artifactId> + <groupId>org.chorem.pollen</groupId> + <artifactId>pollen-ui</artifactId> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>pollen-business</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </dependency> - <dependency> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-core</artifactId> - </dependency> - <dependency> - <groupId>org.nuiton.web</groupId> - <artifactId>nuiton-tapestry-extra</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> - <dependency> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-upload</artifactId> - </dependency> - <dependency> - <groupId>org.chenillekit</groupId> - <artifactId>chenillekit-tapestry</artifactId> - </dependency> - <dependency> - <groupId>jfree</groupId> - <artifactId>jfreechart</artifactId> - </dependency> - <dependency> - <groupId>javassist</groupId> - <artifactId>javassist</artifactId> - </dependency> - <dependency> - <groupId>net.sf.opencsv</groupId> - <artifactId>opencsv</artifactId> - </dependency> - <dependency> - <groupId>rome</groupId> - <artifactId>rome</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </dependency> - <dependency> - <groupId>org.nuiton</groupId> - <artifactId>nuiton-utils</artifactId> - </dependency> - <dependency> - <groupId>org.jvnet.hudson.winstone</groupId> - <artifactId>winstone</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>pollen-business</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </dependency> + <dependency> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-core</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.web</groupId> + <artifactId>nuiton-tapestry-extra</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + <dependency> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-upload</artifactId> + </dependency> + <dependency> + <groupId>org.chenillekit</groupId> + <artifactId>chenillekit-tapestry</artifactId> + </dependency> + <dependency> + <groupId>jfree</groupId> + <artifactId>jfreechart</artifactId> + </dependency> + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + </dependency> + <dependency> + <groupId>net.sf.opencsv</groupId> + <artifactId>opencsv</artifactId> + </dependency> + <dependency> + <groupId>rome</groupId> + <artifactId>rome</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + </dependency> + <dependency> + <groupId>org.jvnet.hudson.winstone</groupId> + <artifactId>winstone</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> - <!-- ************************************************************* --> - <!-- *** Project Information ************************************* --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> - <name>Pollen :: Web Interface</name> - <description>Interface Web Tapestry pour Pollen</description> + <name>Pollen :: Web Interface</name> + <description>Interface Web Tapestry pour Pollen</description> - <!-- ************************************************************* --> - <!-- *** Build Settings ****************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> - <packaging>war</packaging> + <packaging>war</packaging> - <properties> - <redmine.releaseFiles>target/${project.build.finalName}.war</redmine.releaseFiles> + <properties> + <redmine.releaseFiles>target/${project.build.finalName}.war + </redmine.releaseFiles> - <i18n.collectOutputName>app</i18n.collectOutputName> - <i18n.bundleOutputName>app</i18n.bundleOutputName> - </properties> + <i18n.collectOutputName>app</i18n.collectOutputName> + <i18n.bundleOutputName>app</i18n.bundleOutputName> + </properties> - <reporting> - <!-- Adds a report detailing the components, mixins and base classes defined by this module. --> - <!-- <plugins> - <plugin> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-component-report</artifactId> - <version>${tapestry.version}</version> - <configuration> - <rootPackage>org.chorem.pollen.ui</rootPackage> - </configuration> - </plugin> - </plugins> --> - </reporting> + <reporting> + <!-- Adds a report detailing the components, mixins and base classes defined by this module. --> + <!-- <plugins> + <plugin> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-component-report</artifactId> + <version>${tapestry.version}</version> + <configuration> + <rootPackage>org.chorem.pollen.ui</rootPackage> + </configuration> + </plugin> + </plugins> --> + </reporting> - <build> - <!-- call result war : pollen-xxx.war --> - <finalName>pollen-${project.version}</finalName> + <build> + <!-- call result war : pollen-xxx.war --> + <finalName>pollen-${project.version}</finalName> - <!-- Add main class into war to make it executable --> - <plugins> + <!-- Add main class into war to make it executable --> + <plugins> - <plugin> - <groupId>org.nuiton.i18n</groupId> - <artifactId>maven-i18n-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>tapestry-bundle</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <archive> - <manifest> - <mainClass>org.nuiton.util.war.WinstoneLauncher</mainClass> - </manifest> - </archive> - <overlays> - <overlay> - <groupId>org.nuiton</groupId> - <artifactId>nuiton-utils</artifactId> - <type>jar</type> - <includes> - <include>**/war/Winstone*</include> - </includes> - </overlay> - <overlay> - <groupId>org.jvnet.hudson.winstone</groupId> - <artifactId>winstone</artifactId> - <type>jar</type> - </overlay> - </overlays> - </configuration> - </plugin> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <configuration> - <connectors> - <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> - <port>8888</port> - </connector> - </connectors> - </configuration> - </plugin> - </plugins> - </build> + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>tapestry-bundle</goal> + </goals> + </execution> + </executions> + </plugin> - <!--<repositories> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <archive> + <manifest> + <mainClass>org.nuiton.util.war.WinstoneLauncher</mainClass> + </manifest> + </archive> + <overlays> + <overlay> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + <type>jar</type> + <includes> + <include>**/war/Winstone*</include> + </includes> + </overlay> + <overlay> + <groupId>org.jvnet.hudson.winstone</groupId> + <artifactId>winstone</artifactId> + <type>jar</type> + </overlay> + </overlays> + </configuration> + </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <configuration> + <connectors> + <connector + implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> + <port>8888</port> + </connector> + </connectors> + </configuration> + </plugin> + </plugins> + </build> - chenillekit Repository - <repository> - <id>chenillekit</id> - <url>http://www.chenillekit.org/mvnrepo/release</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> + <!--<repositories> - Maven Java.net Repository - <repository> - <id>maven2-repository.dev.java.net</id> - <name>Java.net Repository for Maven</name> - <url>http://download.java.net/maven/2/</url> - <layout>default</layout> - </repository> - </repositories>--> + chenillekit Repository + <repository> + <id>chenillekit</id> + <url>http://www.chenillekit.org/mvnrepo/release</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + + Maven Java.net Repository + <repository> + <id>maven2-repository.dev.java.net</id> + <name>Java.net Repository for Maven</name> + <url>http://download.java.net/maven/2/</url> + <layout>default</layout> + </repository> + </repositories>--> </project> Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/SubForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/SubForm.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/SubForm.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -3,6 +3,7 @@ import org.apache.tapestry5.Block; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.ioc.annotations.Inject; +import org.slf4j.Logger; /** * Created: 14 mai 2010 @@ -16,12 +17,18 @@ private boolean visible; @Inject + private Logger logger; + + @Inject private Block formBlock; @Inject private Block noFormBlock; public Block getActiveBlock() { + if (logger.isDebugEnabled()) { + logger.debug("form already visible : " + visible); + } if (visible) { return noFormBlock; } Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantListModel.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantListModel.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantListModel.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -0,0 +1,160 @@ +package org.chorem.pollen.ui.data; + +import org.apache.tapestry5.ValueEncoder; +import org.chorem.pollen.PollenBusinessException; +import org.chorem.pollen.entity.Participant; +import org.chorem.pollen.entity.ParticipantList; +import org.chorem.pollen.service.ServicePoll; +import org.chorem.pollen.ui.services.PollenManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Created: 18 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class ParticipantListModel implements ValueEncoder<Participant> { + + private static final Logger logger = + LoggerFactory.getLogger(ParticipantListModel.class); + + protected ServicePoll service; + + protected PollenManager manager; + + protected ParticipantList list; + + protected ParticipantMap participants; + + public ParticipantListModel(ServicePoll service, PollenManager manager) { + this.service = service; + this.manager = manager; + participants = new ParticipantMap(); + } + + public Participant addNewParticipant() { + Participant newParticipant = service.getNewPollParticipant(); + String id = manager.createPollenId(); + participants.put(id, newParticipant); + return newParticipant; + } + + public void removeParticipant(Participant participant) { + if (logger.isDebugEnabled()) { + logger.debug("Remove participant : " + participant); + } + participants.remove(participant); + } + + public Collection<Participant> getParticipants() { + return participants.values(); + } + + public void setList(ParticipantList participantList) { + if (logger.isDebugEnabled()) { + logger.debug("Set current list : " + participantList.getName()); + } + list = participantList; + participants.clear(); + for (Participant participant : participantList.getParticipants()) { + String id = participant.getId() != null ? participant.getId() : + manager.createPollenId(); + if (logger.isTraceEnabled()) { + logger.trace("Push participant : " + + participant.getName() + + " (" + participant.getEmail() + ")" + + " ID = " + id); + } + participants.put(id, participant); + } + } + + public ParticipantList getList() { + return list; + } + + public void reset() { + if (logger.isDebugEnabled()) { + logger.debug("Reset current list"); + } + list = null; + participants.clear(); + } + + public void persistParticipants() throws PollenBusinessException { + if (logger.isDebugEnabled()) { + logger.debug("Save current list : " + list.getName()); + } + list.setParticipants(getParticipants()); + } + + @Override + public String toClient(Participant value) { + String key = participants.getKey(value); + if (logger.isTraceEnabled()) { + logger.trace("toClient key = " + key); + } + return key; + } + + @Override + public Participant toValue(String key) { + Participant value = participants.getValue(key); + if (logger.isTraceEnabled()) { + logger.trace("toValue from : " + key + " = " + value.getName() + + " (" + value.getEmail() + ")"); + } + return value; + } + + /** + * Participant map is a BidiMap ordered on values inserted using a {@link + * LinkedHashMap}. + */ + protected class ParticipantMap { + + protected Map<String, Participant> participants; + + protected Map<Participant, String> keys; + + public ParticipantMap() { + participants = new LinkedHashMap<String, Participant>(); + keys = new HashMap<Participant, String>(); + } + + public void put(String id, Participant participant) { + participants.put(id, participant); + keys.put(participant, id); + } + + public String getKey(Participant participant) { + return keys.get(participant); + } + + public Participant getValue(String id) { + return participants.get(id); + } + + public void clear() { + keys.clear(); + participants.clear(); + } + + public void remove(Participant participant) { + String id = keys.remove(participant); + participants.remove(id); + } + + public Collection<Participant> values() { + return participants.values(); + } + + } +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantListModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantsListener.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantsListener.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantsListener.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -0,0 +1,24 @@ +package org.chorem.pollen.ui.data; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +/** + * Created: 18 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class ParticipantsListener implements PropertyChangeListener { + + protected boolean changed; + + @Override + public void propertyChange(PropertyChangeEvent evt) { + changed = true; + } + + public boolean hasChanged() { + return changed; + } +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ParticipantsListener.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollFormModel.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollFormModel.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollFormModel.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -0,0 +1,241 @@ +package org.chorem.pollen.ui.data; + +import org.apache.commons.lang.StringUtils; +import org.apache.tapestry5.ValueEncoder; +import org.chorem.pollen.PollenBusinessException; +import org.chorem.pollen.common.PollType; +import org.chorem.pollen.entity.ParticipantList; +import org.chorem.pollen.entity.Poll; +import org.chorem.pollen.service.ServicePoll; +import org.chorem.pollen.ui.pages.poll.PollForm; +import org.chorem.pollen.ui.services.PollenManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Model for PollForm page. Contains the current {@code poll} and its + * participant {@code lists}. Use {@link ParticipantListModel} to manage current + * edited list for restricted or group Poll. Implement a {@link ValueEncoder} to + * manage ParticipantList client conversion in PollForm page. + * <p/> + * Created: 18 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + * @see PollForm + * @see ValueEncoder + */ +public class PollFormModel implements ValueEncoder<ParticipantList> { + + private static final Logger logger = + LoggerFactory.getLogger(PollFormModel.class); + + /** Default listName for Restricted Poll */ + private static final String DEFAULT_LIST_NAME = "LIST"; + + /** Service to manage poll */ + protected ServicePoll service; + + /** Current poll in edition */ + protected Poll poll; + + /** Current lists in edition */ + protected Map<String, ParticipantList> lists; + + /** Current listModel that contains current edited list and its participants */ + protected ParticipantListModel listModel; + + /** + * Constructor of PollFormModel. Initialize with edited {@code poll}. Need + * services {@code servicePoll} and {@code manager} to manage the {@code + * poll}. + * + * @param poll Current poll in edition + * @param servicePoll ServicePoll to manage poll + * @param manager PollenManager to manage ids + */ + public PollFormModel(Poll poll, + ServicePoll servicePoll, + PollenManager manager) { + this.poll = poll; + this.service = servicePoll; + lists = new LinkedHashMap<String, ParticipantList>(); + this.listModel = new ParticipantListModel(service, manager); + } + + /** + * Change the poll type to {@code type}. The lists managment will depends on + * poll type. For a {@link PollType#RESTRICTED} poll, a new list will be + * automatically added and set for current usage. For a {@link + * PollType#GROUP} poll, the listModel is simply reset. + * + * @param type PollType to change + */ + public void setPollType(PollType type) { + lists.clear(); + if (type.isRestricted()) { + addNewList(DEFAULT_LIST_NAME); + // Set automatically the current list to the unique one + listModel.setList(lists.get(DEFAULT_LIST_NAME)); + } else if (type.isGroup()) { + listModel.reset(); + } + poll.setPollType(type); + } + + /** + * Retrieve a collection of {@link ParticipantList} of current lists. + * + * @return a Collection<ParticipantList> + */ + public Collection<ParticipantList> getLists() { + return lists.values(); + } + + /** + * Add a new list to the poll using the {@code listName}. The list will not + * be added if the {@code listName} is empty or if a list with this {@code + * listName} already exists. + * + * @param listName for the new list to add + * @return true if the list has been added, false otherwise + * @see #addList(ParticipantList) + */ + public boolean addNewList(String listName) { + boolean result = false; + if (StringUtils.isNotEmpty(listName)) { + ParticipantList newList = service.getNewPollList(); + newList.setName(listName); + return addList(newList); + } + return result; + } + + /** + * Add a {@code list} to the poll. The {@code list} will not be added if its + * name already reference an exising list. + * + * @param list ParticipantList to add + * @return true if the list has been added, false otherwise + */ + public boolean addList(ParticipantList list) { + boolean result = false; + if (list != null) { + String listName = list.getName(); + if (!lists.containsKey(listName)) { + if (logger.isDebugEnabled()) { + logger.debug("Add list : " + listName); + } + lists.put(listName, list); + result = true; + } else if (logger.isDebugEnabled()) { + logger.debug("Refuse adding list : " + listName); + } + } + return result; + } + + /** + * Give the current {@link ParticipantListModel} that references the list + * currently edited. + * + * @return the current listModel + */ + public ParticipantListModel getListModel() { + return listModel; + } + + /** + * Set the current list using its {@code listName}. The previous current + * list will be automatically saved. If error occurs during save, the + * previous list will be refresh (no list change will be done). + * + * @param listName name of the list to set (empty name will be ignored) + * @throws PollenBusinessException for saving error (doubloons) + * @see #saveCurrentList() + */ + public void setCurrentList(String listName) throws PollenBusinessException { + if (StringUtils.isNotEmpty(listName)) { + ParticipantList list = getCurrentList(); + try { + // Save previous list if not null + if (list != null) { + saveCurrentList(); + } + // Change list + list = lists.get(listName); + } finally { + // Previous list will be keeped if error occurs during save. + // Apply change in listModel + listModel.setList(list); + } + } + } + + /** + * Get the current list. + * + * @return the current list in edition. + */ + public ParticipantList getCurrentList() { + return listModel.getList(); + } + + /** Remove the current list. */ + public void removeCurrentList() { + if (logger.isDebugEnabled()) { + logger.debug("Remove list : " + listModel.getList().getName()); + } + + getLists().remove(listModel.getList()); + listModel.reset(); + } + + /** + * Save the current participants from current list. + * + * @throws PollenBusinessException for saving errors (doubloons) + * @see ParticipantListModel#persistParticipants() + */ + public void saveCurrentList() throws PollenBusinessException { + listModel.persistParticipants(); + } + + public void create() throws PollenBusinessException { + service.createPoll(poll, getLists()); + } + + /** + * ValueEncoder toClient is used to convert {@code value} to the list name. + * + * @param value ParticipantList to convert toClient + * @return the list name as a unique key for the list + * @see ValueEncoder#toClient(Object) + */ + @Override + public String toClient(ParticipantList value) { + return value.getName(); + } + + /** + * ValueEncoder toClient is used to convert {@code clientValue} key to the + * list object. + * + * @param clientValue List name of the ParticipantList to retrieve. + * @return the ParticipantList corresponding to its name in argument + * @see ValueEncoder#toValue(String) + */ + @Override + public ParticipantList toValue(String clientValue) { + for (ParticipantList curr : lists.values()) { + if (clientValue.equals(curr.getName())) { + return curr; + } + } + return null; + } +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollFormModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,11 +1,8 @@ package org.chorem.pollen.ui.pages.poll; import org.apache.commons.lang.StringUtils; -import org.apache.tapestry5.Block; import org.apache.tapestry5.ComponentResources; -import org.apache.tapestry5.Field; import org.apache.tapestry5.RenderSupport; -import org.apache.tapestry5.ValueEncoder; import org.apache.tapestry5.annotations.Environmental; import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry5.annotations.IncludeStylesheet; @@ -13,7 +10,6 @@ import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; -import org.apache.tapestry5.corelib.components.AjaxFormLoop; import org.apache.tapestry5.corelib.components.Form; import org.apache.tapestry5.corelib.components.Zone; import org.apache.tapestry5.ioc.Messages; @@ -24,7 +20,6 @@ import org.chorem.pollen.entity.Participant; import org.chorem.pollen.entity.ParticipantList; import org.chorem.pollen.entity.Poll; -import org.chorem.pollen.entity.PollAccountImpl; import org.chorem.pollen.entity.PreventRule; import org.chorem.pollen.entity.PreventRuleImpl; import org.chorem.pollen.mail.PreventRuleManager; @@ -32,23 +27,16 @@ import org.chorem.pollen.ui.base.AbstractPollenPage; import org.chorem.pollen.ui.components.Border; import org.chorem.pollen.ui.data.AddressBar; -import org.chorem.pollen.ui.data.GenericEncoder; -import org.chorem.pollen.ui.data.ParticipantsListener; +import org.chorem.pollen.ui.data.ParticipantListModel; +import org.chorem.pollen.ui.data.PollFormModel; import org.chorem.pollen.ui.services.PollenManager; import org.nuiton.web.tapestry5.components.FeedBack; import org.slf4j.Logger; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; /** * PollForm : Creation and Modification. @@ -70,11 +58,8 @@ * <p/> * Created: 2 mars 2010 * - * @author fdesbois - * @version $Revision$ - * <p/> - * Mise a jour: $Date$ - * par : $Author$ + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ */ @IncludeStylesheet("context:css/poll.css") @IncludeJavaScriptLibrary({"context:js/pollForm.js", "context:js/jquery-1.4.2.min.js"}) @@ -123,6 +108,8 @@ poll = null; initMainInfos(); initOptions(); + model = null; + listsFeedback.clearErrors(); } /** @@ -225,7 +212,7 @@ } } - /** ************************* MAIN INFOS ********************************* */ + /** *********************** MAIN INFOS ********************************* */ @InjectComponent private Form mainForm; @@ -410,22 +397,25 @@ return getPoll().getPollType().isFree(); } - /** *********************** LISTS *****************************************/ + /** ********************* LISTS **************************************** */ @Persist - private Map<String, ParticipantList> lists; + private PollFormModel model; +// @Persist +// private Map<String, ParticipantList> lists; + @Property private ParticipantList list; // @Persist // private String listSelectedName; - @Persist - private ParticipantList listSelected; +// @Persist +// private ParticipantList listSelected; +// +// private Map<String, Participant> selectedParticipants; - private Map<String, Participant> selectedParticipants; - @Property private Participant participant; @@ -444,30 +434,47 @@ @InjectComponent private FeedBack listsFeedback; - private ParticipantsListener listSelectedListener; + private boolean editLists; - public Map<String, ParticipantList> getLists() { - if (lists == null) { - lists = new LinkedHashMap<String, ParticipantList>(); - if (getPoll().getPollType().isRestricted()) { - lists.put("LIST", servicePoll.getNewPollList()); + /** DATA ** */ + + public PollFormModel getModel() { + if (model == null) { + if (log.isDebugEnabled()) { + log.debug("-------- NEW MODEL --------"); } + model = new PollFormModel(getPoll(), servicePoll, manager); } - return lists; + return model; } + public ParticipantListModel getListModel() { + return getModel().getListModel(); + } + + public Collection<ParticipantList> getLists() { + return getModel().getLists(); + } + + public ParticipantList getListSelected() { + ParticipantList result = getModel().getCurrentList(); + if (log.isDebugEnabled() && result != null) { + log.debug("List selected : " + result.getName()); + } + return result; + } + + /** PollType change ** */ + @Log Object onChangeFromPollType(String value) { PollType type = PollType.valueOf(value); - getPoll().setPollType(type); + getModel().setPollType(type); if (type.isRestrictedOrGroup()) { listsFeedback.addInfo("Edition en cours d'une liste restreinte. " + "Attention un changement de type de restriction provoquera" + " une remise à zéro de la/les liste(s) en cours d'édition."); } - // Clean persist data for lists : careful, will reset unsaved data - lists = null; - listSelected = null; return refreshListZone(); } @@ -476,249 +483,81 @@ return getPoll().getPollType().isRestrictedOrGroup(); } - public ParticipantList getListSelected() { - if (listSelected == null && getPoll().getPollType().isRestricted()) { - listSelected = getLists().get("LIST"); -// if (listSelected == null) { -// listSelected = servicePoll.getNewPollList(); -// getLists().put("LIST", listSelected); -// if (log.isDebugEnabled()) { -// log.debug("Instantiate list for restricted poll"); -// } -// } - } -// else if (StringUtils.isNotEmpty(listSelectedName)) { -// listSelected = getLists().get(listSelectedName); -// } - if (log.isDebugEnabled() && listSelected != null) { - log.debug("List selected : " + listSelected.getName()); - } - return listSelected; - } + /** GROUPS MANAGMENT ** */ public String getStyleSelected() { return isCurrentListSelected() ? " selected" : ""; } public boolean isCurrentListSelected() { - return listSelected != null && - list.getName().equals(listSelected.getName()); + return getListSelected() != null && + list.getName().equals(getListSelected().getName()); } @Log void onSelectedFromAddList() { - formActivate = true; - if (StringUtils.isNotEmpty(listName) && - !getLists().containsKey(listName)) { - if (log.isDebugEnabled()) { - log.debug("Add list : " + listName); - } - ParticipantList list = servicePoll.getNewPollList(); - list.setName(listName); - getLists().put(listName, list); - listSelected = list; - } else { - if (log.isDebugEnabled()) { - log.debug("Refuse adding list : " + listName); - } -// listSelected = null; -// listsFeedback.addError("Impossible d'ajouter une liste avec un nom vide"); - } + // Set flag for editing lists + setEditListsFlag(); + // Add new list in model + getModel().addNewList(listName); + // Set the new list as selected one + setSelectedList(listName); // Reset form field before refresh form listName = null; - if (log.isDebugEnabled() && listSelected != null) { - log.debug("Selected list : " + listSelected.getName()); - } } @Log void onSelectedFromEditList(String listName) { - formActivate = true; - listSelected = getLists().get(listName); - if (log.isDebugEnabled() && listSelected != null) { - log.debug("List selected : " + listSelected.getName()); - } + // Set flag for editing lists + setEditListsFlag(); + // Set the selected list + setSelectedList(listName); } - public Map<String, Participant> getSelectedParticipants() { - if (selectedParticipants == null) { - if (log.isDebugEnabled() && listSelected != null) { - log.debug("Retrieve participants from list"); - } - selectedParticipants = new LinkedHashMap<String, Participant>(); - for (Participant participant : listSelected.getParticipants()) { - String id = manager.createPollenUrlId(); - selectedParticipants.put(id, participant); - } - } - return selectedParticipants; - } - - @Log - Object onActionFromRemoveList() { - if (log.isDebugEnabled()) { - log.debug("Remove list : " + listSelected.getName()); - } - getLists().remove(listSelected.getName()); - if (log.isDebugEnabled()) { - for (ParticipantList list : getLists().values()) { - log.debug("Existing lists : " + list.getName()); - } - } - listSelected = null; - return refreshListZone(); - } - - @Log - void onSelectedFromSaveList(String listName) { + protected void setSelectedList(String listName) { + // Change current list, will save the previous current one + // Errors can appear during saving previous participants. try { - listSelected.setParticipants(selectedParticipants.values()); + getModel().setCurrentList(listName); } catch (PollenBusinessException eee) { String message = manager.getErrorMessage(eee, messages, logger); listsFeedback.addError(message); } } - -// @Log -// void onSelectedFromRemoveList(String listName) { -// if (formActivate) { -// if (log.isWarnEnabled()) { -// log.warn("Strange submit behavior... Escape remove."); -// } -// return; -// } -// formActivate = true; -// if (log.isDebugEnabled()) { -// log.debug("Remove list : " + listName); -// } -// getLists().remove(listName); -// if (log.isDebugEnabled()) { -// for (ParticipantList list : getLists().values()) { -// log.debug("Existing lists : " + list.getName()); -// } -// } -// if (listSelected != null && listSelected.getName().equals(listName)) { -// listSelected = null; -// } -// } - public ValueEncoder<ParticipantList> getListEncoder() { - final Collection<ParticipantList> lists = getLists().values(); - ValueEncoder<ParticipantList> encoder = - new ValueEncoder<ParticipantList>() { - - @Override - public String toClient(ParticipantList participant) { - return participant.getName(); - } - - @Override - public ParticipantList toValue(String s) { - for (ParticipantList curr : lists) { - if (s.equals(curr.getName())) { - return curr; - } - } - return null; - } - }; - return encoder; + @Log + Object onActionFromRemoveList() { + getModel().removeCurrentList(); + return refreshListZone(); } + /** PARTICIPANTS FOR LIST ** */ + Object onAddRowFromParticipants() { - Participant newParticipant = servicePoll.getNewPollParticipant(); - //selectedParticipants.add(newParticipant); -// try { -// listSelected.addParticipant(newParticipant); -// } catch (PollenBusinessException eee) { -// String message = manager.getErrorMessage(eee, messages, logger); -// listsFeedback.addError(message); -// } - return newParticipant; + return getListModel().addNewParticipant(); } void onRemoveRowFromParticipants(Participant participant) { -// if (log.isDebugEnabled()) { -// for (Participant p : listSelected.getParticipants()) { -// log.debug("Before Existing participants : " + -// p.getName() + "_" + p.getEmail()); -// } -// } -//// boolean isRemoved = -//// listSelected.getParticipants().remove(participant); -//// listSelected.removeParticipant(participant); -// if (log.isDebugEnabled()) { -// log.debug("Participant removed : " + participant.getName()); -// } -// if (log.isDebugEnabled()) { -// for (Participant p : listSelected.getParticipants()) { -// log.debug("Existing participants : " + -// p.getName() + "_" + p.getEmail()); -// } -// } + getListModel().removeParticipant(participant); } - public ValueEncoder<Participant> getParticipantEncoder() { - ValueEncoder<Participant> encoder = new ValueEncoder<Participant>() { - - @Override - public String toClient(Participant participant) { -// String key = getParticipantKey(participant); - if (log.isDebugEnabled()) { - log.debug("Participant to find : " + participant); - } - for (Map.Entry<String, Participant> entry : - getSelectedParticipants().entrySet()) { - if (logger.isDebugEnabled()) { - logger.debug("Selected participant entry : " + - "key = " + entry.getKey() + " -> " + - "value = " + entry.getValue()); - } - if (entry.getValue() == participant) { - if (logger.isDebugEnabled()) { - logger.debug("toClient : key = " + entry.getKey()); - } - return entry.getKey(); - } - } - return null; - } - - @Override - public Participant toValue(String s) { -// for (Participant curr : getSelectedParticipants()) { -// String key = getParticipantKey(curr); -// if (s.equals(key)) { -// if (logger.isDebugEnabled()) { -// logger.debug("toValue from : " + s); -// } -// return curr; -// } -// } - Participant participant = getSelectedParticipants().get(s); - if (logger.isDebugEnabled()) { - logger.debug("toValue : key = " + s + " -> " + participant); - } - return participant; - } - }; - return encoder; - } - protected Object refreshListZone() { formActivate = false; return listsZone.getBody(); } + protected void setEditListsFlag() { + formActivate = true; + editLists = true; + } + @Log Object onSuccess() { +// if (!editLists) { +// saveCurrentList(); +// } return mainZone; } - // TODO-FD2010-05-18 : Put this in ParticipantHelper in business - public String getParticipantKey(Participant participant) { - return participant.getName() + "_" + participant.getEmail(); - } - } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-05-19 12:59:57 UTC (rev 3001) @@ -21,10 +21,6 @@ package org.chorem.pollen.ui.services; -import java.util.Arrays; -import java.util.Date; -import java.util.Map; -import java.util.Properties; import org.apache.tapestry5.ioc.Messages; import org.apache.tapestry5.ioc.services.RegistryShutdownListener; import org.apache.tapestry5.ioc.services.SymbolProvider; @@ -36,26 +32,31 @@ import org.nuiton.util.ApplicationConfig; import org.slf4j.Logger; +import java.util.Arrays; +import java.util.Date; +import java.util.Map; +import java.util.Properties; + /** * WaoManager - * + * <p/> * Created: 24 nov. 2009 * * @author fdesbois * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * <p/> + * Mise a jour: $Date$ + * par : $Author$ */ public class PollenManager implements Runnable, - RegistryShutdownListener, - SymbolProvider { + RegistryShutdownListener, + SymbolProvider { // private static final Logger logger = // LoggerFactory.getLogger(PollenManager.class); private final Map<String, String> propertiesMap = - new CaseInsensitiveMap<String>(); + new CaseInsensitiveMap<String>(); private PollenContext context; @@ -74,16 +75,14 @@ this.serviceUser = serviceUser; } - /** - * Called to start the application. - */ + /** Called to start the application. */ @Override public void run() { context.start(serviceUser); // Copy properties to propertiesMap (insentitive) for SymbolProvider Properties properties = getConfiguration().getOptions(); for (Object key : properties.keySet()) { - propertiesMap.put((String)key, + propertiesMap.put((String) key, properties.getProperty((String) key)); } } @@ -93,9 +92,7 @@ return propertiesMap.get(key); } - /** - * Called to stop the application - */ + /** Called to stop the application */ @Override public void registryDidShutdown() { context.stop(); @@ -122,12 +119,12 @@ return context.getCurrentDate(); } - public String createPollenUrlId() { + public String createPollenId() { return context.createPollenUrlId(); } public String getErrorMessage(PollenBusinessException eee, - Messages messages, Logger logger) { + Messages messages, Logger logger) { if (logger.isDebugEnabled()) { logger.debug("ERROR from business : " + eee.getMessage() + " _ args = " + Arrays.toString(eee.getArgs())); Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,6 +1,9 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html t:type="border" t:addressBar="addressBar" t:pageLogo="literal:Creation" t:pageBodyId="p-pollForm" t:pageTitle="prop:pageTitle" - xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html t:type="border" t:addressBar="addressBar" t:pageLogo="literal:Creation" + t:pageBodyId="p-pollForm" t:pageTitle="prop:pageTitle" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" + xmlns:p="tapestry:parameter"> <h1 class="titlePoll"> <t:if t:test="createMode"> @@ -10,303 +13,417 @@ </h1> <t:zone t:id="mainZone" t:update="show"> - <form t:type="form" t:id="mainForm" t:zone="mainZone" action="post"> - <t:errors/> - <!-- MAIN INFOS --> - <div id="p-pollForm-mainInfos"> - <fieldset> - <legend> - <img class="form-toggle" src="${asset:context:img/1uparrow.png}" /> ${message:legend-mainInfos} - </legend> - <div class="form-block"> - <p> - <span><label t:type="label" t:for="title"/>:</span> - <input type="text" t:type="textfield" class="title" t:id="title" value="poll.title" t:validate="required"/> - </p> - <p> - <span><label t:type="label" t:for="creatorName"/>:</span> - <input type="text" t:type="textfield" t:id="creatorName" value="poll.creator.name" t:validate="required,minlength=2"/> - <label t:type="label" t:for="email"/>: - <input type="text" t:type="textfield" class="email" t:id="email" value="poll.creator.email" t:validate="regexp"/> - </p> - <p> - <span><label t:type="label" t:for="description"/>: </span> - <textarea t:type="textarea" cols="80" rows="2" t:id="description" t:value="poll.description">${poll.description}</textarea> - </p> - <p> - <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> - <span><label t:type="label" t:for="beginDate"/>: </span> - <input t:type="ck/dateTimeField" t:id="beginDate" value="poll.beginDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> - <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> - <label t:type="label" t:for="endDate"/>: - <input t:type="ck/dateTimeField" t:id="endDate" value="poll.endDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> - <label t:type="label" t:for="voteCountingType"/>: - <select t:type="select" t:id="voteCountingType" t:value="poll.voteCountingType" t:validate="required"> - <option></option> - </select> - <span t:type="ck/Tooltip" title="${message:help}" t:value="${message:voteCounting-help}" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="${message:help}"/> +<form t:type="form" t:id="mainForm" t:zone="mainZone" action="post"> +<t:errors /> +<!-- MAIN INFOS --> +<div id="p-pollForm-mainInfos"> + <fieldset> + <legend> + <img class="form-toggle" src="${asset:context:img/1uparrow.png}" /> ${message:legend-mainInfos} + </legend> + <div class="form-block"> + <p> + <span><label t:type="label" t:for="title" />:</span> + <input type="text" t:type="textfield" class="title" t:id="title" + value="poll.title" t:validate="required" /> + </p> + + <p> + <span><label t:type="label" t:for="creatorName" />:</span> + <input type="text" t:type="textfield" t:id="creatorName" + value="poll.creator.name" + t:validate="required,minlength=2" /> + <label t:type="label" t:for="email" />: + <input type="text" t:type="textfield" class="email" t:id="email" + value="poll.creator.email" t:validate="regexp" /> + </p> + + <p> + <span><label t:type="label" t:for="description" />: </span> + <textarea t:type="textarea" cols="80" rows="2" + t:id="description" t:value="poll.description">${poll.description}</textarea> + </p> + + <p> + <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> + <span><label t:type="label" t:for="beginDate" />: </span> + <input t:type="ck/dateTimeField" t:id="beginDate" + value="poll.beginDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" + t:timePickerAdjacent="true" /> + <!-- FIXME : validate by regexp doesn't work : seems to be caused by dateTimeField component --> + <label t:type="label" t:for="endDate" />: + <input t:type="ck/dateTimeField" t:id="endDate" + value="poll.endDate" t:validate="regexp" + t:datePattern="message:date-pattern" t:timePicker="true" + t:timePickerAdjacent="true" /> + <label t:type="label" t:for="voteCountingType" />: + <select t:type="select" t:id="voteCountingType" + t:value="poll.voteCountingType" t:validate="required"> + <option></option> + </select> + <span t:type="ck/Tooltip" title="${message:help}" + t:value="${message:voteCounting-help}" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="${message:help}" /> </span> - </p> - </div> - </fieldset> + </p> </div> - <!-- OPTIONS --> - <div id="p-pollForm-options"> - <fieldset> - <legend> - <!--<input t:type="checkbox" t:id="advancedOptions" t:mixins="triggerfragment" t:fragment="optionsFragment"/>--> - <!--<label t:type="label" t:for="advancedOptions"/>--> - <img class="form-toggle" src="${asset:context:img/1downarrow.png}" /> ${message:legend-options} - </legend> - <div class="form-block clearfix" style="display:none;"> - <!--<t:formFragment t:id="optionsFragment" visible="advancedOptions">--> - <!-- LEFT COLUMN --> - <div class="left-column fleft"> - <p> - <input t:type="checkbox" t:id="anonymous" value="poll.anonymous" /> - <label t:type="label" t:for="anonymous"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymous-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </fieldset> +</div> +<!-- OPTIONS --> +<div id="p-pollForm-options"> + <fieldset> + <legend> + <!--<input t:type="checkbox" t:id="advancedOptions" t:mixins="triggerfragment" t:fragment="optionsFragment"/>--> + <!--<label t:type="label" t:for="advancedOptions"/>--> + <img class="form-toggle" + src="${asset:context:img/1downarrow.png}" /> ${message:legend-options} + </legend> + <div class="form-block clearfix" style="display:none;"> + <!--<t:formFragment t:id="optionsFragment" visible="advancedOptions">--> + <!-- LEFT COLUMN --> + <div class="left-column fleft"> + <p> + <input t:type="checkbox" t:id="anonymous" + value="poll.anonymous" /> + <label t:type="label" t:for="anonymous" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:anonymous-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <input t:type="checkbox" t:id="continuousResults" value="poll.continuousResults"/> - <label t:type="label" t:for="continuousResults"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:continuousResults-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <input t:type="checkbox" t:id="continuousResults" + value="poll.continuousResults" /> + <label t:type="label" t:for="continuousResults" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:continuousResults-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <input t:type="checkbox" t:id="choiceAddAllowed" value="poll.choiceAddAllowed" - t:mixins="triggerfragment" t:fragment="choiceDateFragment"/> - <label t:type="label" t:for="choiceAddAllowed"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceAddAllowed-help}" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <input t:type="checkbox" t:id="choiceAddAllowed" + value="poll.choiceAddAllowed" + t:mixins="triggerfragment" + t:fragment="choiceDateFragment" /> + <label t:type="label" t:for="choiceAddAllowed" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:choiceAddAllowed-help}" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <t:formFragment t:id="choiceDateFragment" t:visible="poll.choiceAddAllowed"> - <label t:type="label" t:for="beginChoiceDate"/> - <input t:type="ck/dateTimeField" t:id="beginChoiceDate" value="poll.beginChoiceDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> - <br/> - <label t:type="label" t:for="endChoiceDate"/> - <input t:type="ck/dateTimeField" t:id="endChoiceDate" value="poll.endChoiceDate" t:validate="regexp" - t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/> - </t:formFragment> - </p> - <p> - <input t:type="checkbox" t:id="sendNotification" value="hasNotification" - disabled="notificationDisabled" t:mixins="triggerfragment" t:fragment="notificationFragment"/> - <label t:type="label" t:for="sendNotification"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:sendNotification-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <t:formFragment t:id="choiceDateFragment" + t:visible="poll.choiceAddAllowed"> + <label t:type="label" t:for="beginChoiceDate" /> + <input t:type="ck/dateTimeField" t:id="beginChoiceDate" + value="poll.beginChoiceDate" t:validate="regexp" + t:datePattern="message:date-pattern" + t:timePicker="true" + t:timePickerAdjacent="true" /> + <br /> + <label t:type="label" t:for="endChoiceDate" /> + <input t:type="ck/dateTimeField" t:id="endChoiceDate" + value="poll.endChoiceDate" t:validate="regexp" + t:datePattern="message:date-pattern" + t:timePicker="true" + t:timePickerAdjacent="true" /> + </t:formFragment> + </p> + <p> + <input t:type="checkbox" t:id="sendNotification" + value="hasNotification" + disabled="notificationDisabled" + t:mixins="triggerfragment" + t:fragment="notificationFragment" /> + <label t:type="label" t:for="sendNotification" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:sendNotification-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <t:formFragment id="notificationHidden" t:id="notificationFragment" t:visible="hasNotification"> - <label t:type="label" t:for="notification"/> - <input t:type="textfield" t:id="notification" value="notification.sensibility" t:size="3" t:validate="min=0"/> - ${message:notification-label2} - </t:formFragment> - </p> - </div> - <!-- RIGHT COLUMN --> - <div class="fleft"> - <p> - <input t:type="checkbox" t:id="anonymousVoteAllowed" value="poll.anonymousVoteAllowed" disabled="anonymousVoteAllowedDisabled"/> - <label t:type="label" t:for="anonymousVoteAllowed"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:anonymousVoteAllowed-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <t:formFragment id="notificationHidden" + t:id="notificationFragment" + t:visible="hasNotification"> + <label t:type="label" t:for="notification" /> + <input t:type="textfield" t:id="notification" + value="notification.sensibility" t:size="3" + t:validate="min=0" /> + ${message:notification-label2} + </t:formFragment> + </p> + </div> + <!-- RIGHT COLUMN --> + <div class="fleft"> + <p> + <input t:type="checkbox" t:id="anonymousVoteAllowed" + value="poll.anonymousVoteAllowed" + disabled="anonymousVoteAllowedDisabled" /> + <label t:type="label" t:for="anonymousVoteAllowed" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:anonymousVoteAllowed-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <input t:type="checkbox" t:id="publicResults" value="poll.publicResults" disabled="publicResultsDisabled"/> - <label t:type="label" t:for="publicResults"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:publicResults-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <input t:type="checkbox" t:id="publicResults" + value="poll.publicResults" + disabled="publicResultsDisabled" /> + <label t:type="label" t:for="publicResults" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:publicResults-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <input t:type="checkbox" t:id="choiceNb" value="hasChoiceNb" disabled="choiceNbDisabled" - t:mixins="triggerFragment" t:fragment="choiceNbFragment"/> - <label t:type="label" t:for="choiceNb"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:choiceNb-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <input t:type="checkbox" t:id="choiceNb" value="hasChoiceNb" + disabled="choiceNbDisabled" + t:mixins="triggerFragment" + t:fragment="choiceNbFragment" /> + <label t:type="label" t:for="choiceNb" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:choiceNb-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <t:formFragment id="choiceNbHidden" t:id="choiceNbFragment" t:visible="hasChoiceNb"> - <label t:type="label" t:for="maxChoiceNb"/> - <input t:type="textfield" t:id="maxChoiceNb" t:value="poll.maxChoiceNb" t:size="1" t:validate="min=0"/> - </t:formFragment> - </p> - <p> - <input t:type="checkbox" t:id="sendReminder" t:value="hasReminder" disabled="reminderDisabled" - t:mixins="triggerfragment" t:fragment="reminderFragment"/> - <label t:type="label" t:for="sendReminder"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:sendReminder-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help"/> + </p> + + <p> + <t:formFragment id="choiceNbHidden" t:id="choiceNbFragment" + t:visible="hasChoiceNb"> + <label t:type="label" t:for="maxChoiceNb" /> + <input t:type="textfield" t:id="maxChoiceNb" + t:value="poll.maxChoiceNb" t:size="1" + t:validate="min=0" /> + </t:formFragment> + </p> + <p> + <input t:type="checkbox" t:id="sendReminder" + t:value="hasReminder" disabled="reminderDisabled" + t:mixins="triggerfragment" + t:fragment="reminderFragment" /> + <label t:type="label" t:for="sendReminder" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:sendReminder-help" + t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </p> - <p> - <t:formFragment id="reminderHidden" t:id="reminderFragment" t:visible="hasReminder"> - <input t:type="textfield" t:id="reminder" t:value="reminder.sensibility" t:size="1" t:validate="min=0"/> - <label t:type="label" t:for="reminder"/> - </t:formFragment> - </p> - </div> - <!--</t:formFragment>--> - </div> - </fieldset> + </p> + + <p> + <t:formFragment id="reminderHidden" t:id="reminderFragment" + t:visible="hasReminder"> + <input t:type="textfield" t:id="reminder" + t:value="reminder.sensibility" t:size="1" + t:validate="min=0" /> + <label t:type="label" t:for="reminder" /> + </t:formFragment> + </p> + </div> + <!--</t:formFragment>--> </div> - <!-- CHOICES --> - <!--<div id="p-pollForm-choices">--> - <!--<fieldset>--> - <!--<legend>--> - <!--<label t:type="label" t:for="choiceType" />: --> - <!--<select t:type="select" t:id="choiceType" t:value="poll.choiceType" t:validate="required">--> - <!--<option></option>--> - <!--</select> --> - <!--<input type="image" t:type="submit" class="ico refresh" t:id="refreshChoices" value="Refresh choices" title="${message:refreshChoices-button}"/>--> - <!--</legend>--> - <!--<div t:type="loop" t:source="choices" t:value="choice" t:volatile="true" class="clearfix">--> - <!--<div class="fleft choiceName">--> - <!--<t:delegate t:to="choiceTypeBlock" />--> - <!--<t:block t:id="choiceText">--> - <!--<label t:type="label" t:for="choiceTextField" />: --> - <!--<input type="text" class="nameField" t:type="textfield" t:id="choiceTextField" value="choice.text" />--> - <!--</t:block>--> - <!--<t:block t:id="choiceDate">--> - <!--<label t:type="label" t:for="choiceDateField" />: --> - <!--<input t:type="ck/dateTimeField" t:id="choiceDateField" value="choice.date" t:validate="regexp"--> - <!--t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/>--> - <!--</t:block>--> - <!--<t:block t:id="choiceImage">--> - <!--<label t:type="label" t:for="choiceImageField" />: --> - <!--<input type="file" class="nameField" t:type="upload" t:id="choiceImageField" value="choice.image" t:validate="regexp" />--> - <!--</t:block>--> - <!--<t:block t:id="choiceDisplay">--> - <!--${choice.name}--> - <!--</t:block>--> - <!-- --> - <!--<t:label t:for="choiceDescription" />: --> - <!--</div>--> - <!--<div class="fleft">--> - <!--<t:textarea cols="34" rows="1" t:id="choiceDescription" t:value="choice.description" />--> - <!--</div>--> - <!--</div>--> - <!--</fieldset>--> - <!--</div>--> - <!-- LISTS --> - <div id="p-pollForm-lists"> - <fieldset> - <legend> - <label t:type="label" t:for="pollType" />: - <select t:type="select" class="list-select" t:id="pollType" t:value="poll.pollType" t:validate="required" - t:mixins="nuiton/zoneUpdater" t:event="change" t:zone="p-pollForm-lists-zone"/> - <span t:type="ck/Tooltip" title="message:help" t:value="message:pollType-help" t:effect="appear"> - <img src="${asset:context:img/help.png}" alt="message:help" /> + </fieldset> +</div> +<!-- CHOICES --> +<!--<div id="p-pollForm-choices">--> +<!--<fieldset>--> +<!--<legend>--> +<!--<label t:type="label" t:for="choiceType" />: --> +<!--<select t:type="select" t:id="choiceType" t:value="poll.choiceType" t:validate="required">--> +<!--<option></option>--> +<!--</select> --> +<!--<input type="image" t:type="submit" class="ico refresh" t:id="refreshChoices" value="Refresh choices" title="${message:refreshChoices-button}"/>--> +<!--</legend>--> +<!--<div t:type="loop" t:source="choices" t:value="choice" t:volatile="true" class="clearfix">--> +<!--<div class="fleft choiceName">--> +<!--<t:delegate t:to="choiceTypeBlock" />--> +<!--<t:block t:id="choiceText">--> +<!--<label t:type="label" t:for="choiceTextField" />: --> +<!--<input type="text" class="nameField" t:type="textfield" t:id="choiceTextField" value="choice.text" />--> +<!--</t:block>--> +<!--<t:block t:id="choiceDate">--> +<!--<label t:type="label" t:for="choiceDateField" />: --> +<!--<input t:type="ck/dateTimeField" t:id="choiceDateField" value="choice.date" t:validate="regexp"--> +<!--t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/>--> +<!--</t:block>--> +<!--<t:block t:id="choiceImage">--> +<!--<label t:type="label" t:for="choiceImageField" />: --> +<!--<input type="file" class="nameField" t:type="upload" t:id="choiceImageField" value="choice.image" t:validate="regexp" />--> +<!--</t:block>--> +<!--<t:block t:id="choiceDisplay">--> +<!--${choice.name}--> +<!--</t:block>--> +<!-- --> +<!--<t:label t:for="choiceDescription" />: --> +<!--</div>--> +<!--<div class="fleft">--> +<!--<t:textarea cols="34" rows="1" t:id="choiceDescription" t:value="choice.description" />--> +<!--</div>--> +<!--</div>--> +<!--</fieldset>--> +<!--</div>--> +<!-- LISTS --> +<div id="p-pollForm-lists"> + <fieldset> + <legend> + <label t:type="label" t:for="pollType" />: + <select t:type="select" class="list-select" t:id="pollType" + t:value="poll.pollType" t:validate="required" + t:mixins="nuiton/zoneUpdater" t:event="change" + t:zone="p-pollForm-lists-zone" /> + <span t:type="ck/Tooltip" title="message:help" + t:value="message:pollType-help" t:effect="appear"> + <img src="${asset:context:img/help.png}" + alt="message:help" /> </span> - </legend> - <div t:type="zone" id="p-pollForm-lists-zone" t:id="listsZone" class="form-block" t:update="show"> - <t:if t:test="canDisplayLists()"> - <t:nuiton.feedback t:id="listsFeedback" /><br /> - <t:subForm t:visible="formActivate"> - <t:if t:test="poll.pollType.group"> - <p> - <label t:type="label" t:for="listName" />: - <input t:type="textfield" t:id="listName" value="listName" /> - <input t:type="submit" t:id="addList" value="ADD" /> - <!--<a t:type="actionlink" t:id="addList" t:zone="p-pollForm-lists-zone">--> - <!--ADD--> - <!--</a>--> - </p> - <p class="center"> - <t:loop t:source="lists.values()" t:value="list" t:encoder="listEncoder"> - <input class="list-edition${styleSelected}" t:type="nuiton/submitContext" t:context="list.name" t:id="editList" value="${list.name}" /> - <!--<span t:type="any" t:mixins="nuiton/confirm">--> - <!--<input t:type="nuiton/submitContext" t:id="removeList" t:image="context:img/delete.png" t:context="list.name" value="${message:delete}" />--> - <!--</span>--> - <t:if t:test="currentListSelected"> - <input t:type="submit" t:id="saveList" t:image="context:img/save.png" t:zone="p-pollForm-lists-zone" /> - <a t:type="actionlink" t:id="removeList" t:zone="p-pollForm-lists-zone"> - <span t:type="any" t:mixins="nuiton/confirm"> - <img src="${asset:context:img/delete.png}" alt="${message:delete}" /> + </legend> + <div t:type="zone" id="p-pollForm-lists-zone" t:id="listsZone" + class="form-block" t:update="show"> + <t:if t:test="canDisplayLists()"> + <t:nuiton.feedback t:id="listsFeedback" /> + <br /> + <t:subForm t:visible="formActivate"> + <t:if t:test="poll.pollType.group"> + <p> + <label t:type="label" t:for="listName" />: + <input t:type="textfield" t:id="listName" + value="listName" /> + <input t:type="submit" t:id="addList" value="ADD" /> + <!--<a t:type="actionlink" t:id="addList" t:zone="p-pollForm-lists-zone">--> + <!--ADD--> + <!--</a>--> + </p> + + <p class="center"> + <t:loop t:source="lists" t:value="list" + t:encoder="model"> + <input class="list-edition${styleSelected}" + t:type="nuiton/submitContext" + t:context="list.name" t:id="editList" + value="${list.name}" /> + <!--<span t:type="any" t:mixins="nuiton/confirm">--> + <!--<input t:type="nuiton/submitContext" t:id="removeList" t:image="context:img/delete.png" t:context="list.name" value="${message:delete}" />--> + <!--</span>--> + <t:if t:test="currentListSelected"> + <!--<input t:type="submit" t:id="saveList" t:image="context:img/save.png" />--> + <a t:type="actionlink" t:id="removeList" + t:zone="p-pollForm-lists-zone"> + <span t:type="any" + t:mixins="nuiton/confirm"> + <img src="${asset:context:img/delete.png}" + alt="${message:delete}" /> </span> - </a> - </t:if> - </t:loop> - </p> - </t:if> - <t:if t:test="listSelected"> - <div class="t-data-grid"> - <table class="t-data-grid"> - <thead> - <tr> - <th>${message:pollen.ui.participant.name-label}</th> - <th>${message:pollen.ui.participant.email-label}</th> - <th>${message:pollen.ui.participant.weight-label}</th> - <th></th> - </tr> - </thead> - <tbody> - <tr t:type="ajaxformloop" t:id="participants" source="selectedParticipants.values()" value="participant" t:encoder="participantEncoder"> - <td> - <t:textfield t:id="participantName" value="participant.name" size="20" t:validate="required"/> - </td> - <td> - <t:textfield t:id="participantEmail" value="participant.email" size="25" t:validate="email"/> - </td> - <td> - <t:textfield t:id="participantWeight" value="participant.weight" size="1"/> - </td> - <td> - <t:removerowlink> - <img src="${asset:context:img/delete.png}" alt="${message:delete}"/> - </t:removerowlink> - </td> - <p:addRow> - <td colspan="4" class="center"> - <t:addrowlink>${message:pollen.ui.participant.add}</t:addrowlink> - </td> - </p:addRow> - </tr> - </tbody> - </table> - </div> - </t:if> - </t:subForm> + </a> + </t:if> + </t:loop> + </p> </t:if> - <!--<t:delegate t:to="listsBlock" />--> - <!--<t:block t:id="listsForm">--> - <!--<form t:type="form" action="tapestry">--> - <!--<t:delegate t:to="listsFields" />--> - <!--</form>--> - <!--</t:block>--> - <!--<t:block t:id="listsFields">--> - <!--<t:if t:test="poll.pollType.group">--> - <!--<p>--> - <!--<label t:type="label" t:for="listName" />: --> - <!--<input t:type="textfield" t:id="listName" value="listName"/> --> - <!--<input t:type="submit" t:id="addList" value="ADD"/>--> - <!--</p>--> - <!--<p>--> - <!--<t:loop t:source="lists.values()" t:value="list" t:volatile="true">--> - <!--${list.name} --> - <!--</t:loop>--> - <!--</p>--> - <!--<p:else>--> - <!--COOL--> - <!--</p:else>--> - <!--</t:if>--> - <!--</t:block> --> - </div> - </fieldset> + <t:if t:test="listSelected"> + <div class="t-data-grid"> + <table class="t-data-grid"> + <thead> + <tr> + <th> + ${message:pollen.ui.participant.name-label} + </th> + <th> + ${message:pollen.ui.participant.email-label} + </th> + <th> + ${message:pollen.ui.participant.weight-label} + </th> + <th></th> + </tr> + </thead> + <tbody> + <tr t:type="ajaxformloop" t:id="participants" + source="listModel.participants" + value="participant" t:encoder="listModel"> + <td> + <t:textfield t:id="participantName" + value="participant.name" + size="20" + t:validate="required" /> + </td> + <td> + <t:textfield t:id="participantEmail" + value="participant.email" + size="25" /> + </td> + <td> + <t:textfield t:id="participantWeight" + value="participant.weight" + size="1" /> + </td> + <td> + <t:removerowlink> + <img src="${asset:context:img/delete.png}" + alt="${message:delete}" /> + </t:removerowlink> + </td> + <p:addRow> + <td colspan="4" class="center"> + <t:addrowlink> + ${message:pollen.ui.participant.add} + </t:addrowlink> + </td> + </p:addRow> + </tr> + </tbody> + </table> + </div> + </t:if> + </t:subForm> + </t:if> + <!--<t:delegate t:to="listsBlock" />--> + <!--<t:block t:id="listsForm">--> + <!--<form t:type="form" action="tapestry">--> + <!--<t:delegate t:to="listsFields" />--> + <!--</form>--> + <!--</t:block>--> + <!--<t:block t:id="listsFields">--> + <!--<t:if t:test="poll.pollType.group">--> + <!--<p>--> + <!--<label t:type="label" t:for="listName" />: --> + <!--<input t:type="textfield" t:id="listName" value="listName"/> --> + <!--<input t:type="submit" t:id="addList" value="ADD"/>--> + <!--</p>--> + <!--<p>--> + <!--<t:loop t:source="lists.values()" t:value="list" t:volatile="true">--> + <!--${list.name} --> + <!--</t:loop>--> + <!--</p>--> + <!--<p:else>--> + <!--COOL--> + <!--</p:else>--> + <!--</t:if>--> + <!--</t:block> --> </div> - </form> + </fieldset> +</div> +</form> </t:zone> </html> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-05-18 17:09:12 UTC (rev 3000) +++ trunk/pom.xml 2010-05-19 12:59:57 UTC (rev 3001) @@ -1,483 +1,491 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <!-- ************************************************************* --> - <!-- *** POM Relationships *************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> - <parent> - <groupId>org.nuiton</groupId> - <artifactId>mavenpom4redmine</artifactId> - <version>2.1.3</version> - </parent> + <parent> + <groupId>org.nuiton</groupId> + <artifactId>mavenpom4redmine</artifactId> + <version>2.1.3</version> + </parent> - <groupId>org.chorem</groupId> - <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <groupId>org.chorem</groupId> + <artifactId>pollen</artifactId> + <version>2.0-SNAPSHOT</version> - <modules> - <module>pollen-ui</module> - <module>pollen-business</module> - <module>pollen-votecounting</module> - </modules> + <modules> + <module>pollen-ui</module> + <module>pollen-business</module> + <module>pollen-votecounting</module> + </modules> - <dependencyManagement> - <dependencies> + <dependencyManagement> + <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-email</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.4</version> - </dependency> -<!-- <dependency> - <groupId>org.chorem</groupId> - <artifactId>chorem-commons</artifactId> - <version>${chorem-commons.version}</version> - </dependency>--> - <dependency> - <groupId>org.nuiton</groupId> - <artifactId>nuiton-utils</artifactId> - <version>${nuiton-utils.version}</version> - </dependency> - <dependency> - <groupId>org.nuiton.eugene</groupId> - <artifactId>eugene</artifactId> - <version>${eugene.version}</version> - </dependency> - <dependency> - <groupId>org.nuiton.topia</groupId> - <artifactId>topia-persistence</artifactId> - <version>${topia.version}</version> - </dependency> - <dependency> - <groupId>org.nuiton.topia</groupId> - <artifactId>topia-service-migration</artifactId> - <version>${topia.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-core</artifactId> - <version>${tapestry.version}</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>jboss</groupId> - <artifactId>javassist</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.nuiton.web</groupId> - <artifactId>nuiton-tapestry-extra</artifactId> - <version>${nuiton-web.version}</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.5.10</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.5.10</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-upload</artifactId> - <version>${tapestry.version}</version> - </dependency> - <dependency> - <groupId>org.chenillekit</groupId> - <artifactId>chenillekit-tapestry</artifactId> - <version>1.0.0</version> - <exclusions> - <exclusion> - <groupId>jboss</groupId> - <artifactId>javassist</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.jdom</groupId> - <artifactId>jdom</artifactId> - <version>1.1</version> - </dependency> - <dependency> - <groupId>jfree</groupId> - <artifactId>jfreechart</artifactId> - <version>1.0.12</version> - </dependency> - <dependency> - <groupId>javassist</groupId> - <artifactId>javassist</artifactId> - <version>3.8.0.GA</version> - </dependency> - <dependency> - <groupId>net.sf.opencsv</groupId> - <artifactId>opencsv</artifactId> - <version>2.0.1</version> - </dependency> - <dependency> - <groupId>rome</groupId> - <artifactId>rome</artifactId> - <version>0.9</version> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <version>1.2.131</version> - </dependency> - <dependency> - <groupId>postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>8.4-701.jdbc4</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.7</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.jvnet.hudson.winstone</groupId> - <artifactId>winstone</artifactId> - <version>0.9.10-hudson-16</version> - </dependency> - </dependencies> - </dependencyManagement> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-email</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2.1</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + </dependency> + <!-- <dependency> + <groupId>org.chorem</groupId> + <artifactId>chorem-commons</artifactId> + <version>${chorem-commons.version}</version> + </dependency>--> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + <version>${nuiton-utils.version}</version> + </dependency> + <dependency> + <groupId>org.nuiton.eugene</groupId> + <artifactId>eugene</artifactId> + <version>${eugene.version}</version> + </dependency> + <dependency> + <groupId>org.nuiton.topia</groupId> + <artifactId>topia-persistence</artifactId> + <version>${topia.version}</version> + </dependency> + <dependency> + <groupId>org.nuiton.topia</groupId> + <artifactId>topia-service-migration</artifactId> + <version>${topia.version}</version> + </dependency> + <dependency> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-core</artifactId> + <version>${tapestry.version}</version> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>jboss</groupId> + <artifactId>javassist</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.nuiton.web</groupId> + <artifactId>nuiton-tapestry-extra</artifactId> + <version>${nuiton-web.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.5.10</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.10</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-upload</artifactId> + <version>${tapestry.version}</version> + </dependency> + <dependency> + <groupId>org.chenillekit</groupId> + <artifactId>chenillekit-tapestry</artifactId> + <version>1.0.0</version> + <exclusions> + <exclusion> + <groupId>jboss</groupId> + <artifactId>javassist</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>jfree</groupId> + <artifactId>jfreechart</artifactId> + <version>1.0.12</version> + </dependency> + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>3.8.0.GA</version> + </dependency> + <dependency> + <groupId>net.sf.opencsv</groupId> + <artifactId>opencsv</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>rome</groupId> + <artifactId>rome</artifactId> + <version>0.9</version> + </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>1.2.131</version> + </dependency> + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>8.4-701.jdbc4</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jvnet.hudson.winstone</groupId> + <artifactId>winstone</artifactId> + <version>0.9.10-hudson-16</version> + </dependency> + </dependencies> + </dependencyManagement> - <!-- ************************************************************* --> - <!-- *** Project Information ************************************* --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> - <name>Pollen</name> - <description>Application de vote Pollen</description> - <inceptionYear>2009</inceptionYear> - <url>http://maven-site.chorem.org/pollen/</url> + <name>Pollen</name> + <description>Application de vote Pollen</description> + <inceptionYear>2009</inceptionYear> + <url>http://maven-site.chorem.org/pollen/</url> - <licenses> - <license> - <name>General Public License (GPL)</name> - <url>${maven.license.file}</url> - <distribution>local</distribution> - </license> - </licenses> + <licenses> + <license> + <name>General Public License (GPL)</name> + <url>${maven.license.file}</url> + <distribution>local</distribution> + </license> + </licenses> - <!-- Developpers, contributors... --> - <developers> - <developer> - <id>fdesbois</id> - <name>Florian DESBOIS</name> - <email>florian.desbois@gmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Chef de Projet</role> - <role>Analyste</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>enema</id> - <name>Erwan NEMA</name> - <email>nemawan@hotmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Chef de Projet</role> - <role>Analyste</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>kmorin</id> - <name>Kevin MORIN</name> - <email>km@kevinmorin.net</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Architecte</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>tpoulit</id> - <name>Thierry POULIT-POUBLAT</name> - <email>tpoulit@gmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Analyste</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>aboukhary</id> - <name>Abdelmajid BOUKHARY</name> - <email>benouna66@gmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Analyste</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>tcicognagni</id> - <name>Thomas CICOGNANI</name> - <email>zhykos@gmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Architecte</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>aeddahbi</id> - <name>Amine EDDAHBI</name> - <email>eddahbi@gmail.com</email> - <organization>ALMA - Code Lutin</organization> - <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Architecte</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>nrannou</id> - <name>Nolwenn RANNOU</name> - <email>rannou@codelutin.com</email> - <organization>Code Lutin</organization> - <organizationUrl>http://www.codelutin.com/</organizationUrl> - <timezone>+1</timezone> - <roles> - <role>Concepteur</role> - <role>Développeur</role> - </roles> - </developer> - <developer> - <id>tchemit</id> - <name>Tony Chemit</name> - <email>chemit@codelutin.com</email> - <organization>CodeLutin</organization> - <timezone>+2</timezone> - <roles> - <role>Développeur</role> - </roles> - </developer> - </developers> + <!-- Developpers, contributors... --> + <developers> + <developer> + <id>fdesbois</id> + <name>Florian DESBOIS</name> + <email>florian.desbois@gmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Chef de Projet</role> + <role>Analyste</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>enema</id> + <name>Erwan NEMA</name> + <email>nemawan@hotmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Chef de Projet</role> + <role>Analyste</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>kmorin</id> + <name>Kevin MORIN</name> + <email>km@kevinmorin.net</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Architecte</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>tpoulit</id> + <name>Thierry POULIT-POUBLAT</name> + <email>tpoulit@gmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Analyste</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>aboukhary</id> + <name>Abdelmajid BOUKHARY</name> + <email>benouna66@gmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Analyste</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>tcicognagni</id> + <name>Thomas CICOGNANI</name> + <email>zhykos@gmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Architecte</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>aeddahbi</id> + <name>Amine EDDAHBI</name> + <email>eddahbi@gmail.com</email> + <organization>ALMA - Code Lutin</organization> + <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Architecte</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>nrannou</id> + <name>Nolwenn RANNOU</name> + <email>rannou@codelutin.com</email> + <organization>Code Lutin</organization> + <organizationUrl>http://www.codelutin.com/</organizationUrl> + <timezone>+1</timezone> + <roles> + <role>Concepteur</role> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>tchemit</id> + <name>Tony Chemit</name> + <email>chemit@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + </developers> - <!-- ************************************************************* --> - <!-- *** Build Settings ****************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> - <packaging>pom</packaging> + <packaging>pom</packaging> - <properties> + <properties> - <!-- redmine configuration --> - <platform>chorem.org</platform> - <projectId>pollen</projectId> + <!-- redmine configuration --> + <platform>chorem.org</platform> + <projectId>pollen</projectId> - <!-- customized versions --> - <!--javadoc.version>2.4</javadoc.version--> - <topia.version>2.4-SNAPSHOT</topia.version> - <eugene.version>2.0.2-SNAPSHOT</eugene.version> - <i18n.version>1.2.2</i18n.version> - <tapestry.version>5.1.0.5</tapestry.version> - <nuiton-web.version>0.1-SNAPSHOT</nuiton-web.version> - <nuiton-utils.version>1.3.1-SNAPSHOT</nuiton-utils.version> - <processor.version>1.0.2</processor.version> + <!-- customized versions --> + <!--javadoc.version>2.4</javadoc.version--> + <topia.version>2.4-SNAPSHOT</topia.version> + <eugene.version>2.0.2-SNAPSHOT</eugene.version> + <i18n.version>1.2.2</i18n.version> + <tapestry.version>5.1.0.5</tapestry.version> + <nuiton-web.version>0.1-SNAPSHOT</nuiton-web.version> + <nuiton-utils.version>1.3.1-SNAPSHOT</nuiton-utils.version> + <processor.version>1.0.2</processor.version> - <!--Multilanguage maven-site --> - <siteLocales>en,fr</siteLocales> + <!--Multilanguage maven-site --> + <siteLocales>en,fr</siteLocales> - <!-- license to use --> - <license.licenseName>gpl_v3</license.licenseName> + <!-- license to use --> + <license.licenseName>gpl_v3</license.licenseName> - </properties> + </properties> - <build> + <build> - <pluginManagement> - <plugins> + <pluginManagement> + <plugins> - <plugin> - <artifactId>maven-site-plugin</artifactId> - <dependencies> - <dependency> - <groupId>org.nuiton.jrst</groupId> - <artifactId>doxia-module-jrst</artifactId> - <version>${jrst.version}</version> - </dependency> - </dependencies> - </plugin> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.nuiton.jrst</groupId> + <artifactId>doxia-module-jrst</artifactId> + <version>${jrst.version}</version> + </dependency> + </dependencies> + </plugin> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <version>7.0.1.v20091125</version> - </plugin> - <!-- EUGene plugin for entities generation --> - <plugin> - <groupId>org.nuiton.eugene</groupId> - <artifactId>maven-eugene-plugin</artifactId> - <version>${eugene.version}</version> - <configuration> - <inputs>zargo</inputs> - <resolver>org.nuiton.util.FasterCachedResourceResolver</resolver> - </configuration> - <dependencies> - <dependency> - <groupId>org.nuiton.topia</groupId> - <artifactId>topia-persistence</artifactId> - <version>${topia.version}</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.nuiton.i18n</groupId> - <artifactId>maven-i18n-plugin</artifactId> - <version>${i18n.version}</version> - </plugin> - </plugins> - </pluginManagement> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>7.0.1.v20091125</version> + </plugin> + <!-- EUGene plugin for entities generation --> + <plugin> + <groupId>org.nuiton.eugene</groupId> + <artifactId>maven-eugene-plugin</artifactId> + <version>${eugene.version}</version> + <configuration> + <inputs>zargo</inputs> + <resolver>org.nuiton.util.FasterCachedResourceResolver</resolver> + </configuration> + <dependencies> + <dependency> + <groupId>org.nuiton.topia</groupId> + <artifactId>topia-persistence</artifactId> + <version>${topia.version}</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <version>${i18n.version}</version> + </plugin> + </plugins> + </pluginManagement> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - </resource> - </resources> - </build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + </build> - <!-- ************************************************************* --> - <!-- *** Build Environment ************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> - <scm> - <connection>scm:svn:http://svn.chorem.org/svn/pollen/trunk</connection> - <developerConnection>scm:svn:http://svn.chorem.org/svn/pollen/trunk</developerConnection> - <url>http://www.chorem.org/repositories/browse/pollen/trunk</url> - </scm> + <scm> + <connection>scm:svn:http://svn.chorem.org/svn/pollen/trunk</connection> + <developerConnection>scm:svn:http://svn.chorem.org/svn/pollen/trunk + </developerConnection> + <url>http://www.chorem.org/repositories/browse/pollen/trunk</url> + </scm> - <repositories> + <repositories> - <!-- chenillekit Repository --> - <!--repository> - <id>chenillekit</id> - <url>http://www.chenillekit.org/mvnrepo/release</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository--> + <!-- chenillekit Repository --> + <!--repository> + <id>chenillekit</id> + <url>http://www.chenillekit.org/mvnrepo/release</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository--> - <!-- Maven Java.net Repository --> - <!--repository> - <id>maven2-repository.dev.java.net</id> - <name>Java.net Repository for Maven</name> - <url>http://download.java.net/maven/2/</url> - <layout>default</layout> - </repository--> + <!-- Maven Java.net Repository --> + <!--repository> + <id>maven2-repository.dev.java.net</id> + <name>Java.net Repository for Maven</name> + <url>http://download.java.net/maven/2/</url> + <layout>default</layout> + </repository--> - <!-- depot des releases nuiton --> + <!-- depot des releases nuiton --> - <repository> - <id>nuiton.release</id> - <name>NuitonReleaseRepository</name> - <url>http://maven.nuiton.org/release</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - <releases> - <enabled>true</enabled> - <checksumPolicy>warn</checksumPolicy> - </releases> - </repository> + <repository> + <id>nuiton.release</id> + <name>NuitonReleaseRepository</name> + <url>http://maven.nuiton.org/release</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + <checksumPolicy>warn</checksumPolicy> + </releases> + </repository> - <!-- depot des snapshots nuiton --> + <!-- depot des snapshots nuiton --> - <repository> - <id>nuiton.snapshot</id> - <name>NuitonSnapshotRepository</name> - <url>http://maven.nuiton.org/snapshot</url> - <snapshots> - <enabled>true</enabled> - <checksumPolicy>fail</checksumPolicy> - </snapshots> - <releases> - <enabled>false</enabled> - </releases> - </repository> + <repository> + <id>nuiton.snapshot</id> + <name>NuitonSnapshotRepository</name> + <url>http://maven.nuiton.org/snapshot</url> + <snapshots> + <enabled>true</enabled> + <checksumPolicy>fail</checksumPolicy> + </snapshots> + <releases> + <enabled>false</enabled> + </releases> + </repository> - </repositories> + </repositories> - <pluginRepositories> + <pluginRepositories> - <!-- depot des releases nuiton --> + <!-- depot des releases nuiton --> - <pluginRepository> + <pluginRepository> - <id>nuiton.release</id> - <name>NuitonReleaseRepository</name> - <url>http://maven.nuiton.org/release</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - <releases> - <enabled>true</enabled> - <checksumPolicy>warn</checksumPolicy> - </releases> - </pluginRepository> + <id>nuiton.release</id> + <name>NuitonReleaseRepository</name> + <url>http://maven.nuiton.org/release</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + <checksumPolicy>warn</checksumPolicy> + </releases> + </pluginRepository> - <!-- depot des snapshots nuiton --> + <!-- depot des snapshots nuiton --> - <pluginRepository> - <id>nuiton.snapshot</id> - <name>NuitonSnapshotRepository</name> - <url>http://maven.nuiton.org/snapshot</url> - <snapshots> - <enabled>true</enabled> - <checksumPolicy>fail</checksumPolicy> - </snapshots> - <releases> - <enabled>false</enabled> - </releases> - </pluginRepository> + <pluginRepository> + <id>nuiton.snapshot</id> + <name>NuitonSnapshotRepository</name> + <url>http://maven.nuiton.org/snapshot</url> + <snapshots> + <enabled>true</enabled> + <checksumPolicy>fail</checksumPolicy> + </snapshots> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> - </pluginRepositories> + </pluginRepositories> </project>
participants (1)
-
fdesbois@users.chorem.org