r3125 - in branches/pollen-1.2.6-struts2: pollen-services/src/main/java/org/chorem/pollen/services pollen-services/src/main/java/org/chorem/pollen/services/exceptions pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-services/src/test/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll polle
Author: tchemit Date: 2012-01-31 22:01:08 +0100 (Tue, 31 Jan 2012) New Revision: 3125 Url: http://chorem.org/repositories/revision/pollen/3125 Log: - favorite list management - squeleton for polls management Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/PollenPagerBean.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotFoundException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotOwnedByUserException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundInListException.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteList.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccount.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccounts.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteLists.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Clone.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Close.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Create.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Delete.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Edit.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Export.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Result.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Vote.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-create-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-edit-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Edit-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-addPollAccount-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-editPollAccount-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteLists-createFavoriteList-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Register-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/clone.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/close.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/delete.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/edit.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/export.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp Removed: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/Login-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/RegisterUser-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/UpdateUser-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListAlreadyExistException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantAlreadyFoundInListException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantExistWithoutMailException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyClosedException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyExistException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollNotFoundException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserEmailAlreadyUsedException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserInvalidPasswordException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserLoginAlreadyUsedException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserNotFoundException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteDoubloonException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotAllowedException.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/EmailServiceTest.java branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/PollServiceTest.java branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/UserServiceTest.java branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/VoteServiceTest.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-admin.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-user.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/web.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/js/gridHelper.js Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/PollenPagerBean.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/PollenPagerBean.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/PollenPagerBean.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,79 @@ +/* + * #%L + * Pollen :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.services; + +import org.apache.commons.lang3.StringUtils; +import org.nuiton.topia.framework.TopiaQuery; +import org.nuiton.util.PagerUtil; + +/** + * Override nuiton pager while adding sort informations. + * <p/> + * Maybe this should be push back to nuiton ? + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class PollenPagerBean extends PagerUtil.PagerBean { + + private static final long serialVersionUID = 1L; + + // sorting order - asc or desc + protected boolean sortAscendant; + + // get index row - i.e. user click to sort. + protected String sortColumn; + + public boolean isSortAscendant() { + return sortAscendant; + } + + public void setSortAscendant(boolean sortAscendant) { + this.sortAscendant = sortAscendant; + } + + public String getSortColumn() { + return sortColumn; + } + + public void setSortColumn(String sortColumn) { + this.sortColumn = sortColumn; + } + + public static void addPagerToQuery(PollenPagerBean pager, + TopiaQuery query) { + + query.setLimit(pager.getRecordStartIndex(), + pager.getRecordEndIndex() - 1); + + if (StringUtils.isNotEmpty(pager.getSortColumn())) { + if (pager.isSortAscendant()) { + query.addOrder(pager.getSortColumn()); + } else { + query.addOrderDesc(pager.getSortColumn()); + } + } + } + +} Property changes on: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/PollenPagerBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListAlreadyExistException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListAlreadyExistException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListAlreadyExistException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class FavoriteListAlreadyExistException extends Exception { Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotFoundException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotFoundException.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotFoundException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,35 @@ +/* + * #%L + * Pollen :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.services.exceptions; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class FavoriteListNotFoundException extends Exception{ + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotFoundException.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotOwnedByUserException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotOwnedByUserException.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotOwnedByUserException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,35 @@ +/* + * #%L + * Pollen :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.services.exceptions; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class FavoriteListNotOwnedByUserException extends Exception{ + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListNotOwnedByUserException.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantAlreadyFoundInListException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantAlreadyFoundInListException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantAlreadyFoundInListException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class ParticipantAlreadyFoundInListException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantExistWithoutMailException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantExistWithoutMailException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantExistWithoutMailException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class ParticipantExistWithoutMailException extends Exception { Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundException.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,35 @@ +/* + * #%L + * Pollen :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.services.exceptions; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class ParticipantNotFoundException extends Exception{ + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundException.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundInListException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundInListException.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundInListException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,35 @@ +/* + * #%L + * Pollen :: Services + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.services.exceptions; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class ParticipantNotFoundInListException extends Exception{ + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/ParticipantNotFoundInListException.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyClosedException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyClosedException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyClosedException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class PollAlreadyClosedException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyExistException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyExistException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAlreadyExistException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class PollAlreadyExistException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollNotFoundException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollNotFoundException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollNotFoundException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class PollNotFoundException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserEmailAlreadyUsedException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserEmailAlreadyUsedException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserEmailAlreadyUsedException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class UserEmailAlreadyUsedException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserInvalidPasswordException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserInvalidPasswordException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserInvalidPasswordException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class UserInvalidPasswordException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserLoginAlreadyUsedException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserLoginAlreadyUsedException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserLoginAlreadyUsedException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class UserLoginAlreadyUsedException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserNotFoundException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserNotFoundException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UserNotFoundException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class UserNotFoundException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteDoubloonException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteDoubloonException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteDoubloonException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class VoteDoubloonException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotAllowedException.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotAllowedException.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotAllowedException.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class VoteNotAllowedException extends Exception { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollCommentService.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -38,7 +38,7 @@ * Manage comments on a poll. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class PollCommentService extends PollenServiceSupport { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollService.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -23,7 +23,6 @@ */ package org.chorem.pollen.services.impl; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.pollen.PollenConfiguration; @@ -35,6 +34,7 @@ import org.chorem.pollen.business.persistence.PollImpl; import org.chorem.pollen.business.persistence.UserAccount; import org.chorem.pollen.entities.PollenDAOHelper; +import org.chorem.pollen.services.PollenPagerBean; import org.chorem.pollen.services.PollenServiceSupport; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaQuery; @@ -79,9 +79,7 @@ return result; } - public List<Poll> getPolls(PagerUtil.PagerBean pager, - String sortColumn, - boolean ascendantOrder) { + public List<Poll> getPolls(PollenPagerBean pager) { try { PollDAO dao = PollenDAOHelper.getPollDAO(getTransaction()); @@ -90,7 +88,7 @@ pager.setRecords((int) records); PagerUtil.computeRecordIndexesAndPagesNumber(pager); TopiaQuery query = dao.createQuery("e"); - addFilterToQuery(query, pager, sortColumn, ascendantOrder); + PollenPagerBean.addPagerToQuery(pager, query); List<Poll> result = dao.findAllByQuery(query); return result; @@ -99,10 +97,7 @@ } } - public List<Poll> getCreatedPolls(PagerUtil.PagerBean pager, - String sortColumn, - boolean ascendantOrder, - UserAccount user) { + public List<Poll> getCreatedPolls(PollenPagerBean pager, UserAccount user) { try { PollDAO dao = PollenDAOHelper.getPollDAO(getTransaction()); @@ -114,7 +109,7 @@ PagerUtil.computeRecordIndexesAndPagesNumber(pager); TopiaQuery query = dao.createQuery("e"); - addFilterToQuery(query, pager, sortColumn, ascendantOrder); + PollenPagerBean.addPagerToQuery(pager, query); query.addWhere("e." + Poll.PROPERTY_CREATOR + "." + PollAccount.PROPERTY_USER_ACCOUNT, TopiaQuery.Op.EQ, user); List<Poll> result = dao.findAllByQuery(query); @@ -124,10 +119,7 @@ } } - public List<Poll> getInvitedPolls(PagerUtil.PagerBean pager, - String sortColumn, - boolean ascendantOrder, - UserAccount user) { + public List<Poll> getInvitedPolls(PollenPagerBean pager, UserAccount user) { try { PollDAO dao = PollenDAOHelper.getPollDAO(getTransaction()); @@ -139,7 +131,7 @@ PagerUtil.computeRecordIndexesAndPagesNumber(pager); TopiaQuery query = dao.createQuery("e"); - addFilterToQuery(query, pager, sortColumn, ascendantOrder); + PollenPagerBean.addPagerToQuery(pager, query); query.addWhere("e." + Poll.PROPERTY_CREATOR + "." + PollAccount.PROPERTY_USER_ACCOUNT, TopiaQuery.Op.EQ, user); List<Poll> result = dao.findAllByQuery(query); @@ -149,10 +141,7 @@ } } - public List<Poll> getParticipatedPolls(PagerUtil.PagerBean pager, - String sortColumn, - boolean ascendantOrder, - UserAccount user) { + public List<Poll> getParticipatedPolls(PollenPagerBean pager, UserAccount user) { try { PollDAO dao = PollenDAOHelper.getPollDAO(getTransaction()); @@ -164,7 +153,7 @@ PagerUtil.computeRecordIndexesAndPagesNumber(pager); TopiaQuery query = dao.createQuery("e"); - addFilterToQuery(query, pager, sortColumn, ascendantOrder); + PollenPagerBean.addPagerToQuery(pager, query); query.addWhere("e." + Poll.PROPERTY_CREATOR + "." + PollAccount.PROPERTY_USER_ACCOUNT, TopiaQuery.Op.EQ, user); List<Poll> result = dao.findAllByQuery(query); @@ -267,17 +256,8 @@ } } */ - private void addFilterToQuery(TopiaQuery query, PagerUtil.PagerBean pager, String sortColumn, boolean ascendantOrder) { - query.setLimit(pager.getRecordStartIndex(), pager.getRecordEndIndex() - 1); - if (StringUtils.isNotEmpty(sortColumn)) { - if (ascendantOrder) { - query.addOrder(sortColumn); - } else { - query.addOrderDesc(sortColumn); - } - } - } + // // /** // * Build a new Poll instance based on existing {@code poll} (copy) Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pollen/services/impl/UserService.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -23,17 +23,31 @@ */ package org.chorem.pollen.services.impl; +import com.google.common.base.Preconditions; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.pollen.PollenTechnicalException; +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.business.persistence.PersonListDAO; +import org.chorem.pollen.business.persistence.PersonListImpl; +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.business.persistence.PollAccountDAO; +import org.chorem.pollen.business.persistence.PollAccountImpl; import org.chorem.pollen.business.persistence.UserAccount; import org.chorem.pollen.business.persistence.UserAccountDAO; import org.chorem.pollen.business.persistence.UserAccountImpl; import org.chorem.pollen.entities.PollenBinderHelper; import org.chorem.pollen.entities.PollenDAOHelper; +import org.chorem.pollen.services.PollenPagerBean; import org.chorem.pollen.services.PollenServiceSupport; +import org.chorem.pollen.services.exceptions.FavoriteListAlreadyExistException; +import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException; +import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException; +import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException; +import org.chorem.pollen.services.exceptions.ParticipantNotFoundException; +import org.chorem.pollen.services.exceptions.ParticipantNotFoundInListException; import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException; @@ -191,37 +205,34 @@ return result; } - public void deleteUser(String login) { + public void deleteUser(String id) throws UserNotFoundException { try { - UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(getTransaction()); - UserAccount user = dao.findByLogin(login); + UserAccountDAO dao = + PollenDAOHelper.getUserAccountDAO(getTransaction()); + UserAccount user = dao.findByTopiaId(id); + + if (user == null) { + throw new UserNotFoundException(); + } dao.delete(user); } catch (TopiaException e) { throw new PollenTechnicalException(e); } } - public List<UserAccount> getUsers(PagerUtil.PagerBean pager, - String sortColumn, - boolean ascendantOrder) { + public List<UserAccount> getUsers(PollenPagerBean pager) { try { - UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(getTransaction()); + UserAccountDAO dao = + PollenDAOHelper.getUserAccountDAO(getTransaction()); long records = dao.count(); pager.setRecords((int) records); PagerUtil.computeRecordIndexesAndPagesNumber(pager); TopiaQuery query = dao.createQuery("e"); - query.setLimit(pager.getRecordStartIndex(), pager.getRecordEndIndex() - 1); + PollenPagerBean.addPagerToQuery(pager, query); - if (StringUtils.isNotEmpty(sortColumn)) { - if (ascendantOrder) { - query.addOrder(sortColumn); - } else { - query.addOrderDesc(sortColumn); - } - } List<UserAccount> result = dao.findAllByQuery(query); return result; } catch (TopiaException e) { @@ -229,6 +240,337 @@ } } + public List<PersonList> getFavoriteLists(UserAccount user, + PollenPagerBean pager) { + + try { + + PersonListDAO dao = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + TopiaQuery countQuery = dao.createQuery("e"); + countQuery.addWhere("e." + PersonList.PROPERTY_OWNER, TopiaQuery.Op.EQ, user); + long records = dao.countByQuery(countQuery); + + pager.setRecords((int) records); + + PagerUtil.computeRecordIndexesAndPagesNumber(pager); + TopiaQuery query = dao.createQuery("e"); + query.addWhere("e." + PersonList.PROPERTY_OWNER, TopiaQuery.Op.EQ, user); + PollenPagerBean.addPagerToQuery(pager, query); + + List<PersonList> result = dao.findAllByQuery(query); + return result; + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public List<PersonList> getFavoriteLists(UserAccount user) { + try { + + PersonListDAO dao = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + TopiaQuery query = dao.createQuery("e"); + query.addWhere("e." + PersonList.PROPERTY_OWNER, TopiaQuery.Op.EQ, user); + List<PersonList> result = dao.findAllByQuery(query); + return result; + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public PersonList getFavoriteList(UserAccount user, + String favoriteListId) throws FavoriteListNotFoundException, FavoriteListNotOwnedByUserException { + try { + + PersonListDAO dao = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + PersonList favoriteList = dao.findByTopiaId(favoriteListId); + + if (favoriteList == null) { + throw new FavoriteListNotFoundException(); + } + + // check this favorite belongs to the given user + UserAccount favoriteListOwner = favoriteList.getOwner(); + if (!favoriteListOwner.equals(user)) { + throw new FavoriteListNotOwnedByUserException(); + } + + return favoriteList; + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public List<PollAccount> getFavoriteListUsers(PersonList favoriteList, + PollenPagerBean pager) { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pager); + try { + + int records = favoriteList.sizePollAccount(); + pager.setRecords(records); + PagerUtil.computeRecordIndexesAndPagesNumber(pager); + + PollAccountDAO pollAccountDAO = + PollenDAOHelper.getPollAccountDAO(getTransaction()); + + TopiaQuery query = pollAccountDAO.createQuery("e"); + query.addWhere("e." + PollAccount.PROPERTY_PERSON_LIST, TopiaQuery.Op.EQ, favoriteList); + PollenPagerBean.addPagerToQuery(pager, query); + + List<PollAccount> result = pollAccountDAO.findAllByQuery(query); + return result; + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public void createFavoriteList(UserAccount user, + String name) throws FavoriteListAlreadyExistException, UserNotFoundException { + + Preconditions.checkNotNull(user); + Preconditions.checkNotNull(name); + + // can't accept favorite list without name + Preconditions.checkArgument(StringUtils.isNotEmpty(name)); + try { + + UserAccountDAO userDAO = + PollenDAOHelper.getUserAccountDAO(getTransaction()); + + UserAccount userToUse = + userDAO.findByTopiaId(user.getTopiaId()); + + if (userToUse == null) { + throw new UserNotFoundException(); + } + + PersonListDAO dao = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + // check list does not already exists + + TopiaQuery query = dao.createQuery("e"); + + query.addWhere("e." + PersonList.PROPERTY_OWNER, TopiaQuery.Op.EQ, user); + query.addWhere("e." + PersonList.PROPERTY_NAME, TopiaQuery.Op.EQ, name); + + boolean exist = dao.existByQuery(query); + + if (exist) { + + throw new FavoriteListAlreadyExistException(); + } + + PersonList favoriteListCreated = dao.create( + PersonList.PROPERTY_OWNER, userToUse + ); + favoriteListCreated.setName(name); + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public PersonList deleteFavoriteList(UserAccount user, + PersonList favoriteList) throws FavoriteListNotFoundException, FavoriteListNotOwnedByUserException, UserNotFoundException { + try { + + Preconditions.checkNotNull(user); + Preconditions.checkNotNull(favoriteList); + + UserAccountDAO userDAO = + PollenDAOHelper.getUserAccountDAO(getTransaction()); + + UserAccount userToUse = + userDAO.findByTopiaId(user.getTopiaId()); + + if (userToUse == null) { + throw new UserNotFoundException(); + } + + PersonListDAO dao = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + PersonList favoriteListToDelete = + dao.findByTopiaId(favoriteList.getTopiaId()); + + if (favoriteListToDelete == null) { + throw new FavoriteListNotFoundException(); + } + + // check this favorite belongs to the given user + UserAccount favoriteListOwner = favoriteListToDelete.getOwner(); + if (!favoriteListOwner.equals(user)) { + throw new FavoriteListNotOwnedByUserException(); + } + + dao.delete(favoriteListToDelete); + return favoriteListToDelete; + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public void addPollAccountToFavoriteList(PersonList favoriteList, + PollAccount pollAccount) throws ParticipantAlreadyFoundInListException, FavoriteListNotFoundException { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + + // can't accept poll account without name + Preconditions.checkArgument( + StringUtils.isNotEmpty(pollAccount.getVotingId())); + + // can't accept poll account without email + Preconditions.checkArgument( + StringUtils.isNotEmpty(pollAccount.getEmail())); + + try { + + PersonListDAO personListDAO = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + PersonList personListToUpdate = + personListDAO.findByTopiaId(favoriteList.getTopiaId()); + + if (personListToUpdate == null) { + throw new FavoriteListNotFoundException(); + } + + PollAccountDAO dao = PollenDAOHelper.getPollAccountDAO(getTransaction()); + + // check there is other poll account in this list with same id + TopiaQuery query = dao.createQuery("e"); + query.addWhere("e." + PollAccount.PROPERTY_PERSON_LIST, TopiaQuery.Op.EQ, personListToUpdate); + query.addWhere("e." + PollAccount.PROPERTY_VOTING_ID, TopiaQuery.Op.EQ, pollAccount.getVotingId()); + boolean pollAccountExists = dao.existByQuery(query); + if (pollAccountExists) { + + throw new ParticipantAlreadyFoundInListException(); + } + + PollAccount pollAccountCreated = + dao.create(PollAccount.PROPERTY_PERSON_LIST, + personListToUpdate); + + pollAccountCreated.setVotingId(pollAccount.getVotingId()); + pollAccountCreated.setEmail(pollAccount.getEmail()); + personListToUpdate.addPollAccount(pollAccountCreated); + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public void editPollAccountToFavoriteList(PersonList favoriteList, + PollAccount pollAccount) throws ParticipantAlreadyFoundInListException, FavoriteListNotFoundException, ParticipantNotFoundException { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + + // can't accept poll account without name + Preconditions.checkArgument( + StringUtils.isNotEmpty(pollAccount.getVotingId())); + + // can't accept poll account without email + Preconditions.checkArgument( + StringUtils.isNotEmpty(pollAccount.getEmail())); + + try { + + PersonListDAO personListDAO = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + PersonList personListToUpdate = + personListDAO.findByTopiaId(favoriteList.getTopiaId()); + + if (personListToUpdate == null) { + throw new FavoriteListNotFoundException(); + } + + PollAccountDAO dao = + PollenDAOHelper.getPollAccountDAO(getTransaction()); + + + PollAccount pollAccountToUpdate = + dao.findByTopiaId(pollAccount.getTopiaId()); + + if (pollAccountToUpdate == null) { + throw new ParticipantNotFoundException(); + } + + // check there is another poll account in this list with same id + TopiaQuery query = dao.createQuery("e"); + query.addWhere("e." + PollAccount.PROPERTY_PERSON_LIST, TopiaQuery.Op.EQ, personListToUpdate); + query.addWhere("e." + PollAccount.PROPERTY_VOTING_ID, TopiaQuery.Op.EQ, pollAccount.getVotingId()); + query.addWhere("e." + PollAccount.TOPIA_ID, TopiaQuery.Op.NEQ, pollAccount.getTopiaId()); + boolean pollAccountExists = dao.existByQuery(query); + if (pollAccountExists) { + + throw new ParticipantAlreadyFoundInListException(); + } + + pollAccountToUpdate.setVotingId(pollAccount.getVotingId()); + pollAccountToUpdate.setEmail(pollAccount.getEmail()); + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + + public void removePollAccountToFavoriteList(PersonList favoriteList, + PollAccount pollAccount) throws ParticipantNotFoundException, FavoriteListNotFoundException, ParticipantNotFoundInListException { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + + try { + + PersonListDAO personListDAO = + PollenDAOHelper.getPersonListDAO(getTransaction()); + + PersonList personListToUpdate = + personListDAO.findByTopiaId(favoriteList.getTopiaId()); + + if (personListToUpdate == null) { + throw new FavoriteListNotFoundException(); + } + + PollAccountDAO dao = + PollenDAOHelper.getPollAccountDAO(getTransaction()); + + PollAccount pollAccountToRemove = + dao.findByTopiaId(pollAccount.getTopiaId()); + + if (pollAccountToRemove == null) { + + throw new ParticipantNotFoundException(); + } + + PollAccount pollAccountInList = + personListToUpdate.getPollAccountByTopiaId(pollAccount.getTopiaId()); + + if (pollAccountInList == null) { + + throw new ParticipantNotFoundInListException(); + } + + personListToUpdate.removePollAccount(pollAccountToRemove); + + } catch (TopiaException e) { + throw new PollenTechnicalException(e); + } + } + public int getNbUsers() { try { UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(getTransaction()); @@ -284,4 +626,13 @@ // Don't keep case for email destination.setEmail(StringUtils.lowerCase(source.getEmail())); } + + public PersonList newFavoriteList() { + PersonListImpl personList = new PersonListImpl(); + return personList; + } + + public PollAccount newPollAccountForFavoriteList() { + return new PollAccountImpl(); + } } Modified: branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/EmailServiceTest.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/EmailServiceTest.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/EmailServiceTest.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -32,7 +32,7 @@ * Test {@link EmailService}. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class EmailServiceTest extends AbstractPollenServiceTest { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/FavoriteServiceTest.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -34,7 +34,7 @@ * Tests the {@link FavoriteService}. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ @Ignore public class FavoriteServiceTest extends AbstractPollenServiceTest { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/PollServiceTest.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/PollServiceTest.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/PollServiceTest.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -34,7 +34,7 @@ * Tests the {@link PollService}. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ @Ignore public class PollServiceTest extends AbstractPollenServiceTest { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/UserServiceTest.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/UserServiceTest.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/UserServiceTest.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -33,7 +33,7 @@ * Tests the {@link UserService}. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ @Ignore public class UserServiceTest extends AbstractPollenServiceTest { Modified: branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/VoteServiceTest.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/VoteServiceTest.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-services/src/test/java/org/chorem/pollen/services/impl/VoteServiceTest.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -32,7 +32,7 @@ * Tests the {@link VoteService}. * * @author tchemit <chemit@codelutin.com> - * @since 2.0 + * @since 1.2.6 */ public class VoteServiceTest extends AbstractPollenServiceTest { Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -28,6 +28,7 @@ import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException; +import org.chorem.pollen.services.exceptions.UserNotFoundException; import org.chorem.pollen.services.impl.UserService; import org.chorem.pollen.ui.actions.PollenActionSupport; @@ -51,6 +52,18 @@ return user; } + public UserAccount getCreateUser() { + return getUser(); + } + + public UserAccount getEditUser() { + return getUser(); + } + + public UserAccount getDeleteUser() { + return getUser(); + } + public String getAction() { return action; } @@ -59,72 +72,87 @@ this.action = action; } - public String createUser() throws Exception { + public String create() throws Exception { Preconditions.checkNotNull(user); UserService service = newService(UserService.class); + String result = INPUT; try { service.createUser(user, true, getApplicationUrl()); getTransaction().commitTransaction(); addActionMessage( - _("pollen.information.user.created", user.getDisplayName())); + _("pollen.information.user.created", + user.getDisplayName())); // remove this user, otherwise it will be reused in the user lists user = null; action = null; - return SUCCESS; + result = SUCCESS; } catch (UserLoginAlreadyUsedException e) { - addFieldError("user.login", _("pollen.error.user.login.already.used")); + addFieldError("createUser.login", + _("pollen.error.user.login.already.used")); + } catch (UserEmailAlreadyUsedException e) { - addFieldError("user.email", _("pollen.error.user.email.already.used")); + addFieldError("createUser.email", + _("pollen.error.user.email.already.used")); } - return INPUT; + return result; } - public String updateUser() throws Exception { + public String edit() throws Exception { Preconditions.checkNotNull(user); UserService service = newService(UserService.class); + String result = INPUT; + try { service.updateUser(user, null, true); getTransaction().commitTransaction(); addActionMessage( - _("pollen.information.user.updated", user.getDisplayName())); + _("pollen.information.user.updated", + user.getDisplayName())); // remove this user, otherwise it will be reused in the user lists user = null; action = null; - return SUCCESS; + result = SUCCESS; } catch (UserEmailAlreadyUsedException e) { - addFieldError("user.email", _("pollen.error.user.email.already.used")); + addFieldError("editUser.email", + _("pollen.error.user.email.already.used")); } catch (UserInvalidPasswordException e) { - addFieldError("user.password", _("pollen.error.user.invalid.password")); + addFieldError("editUser.password", + _("pollen.error.user.invalid.password")); } - return INPUT; + return result; } - public String deleteUser() throws Exception { + public String delete() throws Exception { Preconditions.checkNotNull(user); UserService service = newService(UserService.class); - service.deleteUser(user.getLogin()); - getTransaction().commitTransaction(); + String result = INPUT; - addActionMessage( - _("pollen.information.user.deleted", user.getDisplayName())); + try { + service.deleteUser(user.getTopiaId()); + getTransaction().commitTransaction(); + addActionMessage( + _("pollen.information.user.deleted", user.getDisplayName())); - // remove this user, otherwise it will be reused in the user lists - user = null; - action = null; - return SUCCESS; + // remove this user, otherwise it will be reused in the user lists + user = null; + action = null; + result = SUCCESS; + } catch (UserNotFoundException e) { + addFieldError("deleteUser.login", + _("pollen.error.user.not.found")); + } + return result; } - - } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/AbstractJSONPaginedAction.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -26,8 +26,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.struts2.json.JSONException; import org.apache.struts2.json.JSONUtil; +import org.chorem.pollen.services.PollenPagerBean; import org.chorem.pollen.ui.actions.PollenActionSupport; -import org.nuiton.util.PagerUtil; /** * Abstract JSON action with pagination support. @@ -47,14 +47,14 @@ public abstract Integer getRecords(); - protected PagerUtil.PagerBean pager = PagerUtil.newPagerBean(); + protected PollenPagerBean pager = new PollenPagerBean(); - // sorting order - asc or desc - protected String sord; +// // sorting order - asc or desc +// protected String sord; +// +// // get index row - i.e. user click to sort. +// protected String sidx; - // get index row - i.e. user click to sort. - protected String sidx; - protected String filters; public void setRows(Integer rows) { @@ -65,20 +65,22 @@ pager.setPageIndex(page); } - public String getSord() { - return sord; - } +// public String getSord() { +// return sord; +// } public void setSord(String sord) { - this.sord = sord; + pager.setSortAscendant("asc".equals(sord)); +// this.sord = sord; } public String getSidx() { - return sidx; + return pager.getSortColumn(); } public void setSidx(String sidx) { - this.sidx = sidx; + pager.setSortColumn(sidx); +// this.sidx = sidx; } public String getFilters() { @@ -89,25 +91,25 @@ this.filters = filters; } - protected String getSortColumn() { - String result = null; - if (useSort()) { - result = sidx; - } - return result; - } +// protected String getSortColumn() { +// String result = null; +// if (useSort()) { +// result = sidx; +// } +// return result; +// } - protected boolean isSortAscendant() { - boolean result = false; - if (useSort()) { - result = "asc".equals(sord); - } - return result; - } +// protected boolean isSortAscendant() { +// boolean result = false; +// if (useSort()) { +// result = "asc".equals(sord); +// } +// return result; +// } - protected boolean useSort() { - return StringUtils.isNotEmpty(sidx); - } +// protected boolean useSort() { +// return StringUtils.isNotEmpty(sidx); +// } protected Object getFilterObject() throws JSONException { Object filterObject = null; Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetCreatedPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -74,12 +74,7 @@ PollService pollService = newService(PollService.class); - boolean ascendantOrder = isSortAscendant(); - String sortColumn = getSortColumn(); - List<Poll> pollList = pollService.getCreatedPolls(pager, - sortColumn, - ascendantOrder, getPollenSession().getUserAccount()); polls = new Map[pollList.size()]; Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteList.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteList.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteList.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,73 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.json; + +import com.google.common.collect.Maps; +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +import java.util.Map; + +/** + * Get given favorite list. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetFavoriteList extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + private String favoriteListId; + + private transient Map<String, Object> favoriteList; + + public String getFavoriteListId() { + return favoriteListId; + } + + public void setFavoriteListId(String favoriteListId) { + this.favoriteListId = favoriteListId; + } + + public Map<String, Object> getFavoriteList() { + return favoriteList; + } + + @Override + public String execute() throws Exception { + + UserService userService = newService(UserService.class); + + PersonList personList = + userService.getEntityById(PersonList.class, favoriteListId); + + favoriteList = Maps.newHashMap(); + favoriteList.put("id", personList.getTopiaId()); + favoriteList.put(PersonList.PROPERTY_NAME, personList.getName()); + + return SUCCESS; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteList.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccount.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccount.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccount.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,79 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.json; + +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.entities.PollenBinderHelper; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; +import org.nuiton.util.beans.Binder; + +import java.util.Map; + +/** + * Get pagined list of poll accounts of a given favorite list. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetFavoriteListPollAccount extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + private String pollAccountId; + + private transient Map<String, Object> pollAccount; + + public String getPollAccountId() { + return pollAccountId; + } + + public void setPollAccountId(String pollAccountId) { + this.pollAccountId = pollAccountId; + } + + public Map<String, Object> getPollAccount() { + return pollAccount; + } + + @Override + public String execute() throws Exception { + + UserService userService = newService(UserService.class); + + PollAccount userAccount = + userService.getEntityById(PollAccount.class, pollAccountId); + + Binder<PollAccount, PollAccount> binder = + PollenBinderHelper.getSimpleTopiaBinder(PollAccount.class); + pollAccount = binder.obtainProperties( + userAccount, + PollAccount.PROPERTY_VOTING_ID, + PollAccount.PROPERTY_EMAIL + ); + pollAccount.put("id", userAccount.getTopiaId()); + + return SUCCESS; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccount.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccounts.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccounts.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccounts.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,109 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.json; + +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.entities.PollenBinderHelper; +import org.chorem.pollen.services.impl.UserService; +import org.nuiton.util.beans.Binder; + +import java.util.List; +import java.util.Map; + +/** + * Get pagined list of poll accounts of a given favorite list. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetFavoriteListPollAccounts extends AbstractJSONPaginedAction { + + private static final long serialVersionUID = 1L; + + protected transient Map<String, Object>[] pollAccounts; + + protected String favoriteListId; + + public Map<String, Object>[] getPollAccounts() { + return pollAccounts; + } + + public String getFavoriteListId() { + return favoriteListId; + } + + public void setFavoriteListId(String favoriteListId) { + this.favoriteListId = favoriteListId; + } + + @Override + public Integer getRows() { + return pager.getPageSize(); + } + + @Override + public Integer getPage() { + return pager.getPageIndex(); + } + + @Override + public Integer getTotal() { + return pager.getPagesNumber(); + } + + @Override + public Integer getRecords() { + return pager.getRecords(); + } + + @Override + public String execute() throws Exception { + + UserService userService = newService(UserService.class); + + PersonList favoriteList = + userService.getEntityById(PersonList.class, favoriteListId); + + List<PollAccount> allPollAccounts = userService.getFavoriteListUsers( + favoriteList, + pager); + + pollAccounts = new Map[allPollAccounts.size()]; + Binder<PollAccount, PollAccount> binder = + PollenBinderHelper.getSimpleTopiaBinder(PollAccount.class); + int index = 0; + for (PollAccount pollAccount : allPollAccounts) { + Map<String, Object> map = binder.obtainProperties( + pollAccount, + PollAccount.PROPERTY_VOTING_ID, + PollAccount.PROPERTY_EMAIL + ); + map.put("id", pollAccount.getTopiaId()); + pollAccounts[index++] = map; + } + + return SUCCESS; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteListPollAccounts.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteLists.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteLists.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteLists.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,90 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.json; + +import com.google.common.collect.Maps; +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.services.impl.UserService; + +import java.util.List; +import java.util.Map; + +/** + * Get pagined list of favorite lists of the connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class GetFavoriteLists extends AbstractJSONPaginedAction { + + private static final long serialVersionUID = 1L; + + protected transient Map<String, Object>[] favoriteLists; + + public Map<String, Object>[] getFavoriteLists() { + return favoriteLists; + } + + @Override + public Integer getRows() { + return pager.getPageSize(); + } + + @Override + public Integer getPage() { + return pager.getPageIndex(); + } + + @Override + public Integer getTotal() { + return pager.getPagesNumber(); + } + + @Override + public Integer getRecords() { + return pager.getRecords(); + } + + @Override + public String execute() throws Exception { + + UserService userService = newService(UserService.class); + + List<PersonList> allFavoriteLists = userService.getFavoriteLists( + getPollenSession().getUserAccount(), + pager); + + favoriteLists = new Map[allFavoriteLists.size()]; + int index = 0; + for (PersonList favoriteList : allFavoriteLists) { + Map<String, Object> map = Maps.newHashMap(); + map.put(PersonList.PROPERTY_NAME, favoriteList.getName()); + map.put("id", favoriteList.getTopiaId()); + map.put("nbAccounts", favoriteList.sizePollAccount()); + favoriteLists[index++] = map; + } + + return SUCCESS; + } +} \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetFavoriteLists.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetInvitedPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -77,12 +77,7 @@ PollService pollService = newService(PollService.class); - boolean ascendantOrder = isSortAscendant(); - String sortColumn = getSortColumn(); - List<Poll> pollList = pollService.getInvitedPolls(pager, - sortColumn, - ascendantOrder, getPollenSession().getUserAccount()); polls = new Map[pollList.size()]; Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetParticipatedPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -74,14 +74,9 @@ PollService pollService = newService(PollService.class); - boolean ascendantOrder = isSortAscendant(); - String sortColumn = getSortColumn(); + List<Poll> pollList = pollService.getParticipatedPolls( + pager, getPollenSession().getUserAccount()); - List<Poll> pollList = pollService.getParticipatedPolls(pager, - sortColumn, - ascendantOrder, - getPollenSession().getUserAccount()); - polls = new Map[pollList.size()]; Binder<Poll, Poll> binder = PollenBinderHelper.getSimpleTopiaBinder(Poll.class); Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -74,13 +74,8 @@ PollService pollService = newService(PollService.class); - boolean ascendantOrder = isSortAscendant(); - String sortColumn = getSortColumn(); + List<Poll> pollList = pollService.getPolls(pager); - List<Poll> pollList = pollService.getPolls(pager, - sortColumn, - ascendantOrder); - polls = new Map[pollList.size()]; Binder<Poll, Poll> binder = PollenBinderHelper.getSimpleTopiaBinder(Poll.class); Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUser.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -38,6 +38,7 @@ * @since 2.0 */ public class GetUser extends PollenActionSupport { + private static final long serialVersionUID = 1L; private String userId; Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json/GetUsers.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -72,13 +72,8 @@ UserService userService = newService(UserService.class); - boolean ascendantOrder = isSortAscendant(); - String sortColumn = getSortColumn(); + List<UserAccount> allUsers = userService.getUsers(pager); - List<UserAccount> allUsers = userService.getUsers(pager, - sortColumn, - ascendantOrder); - users = new Map[allUsers.size()]; Binder<UserAccount, UserAccount> binder = PollenBinderHelper.getSimpleTopiaBinder(UserAccount.class); Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Clone.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Clone.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Clone.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,38 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Creates a new poll by cloning an existing one. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class Clone extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Clone.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Close.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Close.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Close.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Closes an existing poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class Close extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Close.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Create.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Create.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Create.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,164 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import com.google.common.collect.Maps; +import com.opensymphony.xwork2.Preparable; +import org.chorem.pollen.business.persistence.Poll; +import org.chorem.pollen.business.persistence.UserAccount; +import org.chorem.pollen.common.ChoiceType; +import org.chorem.pollen.common.I18nAble; +import org.chorem.pollen.common.PollType; +import org.chorem.pollen.common.VoteCountingType; +import org.chorem.pollen.services.impl.PollService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +import java.util.Map; + +/** + * Creates a new poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Create extends PollenActionSupport implements Preparable { + + private static final long serialVersionUID = 1L; + + protected Poll poll; + + protected Map<Integer, String> pollTypes; + + protected Map<Integer, String> voteCountingTypes; + + protected Map<Integer, String> choiceTypes; + + protected boolean notification; + + protected boolean reminder; + + protected boolean limitChoice; + + protected int reminderHourCountdown; + + protected int notificationNumber; + + public String getPageLogo() { + return "Creation"; + } + + public Poll getPoll() { + if (poll == null) { + UserAccount userAccount = getPollenSession().getUserAccount(); + poll = newService(PollService.class).getNewPoll(userAccount); + } + return poll; + } + + public Map<Integer, String> getPollTypes() { + return pollTypes; + } + + public Map<Integer, String> getVoteCountingTypes() { + return voteCountingTypes; + } + + public Map<Integer, String> getChoiceTypes() { + return choiceTypes; + } + + public boolean isNotification() { + return notification; + } + + public void setNotification(boolean notification) { + this.notification = notification; + } + + public boolean isReminder() { + return reminder; + } + + public void setReminder(boolean reminder) { + this.reminder = reminder; + } + + public boolean isLimitChoice() { + return limitChoice; + } + + public void setLimitChoice(boolean limitChoice) { + this.limitChoice = limitChoice; + } + + public int getReminderHourCountdown() { + return reminderHourCountdown; + } + + public void setReminderHourCountdown(int reminderHourCountdown) { + this.reminderHourCountdown = reminderHourCountdown; + } + + public int getNotificationNumber() { + return notificationNumber; + } + + public void setNotificationNumber(int notificationNumber) { + this.notificationNumber = notificationNumber; + } + + @Override + public String execute() throws Exception { + + PollService service = newService(PollService.class); + +// try { +// Poll basicPoll = service.createBasicPoll(poll); +// +// return SUCCESS; +// } catch (TopiaException e) { +// +// } + + // back to input + return INPUT; + } + + @Override + public void prepare() throws Exception { + + pollTypes = decorate(PollType.values()); + choiceTypes = decorate(ChoiceType.values()); + voteCountingTypes = decorate(VoteCountingType.values()); + + } + + private <E extends Enum<E> & I18nAble> Map<Integer, String> decorate(E... values) { + Map<Integer, String> result = Maps.newLinkedHashMap(); + for (E value : values) { + result.put(value.ordinal(), getText(value.getI18nKey())); + } + return result; + } +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Create.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,164 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.poll; - -import com.google.common.collect.Maps; -import com.opensymphony.xwork2.Preparable; -import org.chorem.pollen.business.persistence.Poll; -import org.chorem.pollen.business.persistence.UserAccount; -import org.chorem.pollen.common.ChoiceType; -import org.chorem.pollen.common.I18nAble; -import org.chorem.pollen.common.PollType; -import org.chorem.pollen.common.VoteCountingType; -import org.chorem.pollen.services.impl.PollService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -import java.util.Map; - -/** - * Creates a new poll. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class CreatePoll extends PollenActionSupport implements Preparable { - - private static final long serialVersionUID = 1L; - - protected Poll poll; - - protected Map<Integer, String> pollTypes; - - protected Map<Integer, String> voteCountingTypes; - - protected Map<Integer, String> choiceTypes; - - protected boolean notification; - - protected boolean reminder; - - protected boolean limitChoice; - - protected int reminderHourCountdown; - - protected int notificationNumber; - - public String getPageLogo() { - return "Creation"; - } - - public Poll getPoll() { - if (poll == null) { - UserAccount userAccount = getPollenSession().getUserAccount(); - poll = newService(PollService.class).getNewPoll(userAccount); - } - return poll; - } - - public Map<Integer, String> getPollTypes() { - return pollTypes; - } - - public Map<Integer, String> getVoteCountingTypes() { - return voteCountingTypes; - } - - public Map<Integer, String> getChoiceTypes() { - return choiceTypes; - } - - public boolean isNotification() { - return notification; - } - - public void setNotification(boolean notification) { - this.notification = notification; - } - - public boolean isReminder() { - return reminder; - } - - public void setReminder(boolean reminder) { - this.reminder = reminder; - } - - public boolean isLimitChoice() { - return limitChoice; - } - - public void setLimitChoice(boolean limitChoice) { - this.limitChoice = limitChoice; - } - - public int getReminderHourCountdown() { - return reminderHourCountdown; - } - - public void setReminderHourCountdown(int reminderHourCountdown) { - this.reminderHourCountdown = reminderHourCountdown; - } - - public int getNotificationNumber() { - return notificationNumber; - } - - public void setNotificationNumber(int notificationNumber) { - this.notificationNumber = notificationNumber; - } - - @Override - public String execute() throws Exception { - - PollService service = newService(PollService.class); - -// try { -// Poll basicPoll = service.createBasicPoll(poll); -// -// return SUCCESS; -// } catch (TopiaException e) { -// -// } - - // back to input - return INPUT; - } - - @Override - public void prepare() throws Exception { - - pollTypes = decorate(PollType.values()); - choiceTypes = decorate(ChoiceType.values()); - voteCountingTypes = decorate(VoteCountingType.values()); - - } - - private <E extends Enum<E> & I18nAble> Map<Integer, String> decorate(E... values) { - Map<Integer, String> result = Maps.newLinkedHashMap(); - for (E value : values) { - result.put(value.ordinal(), getText(value.getI18nKey())); - } - return result; - } -} Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,42 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Display list of created polls. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class CreatedList extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + @Override + public String getPageLogo() { + return "Creation"; + } +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatedList.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Delete.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Delete.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Delete.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Deletes an existing poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class Delete extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Delete.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,42 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.poll; - -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Display list of created polls. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayCreatedPolls extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - @Override - public String getPageLogo() { - return "Creation"; - } -} Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,42 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.poll; - -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Display list of participated polls. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayParticipatedPolls extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - @Override - public String getPageLogo() { - return "Vote"; - } -} Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,37 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.poll; - -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Display a poll. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayPoll extends PollenActionSupport { - - private static final long serialVersionUID = 1L; -} Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,37 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.poll; - -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Display results of a poll. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayPollResult extends PollenActionSupport { - - private static final long serialVersionUID = 1L; -} Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Edit.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Edit.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Edit.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Display a poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Edit extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Edit.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Export.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Export.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Export.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Exports an existing poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class Export extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Export.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,42 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Display list of participated polls. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class ParticipatedList extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + @Override + public String getPageLogo() { + return "Vote"; + } +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ParticipatedList.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Result.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Result.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Result.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Display results of a poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Result extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Result.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Vote.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Vote.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Vote.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.poll; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Votes to a poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class Vote extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/Vote.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,115 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.user; + +import org.chorem.pollen.business.persistence.UserAccount; +import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; +import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Update a user. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Edit extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + protected UserAccount user; + + protected String newPassword; + + protected String newPassword2; + + public String getPageLogo() { + return "Creation"; + } + + public UserAccount getUser() { + if (user == null) { + UserService service = newService(UserService.class); + user = service.getNewUser(); + } + return user; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } + + public String getNewPassword2() { + return newPassword2; + } + + public void setNewPassword2(String newPassword2) { + this.newPassword2 = newPassword2; + } + + public String input() throws Exception { + UserAccount userAccount = getPollenSession().getUserAccount(); + UserService userService = newService(UserService.class); + user = userService.getEntityById(UserAccount.class, userAccount.getTopiaId()); + return INPUT; + } + + @Override + public String execute() throws Exception { + + // let's push back admin property to user to save + user.setAdministrator( + getPollenSession().getUserAccount().isAdministrator()); + + UserService service = newService(UserService.class); + + try { + UserAccount updatedUser = + service.updateUser(user, newPassword, false); + getTransaction().commitTransaction(); + + // push back user to session + getPollenSession().setUserAccount(updatedUser); + return SUCCESS; + } catch (UserEmailAlreadyUsedException e) { + addFieldError("user.email", _("pollen.error.user.email.already.used")); + } catch (UserInvalidPasswordException e) { + addFieldError("user.password", _("pollen.error.user.invalid.password")); + } + + // if error go back to input + + // reset password + user.setPassword(null); + newPassword = newPassword2 = null; + + return INPUT; + } + +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Edit.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,195 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.user; + +import com.google.common.base.Preconditions; +import com.opensymphony.xwork2.Preparable; +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.services.exceptions.FavoriteListNotFoundException; +import org.chorem.pollen.services.exceptions.FavoriteListNotOwnedByUserException; +import org.chorem.pollen.services.exceptions.ParticipantAlreadyFoundInListException; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Manage a selected favorite lists of a connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class ManageFavoriteList extends PollenActionSupport implements Preparable { + + private static final long serialVersionUID = 1L; + + @Override + public String getPageLogo() { + return "Creation"; + } + + protected String action; + + protected String favoriteListId; + + protected PersonList favoriteList; + + protected PollAccount pollAccount; + + public PollAccount getCreatePollAccount() { + return getPollAccount(); + } + + public PollAccount getEditPollAccount() { + return getPollAccount(); + } + + public PollAccount getDeletePollAccount() { + return getPollAccount(); + } + + public PersonList getFavoriteList() { + return favoriteList; + } + + public String getFavoriteListId() { + return favoriteListId; + } + + public void setFavoriteListId(String favoriteListId) { + this.favoriteListId = favoriteListId; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + @Override + public void prepare() throws Exception { + + Preconditions.checkNotNull(favoriteListId); + + UserService userService = newService(UserService.class); + + try { + favoriteList = userService.getFavoriteList( + getPollenSession().getUserAccount(), favoriteListId); + } catch (FavoriteListNotFoundException e) { + addActionError(_("pollen.error.favoriteList.not.found")); + } catch (FavoriteListNotOwnedByUserException e) { + addActionError(_("pollen.error.favoriteList.not.owned.by.user")); + } + } + + public String create() throws Exception { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + + String result = INPUT; + + + UserService userService = newService(UserService.class); + + try { + + userService.addPollAccountToFavoriteList(favoriteList, pollAccount); + getTransaction().commitTransaction(); + + addActionMessage( + _("pollen.information.pollAccount.addedTofavoriteList", + pollAccount.getVotingId())); + + pollAccount = null; + action = null; + result = SUCCESS; + } catch (ParticipantAlreadyFoundInListException e) { + addFieldError("createPollAccount.votingId", + _("pollen.error.favoriteList.participant.already.found.in.list")); + } + return result; + } + + public String edit() throws Exception { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + + String result = INPUT; + + + UserService userService = newService(UserService.class); + + try { + + userService.editPollAccountToFavoriteList(favoriteList, pollAccount); + getTransaction().commitTransaction(); + + addActionMessage( + _("pollen.information.pollAccount.updatedTofavoriteList", + pollAccount.getVotingId())); + + pollAccount = null; + action = null; + result = SUCCESS; + } catch (ParticipantAlreadyFoundInListException e) { + addFieldError("editPollAccount.votingId", + _("pollen.error.favoriteList.participant.already.found.in.list")); + } + return result; + } + + public String delete() throws Exception { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(pollAccount); + Preconditions.checkNotNull(pollAccount.getTopiaId()); + + UserService userService = newService(UserService.class); + + userService.removePollAccountToFavoriteList(favoriteList, pollAccount); + getTransaction().commitTransaction(); + + addActionMessage( + _("pollen.information.pollAccount.removedFromFavoriteList", + pollAccount.getVotingId())); + + action = null; + pollAccount = null; + + return SUCCESS; + } + + protected PollAccount getPollAccount() { + if (pollAccount == null) { + UserService userService = newService(UserService.class); + pollAccount = userService.newPollAccountForFavoriteList(); + } + return pollAccount; + } + +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteList.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,144 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.user; + +import com.google.common.base.Preconditions; +import org.chorem.pollen.business.persistence.PersonList; +import org.chorem.pollen.services.exceptions.FavoriteListAlreadyExistException; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +import java.io.File; + +/** + * Manage favorite lists of a connected user. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.2.6 + */ +public class ManageFavoriteLists extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + protected PersonList favoriteList; + + protected File csvImport; + + protected String csvImportContentType; + + protected String csvImportFileName; + + protected String ldapImport; + + protected String action; + + public void setCsvImport(File csvImport) { + this.csvImport = csvImport; + } + + public void setCsvImportContentType(String csvImportContentType) { + this.csvImportContentType = csvImportContentType; + } + + public void setCsvImportFileName(String csvImportFileName) { + this.csvImportFileName = csvImportFileName; + } + + public String getLdapImport() { + return ldapImport; + } + + public void setLdapImport(String ldapImport) { + this.ldapImport = ldapImport; + } + + public PersonList getCreateFavoriteList() { + return getFavoriteList(); + } + + public PersonList getDeleteFavoriteList() { + return getFavoriteList(); + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + @Override + public String getPageLogo() { + return "Creation"; + } + + public String create() throws Exception { + + Preconditions.checkNotNull(favoriteList); + Preconditions.checkNotNull(favoriteList.getName()); + + String result = INPUT; + UserService userService = newService(UserService.class); + try { + userService.createFavoriteList(getPollenSession().getUserAccount(), + favoriteList.getName()); + getTransaction().commitTransaction(); + + addActionMessage(_("pollen.information.favoriteList.created", + favoriteList.getName())); + action = null; + favoriteList = null; + result = SUCCESS; + } catch (FavoriteListAlreadyExistException e) { + addFieldError("createFavoriteList.name", + _("pollen.error.favoriteList.already.used")); + } + return result; + } + + public String delete() throws Exception { + + Preconditions.checkNotNull(favoriteList); + + UserService userService = newService(UserService.class); + + PersonList deletedFavoritedList = userService.deleteFavoriteList(getPollenSession().getUserAccount(), + favoriteList); + getTransaction().commitTransaction(); + + addActionMessage(_("pollen.information.favoriteList.deleted", + deletedFavoritedList.getName())); + action = null; + favoriteList = null; + return SUCCESS; + } + + protected PersonList getFavoriteList() { + if (favoriteList == null) { + favoriteList = newService(UserService.class).newFavoriteList(); + } + return favoriteList; + } +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,92 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.user; + +import org.chorem.pollen.business.persistence.UserAccount; +import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; +import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException; +import org.chorem.pollen.services.impl.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Register a new user. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Register extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + protected UserAccount user; + + protected String password2; + + public UserAccount getUser() { + if (user == null) { + UserService service = newService(UserService.class); + user = service.getNewUser(); + } + return user; + } + + public String getPassword2() { + return password2; + } + + public void setPassword2(String password2) { + this.password2 = password2; + } + + public String getPageLogo() { + return "Creation"; + } + + @Override + public String execute() throws Exception { + + UserService service = newService(UserService.class); + + try { + UserAccount createdUser = service.createUser(user, false, getApplicationUrl()); + getTransaction().commitTransaction(); + + getPollenSession().setUserAccount(createdUser); + addActionMessage(_("pollen.information.your.are.loggued")); + return SUCCESS; + } catch (UserLoginAlreadyUsedException e) { + addFieldError("user.login", _("pollen.error.user.login.already.used")); + } catch (UserEmailAlreadyUsedException e) { + addFieldError("user.email", _("pollen.error.user.email.already.used")); + } + + // if error go back to input + + // reset password + user.setPassword(null); + password2 = null; + + return INPUT; + } +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Register.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,92 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.user; - -import org.chorem.pollen.business.persistence.UserAccount; -import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException; -import org.chorem.pollen.services.impl.UserService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Register a new user. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class RegisterUser extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected UserAccount user; - - protected String password2; - - public UserAccount getUser() { - if (user == null) { - UserService service = newService(UserService.class); - user = service.getNewUser(); - } - return user; - } - - public String getPassword2() { - return password2; - } - - public void setPassword2(String password2) { - this.password2 = password2; - } - - public String getPageLogo() { - return "Creation"; - } - - @Override - public String execute() throws Exception { - - UserService service = newService(UserService.class); - - try { - UserAccount createdUser = service.createUser(user, false, getApplicationUrl()); - getTransaction().commitTransaction(); - - getPollenSession().setUserAccount(createdUser); - addActionMessage(_("pollen.information.your.are.loggued")); - return SUCCESS; - } catch (UserLoginAlreadyUsedException e) { - addFieldError("user.login", _("pollen.error.user.login.already.used")); - } catch (UserEmailAlreadyUsedException e) { - addFieldError("user.email", _("pollen.error.user.email.already.used")); - } - - // if error go back to input - - // reset password - user.setPassword(null); - password2 = null; - - return INPUT; - } -} Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,47 @@ +/* + * #%L + * Pollen :: UI (strust2) + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen.ui.actions.user; + +import org.chorem.pollen.business.persistence.UserAccount; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Show user account. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Show extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + public String getPageLogo() { + return "Creation"; + } + + public UserAccount getUser() { + return getPollenSession().getUserAccount(); + } + +} Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Show.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,47 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.user; - -import org.chorem.pollen.business.persistence.UserAccount; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Show user account. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class ShowUser extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - public String getPageLogo() { - return "Creation"; - } - - public UserAccount getUser() { - return getPollenSession().getUserAccount(); - } - -} Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,115 +0,0 @@ -/* - * #%L - * Pollen :: UI (strust2) - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen.ui.actions.user; - -import org.chorem.pollen.business.persistence.UserAccount; -import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; -import org.chorem.pollen.services.impl.UserService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Update a user. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class UpdateUser extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected UserAccount user; - - protected String newPassword; - - protected String newPassword2; - - public String getPageLogo() { - return "Creation"; - } - - public UserAccount getUser() { - if (user == null) { - UserService service = newService(UserService.class); - user = service.getNewUser(); - } - return user; - } - - public String getNewPassword() { - return newPassword; - } - - public void setNewPassword(String newPassword) { - this.newPassword = newPassword; - } - - public String getNewPassword2() { - return newPassword2; - } - - public void setNewPassword2(String newPassword2) { - this.newPassword2 = newPassword2; - } - - public String input() throws Exception { - UserAccount userAccount = getPollenSession().getUserAccount(); - UserService userService = newService(UserService.class); - user = userService.getEntityById(UserAccount.class, userAccount.getTopiaId()); - return INPUT; - } - - @Override - public String execute() throws Exception { - - // let's push back admin property to user to save - user.setAdministrator( - getPollenSession().getUserAccount().isAdministrator()); - - UserService service = newService(UserService.class); - - try { - UserAccount updatedUser = - service.updateUser(user, newPassword, false); - getTransaction().commitTransaction(); - - // push back user to session - getPollenSession().setUserAccount(updatedUser); - return SUCCESS; - } catch (UserEmailAlreadyUsedException e) { - addFieldError("user.email", _("pollen.error.user.email.already.used")); - } catch (UserInvalidPasswordException e) { - addFieldError("user.password", _("pollen.error.user.invalid.password")); - } - - // if error go back to input - - // reset password - user.setPassword(null); - newPassword = newPassword2 = null; - - return INPUT; - } - -} Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-admin.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-admin.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-admin.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -37,12 +37,11 @@ <!-- manage users --> <action name="usersList" method="input" class="org.chorem.pollen.ui.actions.admin.ManageUsers"> - <!--<interceptor-ref name="pollenBasicAdminStack"/>--> <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> </action> <!-- create user --> - <action name="createUser" method="createUser" + <action name="create" method="create" class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> @@ -50,7 +49,7 @@ </action> <!-- save user --> - <action name="updateUser" method="updateUser" + <action name="edit" method="edit" class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> @@ -58,7 +57,7 @@ </action> <!-- delete user --> - <action name="deleteUser" method="deleteUser" + <action name="delete" method="delete" class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> @@ -68,7 +67,6 @@ <!-- manage polls --> <action name="pollsList" method="input" class="org.chorem.pollen.ui.actions.admin.ManagePolls"> - <!--<interceptor-ref name="pollenBasicAdminStack"/>--> <result name="input">/WEB-INF/jsp/admin/pollsList.jsp</result> </action> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-json.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -45,6 +45,34 @@ <result type="json"/> </action> + <!-- get pagined favorite lists of user --> + <action name="getFavoriteLists" + class="org.chorem.pollen.ui.actions.json.GetFavoriteLists"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + + <!-- get selected favorite list of user --> + <action name="getFavoriteList" + class="org.chorem.pollen.ui.actions.json.GetFavoriteList"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + + <!-- get pagined poll accounts of a given favorite list --> + <action name="getFavoriteListPollAccounts" + class="org.chorem.pollen.ui.actions.json.GetFavoriteListPollAccounts"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + + <!-- get selected poll account of a given favorite list --> + <action name="getFavoriteListPollAccount" + class="org.chorem.pollen.ui.actions.json.GetFavoriteListPollAccount"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result type="json"/> + </action> + <!-- get pagined polls --> <action name="getPolls" class="org.chorem.pollen.ui.actions.json.GetPolls"> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -33,37 +33,72 @@ <package name="poll" extends="default" namespace="/poll"> <!-- create poll --> - <action name="createPoll" - class="org.chorem.pollen.ui.actions.poll.CreatePoll"> - <result name="input">/WEB-INF/jsp/poll/createPoll.jsp</result> + <action name="create" + class="org.chorem.pollen.ui.actions.poll.Create"> + <result name="input">/WEB-INF/jsp/poll/create.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> - <!-- display poll --> - <action name="displayPoll" - class="org.chorem.pollen.ui.actions.poll.DisplayPoll"> - <result name="input">/WEB-INF/jsp/poll.jsp</result> + <!-- edit poll --> + <action name="edit" + class="org.chorem.pollen.ui.actions.poll.Edit"> + <result name="input">/WEB-INF/jsp/poll/edit.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> + <!-- vote poll --> + <action name="vote" + class="org.chorem.pollen.ui.actions.poll.Vote"> + <result name="input">/WEB-INF/jsp/poll/vote.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> + </action> + + <!-- clone poll --> + <action name="clone" + class="org.chorem.pollen.ui.actions.poll.Clone"> + <result name="input">/WEB-INF/jsp/poll/clone.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> + </action> + + <!-- export poll --> + <action name="export" + class="org.chorem.pollen.ui.actions.poll.Export"> + <result name="input">/WEB-INF/jsp/poll/export.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> + </action> + + <!-- close poll --> + <action name="close" + class="org.chorem.pollen.ui.actions.poll.Close"> + <result name="input">/WEB-INF/jsp/poll/close.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> + </action> + + <!-- delete poll --> + <action name="delete" + class="org.chorem.pollen.ui.actions.poll.Delete"> + <result name="input">/WEB-INF/jsp/poll/delete.jsp</result> + <result>/WEB-INF/jsp/home.jsp</result> + </action> + <!-- display poll result --> - <action name="displayPollResult" - class="org.chorem.pollen.ui.actions.poll.DisplayPollResult"> - <result name="input">/WEB-INF/jsp/pollResult.jsp</result> + <action name="result" + class="org.chorem.pollen.ui.actions.poll.Result"> + <result name="input">/WEB-INF/jsp/poll/result.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display createds polls --> - <action name="displayCreatedPolls" - class="org.chorem.pollen.ui.actions.poll.DisplayCreatedPolls"> + <action name="createdList" + class="org.chorem.pollen.ui.actions.poll.CreatedList"> <interceptor-ref name="pollenBasicLogguedStack"/> <result name="input">/WEB-INF/jsp/poll/createdList.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display participated polls --> - <action name="displayParticipatedPolls" - class="org.chorem.pollen.ui.actions.poll.DisplayParticipatedPolls"> + <action name="participatedList" + class="org.chorem.pollen.ui.actions.poll.ParticipatedList"> <interceptor-ref name="pollenBasicLogguedStack"/> <result name="input">/WEB-INF/jsp/poll/participatedList.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-user.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -39,24 +39,21 @@ </action> <!-- register user --> - <action name="registerUser" - class="org.chorem.pollen.ui.actions.user.RegisterUser"> - <result name="input">/WEB-INF/jsp/user/registerUser.jsp</result> + <action name="register" class="org.chorem.pollen.ui.actions.user.Register"> + <result name="input">/WEB-INF/jsp/user/register.jsp</result> <result type="redirectToHome"/> </action> <!-- show user account --> - <action name="showUser" - class="org.chorem.pollen.ui.actions.user.ShowUser"> - <result>/WEB-INF/jsp/user/showUser.jsp</result> + <action name="show" class="org.chorem.pollen.ui.actions.user.Show"> + <result>/WEB-INF/jsp/user/show.jsp</result> </action> - <!-- modify user account --> - <action name="updateUser" - class="org.chorem.pollen.ui.actions.user.UpdateUser"> - <result name="input">/WEB-INF/jsp/user/updateUser.jsp</result> + <!-- edit user account --> + <action name="edit" class="org.chorem.pollen.ui.actions.user.Edit"> + <result name="input">/WEB-INF/jsp/user/edit.jsp</result> <result type="redirectAction"> - <param name="actionName">showUser</param> + <param name="actionName">show</param> <param name="namespace">/user</param> </result> </action> @@ -66,6 +63,61 @@ <result type="redirectToHome"/> </action> + <!-- show favorite lists --> + <action name="favoriteLists" method="input" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteLists"> + <interceptor-ref name="pollenBasicLogguedStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteLists.jsp</result> + <result>/WEB-INF/jsp/user/favoriteLists.jsp</result> + </action> + + <!-- create favorite list --> + <action name="createFavoriteList" method="create" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteLists"> + <interceptor-ref name="pollenParamsPrepareParamsLogguedStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteLists.jsp</result> + <result>/WEB-INF/jsp/user/favoriteLists.jsp</result> + </action> + + <!-- delete favorite list --> + <action name="deleteFavoriteList" method="delete" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteLists"> + <interceptor-ref name="pollenParamsPrepareParamsLogguedStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteLists.jsp</result> + <result>/WEB-INF/jsp/user/favoriteLists.jsp</result> + </action> + + <!-- edit favorite list --> + <action name="editFavoriteList" method="input" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteList"> + <interceptor-ref name="pollenParamsPrepareParamsLogguedStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result> + </action> + + <!-- add poll account to favorite list --> + <action name="addPollAccount" method="create" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteList"> + <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result> + <result>/WEB-INF/jsp/user/favoriteList.jsp</result> + </action> + + <!-- edit poll account to favorite list --> + <action name="editPollAccount" method="edit" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteList"> + <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result> + <result>/WEB-INF/jsp/user/favoriteList.jsp</result> + </action> + + <!-- remove poll account from a favorite list --> + <action name="removePollAccount" method="delete" + class="org.chorem.pollen.ui.actions.user.ManageFavoriteList"> + <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> + <result name="input">/WEB-INF/jsp/user/favoriteList.jsp</result> + <result>/WEB-INF/jsp/user/favoriteList.jsp</result> + </action> + </package> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,9 +1,17 @@ poll.common.select.choiceType=Select the type of choice +poll.common.select.userFavoriteList=List +pollen.action.backToFavoriteLists=Back to favorite lists pollen.action.create=Create +pollen.action.createFavoriteList=Create a new list pollen.action.createPoll=Create the poll +pollen.action.createPollAccount=Add a new member pollen.action.createUser=Create a new user pollen.action.delete=Delete +pollen.action.deleteFavoriteList=Delete a list +pollen.action.deletePollAccount=Delete selected member pollen.action.deleteUser=Delete selected user +pollen.action.editFavoriteList=Edit a list +pollen.action.editPollAccount=Edit selected member pollen.action.editUser=Edit selected user pollen.action.login=Log me In pollen.action.modify=Modify @@ -21,6 +29,7 @@ pollen.common.beginChoiceDate=Begin choice date pollen.common.beginDate=Begin date pollen.common.bugReport=Bug report +pollen.common.csvImport=CSV import pollen.common.description=Description pollen.common.email=Em@il pollen.common.endChoiceDate=end choice date @@ -28,8 +37,11 @@ pollen.common.firstName=First name pollen.common.functions=Functions pollen.common.lastName=Last name +pollen.common.ldapImport=LDAP import pollen.common.license=Licence pollen.common.login=Login +pollen.common.name=Name +pollen.common.nbAccounts=Number of members pollen.common.newPassword=New password pollen.common.newPassword2=Reenter new passworsd pollen.common.or=or @@ -50,26 +62,46 @@ pollen.common.title=Title pollen.common.userSupport=User support pollen.common.voteCountingType=Counting type -pollen.error.email.required=You must provide a email +pollen.error.email.required=You must provide an email +pollen.error.favoriteList.already.used=List name already used +pollen.error.favoriteList.not.found=Favorite list not found +pollen.error.favoriteList.not.owned.by.user=You are not owner of this favorite list +pollen.error.favoriteList.participant.already.found.in.list=Member was same name already in favorite list +pollen.error.favoriteList.participant.not.found.in.list=Member not found in favorite list +pollen.error.favoriteListName.required=List name mandatory pollen.error.login.required=You must provide a login pollen.error.password.required=Your must provide a password pollen.error.password2.required=You must repeat your password for confirmation pollen.error.passwords.not.equals=Les deux mots de passe saisis non identiques +pollen.error.pollAccount.email.required=Em@il mandatory +pollen.error.pollAccount.not.found=Poll account not found +pollen.error.pollAccount.votingId.required=Name mandatory pollen.error.user.bad.login.or.password=Login or password invalid. pollen.error.user.email.already.used=This email is already used pollen.error.user.invalid.password=Invalid password pollen.error.user.login.already.used=This login is already used -pollen.fieldset.connexionInformation=Information de connexion +pollen.error.user.not.found=User not found +pollen.fieldset.connexionInformation=Connexion informations pollen.fieldset.login=Login pollen.fieldset.poll.choices=Choices pollen.fieldset.poll.general=Your poll pollen.fieldset.poll.options=Options pollen.fieldset.poll.you=You +pollen.fieldset.pollAccount.toAddToFavoriteList=Add a new member +pollen.fieldset.pollAccount.toDeleteFromFavoriteList=Remove a member +pollen.fieldset.pollAccount.toEditToFavoriteList=Edit member +pollen.fieldset.userFavoriteList.toCreate=Create a new list +pollen.fieldset.userFavoriteList.toDelete=List de favoris à supprimer pollen.fieldset.userInformation=User information pollen.fieldset.userInformation.toCreate=User informations to create pollen.fieldset.userInformation.toDelete=User informations to delete pollen.fieldset.userInformation.toUpdate=User informations to update +pollen.information.favoriteList.created=Favorite list %s created. +pollen.information.favoriteList.deleted=Favorite list %s deleted. pollen.information.need.login=You must be logged to access this page. Please fill the form below. +pollen.information.pollAccount.addedTofavoriteList=Member '%s was added to favorite list. +pollen.information.pollAccount.removedFromFavoriteList=Member %s was removed from favorite list. +pollen.information.pollAccount.updatedTofavoriteList=Member %s was updated in favorite list. pollen.information.user.created=User %s created. pollen.information.user.deleted=User %s deleted. pollen.information.user.updated=User %s updated. @@ -78,18 +110,20 @@ pollen.legend.login=Login pollen.menu.admin=Administration pollen.menu.createPoll=Create a poll -pollen.menu.displayCreatedPolls=Created polls -pollen.menu.displayParticipatedPolls=Participated polls -pollen.menu.displayVotingLists=Voting lists pollen.menu.home=Home pollen.menu.login=Log in pollen.menu.logout=Log out pollen.menu.managePolls=Manage Polls pollen.menu.manageUsers=Manage Users pollen.menu.polls=Polls +pollen.menu.pollsCreatedList=Created polls +pollen.menu.pollsParticipatedList=Participated polls pollen.menu.preferences=My account pollen.menu.register=Register +pollen.menu.userFavoriteLists=Voting lists pollen.title.createPoll=New poll +pollen.title.editFavoriteList=Edition de la liste des favoris +pollen.title.favoriteLists=Vos listes de votants pollen.title.myAccount=My account pollen.title.pollsCreatedList=Polls created pollen.title.pollsCreatedList.legend=Polls you have proposed Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,9 +1,17 @@ poll.common.select.choiceType=Sélectionner le type de choix +poll.common.select.userFavoriteList=Liste +pollen.action.backToFavoriteLists=Retour à la liste des favoris pollen.action.create=Créer +pollen.action.createFavoriteList=Créer une ouvelle liste pollen.action.createPoll=Créer le sondage +pollen.action.createPollAccount=Ajouter une membre à la liste pollen.action.createUser=Créer un nouvel utilisateur pollen.action.delete=Supprimer +pollen.action.deleteFavoriteList=Supprimer une liste sélectionnée +pollen.action.deletePollAccount=Supprimer une membre de la liste pollen.action.deleteUser=Supprimer un utilisateur sélectionné +pollen.action.editFavoriteList=Editer une liste sélectionnée +pollen.action.editPollAccount=Editer le membre sélectionné pollen.action.editUser=Editer un utilisateur sélectionné pollen.action.login=M'identifier pollen.action.modify=Modifier @@ -21,6 +29,7 @@ pollen.common.beginChoiceDate=Date de début des choix pollen.common.beginDate=Date de début pollen.common.bugReport=Rapport de bug +pollen.common.csvImport=Import CSV pollen.common.description=Description pollen.common.email=Em@il pollen.common.endChoiceDate=Date de fin des choix @@ -28,8 +37,11 @@ pollen.common.firstName=Prénom pollen.common.functions=Fonctions pollen.common.lastName=Nom +pollen.common.ldapImport=Import LDAP pollen.common.license=Licence pollen.common.login=Identifiant +pollen.common.name=Nom +pollen.common.nbAccounts=Nombre de membres pollen.common.newPassword=Nouveau mot de passe pollen.common.newPassword2=Répétez votre nouveau mot de passe pollen.common.or=ou @@ -52,25 +64,45 @@ pollen.common.voteCountingType=Type de dépouillement pollen.common.x=Dépouillement pollen.error.email.required=Courriel obligatoire +pollen.error.favoriteList.already.used=Nom de liste déjà utilisé +pollen.error.favoriteList.not.found=Liste non trouvée +pollen.error.favoriteList.not.owned.by.user=La liste d'utilisateur ne vous appartient pas +pollen.error.favoriteList.participant.already.found.in.list=Nom déjà utilisé dans la liste +pollen.error.favoriteList.participant.not.found.in.list=Membre non trouvé dans la liste +pollen.error.favoriteListName.required=Nom de liste obligatoire pollen.error.login.required=Login obligatoire pollen.error.password.required=Mot de passe obligatoire pollen.error.password2.required=Mot de passe répété obligatoire pollen.error.passwords.not.equals=Les deux mots de passe saisis non identiques +pollen.error.pollAccount.email.required=Em@il obliqatoire +pollen.error.pollAccount.not.found=Membre non trouvé +pollen.error.pollAccount.votingId.required=Nom obliqatoire pollen.error.user.bad.login.or.password=Mauvais identifiant ou mot de passe. pollen.error.user.email.already.used=Le courriel saisi est déjà utilisé par un autre utilisateur pollen.error.user.invalid.password=Mot de passe invalide pollen.error.user.login.already.used=Le login saisie est déjà utilisé par un autre utilisateur +pollen.error.user.not.found=Utilisateur non trouvé pollen.fieldset.connexionInformation=Information de connexion pollen.fieldset.login=Connexion pollen.fieldset.poll.choices=Les choix pollen.fieldset.poll.general=Votre sondage pollen.fieldset.poll.options=Les options pollen.fieldset.poll.you=Vous +pollen.fieldset.pollAccount.toAddToFavoriteList=Ajouter un membre +pollen.fieldset.pollAccount.toDeleteFromFavoriteList=Supprimer un membre +pollen.fieldset.pollAccount.toEditToFavoriteList=Editer le membre +pollen.fieldset.userFavoriteList.toCreate=Créer une nouvelle liste +pollen.fieldset.userFavoriteList.toDelete=List de favoris à supprimer pollen.fieldset.userInformation=Informations de l'utilisateur pollen.fieldset.userInformation.toCreate=Informations de l'utilisateur à créer pollen.fieldset.userInformation.toDelete=Informations de l'utilisateur à supprimer pollen.fieldset.userInformation.toUpdate=Informations de l'utilisateur à mettre à jour +pollen.information.favoriteList.created=La liste %s a été créée. +pollen.information.favoriteList.deleted=La liste %s a été supprimée. pollen.information.need.login=Vous devez être identifié pour pouvoir accéder à cette page. Veuillez remplir le formulaire ci-dessous. +pollen.information.pollAccount.addedTofavoriteList=Le membre %s a été ajoutée à la liste des favoris. +pollen.information.pollAccount.removedFromFavoriteList=Le membre %s a été supprimé de la liste des favoris. +pollen.information.pollAccount.updatedTofavoriteList=Le membre %s a été mise à jour dans la liste des favoris. pollen.information.user.created=L'utilisateur %s a été créé. pollen.information.user.deleted=L'utilisateur %s a été supprimé. pollen.information.user.updated=L'utilisateur %s a été mis à jour. @@ -79,18 +111,20 @@ pollen.legend.login=Login pollen.menu.admin=Administration pollen.menu.createPoll=Créer un sondage -pollen.menu.displayCreatedPolls=Sondages créés -pollen.menu.displayParticipatedPolls=Sondages participés -pollen.menu.displayVotingLists=Listes de votants pollen.menu.home=Accueil pollen.menu.login=Identifiez-vous pollen.menu.logout=Déconnexion pollen.menu.managePolls=Gérer les sondages pollen.menu.manageUsers=Gérer les utilisateurs pollen.menu.polls=Sondages +pollen.menu.pollsCreatedList=Sondages créés +pollen.menu.pollsParticipatedList=Sondages participés pollen.menu.preferences=Mon compte pollen.menu.register=Inscrivez-vous +pollen.menu.userFavoriteLists=Listes de votants pollen.title.createPoll=Nouveau sondage +pollen.title.editFavoriteList=Edition de la liste des favoris +pollen.title.favoriteLists=Vos listes de votants pollen.title.myAccount=Mon compte pollen.title.pollsCreatedList=Sondages créés pollen.title.pollsCreatedList.legend=Liste des sondages que vous avez proposés Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/Login-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/Login-validation.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/Login-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,44 +0,0 @@ -<!-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - </field> - - <field name="password"> - - <field-validator type="requiredstring"> - <message key="pollen.error.password.required"/> - </field-validator> - - </field> - -</validators> Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/RegisterUser-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/RegisterUser-validation.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/RegisterUser-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,65 +0,0 @@ -<!-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="user.login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - </field> - - <field name="user.password"> - - <field-validator type="requiredstring"> - <message key="pollen.error.password.required"/> - </field-validator> - - </field> - - <field name="password2"> - - <field-validator type="requiredstring" short-circuit="true"> - <message key="pollen.error.password2.required"/> - </field-validator> - - <field-validator type="fieldexpression"> - <param name="expression">password2.equals(user.password)</param> - <message key="pollen.error.passwords.not.equals"/> - </field-validator> - - </field> - - <field name="user.email"> - - <field-validator type="requiredstring"> - <message key="pollen.error.email.required"/> - </field-validator> - - </field> - -</validators> Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/UpdateUser-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/UpdateUser-validation.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/UpdateUser-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,61 +0,0 @@ -<!-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="user.login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - </field> - - <field name="user.password"> - - <field-validator type="requiredstring"> - <message key="pollen.error.password.required"/> - </field-validator> - - </field> - - <field name="newPassword2"> - - <field-validator type="fieldexpression"> - <param name="expression">newPassword == null || newPassword == null || newPassword2.equals(newPassword)</param> - <message key="pollen.error.passwords.not.equals"/> - </field-validator> - - </field> - - <field name="user.email"> - - <field-validator type="requiredstring"> - <message key="pollen.error.email.required"/> - </field-validator> - - </field> - -</validators> Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-create-validation.xml (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-create-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-create-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,45 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="createUser.login"> + + <field-validator type="requiredstring"> + <message key="pollen.error.login.required"/> + </field-validator> + + </field> + + <field name="createUser.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.email.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-create-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,45 +0,0 @@ -<!-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="user.login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - - </field> - - <field name="user.email"> - - <field-validator type="requiredstring"> - <message key="pollen.error.email.required"/> - </field-validator> - - </field> - -</validators> Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-edit-validation.xml (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-edit-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-edit-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,45 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="editUser.login"> + + <field-validator type="requiredstring"> + <message key="pollen.error.login.required"/> + </field-validator> + + </field> + + <field name="editUser.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.email.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-edit-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,45 +0,0 @@ -<!-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="user.login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - - </field> - - <field name="user.email"> - - <field-validator type="requiredstring"> - <message key="pollen.error.email.required"/> - </field-validator> - - </field> - -</validators> Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Edit-validation.xml (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/UpdateUser-validation.xml) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Edit-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Edit-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,61 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="user.login"> + + <field-validator type="requiredstring"> + <message key="pollen.error.login.required"/> + </field-validator> + </field> + + <field name="user.password"> + + <field-validator type="requiredstring"> + <message key="pollen.error.password.required"/> + </field-validator> + + </field> + + <field name="newPassword2"> + + <field-validator type="fieldexpression"> + <param name="expression">newPassword == null || newPassword == null || newPassword2.equals(newPassword)</param> + <message key="pollen.error.passwords.not.equals"/> + </field-validator> + + </field> + + <field name="user.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.email.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Edit-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/Login-validation.xml) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,44 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="login"> + + <field-validator type="requiredstring"> + <message key="pollen.error.login.required"/> + </field-validator> + </field> + + <field name="password"> + + <field-validator type="requiredstring"> + <message key="pollen.error.password.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Login-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-addPollAccount-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-addPollAccount-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-addPollAccount-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> + + +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> + +<validators> + + <field name="createPollAccount.votingId"> + + <field-validator type="requiredstring"> + <message key="pollen.error.pollAccount.votingId.required"/> + </field-validator> + + </field> + + <field name="createPollAccount.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.pollAccount.email.required"/> + </field-validator> + + </field> + +</validators> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-addPollAccount-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-editPollAccount-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-editPollAccount-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-editPollAccount-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> + + +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> + +<validators> + + <field name="editPollAccount.votingId"> + + <field-validator type="requiredstring"> + <message key="pollen.error.pollAccount.votingId.required"/> + </field-validator> + + </field> + + <field name="editPollAccount.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.pollAccount.email.required"/> + </field-validator> + + </field> + +</validators> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteList-editPollAccount-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteLists-createFavoriteList-validation.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteLists-createFavoriteList-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteLists-createFavoriteList-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,37 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="createFavoriteList.name"> + + <field-validator type="requiredstring"> + <message key="pollen.error.favoriteListName.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/ManageFavoriteLists-createFavoriteList-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Register-validation.xml (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/RegisterUser-validation.xml) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Register-validation.xml (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Register-validation.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,65 @@ +<!-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="user.login"> + + <field-validator type="requiredstring"> + <message key="pollen.error.login.required"/> + </field-validator> + </field> + + <field name="user.password"> + + <field-validator type="requiredstring"> + <message key="pollen.error.password.required"/> + </field-validator> + + </field> + + <field name="password2"> + + <field-validator type="requiredstring" short-circuit="true"> + <message key="pollen.error.password2.required"/> + </field-validator> + + <field-validator type="fieldexpression"> + <param name="expression">password2.equals(user.password)</param> + <message key="pollen.error.passwords.not.equals"/> + </field-validator> + + </field> + + <field name="user.email"> + + <field-validator type="requiredstring"> + <message key="pollen.error.email.required"/> + </field-validator> + + </field> + +</validators> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/user/Register-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators/layout-default.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -89,7 +89,7 @@ <div class="top_left${pageLogo}"></div> <ul class="top_middle${pageLogo}"> <li> - <s:a action="showUser" namespace="/user"> + <s:a action="show" namespace="/user"> <s:text name="pollen.menu.preferences"/> </s:a> </li> @@ -103,8 +103,9 @@ </span> </s:if> <s:else> - <span onClick="$('#login_menu').toggle()"><s:text - name="pollen.menu.login"/></span> + <span onClick="$('#login_menu').toggle()"> + <s:text name="pollen.menu.login"/> + </span> <div class="dropdown_menu" id="login_menu" style="display: none;"> <div class="top_right${pageLogo}"></div> @@ -133,7 +134,7 @@ </s:form> </div> <s:text name="pollen.common.or"/> - <s:a action="registerUser" method="input" namespace="/user"> + <s:a action="register" method="input" namespace="/user"> <s:text name="pollen.menu.register"/> </s:a> </s:else> @@ -156,24 +157,24 @@ <div class="top_left${pageLogo}"></div> <ul class="top_middle${pageLogo}"> <li> - <s:a action="createPoll" method="input" namespace="/poll"> + <s:a action="create" method="input" namespace="/poll"> <s:text name="pollen.menu.createPoll"/> </s:a> </li> <s:if test="userExists"> <li> - <s:a action="displayCreatedPolls" method="input" namespace="/poll"> - <s:text name="pollen.menu.displayCreatedPolls"/> + <s:a action="createdList" method="input" namespace="/poll"> + <s:text name="pollen.menu.pollsCreatedList"/> </s:a> </li> <li> - <s:a action="displayParticipatedPolls" method="input" namespace="/poll"> - <s:text name="pollen.menu.displayParticipatedPolls"/> + <s:a action="participatedList" method="input" namespace="/poll"> + <s:text name="pollen.menu.pollsParticipatedList"/> </s:a> </li> <li> - <s:a action="displayVotingLists" method="input" namespace="/user"> - <s:text name="pollen.menu.displayVotingLists"/> + <s:a action="favoriteLists" namespace="/user"> + <s:text name="pollen.menu.userFavoriteLists"/> </s:a> </li> </s:if> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/decorators.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -28,6 +28,7 @@ <pattern>/js/*</pattern> <pattern>/images/*</pattern> <pattern>/config-browser/*</pattern> + <pattern>/json/*</pattern> </excludes> <decorator name="layout-default" page="layout-default.jsp"> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -30,7 +30,7 @@ <h1 class="title${pageLogo}"><s:text name="pollen.title.usersList"/></h1> -<s:url id="loadUSers" action="getUsers" namespace="/json" escapeAmp="false"/> +<s:url id="loadUsers" action="getUsers" namespace="/json" escapeAmp="false"/> <s:url id="loadUser" action="getUser" namespace="/json"/> @@ -39,10 +39,13 @@ <script type="text/javascript"> jQuery(document).ready(function () { + + var action='${action}'; + if ('${action}' == 'create') { $('#createForm').show(); } - if ('${action}' == 'update') { + if ('${action}' == 'edit') { $('#editForm').show(); } if ('${action}' == 'delete') { @@ -53,27 +56,47 @@ $.addRowSelectTopic('users'); $.addClearSelectTopic('users', function(){ + if (action !='') { + // come back from action + action=''; + return; + } $(".userForm").hide(); }); + // to create a new row + $.listenRowTopic('users-addRow', function(event) { + + $('#createForm .errorMessage').hide(); + $('#createForm [name="createUser.login"]').val(""); + $('#createForm [name="createUser.email"]').val(""); + $('#createForm [name="createUser.firstName"]').val(""); + $('#createForm [name="createUser.lastName"]').val(""); + $('#createForm [name="createUser.administrator"]').prop('checked',false); + $('#editForm').hide(); + $('#deleteForm').hide(); + $('#createForm').show(); + }); + // to edit a selected row $.listenRowTopic('users-editRow', function (event) { - if(!jQuery.struts2_jquery['users']) { + var id = $.getSelectedId('users'); + if(!id) { // no user selected return; } - var id = jQuery.struts2_jquery['users']['selectedRow']; + $('#editForm .errorMessage').hide(); jQuery.getJSON("${loadUser}", { "userId":id }, function (result) { var user = result.user; - $('#editForm [name="user.topiaId"]').val(user.id); - $('#editForm [name="user.login"]').val(user.login); - $('#editForm [name="user.email"]').val(user.email); - $('#editForm [name="user.firstName"]').val(user.firstName); - $('#editForm [name="user.lastName"]').val(user.lastName); - $('#editForm [name="user.administrator"]').prop('checked',false); - $('#editForm [name="user.administrator"]').prop('checked',user.administrator); + $('#editForm [name="editUser.topiaId"]').val(user.id); + $('#editForm [name="editUser.login"]').val(user.login); + $('#editForm [name="editUser.email"]').val(user.email); + $('#editForm [name="editUser.firstName"]').val(user.firstName); + $('#editForm [name="editUser.lastName"]').val(user.lastName); + $('#editForm [name="editUser.administrator"]').prop('checked',false); + $('#editForm [name="editUser.administrator"]').prop('checked',user.administrator); $('#editForm').show(); $('#createForm').hide(); $('#deleteForm').hide(); @@ -81,26 +104,15 @@ ); }); - // to create a new row - $.listenRowTopic('users-addRow', function(event) { - $('#createForm [name="user.login"]').val(""); - $('#createForm [name="user.email"]').val(""); - $('#createForm [name="user.firstName"]').val(""); - $('#createForm [name="user.lastName"]').val(""); - $('#createForm [name="user.administrator"]').prop('checked',false); - $('#editForm').hide(); - $('#deleteForm').hide(); - $('#createForm').show(); - }); - // to delete the selected row $.listenRowTopic('users-deleteRow', function(event) { - if(!jQuery.struts2_jquery['users']) { + var id = $.getSelectedId('users'); + if(!id) { // no user selected return; } - var id = jQuery.struts2_jquery['users']['selectedRow']; + var userId = '${user.topiaId}'; if (id == userId) { @@ -108,17 +120,18 @@ // can not delete connected user return; } + $('#deleteForm .errorMessage').hide(); jQuery.getJSON("${loadUser}", { "userId":id }, function (result) { var user = result.user; - $('#deleteForm [name="user.topiaId"]').val(user.id); - $('#deleteForm [name="user.login"]').val(user.login); - $('#deleteForm [name="user.email"]').val(user.email); - $('#deleteForm [name="user.firstName"]').val(user.firstName); - $('#deleteForm [name="user.lastName"]').val(user.lastName); - $('#deleteForm [name="user.administrator"]').prop('checked',false); - $('#deleteForm [name="user.administrator"]').prop('checked',user.administrator); + $('#deleteForm [name="deleteUser.topiaId"]').val(user.id); + $('#deleteForm [name="deleteUser.login"]').val(user.login); + $('#deleteForm [name="deleteUser.email"]').val(user.email); + $('#deleteForm [name="deleteUser.firstName"]').val(user.firstName); + $('#deleteForm [name="deleteUser.lastName"]').val(user.lastName); + $('#deleteForm [name="deleteUser.administrator"]').prop('checked',false); + $('#deleteForm [name="deleteUser.administrator"]').prop('checked',user.administrator); $('#editForm').hide(); $('#createForm').hide(); $('#deleteForm').show(); @@ -128,7 +141,7 @@ }); </script> -<sjg:grid id="users" dataType="json" href="%{loadUSers}" gridModel="users" +<sjg:grid id="users" dataType="json" href="%{loadUsers}" gridModel="users" sortable="true" pager="true" pagerButtons="true" pagerInput="true" navigator="true" rownumbers="false" autowidth="true" onSelectRowTopics='users-rowSelect' editinline="false" @@ -139,7 +152,7 @@ rowList="10,15,20,50,100" rowNum="10" navigatorExtraButtons="{ add: { title: '%{getText(\"pollen.action.createUser\")}', icon: 'ui-icon-plus', topic: 'users-addRow' }, - edit: { title: '%{getText(\"pollen.action.editUser\")}', icon: 'ui-icon-pencil', topic: 'users-editRow' }, + edit: { title: '%{getText(\"pollen.action.editUser\")}', icon: 'ui-icon-pencil', topic: 'users-editRow' }, delete:{ title: '%{getText(\"pollen.action.deleteUser\")}', icon: 'ui-icon-trash', topic: 'users-deleteRow' }}"> <sjg:gridColumn name="id" title="id" hidden="true"/> @@ -147,60 +160,60 @@ <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}'/> <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}'/> <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}'/> - <sjg:gridColumn name="administrator" title='%{getText("pollen.common.administrator")}'width="100" formatter="checkbox" /> + <sjg:gridColumn name="administrator" width="100" formatter="checkbox" + title='%{getText("pollen.common.administrator")}' /> </sjg:grid> <br/> -<s:form id='editForm' method="POST" namespace="/admin" cssClass="hidden userForm"> +<s:form id='createForm' method="POST" namespace="/admin" cssClass="hidden userForm"> - <s:hidden name="action" value="update"/> - <s:hidden key="user.topiaId" label=""/> - <%--<s:hidden key="user.login" label=""/>--%> - + <s:hidden name="action" value="create"/> <fieldset> - <legend><s:text name="pollen.fieldset.userInformation.toUpdate"/></legend> - <s:textfield key="user.login" label="%{getText('pollen.common.login')}" required="true" readonly="true" size="40"/> - <s:textfield key="user.email" label="%{getText('pollen.common.email')}" required="true" size="40"/> - <s:textfield key="user.firstName" label="%{getText('pollen.common.firstName')}" size="40"/> - <s:textfield key="user.lastName" label="%{getText('pollen.common.lastName')}" size="40"/> - <s:checkbox key="user.administrator" label="%{getText('pollen.common.administrator')}"/> + <legend><s:text name="pollen.fieldset.userInformation.toCreate"/></legend> + <s:textfield key="createUser.login" label="%{getText('pollen.common.login')}" required="true" size="40"/> + <s:textfield key="createUser.email" label="%{getText('pollen.common.email')}" required="true" size="40"/> + <s:textfield key="createUser.firstName" label="%{getText('pollen.common.firstName')}" size="40"/> + <s:textfield key="createUser.lastName" label="%{getText('pollen.common.lastName')}" size="40"/> + <s:checkbox key="createUser.administrator" label="%{getText('pollen.common.administrator')}"/> </fieldset> <br/> - <s:submit action="updateUser" key="pollen.action.validate" align="center"/> - + <s:submit action="create" key="pollen.action.create" align="center"/> </s:form> -<s:form id='createForm' method="POST" namespace="/admin" cssClass="hidden userForm"> +<s:form id='editForm' method="POST" namespace="/admin" cssClass="hidden userForm"> - <s:hidden name="action" value="create"/> + <s:hidden name="action" value="edit"/> + <s:hidden key="editUser.topiaId" label=""/> + <fieldset> - <legend><s:text name="pollen.fieldset.userInformation.toCreate"/></legend> - <s:textfield key="user.login" label="%{getText('pollen.common.login')}" required="true" size="40"/> - <s:textfield key="user.email" label="%{getText('pollen.common.email')}" required="true" size="40"/> - <s:textfield key="user.firstName" label="%{getText('pollen.common.firstName')}" size="40"/> - <s:textfield key="user.lastName" label="%{getText('pollen.common.lastName')}" size="40"/> - <s:checkbox key="user.administrator" label="%{getText('pollen.common.administrator')}"/> + <legend><s:text name="pollen.fieldset.userInformation.toUpdate"/></legend> + <s:textfield key="editUser.login" label="%{getText('pollen.common.login')}" required="true" readonly="true" size="40"/> + <s:textfield key="editUser.email" label="%{getText('pollen.common.email')}" required="true" size="40"/> + <s:textfield key="editUser.firstName" label="%{getText('pollen.common.firstName')}" size="40"/> + <s:textfield key="editUser.lastName" label="%{getText('pollen.common.lastName')}" size="40"/> + <s:checkbox key="editUser.administrator" label="%{getText('pollen.common.administrator')}"/> </fieldset> <br/> - <s:submit action="createUser" key="pollen.action.create" align="center"/> + <s:submit action="edit" key="pollen.action.validate" align="center"/> + </s:form> <s:form id='deleteForm' method="POST" namespace="/admin" cssClass="hidden userForm"> <s:hidden name="action" value="delete"/> - <s:hidden key="user.topiaId" label=""/> + <s:hidden key="deleteUser.topiaId" label=""/> <fieldset> <legend><s:text name="pollen.fieldset.userInformation.toDelete"/></legend> - <s:textfield key="user.login" label="%{getText('pollen.common.login')}" required="true" readonly="true" size="40"/> - <s:textfield key="user.email" label="%{getText('pollen.common.email')}" required="true" readonly="true" size="40"/> - <s:textfield key="user.firstName" label="%{getText('pollen.common.firstName')}" readonly="true" size="40"/> - <s:textfield key="user.lastName" label="%{getText('pollen.common.lastName')}" readonly="true" size="40"/> - <s:checkbox key="user.administrator" label="%{getText('pollen.common.administrator')}" disabled="true"/> + <s:textfield key="deleteUser.login" label="%{getText('pollen.common.login')}" required="true" readonly="true" size="40"/> + <s:textfield key="deleteUser.email" label="%{getText('pollen.common.email')}" required="true" readonly="true" size="40"/> + <s:textfield key="deleteUser.firstName" label="%{getText('pollen.common.firstName')}" readonly="true" size="40"/> + <s:textfield key="deleteUser.lastName" label="%{getText('pollen.common.lastName')}" readonly="true" size="40"/> + <s:checkbox key="deleteUser.administrator" label="%{getText('pollen.common.administrator')}" disabled="true"/> </fieldset> <br/> - <s:submit action="deleteUser" key="pollen.action.delete" align="center"/> + <s:submit action="delete" key="pollen.action.delete" align="center"/> </s:form> Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/clone.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/clone.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/clone.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>clone poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/clone.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/close.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/close.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/close.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>close poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/close.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,137 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<script type="text/javascript"> + + jQuery(document).ready(function () { + $('[name="poll.choiceAddAllowed"]').change(function(event) { + var val = $(this).prop('checked'); + if (val) { + $('#addChoiceAddAllowedPanel').show(); + } else { + $('#addChoiceAddAllowedPanel').hide(); + } + }); + + $('[name="limitChoice"]').change(function(event) { + var val = $(this).prop('checked'); + if (val) { + $('#maxChoiceNbPanel').show(); + } else { + $('#maxChoiceNbPanel').hide(); + } + }); + + $('[name="reminder"]').change(function(event) { + var val = $(this).prop('checked'); + if (val) { + $('#reminderPanel').show(); + } else { + $('#reminderPanel').hide(); + } + }); + + $('[name="notification"]').change(function(event) { + var val = $(this).prop('checked'); + if (val) { + $('#notificationPanel').show(); + } else { + $('#notificationPanel').hide(); + } + }); + + $('[name="poll.anonymous"]').change(function(event) { + var val = $(this).prop('checked'); + $('[name="poll.anonymousVoteAllowed"]').prop('checked', val); + }); + $('[name="poll.continuousResults"]').change(function(event) { + var val = $(this).prop('checked'); + $('[name="poll.publicResults"]').prop('checked', val); + }); + }); +</script> +<title><s:text name="pollen.title.createPoll"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.createPoll"/></h1> + +<s:form method="POST" key="registerForm" namespace="/poll"> + + <fieldset> + <legend><s:text name="pollen.fieldset.poll.you"/></legend> + <s:textfield key="poll.creator.name" label="%{getText('pollen.common.login')}" required="true"/> + <s:textfield key="poll.creator.email" label="%{getText('pollen.common.email')}"/> + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.poll.general"/></legend> + + <s:textfield key="poll.title" label="%{getText('pollen.common.title')}" required="true"/> + <s:textfield key="poll.description" label="%{getText('pollen.common.description')}"/> + <sj:datepicker key="poll.beginDate" label="%{getText('pollen.common.beginDate')}" displayFormat="dd/mm/yy"/> + <sj:datepicker key="poll.endDate" label="%{getText('pollen.common.endDate')}" displayFormat="dd/mm/yy"/> + <s:radio key='poll.pollType' list="pollTypes" label='%{getText("pollen.common.pollType")}' /> + <s:radio key='poll.voteCountingType' list="voteCountingTypes" label='%{getText("pollen.common.voteCountingType")}' /> + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.poll.options"/></legend> + + <s:checkbox key="poll.anonymous" label="%{getText('pollen.common.pollOption.anonymous')}" /> + <s:checkbox key="poll.anonymousVoteAllowed" label="%{getText('pollen.common.pollOption.anonymousVoteAllowed')}" /> + <s:checkbox key="poll.continuousResults" label="%{getText('pollen.common.pollOption.continuousResults')}" /> + <s:checkbox key="poll.publicResults" label="%{getText('pollen.common.pollOption.publicResults')}" /> + <s:checkbox key="poll.choiceAddAllowed" label="%{getText('pollen.common.pollOption.choiceAddAllowed')}" /> + <div id='addChoiceAddAllowedPanel' class="hidden"> + <sj:datepicker key="poll.beginChoiceDate" label="%{getText('pollen.common.beginChoiceDate')}" displayFormat="dd/mm/yy"/> + <sj:datepicker key="poll.endChoiceDate" label="%{getText('pollen.common.endChoiceDate')}" displayFormat="dd/mm/yy"/> + </div> + <s:checkbox key="limitChoice" label="%{getText('pollen.common.pollOption.limitChoice')}" /> + <div id='maxChoiceNbPanel' class="hidden"> + <s:textfield key="poll.maxChoiceNb" label="%{getText('pollen.common.pollOption.maxChoiceNb')}"/> + </div> + <s:checkbox key="notification" label="%{getText('pollen.common.pollOption.notification')}" /> + <div id='notificationPanel' class="hidden"> + <s:textfield key="notificationNumber" + label="%{getText('pollen.common.pollOption.notificationNumber')}" /> + </div> + <s:checkbox key="reminder" label="%{getText('pollen.common.pollOption.reminder')}" /> + <div id='reminderPanel' class="hidden"> + <s:textfield key="reminderHourCountdown" + label="%{getText('pollen.common.pollOption.reminderHourCountdown')}" /> + </div> + + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.poll.choices"/></legend> + <s:select key="poll.choiceType" label='%{getText("poll.common.select.choiceType")}' + list="choiceTypes" headerKey="" headerValue=""/> + + </fieldset> + + <br/> + <s:submit action="create" key="pollen.action.createPoll" align="center"/> +</s:form> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,137 +0,0 @@ -<%-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --%> -<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> -<script type="text/javascript"> - - jQuery(document).ready(function () { - $('[name="poll.choiceAddAllowed"]').change(function(event) { - var val = $(this).prop('checked'); - if (val) { - $('#addChoiceAddAllowedPanel').show(); - } else { - $('#addChoiceAddAllowedPanel').hide(); - } - }); - - $('[name="limitChoice"]').change(function(event) { - var val = $(this).prop('checked'); - if (val) { - $('#maxChoiceNbPanel').show(); - } else { - $('#maxChoiceNbPanel').hide(); - } - }); - - $('[name="reminder"]').change(function(event) { - var val = $(this).prop('checked'); - if (val) { - $('#reminderPanel').show(); - } else { - $('#reminderPanel').hide(); - } - }); - - $('[name="notification"]').change(function(event) { - var val = $(this).prop('checked'); - if (val) { - $('#notificationPanel').show(); - } else { - $('#notificationPanel').hide(); - } - }); - - $('[name="poll.anonymous"]').change(function(event) { - var val = $(this).prop('checked'); - $('[name="poll.anonymousVoteAllowed"]').prop('checked', val); - }); - $('[name="poll.continuousResults"]').change(function(event) { - var val = $(this).prop('checked'); - $('[name="poll.publicResults"]').prop('checked', val); - }); - }); -</script> -<title><s:text name="pollen.title.createPoll"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.createPoll"/></h1> - -<s:form method="POST" key="registerForm" namespace="/poll"> - - <fieldset> - <legend><s:text name="pollen.fieldset.poll.you"/></legend> - <s:textfield key="poll.creator.name" label="%{getText('pollen.common.login')}" required="true"/> - <s:textfield key="poll.creator.email" label="%{getText('pollen.common.email')}"/> - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.poll.general"/></legend> - - <s:textfield key="poll.title" label="%{getText('pollen.common.title')}" required="true"/> - <s:textfield key="poll.description" label="%{getText('pollen.common.description')}"/> - <sj:datepicker key="poll.beginDate" label="%{getText('pollen.common.beginDate')}" displayFormat="dd/mm/yy"/> - <sj:datepicker key="poll.endDate" label="%{getText('pollen.common.endDate')}" displayFormat="dd/mm/yy"/> - <s:radio key='poll.pollType' list="pollTypes" label='%{getText("pollen.common.pollType")}' /> - <s:radio key='poll.voteCountingType' list="voteCountingTypes" label='%{getText("pollen.common.voteCountingType")}' /> - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.poll.options"/></legend> - - <s:checkbox key="poll.anonymous" label="%{getText('pollen.common.pollOption.anonymous')}" /> - <s:checkbox key="poll.anonymousVoteAllowed" label="%{getText('pollen.common.pollOption.anonymousVoteAllowed')}" /> - <s:checkbox key="poll.continuousResults" label="%{getText('pollen.common.pollOption.continuousResults')}" /> - <s:checkbox key="poll.publicResults" label="%{getText('pollen.common.pollOption.publicResults')}" /> - <s:checkbox key="poll.choiceAddAllowed" label="%{getText('pollen.common.pollOption.choiceAddAllowed')}" /> - <div id='addChoiceAddAllowedPanel' class="hidden"> - <sj:datepicker key="poll.beginChoiceDate" label="%{getText('pollen.common.beginChoiceDate')}" displayFormat="dd/mm/yy"/> - <sj:datepicker key="poll.endChoiceDate" label="%{getText('pollen.common.endChoiceDate')}" displayFormat="dd/mm/yy"/> - </div> - <s:checkbox key="limitChoice" label="%{getText('pollen.common.pollOption.limitChoice')}" /> - <div id='maxChoiceNbPanel' class="hidden"> - <s:textfield key="poll.maxChoiceNb" label="%{getText('pollen.common.pollOption.maxChoiceNb')}"/> - </div> - <s:checkbox key="notification" label="%{getText('pollen.common.pollOption.notification')}" /> - <div id='notificationPanel' class="hidden"> - <s:textfield key="notificationNumber" - label="%{getText('pollen.common.pollOption.notificationNumber')}" /> - </div> - <s:checkbox key="reminder" label="%{getText('pollen.common.pollOption.reminder')}" /> - <div id='reminderPanel' class="hidden"> - <s:textfield key="reminderHourCountdown" - label="%{getText('pollen.common.pollOption.reminderHourCountdown')}" /> - </div> - - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.poll.choices"/></legend> - <s:select key="poll.choiceType" label='%{getText("poll.common.select.choiceType")}' - list="choiceTypes" headerKey="" headerValue=""/> - - </fieldset> - - <br/> - <s:submit action="createPoll" key="pollen.action.createPoll" align="center"/> -</s:form> Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/delete.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/delete.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/delete.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>delete poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/delete.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/edit.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/edit.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/edit.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>edit poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/edit.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/export.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/export.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/export.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>export poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/export.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>result poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/result.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,25 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<h2>vote poll TODO</h2> \ No newline at end of file Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -26,33 +26,33 @@ <script type="text/javascript" src="<s:url value='/js/gridHelper.js' />"></script> -<s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/> +<s:url id="loadUrl" action="getPolls" namespace="/json" method="input"/> -<s:url id="voteUrl" action="vote" namespace="/poll" escapeAmp="false"/> +<s:url id="voteUrl" action="vote" namespace="/poll" method="input"/> <s:url id='voteImg' value='/img/vote.png'/> <s:set id='voteTitle'><s:text name="pollen.action.pollVote"/></s:set> -<s:url id="resultUrl" action="result" namespace="/poll" escapeAmp="false"/> +<s:url id="resultUrl" action="result" namespace="/poll" method="input"/> <s:url id='resultImg' value='/img/count.png'/> <s:set id='resultTitle'><s:text name="pollen.action.pollResult"/></s:set> -<s:url id="editUrl" action="edit" namespace="/poll" escapeAmp="false"/> +<s:url id="editUrl" action="edit" namespace="/poll" method="input"/> <s:url id='editImg' value='/img/edit.png'/> <s:set id='editTitle'><s:text name="pollen.action.pollEdit"/></s:set> -<s:url id="closeUrl" action="close" namespace="/poll" escapeAmp="false"/> +<s:url id="closeUrl" action="close" namespace="/poll" method="input"/> <s:url id='closeImg' value='/img/close.png'/> <s:set id='closeTitle'><s:text name="pollen.action.pollClose"/></s:set> -<s:url id="exportUrl" action="export" namespace="/poll" escapeAmp="false"/> +<s:url id="exportUrl" action="export" namespace="/poll" method="input"/> <s:url id='exportImg' value='/img/export.png'/> <s:set id='exportTitle'><s:text name="pollen.action.pollExport"/></s:set> -<s:url id="cloneUrl" action="clone" namespace="/poll" escapeAmp="false"/> +<s:url id="cloneUrl" action="clone" namespace="/poll" method="input"/> <s:url id='cloneImg' value='/img/copy.png'/> <s:set id='cloneTitle'><s:text name="pollen.action.pollClone"/></s:set> -<s:url id="deleteUrl" action="delete" namespace="/poll" escapeAmp="false"/> +<s:url id="deleteUrl" action="delete" namespace="/poll" method="input"/> <s:url id='deleteImg' value='/img/delete.png'/> <s:set id='deleteTitle'><s:text name="pollen.action.pollDelete"/></s:set> Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,53 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title><s:text name="pollen.title.myAccount"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1> + +<s:form method="POST" namespace="/user"> + + <fieldset> + <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> + + <s:hidden key="user.topiaId" label=""/> + <s:textfield name="user.login" key="pollen.common.login" required="true"/> + <s:password name="user.password" key="pollen.common.password" + required="true"/> + <s:password name="newPassword" key="pollen.common.newPassword"/> + <s:password name="newPassword2" key="pollen.common.newPassword2"/> + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.userInformation"/></legend> + + <s:textfield name="user.email" key="pollen.common.email" required="true"/> + <s:textfield name="user.firstName" key="pollen.common.firstName"/> + <s:textfield name="user.lastName" key="pollen.common.lastName"/> + </fieldset> + <br/> + <s:submit action="edit" key="pollen.action.validate" align="center"/> +</s:form> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/edit.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,217 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% +--%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<s:url id="loadPollAccounts" action="getFavoriteListPollAccounts" + namespace="/json" escapeAmp="false"> + <s:param name="favoriteListId" value="%{favoriteListId}"/> +</s:url> + +<s:url id="loadPollAccount" action="getFavoriteListPollAccount" + namespace="/json"/> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + var action = '${action}'; + + if ('${action}' == 'create') { + $('#createForm').show(); + } else if ('${action}' == 'edit') { + $('#editForm').show(); + } else if ('${action}' == 'delete') { + $('#deleteForm').show(); + } + + // listen row selection + $.addRowSelectTopic('pollAccounts'); + + $.addClearSelectTopic('pollAccounts', function () { + if (action != '') { + // come back from action + action = ''; + return; + } + $(".pollAccountForm").hide(); + }); + + // to create a new row + $.listenRowTopic('pollAccounts-addRow', function (event) { + $('#createForm [name="createPollAccount.votingId"]').val(""); + $('#createForm [name="createPollAccount.email"]').val(""); + $('#deleteForm').hide(); + $('#editForm').hide(); + $('#createForm').show(); + }); + + // to edit the selected row + $.listenRowTopic('pollAccounts-editRow', function (event) { + var id = $.getSelectedId('pollAccounts'); + if (!id) { + + // no row selected + return; + } + + jQuery.getJSON("${loadPollAccount}", { "pollAccountId":id }, + function (result) { + + var pollAccount = result.pollAccount; + $('#editForm [name="editPollAccount.topiaId"]').val(pollAccount.id); + $('#editForm [name="editPollAccount.votingId"]').val(pollAccount.votingId); + $('#editForm [name="editPollAccount.email"]').val(pollAccount.email); + $('#deleteForm').hide(); + $('#createForm').hide(); + $('#editForm').show(); + } + ); + }); + + // to delete the selected row + $.listenRowTopic('pollAccounts-deleteRow', function (event) { + var id = $.getSelectedId('pollAccounts'); + if (!id) { + + // no row selected + return; + } + + jQuery.getJSON("${loadPollAccount}", { "pollAccountId":id }, + function (result) { + + var pollAccount = result.pollAccount; + $('#deleteForm [name="deletePollAccount.topiaId"]').val(pollAccount.id); + $('#deleteForm [name="deletePollAccount.votingId"]').val(pollAccount.votingId); + $('#deleteForm [name="deletePollAccount.email"]').val(pollAccount.email); + $('#editForm').hide(); + $('#createForm').hide(); + $('#deleteForm').show(); + } + ); + }); + }); +</script> + +<title> + <s:text name="pollen.title.editFavoriteList"/> ${favoriteList.name} +</title> + +<h1 class="title${pageLogo}"> + <s:text name="pollen.title.editFavoriteList"/> ${favoriteList.name} +</h1> + +<sjg:grid id="pollAccounts" dataType="json" href="%{loadPollAccounts}" + gridModel="pollAccounts" sortable="true" pager="true" + pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='pollAccounts-rowSelect' editinline="false" + onCompleteTopics='pollAccounts-clearSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" viewrecords="true" + rowList="10,15,20,50,100" rowNum="10" + navigatorExtraButtons="{ + add: { title: '%{getText(\"pollen.action.createPollAccount\")}', icon: 'ui-icon-plus', topic: 'pollAccounts-addRow' }, + edit: { title: '%{getText(\"pollen.action.editPollAccount\")}', icon: 'ui-icon-pencil', topic: 'pollAccounts-editRow' }, + delete:{ title: '%{getText(\"pollen.action.deletePollAccount\")}', icon: 'ui-icon-trash', topic: 'pollAccounts-deleteRow'}}"> + + <sjg:gridColumn name="id" title="id" hidden="true"/> + <sjg:gridColumn name="votingId" title='%{getText("pollen.common.name")}'/> + <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}'/> +</sjg:grid> + +<br/> + +<s:form id='createForm' method="POST" namespace="/user" + cssClass="hidden pollAccountForm"> + + <s:hidden name="action" value="create"/> + <s:hidden key="favoriteListId" label=""/> + <fieldset> + <legend> + <s:text name="pollen.fieldset.pollAccount.toAddToFavoriteList"/> + </legend> + <s:textfield key="createPollAccount.votingId" required="true" + label="%{getText('pollen.common.name')}" size="40"/> + <s:textfield key="createPollAccount.email" required="true" + label="%{getText('pollen.common.email')}" size="40"/> + + </fieldset> + <br/> + <s:submit action="addPollAccount" + key="pollen.action.create" align="center"/> +</s:form> + +<s:form id='editForm' method="POST" namespace="/user" + cssClass="hidden pollAccountForm"> + + <s:hidden name="action" value="edit"/> + <s:hidden key="editPollAccount.topiaId" label=""/> + <s:hidden key="favoriteListId" label=""/> + + <fieldset> + <legend> + <s:text name="pollen.fieldset.pollAccount.toEditToFavoriteList"/> + </legend> + <s:textfield key="editPollAccount.votingId" required="true" + label="%{getText('pollen.common.name')}" size="40"/> + <s:textfield key="editPollAccount.email" required="true" + label="%{getText('pollen.common.email')}" size="40"/> + </fieldset> + <br/> + <s:submit action="editPollAccount" key="pollen.action.validate" + align="center"/> +</s:form> + +<s:form id='deleteForm' method="POST" namespace="/user" + cssClass="hidden pollAccountForm"> + + <s:hidden name="action" value="delete"/> + <s:hidden key="deletePollAccount.topiaId" label=""/> + <s:hidden key="favoriteListId" label=""/> + + <fieldset> + <legend> + <s:text name="pollen.fieldset.pollAccount.toDeleteFromFavoriteList"/> + </legend> + <s:textfield key="deletePollAccount.votingId" required="true" size="40" + label="%{getText('pollen.common.name')}" readonly="true"/> + <s:textfield key="deletePollAccount.email" required="true" readonly="true" + label="%{getText('pollen.common.email')}" size="40"/> + </fieldset> + <br/> + + <s:submit action="removePollAccount" key="pollen.action.delete" align="center"/> +</s:form> + +<br/> +<s:form method="POST" namespace="/user"> + + <s:submit action="favoriteLists" + key="pollen.action.backToFavoriteLists" align="center"/> +</s:form> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteList.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,172 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% +--%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<title><s:text name="pollen.title.favoriteLists"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.favoriteLists"/></h1> + +<s:url id="loadFavoriteLists" action="getFavoriteLists" namespace="/json"/> +<s:url id="loadFavoriteList" action="getFavoriteList" namespace="/json"/> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + var action = '${action}'; + + if ('${action}' == 'create') { + $('#createForm').show(); + } else if ('${action}' == 'delete') { + $('#deleteForm').show(); + } + + // listen row selection + $.addRowSelectTopic('favoriteLists'); + + $.addClearSelectTopic('favoriteLists', function () { + if (action != '') { + // come back from action + action = ''; + return; + } + $(".userForm").hide(); + }); + + // to create a new row + $.listenRowTopic('favoriteLists-addRow', function (event) { + + $('#createForm .errorMessage').hide(); + $('#createForm [name="favoriteList.name"]').val(""); + $('#createForm [name="csvImport"]').val(""); + $('#createForm [name="ldapImport"]').val(""); + $('#deleteForm').hide(); + $('#createForm').show(); + }); + + // to edit a selected row + $.listenRowTopic('favoriteLists-editRow', function (event) { + var id = $.getSelectedId('favoriteLists'); + if (!id) { + // no row selected + return; + } + + $('#editForm [name="favoriteListId"]').val(id); + $('#editForm').submit(); + }); + + // to delete the selected row + $.listenRowTopic('favoriteLists-deleteRow', function (event) { + var id = $.getSelectedId('favoriteLists'); + if (!id) { + // no row selected + return; + } + jQuery.getJSON("${loadFavoriteList}", { favoriteListId:id }, + function (result) { + var user = result.favoriteList; + $('#deleteForm [name="deleteFavoriteList.topiaId"]').val(user.id); + $('#deleteForm [name="deleteFavoriteList.name"]').val(user.name); + $('#createForm').hide(); + $('#deleteForm').show(); + } + ); + }); + }); +</script> + +<sjg:grid id="favoriteLists" dataType="json" href="%{loadFavoriteLists}" + gridModel="favoriteLists" sortable="true" pager="true" + pagerButtons="true" pagerInput="true" navigator="true" + rownumbers="false" autowidth="true" viewrecords="true" + onSelectRowTopics='favoriteLists-rowSelect' + onCompleteTopics='favoriteLists-clearSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" rowList="10,15,20,50,100" rowNum="10" + navigatorExtraButtons="{ + add: { title: '%{getText(\"pollen.action.createFavoriteList\")}', icon: 'ui-icon-plus', topic: 'favoriteLists-addRow' }, + edit: { title: '%{getText(\"pollen.action.editFavoriteList\")}', icon: 'ui-icon-pencil', topic: 'favoriteLists-editRow' }, + delete:{ title: '%{getText(\"pollen.action.deleteFavoriteList\")}', icon: 'ui-icon-trash', topic: 'favoriteLists-deleteRow'}}"> + + <sjg:gridColumn name="id" title="id" hidden="true"/> + <sjg:gridColumn name="name" title='%{getText("pollen.common.name")}'/> + <sjg:gridColumn name="nbAccounts" + title='%{getText("pollen.common.nbAccounts")}'/> +</sjg:grid> + +<br/> +<s:form id='createForm' method="POST" namespace="/user" + cssClass="hidden favoriteForm"> + + <s:hidden name="action" value="create"/> + <fieldset> + <legend> + <s:text name="pollen.fieldset.userFavoriteList.toCreate"/> + </legend> + <s:textfield key="createFavoriteList.name" required="true" size="40" + label="%{getText('pollen.common.name')}"/> + <s:file key="csvImport" label="%{getText('pollen.common.csvImport')}"/> + <s:textfield key="ldapImport" label="%{getText('pollen.common.ldapImport')}" + size="40"/> + </fieldset> + <br/> + <s:submit action="createFavoriteList" key="pollen.action.create" + align="center"/> +</s:form> + +<s:form id='deleteForm' method="POST" namespace="/user" + cssClass="hidden favoriteForm"> + + <s:hidden name="action" value="delete"/> + <s:hidden key="deleteFavoriteList.topiaId" label=""/> + + <fieldset> + <legend> + <s:text name="pollen.fieldset.userFavoriteList.toDelete"/> + </legend> + <s:textfield key="deleteFavoriteList.name" required="true" readonly="true" + size="40" label="%{getText('pollen.common.name')}"/> + + </fieldset> + <br/> + <s:submit action="deleteFavoriteList" key="pollen.action.delete" + align="center"/> +</s:form> + +<s:form id='editForm' method="POST" namespace="/user" + action="editFavoriteList" theme="simple" + cssClass="hidden"> + + <s:hidden key="favoriteListId" label=""/> + <s:submit action="editFavoriteList"/> + +</s:form> + + + Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/favoriteLists.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,50 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title><s:text name="pollen.title.register"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.register"/></h1> + +<s:form method="POST" key="registerForm"> + + <fieldset> + <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> + + <s:textfield name="user.login" key="pollen.common.login" required="true"/> + <s:password name="user.password" key="pollen.common.password" required="true"/> + <s:password name="password2" key="pollen.common.password2" required="true"/> + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.userInformation"/></legend> + + <s:textfield name="user.email" key="pollen.common.email" required="true"/> + <s:textfield name="user.firstName" key="pollen.common.firstName"/> + <s:textfield name="user.lastName" key="pollen.common.lastName"/> + </fieldset> + <br/> + <s:submit action="register" key="pollen.action.register" align="center"/> +</s:form> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/register.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,50 +0,0 @@ -<%-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --%> -<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title><s:text name="pollen.title.register"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.register"/></h1> - -<s:form method="POST" key="registerForm"> - - <fieldset> - <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> - - <s:textfield name="user.login" key="pollen.common.login" required="true"/> - <s:password name="user.password" key="pollen.common.password" required="true"/> - <s:password name="password2" key="pollen.common.password2" required="true"/> - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation"/></legend> - - <s:textfield name="user.email" key="pollen.common.email" required="true"/> - <s:textfield name="user.firstName" key="pollen.common.firstName"/> - <s:textfield name="user.lastName" key="pollen.common.lastName"/> - </fieldset> - <br/> - <s:submit action="registerUser" key="pollen.action.register" align="center"/> -</s:form> Copied: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp (from rev 3124, branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp) =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp (rev 0) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -0,0 +1,50 @@ +<%-- + #%L + Pollen :: UI (strust2) + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --%> +<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title><s:text name="pollen.title.myAccount"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1> + +<s:form method="POST" namespace="/user"> + + <fieldset> + <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> + + <s:hidden key="user.topiaId" label="" /> + <s:label name="user.login" key="pollen.common.login"/> + </fieldset> + + <fieldset> + <legend><s:text name="pollen.fieldset.userInformation"/></legend> + + <s:label name="user.email" key="pollen.common.email" /> + <s:label name="user.firstName" key="pollen.common.firstName" /> + <s:label name="user.lastName" key="pollen.common.lastName" /> + </fieldset> + <br/> + <s:submit action="edit" method="input" + key="pollen.action.modify" align="center"/> +</s:form> Property changes on: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/show.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,50 +0,0 @@ -<%-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --%> -<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title><s:text name="pollen.title.myAccount"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1> - -<s:form method="POST"> - - <fieldset> - <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> - - <s:hidden key="user.topiaId" label="" /> - <s:label name="user.login" key="pollen.common.login"/> - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation"/></legend> - - <s:label name="user.email" key="pollen.common.email" /> - <s:label name="user.firstName" key="pollen.common.firstName" /> - <s:label name="user.lastName" key="pollen.common.lastName" /> - </fieldset> - <br/> - <s:submit action="updateUser" method="input" - key="pollen.action.modify" align="center"/> -</s:form> Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp 2012-01-31 21:01:08 UTC (rev 3125) @@ -1,53 +0,0 @@ -<%-- - #%L - Pollen :: UI (strust2) - - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2012 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --%> -<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - -<title><s:text name="pollen.title.myAccount"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.myAccount"/></h1> - -<s:form method="POST"> - - <fieldset> - <legend><s:text name="pollen.fieldset.connexionInformation"/></legend> - - <s:hidden key="user.topiaId" label=""/> - <s:textfield name="user.login" key="pollen.common.login" required="true"/> - <s:password name="user.password" key="pollen.common.password" - required="true"/> - <s:password name="newPassword" key="pollen.common.newPassword"/> - <s:password name="newPassword2" key="pollen.common.newPassword2"/> - </fieldset> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation"/></legend> - - <s:textfield name="user.email" key="pollen.common.email" required="true"/> - <s:textfield name="user.firstName" key="pollen.common.firstName"/> - <s:textfield name="user.lastName" key="pollen.common.lastName"/> - </fieldset> - <br/> - <s:submit action="updateUser" key="pollen.action.validate" align="center"/> -</s:form> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/web.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/web.xml 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/web.xml 2012-01-31 21:01:08 UTC (rev 3125) @@ -27,7 +27,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - <display-name>EchoBase</display-name> + <display-name>Pollen</display-name> <filter> <filter-name>topiaTransaction</filter-name> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/js/gridHelper.js =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/js/gridHelper.js 2012-01-30 23:53:24 UTC (rev 3124) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/js/gridHelper.js 2012-01-31 21:01:08 UTC (rev 3125) @@ -81,6 +81,13 @@ } }, {id:gridId, callback:callback}); }, + getSelectedId: function(gridId) { + var result = $.struts2_jquery[gridId] + if(result) { + result = result['selectedRow']; + } + return result; + }, // addAddRowTopic:function (gridId, url) { // $.subscribe(gridId + '-rowAdd', function (event) { @@ -191,6 +198,9 @@ addMultiRowTopic:function (gridId, action, target, checkboxName, calbback) { return $(document).addMultiRowTopic(gridId, action, target, checkboxName, calbback); }, + getSelectedId: function(gridId) { + return $(document).getSelectedId(gridId); + }, serializeCheckboxs:function (id, params, newId) { return $(document).serializeCheckboxs(id, params, newId); },
participants (1)
-
tchemit@users.chorem.org