Author: fdesbois Date: 2010-05-06 19:03:11 +0200 (Thu, 06 May 2010) New Revision: 2988 Url: http://chorem.org/repositories/revision/pollen/2988 Log: - Evo #190 : javadoc and missing i18n messages - Connexion page is renamed in Connection Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connection.java trunk/pollen-ui/src/main/webapp/Connection.tml Removed: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connexion.java trunk/pollen-ui/src/main/webapp/Connexion.tml Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsCreate.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsUpdate.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollenRequiresAuthentication.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthenticationFilter.java trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsCreate.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsCreate.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsCreate.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -17,11 +17,12 @@ import org.slf4j.Logger; /** - * UserListsCreate + * Component to create a new FavoriteList using the {@code createList} form. * * Created: 27 avr. 2010 * - * @author fdesbois + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ */ public class UserListsCreate { @@ -53,10 +54,21 @@ @InjectComponent private Form createList; + /** + * SETUP_RENDER :: Handler method called when the component is rendered. + * Will clean errors from {@code createList} form. + */ void setupRender() { createList.clearErrors(); } + /** + * ON_PREPARE :: Handler method for both prepareRender and prepareSubmit + * events of {@code createList} form. Will instantiate a new instance + * of FavoriteList using {@code serviceFavorite} and user connected. + * + * @see ServiceFavorite#getNewFavoriteList(UserAccount) + */ void onPrepareFromCreateList() { if (newFavoriteList == null) { if (logger.isDebugEnabled()) { @@ -67,6 +79,14 @@ } } + /** + * ON_VALIDATE_FORM :: Handler method for validateForm event of the + * {@code createList} form. The {@code newFavoriteList} will be created + * using {@code serviceFavorite}. Errors from service will be recorded + * into the {@code createList} form. + * + * @see ServiceFavorite#createFavoriteParticipant(FavoriteParticipant) + */ void onValidateFormFromCreateList() { try { serviceFavorite.createFavoriteList(newFavoriteList); @@ -85,12 +105,21 @@ } } + /** + * ON_SUCCESS :: Handler method for success event of the {@code createList} + * form. Will display a success message and refresh the {@code page} + * container. + */ Object onSuccessFromCreateList() { page.addInfo(messages.format("pollen.ui.list.create.success", newFavoriteList.getName())); return page; } + /** + * ON_FAILURE :: Handler method for failure event of the {@code createList} + * form. Will refresh the form (included in a zone} to display errors. + */ Object onFailureFromCreateList() { return createList; } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsUpdate.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsUpdate.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/UserListsUpdate.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -1,7 +1,6 @@ package org.chorem.pollen.ui.components; -import org.apache.commons.lang.StringUtils; import org.apache.tapestry5.annotations.InjectComponent; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Parameter; @@ -22,15 +21,17 @@ import org.slf4j.Logger; /** - * UserListsUpdate + * Component to manage FavoriteParticipant in a FavoriteList as {@code source}. + * The {@code participants} are displayed in an editable Grid surrounded by an + * unique Zone {@code updateZone}. Two forms are used, one to add a new + * participant in the Grid and one to edit a participant directly in the grid. + * Each action will return the {@code updateZone} to refresh data loaded by + * {@link #getParticipants()} method. * * Created: 27 avr. 2010 * - * @author fdesbois - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$s */ public class UserListsUpdate { @@ -108,7 +109,7 @@ * call prepareForSubmit * load size of participants dataSource * load participants data - * load participantEdited to push form data + * load participantEdited to push form data (hidden fields in first) * call selected on submit button * call validateForm * call success or failure @@ -165,16 +166,17 @@ } /** - * ON_ACTION :: Handler method for action on deletedAccount actionLink. - * The selected login from the Grid will be used to delete the user. + * ON_ACTION :: Handler method for action on removeParticipant actionLink. + * The selected id from the Grid will be used to delete the participant. * - * @param login used to delete the user + * @param id used to delete the participant * @return the updateZone content to refresh - * @see ServiceUser#deleteUser(String) + * @see ServiceFavorite#deleteFavoriteParticipant(String) */ Object onActionFromRemoveParticipant(String id) { serviceFavorite.deleteFavoriteParticipant(id); - participantsFeedback.addInfo("Suppression OK"); + participantsFeedback.addInfo( + messages.get("pollen.ui.list.update.removeParticipant.success")); return updateZone; } @@ -204,10 +206,11 @@ /** * ON_VALIDATE_FORM :: Handler method for validateForm event of the - * usersForm. The accountEdited will be updated using serviceUser. Errors - * from service will be recorded into the usersForm. + * participantsForm. The participantEdited will be updated using + * serviceFavorite. Errors from service will be recorded into the + * participantsForm. * - * @see ServiceUser#updateUser(UserAccount, boolean) + * @see ServiceFavorite#updateFavoriteParticipant(FavoriteParticipant) */ @Log void onValidateFormFromParticipantsForm() { @@ -224,29 +227,34 @@ /** * ON_SUCCESS :: Handler method for success event of the participantsForm. - * Refresh the page to display a success message. - * - * @return the page container. + * Clean form data (participantEdited) and display a success message. + * {@link #onSubmitFromParticipantsForm()} will be called after it to + * refresh the updateZone. */ - Object onSuccessFromParticipantsForm() { - participantsFeedback.addInfo("Modification OK"); + void onSuccessFromParticipantsForm() { + participantsFeedback.addInfo( + messages.get("pollen.ui.list.update.saveParticipant.success")); // Clean form data before refresh zone cleanFormData(); - return updateZone; } + /** + * Clean the form content, i.e. the favorite participant in edition and + * its id. + */ protected void cleanFormData() { participantEditedId = null; participantEdited = null; } /** - * ON_FAILURE :: Handler method for failure event of the participantsForm. - * Will display errors and keep participantEdited in edition. + * ON_SUBMIT :: Handler method for submit event called after succes or + * failure of the participantsForm. Will refresh the updateZone to display + * errors or Grid updated. * * @return the updateZone to refresh */ - Object onFailureFromParticipantsForm() { + Object onSubmitFromParticipantsForm() { return updateZone; } @@ -258,6 +266,13 @@ @InjectComponent private Form addParticipant; + /** + * ON_PREPARE :: Handler method for both prepareSubmit and prepareRender + * events of the participantsForm. Will instantiate a new + * FavoriteParticipant to render or saved with form data. + * + * @see ServiceFavorite#getNewFavoriteParticipant(FavoriteList) + */ void onPrepareFromAddParticipant() { if (newParticipant == null) { newParticipant = @@ -265,6 +280,14 @@ } } + /** + * ON_VALIDATE_FORM :: Handler method for validateForm event of the + * addParticipant form. The newParticipant will be created using + * serviceFavorite. Errors from service will be recorded into the + * addParticipant form. + * + * @see ServiceFavorite#createFavoriteParticipant(FavoriteParticipant) + */ void onValidateFormFromAddParticipant() { if (logger.isDebugEnabled()) { logger.debug("FavoriteList selected : " + source); @@ -277,8 +300,25 @@ } } + /** + * ON_SUCCESS :: Handler method for success event of the addParticipant form. + * Will display a success message. {@link #onSubmitFromAddParticipant()} + * will be called after it to refresh the updateZone. + */ + void onSuccessFromAddParticipant() { + participantsFeedback.addInfo( + messages.format("pollen.ui.list.update.addParticipant.success", + newParticipant.getName())); + } + + /** + * ON_SUBMIT :: Handler method for submit event called after succes or + * failure of the addParticipant form. Will refresh the updateZone to + * display errors or Grid updated. + * + * @return the updateZone to refresh + */ Object onSubmitFromAddParticipant() { - participantsFeedback.addInfo("Ajout OK"); return updateZone; } } Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollenRequiresAuthentication.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollenRequiresAuthentication.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollenRequiresAuthentication.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -6,15 +6,23 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.chorem.pollen.ui.services.PollenAuthenticationFilter; +import org.chorem.pollen.ui.base.AbstractPollenPage; +import org.nuiton.web.tapestry5.services.ServiceAuthentication; /** * This annotation is used on pages and components that need authentication - * to be rendered. + * to be rendered. The ServiceAuthentication is used to check authorizations + * on each page from {@link AbstractPollenPage}. This service is called from + * a Filter {@link PollenAuthenticationFilter} registered in Tapestry registry + * that intercept event on component and page render. * * Created: 3 mai 2010 * - * @author fdesbois - * $Id$ + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + * @see ServiceAuthentication + * @see PollenAuthenticationFilter */ @Target( { ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) Copied: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connection.java (from rev 2985, trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connexion.java) =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connection.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connection.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -0,0 +1,127 @@ + +package org.chorem.pollen.ui.pages; + +import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.Log; +import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.corelib.components.Form; +import org.apache.tapestry5.ioc.Messages; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.apache.tapestry5.services.PageRenderLinkSource; +import org.chorem.pollen.PollenBusinessException; +import org.chorem.pollen.entity.UserAccount; +import org.chorem.pollen.service.ServiceUser; +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.services.PollenManager; +import org.nuiton.web.tapestry5.services.ServiceAuthentication; +import org.slf4j.Logger; + +/** + * Connexion + * + * Created: 4 mai 2010 + * + * @author fdesbois + * $Id$ + */ +public class Connection extends AbstractPollenPage { + + @InjectComponent + private Border border; + + @Override + public Border getBorder() { + return border; + } + + public AddressBar getAddressBar() { + return AddressBar.newBar(); + } + + @InjectComponent + private Form loginForm; + + /** + * Champ login du formulaire d'identification + */ + @Property + private String connectionLogin; + + /** + * Champ password du formulaire d'identification + */ + @Property + private String connectionPassword; + + /** Injection des services */ + @Inject + private Logger logger; + + @Inject + private Messages messages; + + @Inject + private ServiceAuthentication<UserAccount> serviceAuthentication; + + @Inject + private ServiceUser serviceUser; + + @Inject + private PollenManager manager; + + @Inject + private PageRenderLinkSource pageRender; + + private String pageName; + + void onActivate(String pageName) { + this.pageName = pageName; + } + + String onPassivate() { + return pageName; + } + + void setupRender() { + addError(messages.format("pollen.ui.user.display.notConnected", + pageName)); + } + + void onValidateFormFromLoginForm() { + UserAccount current; + try { + current = serviceUser.connect(connectionLogin, connectionPassword); + if (current != null) { + serviceAuthentication.setUserConnected(current); + } else { + loginForm.recordError(messages.get("loginFailed")); + } + } catch (PollenBusinessException eee) { + // TODO two different errors, on password or on login + //addError(messages.get("loginFailed")); + String message = manager.getErrorMessage(eee, messages, logger); + loginForm.recordError(message); + } + } + + /** + * Methode appelée lorsque l'utilisateur s'identifie + * + * @return la zone à mettre à jour + */ + @Log + Object onSuccessFromLoginForm() { + if (pageName == null) { + pageName = "index"; + } + return pageRender.createPageRenderLink(pageName); + } + + @Log + void onFailureFromLoginForm() { + + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connection.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:mergeinfo + Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connexion.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connexion.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Connexion.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -1,127 +0,0 @@ - -package org.chorem.pollen.ui.pages; - -import org.apache.tapestry5.annotations.InjectComponent; -import org.apache.tapestry5.annotations.Log; -import org.apache.tapestry5.annotations.Property; -import org.apache.tapestry5.corelib.components.Form; -import org.apache.tapestry5.ioc.Messages; -import org.apache.tapestry5.ioc.annotations.Inject; -import org.apache.tapestry5.services.PageRenderLinkSource; -import org.chorem.pollen.PollenBusinessException; -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.service.ServiceUser; -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.services.PollenManager; -import org.nuiton.web.tapestry5.services.ServiceAuthentication; -import org.slf4j.Logger; - -/** - * Connexion - * - * Created: 4 mai 2010 - * - * @author fdesbois - * $Id$ - */ -public class Connexion extends AbstractPollenPage { - - @InjectComponent - private Border border; - - @Override - public Border getBorder() { - return border; - } - - public AddressBar getAddressBar() { - return AddressBar.newBar(); - } - - @InjectComponent - private Form loginForm; - - /** - * Champ login du formulaire d'identification - */ - @Property - private String connectionLogin; - - /** - * Champ password du formulaire d'identification - */ - @Property - private String connectionPassword; - - /** Injection des services */ - @Inject - private Logger logger; - - @Inject - private Messages messages; - - @Inject - private ServiceAuthentication<UserAccount> serviceAuthentication; - - @Inject - private ServiceUser serviceUser; - - @Inject - private PollenManager manager; - - @Inject - private PageRenderLinkSource pageRender; - - private String pageName; - - void onActivate(String pageName) { - this.pageName = pageName; - } - - String onPassivate() { - return pageName; - } - - void setupRender() { - addError(messages.format("pollen.ui.user.display.notConnected", - pageName)); - } - - void onValidateFormFromLoginForm() { - UserAccount current; - try { - current = serviceUser.connect(connectionLogin, connectionPassword); - if (current != null) { - serviceAuthentication.setUserConnected(current); - } else { - loginForm.recordError(messages.get("loginFailed")); - } - } catch (PollenBusinessException eee) { - // TODO two different errors, on password or on login - //addError(messages.get("loginFailed")); - String message = manager.getErrorMessage(eee, messages, logger); - loginForm.recordError(message); - } - } - - /** - * Methode appelée lorsque l'utilisateur s'identifie - * - * @return la zone à mettre à jour - */ - @Log - Object onSuccessFromLoginForm() { - if (pageName == null) { - pageName = "index"; - } - return pageRender.createPageRenderLink(pageName); - } - - @Log - void onFailureFromLoginForm() { - - } - -} Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -10,7 +10,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. ##%*/ @@ -24,20 +23,28 @@ import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.ioc.Messages; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.ioc.services.PropertyAccess; import org.chorem.pollen.entity.FavoriteList; import org.chorem.pollen.service.ServiceFavorite; import org.chorem.pollen.ui.base.AbstractPollenPage; import org.chorem.pollen.ui.components.Border; +import org.chorem.pollen.ui.components.UserListsCreate; +import org.chorem.pollen.ui.components.UserListsUpdate; import org.chorem.pollen.ui.data.AddressBar; import org.chorem.pollen.ui.data.GenericSelectModel; import org.chorem.pollen.ui.data.PollenRequiresAuthentication; /** - * Classe de la page d'affichage des listes de votants favorites de - * l'utilisateur. Si l'utilisateur n'est pas identifié, on lui demande d'abord - * de s'identifier via un formulaire. + * Page to manage favorite lists of the connected user only (managed thanks to + * {@link PollenRequiresAuthentication} annotation). This page use two main + * components, {@link UserListsCreate} to create a FavoriteList (from import + * csv, ldap or an empty one) and {@link UserListsUpdate} to manage content + * of the FavoriteList. This page will provide {@code favoriteListSelected} + * from a form with only a SelectModel loaded by {@link #getFavoriteLists()} + * with {@link #getFavoriteListModel()} as model. The delete action is also + * manage by the page using {@code serviceFavorite}. * * @author rannou * @author fdesbois <fdesbois@codelutin.com> @@ -47,6 +54,9 @@ @IncludeStylesheet("context:css/users.css") public class UserLists extends AbstractPollenPage { + /************************** PAGE CONFIGURATION ****************************/ + + /** Border layout **/ @InjectComponent private Border border; @@ -61,23 +71,44 @@ @Property private String title; + /** + * AddressBar for {@code border} component. + * + * @return a new AddressBar for the page. + */ public AddressBar getAddressBar() { return AddressBar.newBar().appendCurrent(title); } + /** Services injected **/ @Inject private ServiceFavorite serviceFavorite; @Inject private PropertyAccess propertyAccess; + @Inject + private Messages messages; + + /************************** SELECT FAVORITE LIST **************************/ + private List<FavoriteList> favoriteLists; private GenericSelectModel<FavoriteList> favoriteListModel; + /** + * Main property favoriteListSelected is keeped in Session and was + * used as parameter for UserListsUpdate component. + **/ @Persist @Property private FavoriteList favoriteListSelected; + /** + * Getter for SelectModel used to display select and bind entries with the + * FavoriteLists loaded by {@link #getFavoriteLists()}. + * + * @return a GenericSelectModel which contains Favorite lists loaded. + */ public GenericSelectModel<FavoriteList> getFavoriteListModel() { if (favoriteListModel == null) { favoriteListModel = @@ -90,6 +121,12 @@ return favoriteListModel; } + /** + * Getter to load data for FavoriteLists from connected user. + * + * @return a list of FavoriteList. + * @see ServiceFavorite#getFavoriteLists(UserAccount) + */ public List<FavoriteList> getFavoriteLists() { if (favoriteLists == null) { favoriteLists = serviceFavorite.getFavoriteLists(getUserConnected()); @@ -97,14 +134,31 @@ return favoriteLists; } + /************************** SELECT FAVORITE LIST **************************/ + + /** + * Used to verify if the {@code favoriteListSelected} is set and ready + * to be deleted using {@code deleteList} actionLink. + * + * @return true if the {@code favoriteListSelected} is not null. + */ public boolean canDeleteList() { return favoriteListSelected != null; } + /** + * ON_ACTION :: Handler method for action on {@code deleteList} actionLink. + * Check is done using {@link #canDeleteList()}, then the + * {@code serviceFavorite} is called to execute the delete on + * {@code favoriteListSelected}. + * + * @see ServiceFavorite#deleteFavoriteList(FavoriteList) + */ void onActionFromDeleteList() { if (canDeleteList()) { serviceFavorite.deleteFavoriteList(favoriteListSelected); - addInfo("Suppression OK"); + addInfo( + messages.get("pollen.ui.list.delete.success")); } } } \ No newline at end of file Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthenticationFilter.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthenticationFilter.java 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenAuthenticationFilter.java 2010-05-06 17:03:11 UTC (rev 2988) @@ -1,27 +1,42 @@ package org.chorem.pollen.ui.services; +import org.apache.tapestry5.services.ComponentRequestFilter; import org.apache.tapestry5.services.ComponentSource; import org.apache.tapestry5.services.PageRenderLinkSource; import org.apache.tapestry5.services.Response; import org.chorem.pollen.entity.UserAccount; import org.chorem.pollen.ui.data.PollenRequiresAuthentication; -import org.chorem.pollen.ui.pages.Connexion; +import org.chorem.pollen.ui.pages.Connection; import org.chorem.pollen.ui.pages.ErrorPage; import org.nuiton.web.tapestry5.services.AbstractAuthenticationFilter; import org.nuiton.web.tapestry5.services.ServiceAuthentication; /** - * AuthenticationFilter + * AuthenticationFilter extends {@link AbstractAuthenticationFilter} that + * implents {@link ComponentRequestFilter} to provide behavior on each + * component and page rander. This is used for security managment and need + * the annotation {@link PollenAuthenticationFilter} to be put on pages that + * need authorization to be displayed. * * Created: 4 mai 2010 * * @author fdesbois - * $Id$ + * @version $Id$ + * @see AbstractAuthenticationFilter */ public class PollenAuthenticationFilter extends AbstractAuthenticationFilter<UserAccount, PollenRequiresAuthentication>{ + /** + * Constructor to intialize super class. + * + * @param renderLinkSource + * @param componentSource + * @param response + * @param serviceAuthentication + * @see AbstractAuthenticationFilter#AbstractAuthenticationFilter(PageRenderLinkSource, ComponentSource, Response, ServiceAuthentication, Class) + */ public PollenAuthenticationFilter(PageRenderLinkSource renderLinkSource, ComponentSource componentSource, Response response, ServiceAuthentication<UserAccount> serviceAuthentication) { @@ -29,11 +44,22 @@ serviceAuthentication, PollenRequiresAuthentication.class); } + /** + * Define which page Class is called to redict user after authorization + * problem. For a NOT_CONNECTED type, this will redirect to + * {@link Connection} page, and for a NOT_ALLOWED type, this will be redirect + * to {@link ErrorPage}. Note that both pages have in context the pageFrom + * called when filter intercept it. + * + * @param redirectType used to define which page will be redirected + * @return the page to redirect to + * @see AbstractAuthenticationFilter#redirectUnauthorizedUser(String) + */ @Override protected Class<?> getRedirectPage(AuthenticationRedirect redirectType) { switch (redirectType) { case NOT_CONNECTED: - return Connexion.class; + return Connection.class; case NOT_ALLOWED: return ErrorPage.class; } 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-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-06 17:03:11 UTC (rev 2988) @@ -35,17 +35,21 @@ pollen.ui.list.create.title=Cr\u00E9er une nouvelle liste pollen.ui.list.create.success=La liste %1$s a \u00E9t\u00E9 cr\u00E9\u00E9e avec succ\u00E8s. pollen.ui.list.create.weightHelp=Ce chiffre correspond au poids du vote de la personne, c'est \u00E0 dire le nombre de voix que poss\u00E8de la personne dans le sondage. -pollen.ui.list.update.addParticipant=Ajouter un nouveau votant \u00E0 la liste pollen.ui.list.delete=Supprimer la liste %1$s pollen.ui.list.delete.confirmMessage=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer cette liste et l'int\u00E9gralit\u00E9 de ses votants ? +pollen.ui.list.delete.success=La liste et son contenu ont \u00E9t\u00E9 supprim\u00E9 avec succ\u00E8s. pollen.ui.list.notSelected=Aucune liste s\u00E9lectionn\u00E9e pollen.ui.list.emptyList=Liste vide. Ajoutez des votants en saisissant leur nom et email. pollen.ui.list.nbParticipants=%1$d votants contenus dans cette liste +pollen.ui.list.update.addParticipant=Ajouter un nouveau votant \u00E0 la liste +pollen.ui.list.update.addParticipant.success=Le votant %1$s a \u00E9t\u00E9 ajout\u00E9 \u00E0 la liste. pollen.ui.list.update.cancelEdition=Annuler les changements pollen.ui.list.update.saveParticipant=Enregistrer les modifications +pollen.ui.list.update.saveParticipant.success=Modification enregistr\u00E9e avec succ\u00E8s. pollen.ui.list.update.updateParticipant=Modifier ce votant pollen.ui.list.update.removeParticipant=Supprimer ce votant pollen.ui.list.update.removeParticipant.confirmMessage=Etes-vous s\u00FBr de vouloir supprimer %1$s de la liste ? +pollen.ui.list.update.removeParticipant.success=Le votant a \u00E9t\u00E9 supprim\u00E9 avec succ\u00E8s. # OLD LOGIN_COMPONENT connectionLegend=Connexion Copied: trunk/pollen-ui/src/main/webapp/Connection.tml (from rev 2983, trunk/pollen-ui/src/main/webapp/Connexion.tml) =================================================================== --- trunk/pollen-ui/src/main/webapp/Connection.tml (rev 0) +++ trunk/pollen-ui/src/main/webapp/Connection.tml 2010-05-06 17:03:11 UTC (rev 2988) @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<t:border t:addressBar="addressBar" t:pageLogo="literal:Index" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> + + <t:form t:id="loginForm"> + <fieldset> + <legend>${message:connectionLegend}</legend> + <t:errors /> + <div> + <t:label for="connectionLogin" /> + <input t:type="TextField" t:id="connectionLogin" validate="required" /> + </div> + <div> + <t:label for="connectionPassword" /> + <input t:type="PasswordField" t:id="connectionPassword" validate="required" /> + </div> + <div class="buttons"> + <input t:id="submitLoginCompForm" t:type="Submit" t:value="${message:loginSubmit}" /> + </div> + </fieldset> + </t:form> + +</t:border> \ No newline at end of file Property changes on: trunk/pollen-ui/src/main/webapp/Connection.tml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:mergeinfo + Deleted: trunk/pollen-ui/src/main/webapp/Connexion.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/Connexion.tml 2010-05-06 10:35:53 UTC (rev 2987) +++ trunk/pollen-ui/src/main/webapp/Connexion.tml 2010-05-06 17:03:11 UTC (rev 2988) @@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<t:border t:addressBar="addressBar" t:pageLogo="literal:Index" - xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter"> - - <t:form t:id="loginForm"> - <fieldset> - <legend>${message:connectionLegend}</legend> - <t:errors /> - <div> - <t:label for="connectionLogin" /> - <input t:type="TextField" t:id="connectionLogin" validate="required" /> - </div> - <div> - <t:label for="connectionPassword" /> - <input t:type="PasswordField" t:id="connectionPassword" validate="required" /> - </div> - <div class="buttons"> - <input t:id="submitLoginCompForm" t:type="Submit" t:value="${message:loginSubmit}" /> - </div> - </fieldset> - </t:form> - -</t:border> \ No newline at end of file