Author: fdesbois Date: 2010-05-20 18:50:54 +0200 (Thu, 20 May 2010) New Revision: 3006 Url: http://chorem.org/repositories/revision/pollen/3006 Log: - Add PageLinks - Evo #196 : add link for moderation without user account - Improve QueryBuilder Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollLinks.java trunk/pollen-ui/src/main/webapp/poll/PollLinks.tml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContext.java trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/PollenQueryBuilder.java trunk/pollen-business/src/main/java/org/chorem/pollen/TopiaQueryBuilder.java trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceFavoriteImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.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/src/main/java/org/chorem/pollen/ui/base/AbstractPollsPage.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollUri.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.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/pages/poll/Results.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthentication.java trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties trunk/pollen-ui/src/main/webapp/poll/CreationValidation.tml trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml trunk/pollen-ui/src/main/webapp/poll/PollForm.tml trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContext.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContext.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContext.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -4,6 +4,8 @@ import org.chorem.pollen.service.ServiceUser; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaQuery; +import org.nuiton.topia.persistence.TopiaDAO; import org.nuiton.util.ApplicationConfig; @@ -121,5 +123,7 @@ */ void closeTransaction(TopiaContext transaction); + PollenQueryBuilder newQueryBuilder(TopiaQuery query); + } //PollenContext Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -13,6 +13,8 @@ import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaQuery; +import org.nuiton.topia.persistence.TopiaDAO; import org.nuiton.util.ApplicationConfig; import org.nuiton.util.ArgumentsParserException; import static org.nuiton.i18n.I18n._; @@ -388,4 +390,13 @@ return null; } + @Override + public PollenQueryBuilder newQueryBuilder(TopiaQuery query) { + PollenQueryBuilder builder = new PollenQueryBuilder(); + if (query != null) { + builder.setQuery(query); + } + return builder; + } + } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenQueryBuilder.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenQueryBuilder.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenQueryBuilder.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -4,6 +4,7 @@ import org.chorem.pollen.bean.Filter; import org.chorem.pollen.entity.FavoriteList; import org.chorem.pollen.entity.FavoriteParticipant; +import org.chorem.pollen.entity.PollAccount; import org.nuiton.topia.framework.TopiaQuery; import org.nuiton.topia.persistence.TopiaDAO; @@ -20,14 +21,10 @@ */ public class PollenQueryBuilder extends TopiaQueryBuilder { - public PollenQueryBuilder() { + protected PollenQueryBuilder() { super(); } - public PollenQueryBuilder(TopiaDAO<?> dao) { - super(dao); - } - public EntityQueryProperty getFavoriteListProperty(String alias) { return getEntityProperty(FavoriteList.class, alias); } @@ -37,6 +34,11 @@ return getEntityProperty(FavoriteParticipant.class, alias); } + public EntityQueryProperty getPollCreatorProperty( + String alias) { + return getEntityProperty(PollAccount.class, alias); + } + public TopiaQuery createQueryFindFavoriteParticipantsByFavoriteList( Filter filter) { Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/TopiaQueryBuilder.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/TopiaQueryBuilder.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/TopiaQueryBuilder.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -20,9 +20,7 @@ * </ul> * <br /> * To use directly {@code prepare} methods, you have to set the query using - * {@link #setQuery(TopiaQuery)} or instantiate the builder with the entity - * dao using {@link #TopiaQueryBuilder(TopiaDAO)}, this will create a new query - * from dao. + * {@link #setQuery(TopiaQuery)}. * * Created: 28 avr. 2010 * @@ -34,33 +32,13 @@ protected TopiaQuery query; - public TopiaQueryBuilder() { + protected TopiaQueryBuilder() { } - /** - * This will create a new TopiaQuery from the {@code dao} in argument. - * - * @param dao used to create a new TopiaQuery in the builder - */ - public TopiaQueryBuilder(TopiaDAO<?> dao) { - setQuery(dao.createQuery()); - } - public static TopiaQueryBuilder newInstance() { return new TopiaQueryBuilder(); } - /** - * This will create a new TopiaQueryBuilder with a new TopiaQuery from - * the {@code dao} in argument. - * - * @param dao used to create a new TopiaQuery in the builder - * @return a new instance of TopiaQueryBuilder - */ - public static TopiaQueryBuilder newInstance(TopiaDAO<?> dao) { - return new TopiaQueryBuilder(dao); - } - public void setQuery(TopiaQuery query) { this.query = query; } @@ -90,7 +68,7 @@ * @param element * @param collection * @return the TopiaQuery created - * @see Filter#prepareQuery(TopiaQuery, boolean, PropertyUid) + * @see #prepareQuery(Filter, EntityQueryProperty) */ public TopiaQuery createQueryFindElementsByCollection( EntityQueryProperty element, Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceFavoriteImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceFavoriteImpl.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceFavoriteImpl.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -244,7 +244,7 @@ protected Map<String, FavoriteParticipant> executeGetFavoriteParticipants( TopiaContext transaction, Filter filter) throws TopiaException { - PollenQueryBuilder builder = new PollenQueryBuilder(); + PollenQueryBuilder builder = context.newQueryBuilder(null); TopiaQuery query = builder.createQueryFindFavoriteParticipantsByFavoriteList(filter); @@ -268,7 +268,7 @@ protected int executeGetNbFavoriteParticipants(TopiaContext transaction, Filter filter) throws TopiaException { - PollenQueryBuilder builder = new PollenQueryBuilder(); + PollenQueryBuilder builder = context.newQueryBuilder(null); TopiaQuery query = builder.createQueryFindFavoriteParticipantsByFavoriteList(filter); 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-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -1,11 +1,14 @@ package org.chorem.pollen.service; import org.apache.commons.collections.CollectionUtils; +import org.chorem.pollen.EntityQueryProperty; import org.chorem.pollen.PollenBinderHelper; import org.chorem.pollen.PollenBusinessException; import org.chorem.pollen.PollenContext; import org.chorem.pollen.PollenDAOHelper; import org.chorem.pollen.PollenException; +import org.chorem.pollen.PollenQueryBuilder; +import org.chorem.pollen.TopiaQueryBuilder; import org.chorem.pollen.common.PollType; import org.chorem.pollen.entity.Choice; import org.chorem.pollen.entity.ChoiceDAO; @@ -21,6 +24,7 @@ import org.chorem.pollen.entity.UserAccount; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaQuery; import java.util.ArrayList; import java.util.Collection; @@ -86,7 +90,7 @@ } @Override - protected void executeCreatePoll(TopiaContext transaction, + protected Poll executeCreatePoll(TopiaContext transaction, List<Object> errorArgs, Poll poll, Collection<ParticipantList> lists) throws TopiaException, IllegalArgumentException, @@ -122,6 +126,8 @@ dao.update(newPoll); transaction.commitTransaction(); + + return newPoll; } protected Poll createBasicPoll(TopiaContext transaction, Poll source) @@ -339,4 +345,51 @@ return participant; } + @Override + protected boolean executeCanAdminPoll(TopiaContext transaction, + String accountUid, String pollUid) + throws TopiaException { + + PollDAO dao = PollenDAOHelper.getPollDAO(transaction); + + // No need alias managment so, no need of queryBuilder +// PollenQueryBuilder builder = context.newQueryBuilder(dao); +// +// EntityQueryProperty creatorProperty = +// builder.getPollCreatorProperty(Poll.CREATOR); +// +// int count = builder.getQuery(). +// add(Poll.UID, pollUid). +// add(creatorProperty.nameProperty(PollAccount.UID), accountUid). +// executeCount(); + + String creatorUidProperty = + TopiaQuery.getProperty(Poll.CREATOR, PollAccount.UID); + + int count = dao.createQuery(). + add(Poll.UID, pollUid). + add(creatorUidProperty, accountUid). + executeCount(); + + // Note a boolean admin exist in PollAccount, maybe + // find the account in lists + + return count > 0; + } + + @Override + protected Poll executeGetPoll(TopiaContext transaction, + String pollUid, String... properties) + throws TopiaException { + + PollDAO dao = PollenDAOHelper.getPollDAO(transaction); + + TopiaQuery query = dao.createQuery(). + add(Poll.UID, pollUid). + addLoad(properties); + + Poll result = dao.findByQuery(query); + return result; + } + } Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -268,11 +268,11 @@ UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(transaction); - TopiaQueryBuilder builder = new TopiaQueryBuilder(dao); - builder.prepareQuery(filter); + TopiaQuery query = dao.createQuery(); + context.newQueryBuilder(query).prepareQuery(filter); Map<String, UserAccount> results = dao.findAllMappedByQuery( - builder.getQuery(), UserAccount.LOGIN, String.class); + query, UserAccount.LOGIN, String.class); return results; } @@ -282,10 +282,10 @@ UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(transaction); - TopiaQueryBuilder builder = new TopiaQueryBuilder(dao); - builder.prepareQuery(filter); + TopiaQuery query = dao.createQuery(); + context.newQueryBuilder(query).prepareQuery(filter); - int result = builder.getQuery().executeCount(); + int result = query.executeCount(); return result; } 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-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-05-20 16:50:54 UTC (rev 3006) @@ -22,6 +22,7 @@ pollen.error.serviceList.deleteAccountFromPersonList= pollen.error.serviceMail.sendEmail= pollen.error.servicePoll.addComment= +pollen.error.servicePoll.canAdminPoll= pollen.error.servicePoll.createChoice= pollen.error.servicePoll.createPoll= pollen.error.servicePoll.createUpdateVote= @@ -40,7 +41,7 @@ pollen.error.servicePoll.getPollForUpdate= pollen.error.servicePoll.getPollForVote= pollen.error.servicePoll.getPollsByUser= -pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s +pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUid \= %1$s and poll with uid \= %2$s pollen.error.servicePoll.getRunningPolls= pollen.error.servicePoll.getVotes= pollen.error.servicePoll.savePoll= 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-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-05-20 16:50:54 UTC (rev 3006) @@ -22,6 +22,7 @@ pollen.error.serviceList.deleteAccountFromPersonList= pollen.error.serviceMail.sendEmail=Erreur lors de l'envoi de l'email sur le serveur %1$s\:%2$d pour %3$s de la part de %4$s pollen.error.servicePoll.addComment=Impossible d'ajouter un nouveau commentaire cr\u00E9\u00E9 par %1$s pour le sondage %2$s (%3$s) +pollen.error.servicePoll.canAdminPoll= pollen.error.servicePoll.createChoice= pollen.error.servicePoll.createPoll=Impossible d'enregistrer le sondage %1$s cr\u00E9\u00E9 par %2$s pollen.error.servicePoll.createUpdateVote= @@ -39,7 +40,7 @@ pollen.error.servicePoll.getPollForUpdate= pollen.error.servicePoll.getPollForVote= pollen.error.servicePoll.getPollsByUser= -pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s +pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUid \= %1$s and poll with uid \= %2$s pollen.error.servicePoll.getRunningPolls= pollen.error.servicePoll.getVotes= pollen.error.servicePoll.savePoll= Modified: trunk/pollen-business/src/main/xmi/pollen.zargo =================================================================== (Binary files differ) Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractPollsPage.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractPollsPage.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractPollsPage.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -113,7 +113,7 @@ // public String getAdminId() { // PollAccount creator = servicePollAccount.findPollAccountById(poll // .getCreatorId()); -// return poll.getPollUId() + ":" + creator.getAccountUId(); +// return poll.getPollUid() + ":" + creator.getAccountUid(); // } /** Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollUri.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollUri.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollUri.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -1,8 +1,6 @@ package org.chorem.pollen.ui.data; -import org.apache.tapestry5.ValueEncoder; - /** * PollUri * @@ -18,30 +16,59 @@ private static final String SEPARATOR = ":"; - protected String pollUId; + protected String pollUid; - protected String accountUId; + protected String accountUid; - public PollUri(String uri) { - String[] tab = uri.split(SEPARATOR); - pollUId = tab[0]; + protected PollUri() { + + } + +// public PollUri(String uri) { +// String[] tab = uri.split(SEPARATOR); +// pollUid = tab[0]; +// if (tab.length == 2) { +// accountUid = tab[1]; +// } +// } + + public static PollUri newUri(String stringUri) { + PollUri uri = new PollUri(); + String[] tab = stringUri.split(SEPARATOR); + uri.setPollUid(tab[0]); if (tab.length == 2) { - accountUId = tab[1]; + uri.setAccountUid(tab[1]); } + return uri; } - public String getAccountUId() { - return accountUId; + public static PollUri newUri(String accountUid, String pollUid) { + PollUri uri = new PollUri(); + uri.setAccountUid(accountUid); + uri.setPollUid(pollUid); + return uri; } - public String getPollUId() { - return pollUId; + public String getAccountUid() { + return accountUid; } + public void setAccountUid(String accountUid) { + this.accountUid = accountUid; + } + + public String getPollUid() { + return pollUid; + } + + public void setPollUid(String pollUid) { + this.pollUid = pollUid; + } + public String getUri() { - String uri = getPollUId(); - if (getAccountUId() != null) { - uri += SEPARATOR + getAccountUId(); + String uri = getPollUid(); + if (getAccountUid() != null) { + uri += SEPARATOR + getAccountUid(); } return uri; } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -101,7 +101,7 @@ if (logger.isDebugEnabled()) { logger.debug("Get existing poll with pollUID = " + uid); } - poll = servicePoll.getPollForUpdate(uid); + poll = servicePoll.getPoll(uid, Poll.CHOICE, Poll.POLL_ACCOUNT); // TODO : init advancedOptions // TODO-fdesbois-2010-05-19 : exception need to be throw if uid not correspond to an existing poll } else { @@ -319,7 +319,7 @@ choiceField.saveName(serviceImage); poll.addChoice(choiceField.getChoice()); } - servicePoll.createPoll(poll, getLists()); + poll = servicePoll.createPoll(poll, getLists()); } public void validate(Messages messages) throws FieldValidationException { @@ -366,13 +366,6 @@ } } - public Date getBeginDate() { - if (poll.getBeginDate() == null) { - poll.setBeginDate(new Date()); - } - return poll.getBeginDate(); - } - /** * ValueEncoder toClient is used to convert {@code value} to the list name. * 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-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -9,6 +9,7 @@ import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary; import org.apache.tapestry5.annotations.IncludeStylesheet; import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; @@ -18,6 +19,7 @@ import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.json.JSONObject; import org.apache.tapestry5.services.ComponentSource; +import org.apache.tapestry5.services.PageRenderLinkSource; import org.chorem.pollen.PollenBusinessException; import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; @@ -25,6 +27,7 @@ import org.chorem.pollen.entity.Participant; import org.chorem.pollen.entity.ParticipantList; import org.chorem.pollen.entity.Poll; +import org.chorem.pollen.entity.PollAccount; import org.chorem.pollen.entity.PreventRule; import org.chorem.pollen.entity.PreventRuleImpl; import org.chorem.pollen.mail.PreventRuleManager; @@ -34,6 +37,7 @@ import org.chorem.pollen.ui.data.AddressBar; import org.chorem.pollen.ui.data.ChoiceField; import org.chorem.pollen.ui.data.FieldValidationException; +import org.chorem.pollen.ui.data.PollUri; import org.chorem.pollen.ui.models.ParticipantListModel; import org.chorem.pollen.ui.models.PollFormModel; import org.chorem.pollen.ui.services.PollenManager; @@ -80,9 +84,6 @@ @InjectComponent private Zone mainZone; - @Inject - private Logger logger; - @Override public Border getBorder() { return border; @@ -90,7 +91,7 @@ /** Services injected */ @Inject - private Logger log; + private Logger logger; @Inject private Messages messages; @@ -125,6 +126,7 @@ initOptions(); listsFeedback.clearErrors(); step = PollStep.MAIN; + mainForm.clearErrors(); } /** @@ -148,8 +150,8 @@ */ public PollFormModel getModel() { if (model == null) { - if (log.isDebugEnabled()) { - log.debug("-------- NEW POLL FORM MODEL --------"); + if (logger.isDebugEnabled()) { + logger.debug("-------- NEW POLL FORM MODEL --------"); } model = new PollFormModel(); model.initPoll(servicePoll, pollUID, getUserConnected()); @@ -211,8 +213,8 @@ @Log void onPrepareForRender() { String formId = mainForm.getClientId(); - if (log.isDebugEnabled()) { - log.debug("form id : " + formId); + if (logger.isDebugEnabled()) { + logger.debug("form id : " + formId); } if (formId != null) { // Script for form interactions : see "webapp/js/pollForm.js" @@ -387,8 +389,8 @@ public ParticipantList getListSelected() { ParticipantList result = getModel().getCurrentList(); - if (log.isDebugEnabled() && result != null) { - log.debug("List selected : " + result.getName()); + if (logger.isDebugEnabled() && result != null) { + logger.debug("List selected : " + result.getName()); } return result; } @@ -410,7 +412,7 @@ // A dialog box will appeared for user confirmation on changing poll // type with data unsaved. json.put("confirm", - messages.get("pollen.ui.poll.listChanged.confirmMessage")); + messages.get("pollen.ui.poll.form.confirmlistChange")); } return json; } @@ -622,10 +624,44 @@ } } + @Inject + private PageRenderLinkSource linkSource; + + private Link successLink; + + @InjectPage + private PollLinks pollLinks; + + public void prepareSuccessLinks(Poll newPoll) { + String creatorUid = newPoll.getCreator().getUid(); + String pollUid = newPoll.getUid(); + PollUri uri = PollUri.newUri(creatorUid, pollUid); +// successLink = linkSource.createPageRenderLinkWithContext( +// PollLinks.class, uri); + pollLinks.setPollUri(uri); + } + @Log Object onSuccess() { + if (!edited) { + PollAccount creator = getPoll().getCreator(); + PollUri uri = PollUri.newUri(creator.getUid(), getPoll().getUid()); + pollLinks.addInfo("Sauvegarde OK !"); + if (creator.getEmail() != null) { + pollLinks.addInfo("Vous avez recu un mail !"); + } + if (getPoll().getPollType().isRestrictedOrGroup()) { + pollLinks.addInfo("Les votants ont reçu un mail !"); + } + return pollLinks; + } return mainZone; } + @Log + Object onFailure() { + return mainZone; + } + } Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollLinks.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollLinks.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollLinks.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -0,0 +1,105 @@ +package org.chorem.pollen.ui.pages.poll; + +import org.apache.tapestry5.Link; +import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.apache.tapestry5.services.PageRenderLinkSource; +import org.chorem.pollen.entity.Poll; +import org.chorem.pollen.service.ServicePoll; +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.PollUri; +import org.slf4j.Logger; + +/** + * Created: 20 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class PollLinks extends AbstractPollenPage { + + public static final String URI_SEPARATOR = "/"; + + @InjectComponent + private Border border; + + @Inject + private Logger logger; + + @Inject + private ServicePoll servicePoll; + + @Override + public Border getBorder() { + return border; + } + + public String getTitle() { + return "Liens d'accès au sondage"; + } + + public AddressBar getAddressBar() { + return AddressBar.newBar().appendCurrent(getTitle()); + } + + @Inject + private PageRenderLinkSource linkSource; + + private Poll poll; + + private PollUri pollUri; + + void onActivate(PollUri pollUri) { + this.pollUri = pollUri; + } + + PollUri onPassivate() { + return pollUri; + } + + void setupRender() { + if (pollUri == null) { + addFatal("pollen.ui.poll.links.uriNotDefined"); + } else if (!servicePoll.canAdminPoll( + pollUri.getAccountUid(), pollUri.getPollUid())) { + addFatal("pollen.ui.poll.links.notAllowed"); + } + } + + public boolean isPollNull() { + return getPoll() == null; + } + + public void setPollUri(PollUri pollUri) { + this.pollUri = pollUri; + } + + public Poll getPoll() { + if (pollUri != null) { + poll = servicePoll.getPoll(pollUri.getPollUid()); + } + return poll; + } + + public Link getPollLink() { + Link link = linkSource.createPageRenderLinkWithContext( + PollForm.class, pollUri); + return link; + } + + public Link getVoteLink() { + PollUri voteUri = PollUri.newUri(null, pollUri.getPollUid()); + Link link = linkSource.createPageRenderLinkWithContext( + VoteForPoll.class, voteUri); + return link; + } + + public Link getModerateVoteLink() { + Link link = linkSource.createPageRenderLinkWithContext( + VoteForPoll.class, pollUri); + return link; + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollLinks.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -372,9 +372,9 @@ // ResultListDTO resultListDTO = null; // // if (byGroup) { -// resultListDTO = serviceResults.getGroupResults(poll.getPollUId()); +// resultListDTO = serviceResults.getGroupResults(poll.getPollUid()); // } else { -// resultListDTO = serviceResults.getNormalResults(poll.getPollUId()); +// resultListDTO = serviceResults.getNormalResults(poll.getPollUid()); // } // // results = resultListDTO.getResultDTOs(); Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -421,10 +421,10 @@ //// //// // Check for restricted poll //// if (!alreadyVoted && !isFreePoll()) { -//// if (uri.getAccountUId() != null) { -//// // The accountUId must be valid for the poll +//// if (uri.getAccountUid() != null) { +//// // The accountUid must be valid for the poll //// PollAccountDTO restrictedAccount = -//// servicePoll.getRestrictedAccount(uri.getAccountUId(), getPoll()); +//// servicePoll.getRestrictedAccount(uri.getAccountUid(), getPoll()); //// //// if (restrictedAccount != null) { //// // PollAccount is replaced by the good account from db @@ -435,7 +435,7 @@ //// } else { //// restrictedListsForbidden = true; //// } -//// // Not allowed to vote without an accountUId +//// // Not allowed to vote without an accountUid //// } else { //// restrictedListsForbidden = true; //// } @@ -525,8 +525,8 @@ // /** Ajout d'une entrée dans le flux de syndication */ // private void addFeedEntry(PollAction pollAction, String titleStr, // String contentStr) throws PollenBusinessException { -// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId(); -// File feedFile = getFeedContext().getFile(getPoll().getPollUId()); +// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUid(); +// File feedFile = getFeedContext().getFile(getPoll().getPollUid()); // String title = null; // String content = null; // @@ -558,8 +558,8 @@ // // /** Envoi du mail de notification */ // private void sendMailNotification() throws PollenBusinessException { -// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId(); -// String modifURL = siteURL + "poll/Modification/" + getPoll().getPollUId() +// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUid(); +// String modifURL = siteURL + "poll/Modification/" + getPoll().getPollUid() // + ":" + MD5.encode(getPoll().getCreatorId()); // Map<String, String> data = new HashMap<String, String>(); // data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST)); @@ -669,7 +669,7 @@ // */ // @Log // public boolean isFeedFileExisting() throws PollenBusinessException { -// File feedFile = getFeedContext().getFile(getPoll().getPollUId()); +// File feedFile = getFeedContext().getFile(getPoll().getPollUid()); // if (log.isDebugEnabled()) { // log.debug("feed context path : " + getFeedContext().getContextPath()); // log.debug("feed absolute path : " + feedFile.getAbsolutePath()); @@ -777,7 +777,7 @@ // if (isTextType()) { // if (newChoice.getName() != null) { // newChoice.setValidate(true); -// newChoice.setPollUId(getPoll().getPollUId()); +// newChoice.setPollUid(getPoll().getPollUid()); // getPoll().getChoices().add(newChoice); // choiceName = newChoice.getName(); // choiceDesc = newChoice.getDescription(); @@ -785,7 +785,7 @@ // } else if (isDateType()) { // if (newDateChoice.getDate() != null) { // newDateChoice.setValidate(true); -// newDateChoice.setPollUId(getPoll().getPollUId()); +// newDateChoice.setPollUid(getPoll().getPollUid()); // newDateChoice.setName(String.valueOf(newDateChoice.getDate() // .getTime())); // getPoll().getChoices().add(newDateChoice); @@ -796,7 +796,7 @@ // } else if (isImageType()) { // if (newImageChoice.getImg() != null) { // newImageChoice.setValidate(true); -// newImageChoice.setPollUId(getPoll().getPollUId()); +// newImageChoice.setPollUid(getPoll().getPollUid()); // newImageChoice.setName(newImageChoice.getImg().getFileName() // .replace(' ', '_')); // getPoll().getChoices().add(newImageChoice); @@ -904,9 +904,9 @@ // if (getPoll().getContinuousResults()) { // // if (isGroupPoll()) { -// resultListDTO = serviceResults.getGroupResults(getPoll().getPollUId()); +// resultListDTO = serviceResults.getGroupResults(getPoll().getPollUid()); // } else { -// resultListDTO = serviceResults.getNormalResults(getPoll().getPollUId()); +// resultListDTO = serviceResults.getNormalResults(getPoll().getPollUid()); // } // // results = resultListDTO.getResultDTOs(); @@ -1048,7 +1048,7 @@ public Poll getPoll() throws PollenBusinessException { if (poll == null) { - poll = servicePoll.getPollForVote(uri.getPollUId()); + poll = servicePoll.getPollForVote(uri.getPollUid()); if (poll != null) { @@ -1082,7 +1082,7 @@ /** * Use a PollAccount to represent the current session user. - * The existing account is used if accountUId is present in the uri. + * The existing account is used if accountUid is present in the uri. * Otherwise a new account is instanciate with user properties * (for vote name). * @@ -1091,8 +1091,8 @@ public PollAccount getPollAccount() throws PollenBusinessException { if (pollAccount == null) { // Identification du votant - if (uri.getAccountUId() != null) { - // pollAccount = serviceUser.getPerson(uri.getAccountUId()); + if (uri.getAccountUid() != null) { + // pollAccount = serviceUser.getPerson(uri.getAccountUid()); // pollAccountId = pollAccount.getId(); @@ -1314,7 +1314,7 @@ // break; // case IMAGE: // newChoice = ChoiceField.getChoiceImage( -// getPoll().getPollUId()); +// getPoll().getPollUid()); // break; // case TEXT: // default: Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -73,7 +73,7 @@ // for (VotingListDTO list : poll.getVotingListDTOs()) { // for (PollAccountDTO account : list.getPollAccountDTOs()) { // if (account.getEmail().equals(user.getEmail())) { -// return poll.getPollUId() + ":" + account.getAccountUId(); +// return poll.getPollUid() + ":" + account.getAccountUid(); // } // } // } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -107,7 +107,7 @@ /** * Execute PollenManager when registry startup. * The manager will be instantiated using - * {@link #buildPollenManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub) }. + * {@link #buildPollenManager() }. * The serviceUser is needed to start the application. * * @param configuration to add the manager to registry startup @@ -187,7 +187,7 @@ @Override public PollUri coerce(String input) { - return new PollUri(input); + return PollUri.newUri(input); } }; @@ -249,12 +249,12 @@ /** * Contribution to ComponentRequestHandler service. The - * {@link AuthenticationFilter} is added to the configuration of + * {@link PollenAuthenticationFilter} is added to the configuration of * the service to provide authentication managment on user connected. * * @param configuration of ComponentRequestHandler * @see ServiceAuthentication - * @see AuthenticationFilter + * @see PollenAuthenticationFilter * @see ComponentRequestFilter */ public static void contributeComponentRequestHandler( Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthentication.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthentication.java 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthentication.java 2010-05-20 16:50:54 UTC (rev 3006) @@ -2,11 +2,13 @@ package org.chorem.pollen.ui.services; import org.apache.tapestry5.annotations.SessionState; +import org.apache.tapestry5.ioc.MappedConfiguration; import org.apache.tapestry5.services.ApplicationStateManager; import org.chorem.pollen.entity.UserAccount; import org.chorem.pollen.entity.UserAccountImpl; import org.chorem.pollen.ui.data.PollenRequiresAuthentication; import org.chorem.pollen.ui.pages.admin.AdminUsers; +import org.nuiton.web.tapestry5.services.ServiceAuthentication; import org.nuiton.web.tapestry5.services.ServiceAuthenticationImpl; /** @@ -27,6 +29,8 @@ public class PollenAuthentication extends ServiceAuthenticationImpl<UserAccount, PollenRequiresAuthentication> { + protected Class<?> pageClass; + public PollenAuthentication(ApplicationStateManager stateManager) { super(stateManager, UserAccount.class, PollenRequiresAuthentication.class); @@ -53,7 +57,7 @@ * in AppModule. * * @return a new instance of UserAccount. - * @see AppModule#contributeApplicationStateManager(MappedConfiguration, ServiceAuthentication) + * @see AppModule#contributeApplicationStateManager(MappedConfiguration , ServiceAuthentication) */ @Override public UserAccount getNewUserInstance() { Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties =================================================================== --- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-20 16:50:54 UTC (rev 3006) @@ -1,6 +1,7 @@ ############################ PAGES ############################################# pollen.page.AdminUsers.title=Gestion des utilisateurs pollen.page.UserLists.title=Vos listes de votants +pollen.page.PollLinks.title=Liens d'acc\u00e8s au sondage ############################ EMAIL ############################################# pollen.email.userRegister.subject=[Pollen] Confirmation de cr\u00e9ation du compte %s @@ -57,8 +58,20 @@ pollen.ui.participant.weight-label=Poids pollen.ui.participant.add=Nouveau participant -pollen.ui.poll.listChanged.confirmMessage=Des changements ont été effectués sur la/les liste(s), un changement de restriction supprimera les modifications. Voulez-vous continuer ? +pollen.ui.poll.form.confirmlistChange=Des changements ont \u00e9t\u00e9 effectu\u00e9s sur la/les liste(s), un changement de restriction supprimera les modifications. Voulez-vous continuer ? +pollen.ui.poll.links.pollName=%1$s par %2$s +pollen.ui.poll.links.uriNotDefined=Page inaccessible sans identifiant du sondage dans l'url ! +pollen.ui.poll.links.notAllowed=L'url est incorrect, vous n'\u00eates pas autoris\u00e9 \u00e0 acc\u00e9der aux liens du sondage. +#pollen.ui.poll.links.votePage=Le lien ci-dessous m\u00e8ne \u00e0 la page de votes. Enregistrez-le et envoyez-le \u00e0 ceux que vous voulez voir voter : +#pollen.ui.poll.links.adminVotePage=Le lien ci-dessous m\u00e8ne \u00e0 la page de votes avec un acc\u00e8s mod\u00e9rateur. Enregistrez-le pour pouvoir mod\u00e9rer les votes si besoin : +#pollen.ui.poll.links.editPage=Le lien ci-dessous m\u00e8ne \u00e0 la page de modification du sondage. Enregistrez-le pour pouvoir modifier votre sondage au besoin ou le clore : +pollen.ui.poll.links.votePage=Lien d'acc\u00e8s publique \u00e0 la page des votes : +pollen.ui.poll.links.adminVotePage=Lien d'acc\u00e8s mod\u00e9rateur \u00e0 la page des votes : +pollen.ui.poll.links.editPage=Lien d'acc\u00e8s \u00e0 la modification du sondage : +pollen.ui.poll.links.register=Si vous \u00eates un utilisateur identifi\u00e9, vous pouvez retrouver ces liens dans la page +pollen.ui.poll.links.myPolls=Mes sondages + # OLD LOGIN_COMPONENT connectionLegend=Connexion loginSubmit=Me connecter @@ -70,6 +83,8 @@ # FORM:: poll groupName-label=Nom du groupe +participantEmail-regexp=^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$ +participantEmail-regexp-message=Adresse email invalide. # FORM:: user firstName-label=Pr\u00e9nom Modified: trunk/pollen-ui/src/main/webapp/poll/CreationValidation.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/CreationValidation.tml 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/webapp/poll/CreationValidation.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -8,8 +8,8 @@ <img src="${asset:context:img/vote.png}" alt="${message:vote}" style="margin-right: 18px;"/> ${message:votePage} <br /> - <t:PageLink t:context="poll.pollUId" t:page="poll/VoteForPoll" style="margin-left:50px;"> - ${siteURL}poll/VoteFor/${poll.pollUId} + <t:PageLink t:context="poll.pollUid" t:page="poll/VoteForPoll" style="margin-left:50px;"> + ${siteURL}poll/VoteFor/${poll.pollUid} </t:PageLink> </div> <div style="margin-top: 10px;"> Modified: trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/webapp/poll/PollCreation.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -275,7 +275,7 @@ </div> </t:formfragment> <t:formfragment t:id="imgChoiceFragment" visible="isImgChoices()"> - <t:ImageContextLink t:id="imgContext" t:dir="poll.pollUId" /> + <t:ImageContextLink t:id="imgContext" t:dir="poll.pollUid" /> <div t:type="loop" t:source="imgTypeChoices" t:value="imgTypeChoice" t:volatile="true"> <div class="fleft choiceName"> <t:label for="imgFile" /> Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -337,7 +337,8 @@ <td> <t:textfield t:id="participantEmail" value="participant.email" - size="25" /> + size="25" + t:validate="required,regexp" /> </td> <td> <t:textfield t:id="participantWeight" Added: trunk/pollen-ui/src/main/webapp/poll/PollLinks.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollLinks.tml (rev 0) +++ trunk/pollen-ui/src/main/webapp/poll/PollLinks.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -0,0 +1,44 @@ +<!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:pageTitle="prop:title" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> + <!--<t:feedback t:id="feedback"/>--> + <t:unless t:test="pollNull"> + <h1 class="titleCreation">${title}</h1> + + <h3>${format:pollen.ui.poll.links.pollName=poll.title,poll.creator.name}</h3> + <t:unless t:test="poll.pollType.restrictedOrGroup"> + <div style="margin-top: 10px;"> + <img src="${asset:context:img/vote.png}" alt="${message:vote}" style="margin-right: 20px;"/> + ${message:pollen.ui.poll.links.votePage} + <br /> + <a href="${voteLink}" style="margin-left:50px;"> + ${url}${voteLink.toAbsoluteUri()} + </a> + </div> + <!--<p:else>--> + <!--${message:pollen.ui.poll.links.noVoteLinkForRestriction}--> + <!--</p:else>--> + </t:unless> + <div style="margin-top: 10px;"> + <img src="${asset:context:img/edit.png}" alt="${message:edit}" /> + <img src="${asset:context:img/vote.png}" alt="${message:vote}" style="margin-right: 1px;" /> + ${message:pollen.ui.poll.links.adminVotePage} + <br /> + <a href="${moderateVoteLink}" style="margin-left:50px;"> + ${url}${moderateVoteLink.toAbsoluteUri()} + </a> + </div> + <div style="margin-top: 10px;"> + <img src="${asset:context:img/edit.png}" alt="${message:edit}" style="margin-right: 26px;" /> + ${message:pollen.ui.poll.links.editPage} + <br /> + <a href="${pollLink}" style="margin-left:50px;"> + ${url}${pollLink.toAbsoluteUri()} + </a> + </div> + <div style="margin-top: 30px;"> + ${message:pollen.ui.poll.links.register} + <t:PageLink t:page="user/PollsCreated">${message:pollen.ui.poll.links.myPolls}</t:PageLink>. + </div> + </t:unless> +</html> \ No newline at end of file Property changes on: trunk/pollen-ui/src/main/webapp/poll/PollLinks.tml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -1,5 +1,5 @@ -<t:border t:address="address.items" t:pageLogo="literal:Vote" t:feedFilename="prop:uri.pollUId" +<t:border t:address="address.items" t:pageLogo="literal:Vote" t:feedFilename="prop:uri.pollUid" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> <t:feedback t:id="feedback"/> @@ -14,13 +14,13 @@ <legend>${message:about}</legend> <div style="float: right"> <t:if test="poll.publicResults"> - <t:PageLink t:page="poll/Results" t:context="poll.pollUId"> + <t:PageLink t:page="poll/Results" t:context="poll.pollUid"> <img src="${asset:context:img/count.png}" title="${message:results-help}" alt="${message:results}"/> </t:PageLink> </t:if> <t:FeedContextLink t:id="feedContext" /> <t:if test="feedFileExisting"> - <t:FileLink filename="${poll.pollUId}" type="literal:application/atom+xml" t:context="feedContext"> + <t:FileLink filename="${poll.pollUid}" type="literal:application/atom+xml" t:context="feedContext"> <img src="${asset:context:img/feed.png}" title="Atom" alt="Atom"/> </t:FileLink> </t:if> @@ -204,7 +204,7 @@ <t:if test="poll.continuousResults"> <tr> <td> - <t:PageLink t:page="poll/results" t:context="${poll.pollUId}">${message:results}</t:PageLink> + <t:PageLink t:page="poll/results" t:context="${poll.pollUid}">${message:results}</t:PageLink> </td> <t:loop t:source="poll.choices" t:value="choiceOfPoll" volatile="true"> <t:if test="!isChoiceHidden()"> @@ -233,7 +233,7 @@ <!-- Ajout de choix --> - <!--<t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUId"/>--> + <!--<t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUid"/>--> <t:if test="canAddChoice"> <h4>${message:pollen.ui.choice.add.title}</h4> <div id="choiceFormDiv"> Modified: trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-05-20 10:55:16 UTC (rev 3005) +++ trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-05-20 16:50:54 UTC (rev 3006) @@ -10,7 +10,7 @@ <t:grid t:id="pollsGrid" t:source="polls" t:row="poll" model="pollsModel" t:inPlace="true" t:rowsPerPage="10" t:pagerPosition="bottom" t:rowClass="prop:evenodd.next"> <p:functionsCell> - <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollUId"> + <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollUid"> <img src="${asset:context:img/vote.png}" title="${message:vote-help}" alt="${message:vote}" /> </t:PageLink> <t:PageLink t:page="poll/results" t:context="adminId"> @@ -21,18 +21,18 @@ <t:PageLink t:page="poll/modification" t:context="adminId"> <img src="${asset:context:img/edit.png}" title="${message:edit-help}" alt="${message:edit}" /> </t:PageLink> - <t:ActionLink t:id="close" t:context="poll.pollUId"> + <t:ActionLink t:id="close" t:context="poll.pollUid"> <img src="${asset:context:img/close.png}" title="${message:close-help}" alt="${message:close}" /> </t:ActionLink> </t:unless> - <t:ActionLink t:id="export" t:context="poll.pollUId"> + <t:ActionLink t:id="export" t:context="poll.pollUid"> <img src="${asset:context:img/export.png}" title="${message:export-help}" alt="${message:export}" /> </t:ActionLink> - <t:PageLink t:page="poll/creation" t:context="poll.pollUId"> + <t:PageLink t:page="poll/creation" t:context="poll.pollUid"> <img src="${asset:context:img/copy.png}" title="${message:copy-help}" alt="${message:copy}" /> </t:PageLink> - <t:ActionLink t:id="deletePoll" t:context="poll.pollUId"> + <t:ActionLink t:id="deletePoll" t:context="poll.pollUid"> <img src="${asset:context:img/delete.png}" title="${message:delete-help}" alt="${message:delete}" /> </t:ActionLink> </p:functionsCell>