r3110 - in branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui java/org/chorem/pollen/ui/actions java/org/chorem/pollen/ui/actions/admin java/org/chorem/pollen/ui/actions/poll java/org/chorem/pollen/ui/actions/user resources resources/config resources/i18n resources/org/chorem/pollen/ui/actions/admin webapp/WEB-INF/jsp webapp/WEB-INF/jsp/admin webapp/WEB-INF/jsp/poll webapp/WEB-INF/jsp/user
Author: tchemit Date: 2012-01-23 23:31:35 +0100 (Mon, 23 Jan 2012) New Revision: 3110 Url: http://chorem.org/repositories/revision/pollen/3110 Log: - simplify user admin - creates poll, user packages - impact fro services api modification Added: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Logout.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp Removed: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/CreatePoll.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayCreatedPolls.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayParticipatedPolls.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPoll.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPollResult.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Login.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Logout.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/RegisterUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/ShowUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/UpdateUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/CreateUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/UpdateUser.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/CreateUser-validation.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/UpdateUser-validation.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/createPoll.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/login.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollsList.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/registerUser.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/showUser.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/updateUser.jsp branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/usersList.jsp Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenApplicationListener.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-admin.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-poll.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-user.xml branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/struts.xml Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenApplicationListener.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenApplicationListener.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenApplicationListener.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -23,14 +23,12 @@ */ package org.chorem.pollen.ui; -import org.apache.commons.collections.MapUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.pollen.PollenConfiguration; import org.chorem.pollen.PollenTechnicalException; -import org.chorem.pollen.PollenTopiaRootContextSupplierFactory; +import org.chorem.pollen.PollenTopiaRootContextFactory; import org.chorem.pollen.entity.Poll; -import org.chorem.pollen.entity.UserAccount; import org.chorem.pollen.services.PollenServiceContext; import org.chorem.pollen.services.PollenServiceContextImpl; import org.chorem.pollen.services.PollenServiceFactory; @@ -41,14 +39,12 @@ import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; import org.nuiton.topia.framework.TopiaContextImplementor; -import org.nuiton.topia.framework.TopiaFilter; import org.nuiton.topia.framework.TopiaUtil; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import java.util.Date; import java.util.Locale; -import java.util.Map; /** * To listen start or end of the application. @@ -92,8 +88,8 @@ if (log.isInfoEnabled()) { log.info("Initializing RootContextSupplier..."); } - PollenTopiaRootContextSupplierFactory factory = - new PollenTopiaRootContextSupplierFactory(); + PollenTopiaRootContextFactory factory = + new PollenTopiaRootContextFactory(); rootContext = factory.newDatabaseFromConfig(configuration); applicationContext.setRootContext(rootContext); @@ -154,9 +150,9 @@ UserService service = serviceFactory.newService(UserService.class, serviceContext); - Map<String, UserAccount> users = service.getUsers(new TopiaFilter()); + int nbUsers = service.getNbUsers(); - if (MapUtils.isEmpty(users)) { + if (nbUsers == 0) { // no users in database create the admin user if (log.isInfoEnabled()) { Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/CreatePoll.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/CreatePoll.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/CreatePoll.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,72 +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; - -import org.chorem.pollen.entity.Poll; -import org.chorem.pollen.entity.PollImpl; -import org.chorem.pollen.services.PollService; -import org.nuiton.topia.TopiaException; - -/** - * Creates a new poll. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class CreatePoll extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected Poll poll; - - public String getPageLogo() { - return "Creation"; - } - - public Poll getPoll() { - if (poll == null) { - poll = new PollImpl(); - } - return poll; - } - - @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; - - } -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayCreatedPolls.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayCreatedPolls.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayCreatedPolls.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,35 +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; - -/** - * Display list of created polls. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayCreatedPolls extends PollenActionSupport { - - private static final long serialVersionUID = 1L; -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayParticipatedPolls.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayParticipatedPolls.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayParticipatedPolls.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,35 +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; - -/** - * Display list of participated polls. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayParticipatedPolls extends PollenActionSupport { - - private static final long serialVersionUID = 1L; -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPoll.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPoll.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPoll.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,35 +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; - -/** - * 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-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPollResult.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPollResult.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPollResult.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,35 +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; - -/** - * Display results of a poll. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DisplayPollResult extends PollenActionSupport { - - private static final long serialVersionUID = 1L; -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Login.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Login.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Login.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,82 +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; - -import com.opensymphony.xwork2.interceptor.annotations.InputConfig; -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.services.UserInvalidPasswordException; -import org.chorem.pollen.services.UserNotFoundException; -import org.chorem.pollen.services.UserService; - -/** - * Login user to pollen. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class Login extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected String login; - - protected String password; - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @InputConfig(resultName = "error") - @Override - public String execute() throws Exception { - - UserService service = newService(UserService.class); - - try { - UserAccount userAccount = service.connect(login, password); - getPollenSession().setUserAccount(userAccount); - addActionMessage(_("pollen.information.your.are.loggued")); - return SUCCESS; - } catch (UserNotFoundException e) { - addActionError(_("pollen.error.user.bad.login.or.password")); - } catch (UserInvalidPasswordException e) { - addActionError(_("pollen.error.user.bad.login.or.password")); - } - - // if error go back to input - return ERROR; - } -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Logout.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Logout.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Logout.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,43 +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; - -/** - * Logout from pollen. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class Logout extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - @Override - public String execute() throws Exception { - - getPollenSession().setUserAccount(null); - - return SUCCESS; - } -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/RegisterUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/RegisterUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/RegisterUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,91 +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; - -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.entity.UserAccountImpl; -import org.chorem.pollen.services.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.UserLoginAlreadyUsedException; -import org.chorem.pollen.services.UserService; - -/** - * 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) { - user = new UserAccountImpl(); - } - 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; - } -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/ShowUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/ShowUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/ShowUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,46 +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; - -import org.chorem.pollen.entity.UserAccount; - -/** - * 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-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/UpdateUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/UpdateUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/UpdateUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,113 +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; - -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.entity.UserAccountImpl; -import org.chorem.pollen.services.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.UserInvalidPasswordException; -import org.chorem.pollen.services.UserService; - -/** - * 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) { - user = new UserAccountImpl(); - } - 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.setAdmin(getPollenSession().getUserAccount().isAdmin()); - - 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; - } - -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/CreateUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/CreateUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/CreateUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,57 +0,0 @@ -package org.chorem.pollen.ui.actions.admin; - -import com.google.common.base.Preconditions; -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.entity.UserAccountImpl; -import org.chorem.pollen.services.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.UserLoginAlreadyUsedException; -import org.chorem.pollen.services.UserService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Create a user informations from users admin screen. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class CreateUser extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected UserAccount createUser; - - public UserAccount getCreateUser() { - if (createUser == null) { - createUser = new UserAccountImpl(); - } - return createUser; - } - - public boolean isCreateUserNotNull() { - return createUser !=null; - } - - @Override - public String execute() throws Exception { - - Preconditions.checkNotNull(createUser); - - UserService service = newService(UserService.class); - - try { - service.createUser(createUser, true, getApplicationUrl()); - getTransaction().commitTransaction(); - addActionMessage( - _("pollen.information.user.created", createUser.getDisplayName())); - // remove this user, otherwise it will be reused in the user lists - createUser = null; - return SUCCESS; - } catch (UserLoginAlreadyUsedException e) { - addFieldError("createUser.login", _("pollen.error.user.login.already.used")); - } catch (UserEmailAlreadyUsedException e) { - addFieldError("createUser.email", _("pollen.error.user.email.already.used")); - } - - return INPUT; - } -} Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/DeleteUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,49 +0,0 @@ -package org.chorem.pollen.ui.actions.admin; - -import com.google.common.base.Preconditions; -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.entity.UserAccountImpl; -import org.chorem.pollen.services.UserService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Delete a user. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class DeleteUser extends PollenActionSupport { - - private static final long serialVersionUID = 1L; - - protected UserAccount deleteUser; - - public UserAccount getDeleteUser() { - if (deleteUser == null) { - deleteUser = new UserAccountImpl(); - } - return deleteUser; - } - - public boolean isDeleteUserNotNull() { - return deleteUser !=null; - } - - @Override - public String execute() throws Exception { - - Preconditions.checkNotNull(deleteUser); - - UserService service = newService(UserService.class); - - service.deleteUser(deleteUser.getLogin()); - getTransaction().commitTransaction(); - - addActionMessage( - _("pollen.information.user.deleted", deleteUser.getDisplayName())); - - // remove this user, otherwise it will be reused in the user lists - deleteUser = null; - return SUCCESS; - } -} Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/ManageUsers.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -23,14 +23,108 @@ */ package org.chorem.pollen.ui.actions.admin; +import com.google.common.base.Preconditions; +import org.chorem.pollen.entity.UserAccount; +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.UserService; import org.chorem.pollen.ui.actions.PollenActionSupport; /** - * * @author tchemit <chemit@codelutin.com> * @since 2.0 */ public class ManageUsers extends PollenActionSupport { private static final long serialVersionUID = 1L; + + protected String action; + + protected UserAccount user; + + public UserAccount getUser() { + if (user == null) { + UserService service = newService(UserService.class); + user = service.getNewUser(); + } + return user; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String createUser() throws Exception { + + Preconditions.checkNotNull(user); + + UserService service = newService(UserService.class); + + try { + service.createUser(user, true, getApplicationUrl()); + getTransaction().commitTransaction(); + addActionMessage( + _("pollen.information.user.created", user.getDisplayName())); + // remove this user, otherwise it will be reused in the user lists + user = null; + action = null; + 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")); + } + + return INPUT; + } + + public String updateUser() throws Exception { + + Preconditions.checkNotNull(user); + + UserService service = newService(UserService.class); + + try { + service.updateUser(user, null, true); + getTransaction().commitTransaction(); + addActionMessage( + _("pollen.information.user.updated", user.getDisplayName())); + + // remove this user, otherwise it will be reused in the user lists + user = null; + action = null; + 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")); + } + + return INPUT; + } + + public String deleteUser() throws Exception { + + Preconditions.checkNotNull(user); + + UserService service = newService(UserService.class); + + service.deleteUser(user.getLogin()); + 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; + } + + } Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/UpdateUser.java =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/UpdateUser.java 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/UpdateUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,58 +0,0 @@ -package org.chorem.pollen.ui.actions.admin; - -import com.google.common.base.Preconditions; -import org.chorem.pollen.entity.UserAccount; -import org.chorem.pollen.entity.UserAccountImpl; -import org.chorem.pollen.services.UserEmailAlreadyUsedException; -import org.chorem.pollen.services.UserInvalidPasswordException; -import org.chorem.pollen.services.UserService; -import org.chorem.pollen.ui.actions.PollenActionSupport; - -/** - * Update a user informations from users admin screen. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.0 - */ -public class UpdateUser extends PollenActionSupport { - - private static final long serialVersionUID = 7738596310901970593L; - - protected UserAccount updateUser; - - public UserAccount getUpdateUser() { - if (updateUser == null) { - updateUser = new UserAccountImpl(); - } - return updateUser; - } - - public boolean isUpdateUserNotNull() { - return updateUser !=null; - } - - @Override - public String execute() throws Exception { - - Preconditions.checkNotNull(updateUser); - - UserService service = newService(UserService.class); - - try { - service.updateUser(updateUser, null, true); - getTransaction().commitTransaction(); - addActionMessage( - _("pollen.information.user.updated", updateUser.getDisplayName())); - - // remove this user, otherwise it will be reused in the user lists - updateUser = null; - return SUCCESS; - } catch (UserEmailAlreadyUsedException e) { - addFieldError("updateUser.email", _("pollen.error.user.email.already.used")); - } catch (UserInvalidPasswordException e) { - addFieldError("updateUser.password", _("pollen.error.user.invalid.password")); - } - - return INPUT; - } -} Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/CreatePoll.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,72 @@ +/* + * #%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.entity.Poll; +import org.chorem.pollen.entity.PollImpl; +import org.chorem.pollen.services.PollService; +import org.chorem.pollen.ui.actions.PollenActionSupport; +import org.nuiton.topia.TopiaException; + +/** + * Creates a new poll. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class CreatePoll extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + protected Poll poll; + + public String getPageLogo() { + return "Creation"; + } + + public Poll getPoll() { + if (poll == null) { + poll = new PollImpl(); + } + return poll; + } + + @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; + + } +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayCreatedPolls.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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 list of created polls. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class DisplayCreatedPolls extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayCreatedPolls.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayParticipatedPolls.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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 list of participated polls. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class DisplayParticipatedPolls extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayParticipatedPolls.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPoll.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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 DisplayPoll extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPoll.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/DisplayPollResult.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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 DisplayPollResult extends PollenActionSupport { + + private static final long serialVersionUID = 1L; +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/DisplayPollResult.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Login.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,83 @@ +/* + * #%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.opensymphony.xwork2.interceptor.annotations.InputConfig; +import org.chorem.pollen.entity.UserAccount; +import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; +import org.chorem.pollen.services.exceptions.UserNotFoundException; +import org.chorem.pollen.services.UserService; +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Login user to pollen. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Login extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + protected String login; + + protected String password; + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @InputConfig(resultName = "error") + @Override + public String execute() throws Exception { + + UserService service = newService(UserService.class); + + try { + UserAccount userAccount = service.connect(login, password); + getPollenSession().setUserAccount(userAccount); + addActionMessage(_("pollen.information.your.are.loggued")); + return SUCCESS; + } catch (UserNotFoundException e) { + addActionError(_("pollen.error.user.bad.login.or.password")); + } catch (UserInvalidPasswordException e) { + addActionError(_("pollen.error.user.bad.login.or.password")); + } + + // if error go back to input + return ERROR; + } +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Logout.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/Logout.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Logout.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Logout.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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% + */ +package org.chorem.pollen.ui.actions.user; + +import org.chorem.pollen.ui.actions.PollenActionSupport; + +/** + * Logout from pollen. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.0 + */ +public class Logout extends PollenActionSupport { + + private static final long serialVersionUID = 1L; + + @Override + public String execute() throws Exception { + + getPollenSession().setUserAccount(null); + + return SUCCESS; + } +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Logout.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java (from rev 3106, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/RegisterUser.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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.entity.UserAccount; +import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; +import org.chorem.pollen.services.exceptions.UserLoginAlreadyUsedException; +import org.chorem.pollen.services.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; + } +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/RegisterUser.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/ShowUser.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -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.entity.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(); + } + +} Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ShowUser.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/UpdateUser.java) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,114 @@ +/* + * #%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.entity.UserAccount; +import org.chorem.pollen.services.exceptions.UserEmailAlreadyUsedException; +import org.chorem.pollen.services.exceptions.UserInvalidPasswordException; +import org.chorem.pollen.services.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.setAdmin(getPollenSession().getUserAccount().isAdmin()); + + 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-2.0-beta-1/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/UpdateUser.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-admin.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-admin.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-admin.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -37,39 +37,39 @@ <!-- 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/usersList.jsp</result> + <!--<interceptor-ref name="pollenBasicAdminStack"/>--> + <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> </action> <!-- create user --> - <action name="createUser" - class="org.chorem.pollen.ui.actions.admin.CreateUser"> + <action name="createUser" method="createUser" + class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> - <result name="input">/WEB-INF/jsp/usersList.jsp</result> - <result>/WEB-INF/jsp/usersList.jsp</result> + <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> + <result>/WEB-INF/jsp/admin/usersList.jsp</result> </action> <!-- save user --> - <action name="updateUser" - class="org.chorem.pollen.ui.actions.admin.UpdateUser"> + <action name="updateUser" method="updateUser" + class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> - <result name="input">/WEB-INF/jsp/usersList.jsp</result> - <result>/WEB-INF/jsp/usersList.jsp</result> + <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> + <result>/WEB-INF/jsp/admin/usersList.jsp</result> </action> <!-- delete user --> - <action name="deleteUser" - class="org.chorem.pollen.ui.actions.admin.DeleteUser"> + <action name="deleteUser" method="deleteUser" + class="org.chorem.pollen.ui.actions.admin.ManageUsers"> <interceptor-ref name="pollenParamsPrepareParamsAdminStack"/> - <result name="input">/WEB-INF/jsp/usersList.jsp</result> - <result>/WEB-INF/jsp/usersList.jsp</result> + <result name="input">/WEB-INF/jsp/admin/usersList.jsp</result> + <result>/WEB-INF/jsp/admin/usersList.jsp</result> </action> <!-- 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/pollsList.jsp</result> + <!--<interceptor-ref name="pollenBasicAdminStack"/>--> + <result name="input">/WEB-INF/jsp/admin/pollsList.jsp</result> </action> </package> Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-poll.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -35,35 +35,35 @@ <!-- create poll --> <action name="createPoll" - class="org.chorem.pollen.ui.actions.CreatePoll"> - <result name="input">/WEB-INF/jsp/createPoll.jsp</result> + class="org.chorem.pollen.ui.actions.poll.CreatePoll"> + <result name="input">/WEB-INF/jsp/poll/createPoll.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display poll --> <action name="displayPoll" - class="org.chorem.pollen.ui.actions.DisplayPoll"> + class="org.chorem.pollen.ui.actions.poll.DisplayPoll"> <result name="input">/WEB-INF/jsp/poll.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display poll result --> <action name="displayPollResult" - class="org.chorem.pollen.ui.actions.DisplayPollResult"> + class="org.chorem.pollen.ui.actions.poll.DisplayPollResult"> <result name="input">/WEB-INF/jsp/pollResult.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display createds polls --> <action name="displayCreatedPolls" - class="org.chorem.pollen.ui.actions.DisplayCreatedPolls"> + class="org.chorem.pollen.ui.actions.poll.DisplayCreatedPolls"> <result name="input">/WEB-INF/jsp/createdPolls.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> <!-- display participated polls --> <action name="displayParticipatedPolls" - class="org.chorem.pollen.ui.actions.DisplayParticipatedPolls"> + class="org.chorem.pollen.ui.actions.poll.DisplayParticipatedPolls"> <result name="input">/WEB-INF/jsp/participatedPolls.jsp</result> <result>/WEB-INF/jsp/home.jsp</result> </action> Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-user.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/config/struts-user.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -33,28 +33,28 @@ <package name="user" extends="default" namespace="/user"> <!-- login --> - <action name="login" class="org.chorem.pollen.ui.actions.Login"> + <action name="login" class="org.chorem.pollen.ui.actions.user.Login"> <result name="error">/WEB-INF/jsp/home.jsp</result> <result type="redirectToHome"/> </action> <!-- register user --> <action name="registerUser" - class="org.chorem.pollen.ui.actions.RegisterUser"> - <result name="input">/WEB-INF/jsp/registerUser.jsp</result> + class="org.chorem.pollen.ui.actions.user.RegisterUser"> + <result name="input">/WEB-INF/jsp/user/registerUser.jsp</result> <result type="redirectToHome"/> </action> <!-- show user account --> <action name="showUser" - class="org.chorem.pollen.ui.actions.ShowUser"> - <result>/WEB-INF/jsp/showUser.jsp</result> + class="org.chorem.pollen.ui.actions.user.ShowUser"> + <result>/WEB-INF/jsp/user/showUser.jsp</result> </action> <!-- modify user account --> <action name="updateUser" - class="org.chorem.pollen.ui.actions.UpdateUser"> - <result name="input">/WEB-INF/jsp/updateUser.jsp</result> + class="org.chorem.pollen.ui.actions.user.UpdateUser"> + <result name="input">/WEB-INF/jsp/user/updateUser.jsp</result> <result type="redirectAction"> <param name="actionName">showUser</param> <param name="namespace">/user</param> @@ -62,7 +62,7 @@ </action> <!-- logout --> - <action name="logout" class="org.chorem.pollen.ui.actions.Logout"> + <action name="logout" class="org.chorem.pollen.ui.actions.user.Logout"> <result type="redirectToHome"/> </action> Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-01-23 22:31:35 UTC (rev 3110) @@ -32,6 +32,7 @@ pollen.fieldset.connexionInformation=Information de connexion pollen.fieldset.login=Login pollen.fieldset.userInformation=Informations de l'utilisateur +pollen.fieldset.userInformation.toUpdate=User informations to update pollen.fieldset.userInformation.toCreate=User informations to create pollen.fieldset.userInformation.toDelete=User informations to delete pollen.information.need.login=You must be logged to access this page. Please fill the form below. Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-01-23 22:31:35 UTC (rev 3110) @@ -32,6 +32,7 @@ pollen.fieldset.connexionInformation=Information de connexion pollen.fieldset.login=Connexion pollen.fieldset.userInformation=Informations de l'utilisateur +pollen.fieldset.userInformation.toUpdate=Informations de l'utilisateur à mettre à jour pollen.fieldset.userInformation.toCreate=Informations de l'utilisateur à créer pollen.fieldset.userInformation.toDelete=Informations de l'utilisateur à supprimer pollen.information.need.login=Vous devez être identifié pour pouvoir accéder à cette page. Veuillez remplir le formulaire ci-dessous. Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/CreateUser-validation.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/CreateUser-validation.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/CreateUser-validation.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,22 +0,0 @@ -<!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> Added: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-createUser-validation.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,22 @@ +<!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> Added: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/ManageUsers-updateUser-validation.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,22 @@ +<!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> Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/UpdateUser-validation.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/UpdateUser-validation.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/admin/UpdateUser-validation.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,22 +0,0 @@ -<!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="updateUser.login"> - - <field-validator type="requiredstring"> - <message key="pollen.error.login.required"/> - </field-validator> - - </field> - - <field name="updateUser.email"> - - <field-validator type="requiredstring"> - <message key="pollen.error.email.required"/> - </field-validator> - - </field> - -</validators> Modified: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/struts.xml =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/struts.xml 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/resources/struts.xml 2012-01-23 22:31:35 UTC (rev 3110) @@ -126,7 +126,7 @@ class="org.chorem.pollen.ui.actions.PollenActionSupport"/> <action name="notLoggued"> - <result>/WEB-INF/jsp/login.jsp</result> + <result>/WEB-INF/jsp/user/login.jsp</result> </action> <action name="notAdmin"> @@ -160,7 +160,6 @@ </package> - <include file="config/struts-json.xml"/> <include file="config/struts-admin.xml"/> <include file="config/struts-poll.xml"/> Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollsList.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,61 @@ +<%-- +#%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.pollsList"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsList"/></h1> + +<s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/> + +<%--script type="text/javascript"> + + jQuery(document).ready(function () { + $.addRowSelectTopic('users'); + $.addClearSelectTopic('users'); + $.addAddRowTopic('users', '${addUrl}'); + $.addSingleRowTopic('users', 'Update', '${editUrl}', 'user.id'); + $.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.id'); + }); +</script--%> + +<sjg:grid id="users" dataType="json" href="%{loadUrl}" gridModel="users" + pager="true" pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='users-rowSelect' editinline="true" editurl="%{loadUrl}" + onCompleteTopics='users-cleanSelect' + navigatorEdit="false" navigatorDelete="false" + navigatorSearch="false" navigatorRefresh="false" + navigatorAdd="false" viewrecords="true" + rowList="10,15,20,50,100" rowNum="10"> + <sjg:gridColumn name="id" title="id" hidden="true"/> + <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' sortable="false" editable="true"/> + <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' sortable="false" editable="true"/> + <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' sortable="false" editable="true"/> + <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' sortable="false" editable="true"/> + <sjg:gridColumn name="admin" title='%{getText("pollen.common.admin")}' sortable="false" width="100" formatter="checkbox" editable="true" edittype="checkbox"/> +</sjg:grid> Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/pollsList.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp (from rev 3107, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/usersList.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,195 @@ +<%-- +#%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.usersList"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.usersList"/></h1> + +<s:url id="loadUSers" action="getUsers" namespace="/json" escapeAmp="false"/> + +<s:url id="loadUser" action="getUser" namespace="/json"/> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + if ('${action}' == 'create') { + $('#createForm').show(); + } + if ('${action}' == 'update') { + $('#editForm').show(); + } + if ('${action}' == 'delete') { + $('#deleteForm').show(); + } + + // listen row selection + $.addRowSelectTopic('users'); + + // to edit a selected row + $.listenRowTopic('users-editRow', function (event) { + if(!jQuery.struts2_jquery['users']) { + return; + } + var id = jQuery.struts2_jquery['users']['selectedRow']; + 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.admin"]').prop('checked',false); + $('#editForm [name="user.admin"]').prop('checked',user.admin); + $('#editForm').show(); + $('#createForm').hide(); + $('#deleteForm').hide(); + } + ); + }); + + // 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.admin"]').prop('checked',false); + $('#editForm').hide(); + $('#deleteForm').hide(); + $('#createForm').show(); + }); + + // to delete the selected row + $.listenRowTopic('users-deleteRow', function(event) { + if(!jQuery.struts2_jquery['users']) { + return; + } + var id = jQuery.struts2_jquery['users']['selectedRow']; + 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.admin"]').prop('checked',false); + $('#deleteForm [name="user.admin"]').prop('checked',user.admin); + $('#editForm').hide(); + $('#createForm').hide(); + $('#deleteForm').show(); + } + ); + }); + }); +</script> + +<sjg:grid id="users" dataType="json" href="%{loadUSers}" gridModel="users" + pager="true" pagerButtons="true" pagerInput="true" + navigator="true" rownumbers="false" autowidth="true" + onSelectRowTopics='users-rowSelect' editinline="false" + onCompleteTopics='users-cleanSelect' + 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.createUser\")}', icon: 'ui-icon-plus', topic: 'users-addRow' }, + 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"/> + <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' + sortable="false"/> + <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' + sortable="false"/> + <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' + sortable="false"/> + <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' + sortable="false"/> + <sjg:gridColumn name="admin" title='%{getText("pollen.common.admin")}' + sortable="false" width="100" formatter="checkbox" + editable="true" /> +</sjg:grid> + +<br/> + +<s:form id='editForm' method="POST" namespace="/admin" cssClass="hidden"> + + <s:hidden name="action" value="update"/> + <s:hidden key="user.topiaId" label=""/> + <%--<s:hidden key="user.login" label=""/>--%> + + <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.admin" label="%{getText('pollen.common.admin')}"/> + </fieldset> + <br/> + <s:submit action="updateUser" key="pollen.action.validate" align="center"/> + +</s:form> + +<s:form id='createForm' method="POST" namespace="/admin" cssClass="hidden"> + + <s:hidden name="action" value="create"/> + <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.admin" label="%{getText('pollen.common.admin')}"/> + </fieldset> + <br/> + <s:submit action="createUser" key="pollen.action.create" align="center"/> +</s:form> + +<s:form id='deleteForm' method="POST" namespace="/admin" cssClass="hidden"> + + <s:hidden name="action" value="delete"/> + <s:hidden key="user.topiaId" label=""/> + <%--<s:hidden key="user.login" 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.admin" label="%{getText('pollen.common.admin')}" disabled="true"/> + </fieldset> + <br/> + <s:submit action="deleteUser" key="pollen.action.delete" align="center"/> +</s:form> + + Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/admin/usersList.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/createPoll.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/createPoll.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/createPoll.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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.createPoll"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.createPoll"/></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> Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/login.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/login.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/login.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,69 +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" %> - -<div> - <strong> - <s:text name="pollen.information.need.login"/> - </strong> -</div> - -<br/> - -<s:form id="connection" action="login" method="POST" namespace="/user"> - -<fieldset> - <legend><s:text name="pollen.fieldset.login"/></legend> - - <s:textfield key="login" size="10" label="%{getText('pollen.common.login')}" - required="true"/> - <s:password key="password" - label="%{getText('pollen.common.password')}" size="10" - required="true"/> - - -</fieldset> - <br/> - <s:submit id="submitform" action="login" key="pollen.action.login" - align="center"/> - </s:form> -<div class="center" style="margin-bottom:20px;"> - <img src="<s:url value='/img/pollen_%{safeLanguage}.png' />" - alt="Pollen logo"/> -</div> -<div class="center"> - <s:a action="createForm"> - <img src="<s:url value='/img/smallCreation_%{safeLanguage}.png' />" - alt="poll creation"/> - </s:a> - <s:a action="createForm"> - <img src="<s:url value='/img/smallVote_%{safeLanguage}.png' />" alt="vote"/> - </s:a> - <s:a action="createForm"> - <img src="<s:url value='/img/smallVoteCounting_%{safeLanguage}.png' />" - alt="voteCounting"/> - </s:a> -</div> \ No newline at end of file Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/createPoll.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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.createPoll"/></title> + +<h1 class="title${pageLogo}"><s:text name="pollen.title.createPoll"/></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> Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/createPoll.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollsList.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollsList.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollsList.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,61 +0,0 @@ -<%-- -#%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.pollsList"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.pollsList"/></h1> - -<s:url id="loadUrl" action="getPolls" namespace="/json" escapeAmp="false"/> - -<%--script type="text/javascript"> - - jQuery(document).ready(function () { - $.addRowSelectTopic('users'); - $.addClearSelectTopic('users'); - $.addAddRowTopic('users', '${addUrl}'); - $.addSingleRowTopic('users', 'Update', '${editUrl}', 'user.id'); - $.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.id'); - }); -</script--%> - -<sjg:grid id="users" dataType="json" href="%{loadUrl}" gridModel="users" - pager="true" pagerButtons="true" pagerInput="true" - navigator="true" rownumbers="false" autowidth="true" - onSelectRowTopics='users-rowSelect' editinline="true" editurl="%{loadUrl}" - onCompleteTopics='users-cleanSelect' - navigatorEdit="false" navigatorDelete="false" - navigatorSearch="false" navigatorRefresh="false" - navigatorAdd="false" viewrecords="true" - rowList="10,15,20,50,100" rowNum="10"> - <sjg:gridColumn name="id" title="id" hidden="true"/> - <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' sortable="false" editable="true"/> - <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' sortable="false" editable="true"/> - <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' sortable="false" editable="true"/> - <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' sortable="false" editable="true"/> - <sjg:gridColumn name="admin" title='%{getText("pollen.common.admin")}' sortable="false" width="100" formatter="checkbox" editable="true" edittype="checkbox"/> -</sjg:grid> Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/registerUser.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/registerUser.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/registerUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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> Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/showUser.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/showUser.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/showUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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="GET"> - - <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-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/updateUser.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/updateUser.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/updateUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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> Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/login.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -0,0 +1,69 @@ +<%-- + #%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" %> + +<div> + <strong> + <s:text name="pollen.information.need.login"/> + </strong> +</div> + +<br/> + +<s:form id="connection" action="login" method="POST" namespace="/user"> + +<fieldset> + <legend><s:text name="pollen.fieldset.login"/></legend> + + <s:textfield key="login" size="10" label="%{getText('pollen.common.login')}" + required="true"/> + <s:password key="password" + label="%{getText('pollen.common.password')}" size="10" + required="true"/> + + +</fieldset> + <br/> + <s:submit id="submitform" action="login" key="pollen.action.login" + align="center"/> + </s:form> +<div class="center" style="margin-bottom:20px;"> + <img src="<s:url value='/img/pollen_%{safeLanguage}.png' />" + alt="Pollen logo"/> +</div> +<div class="center"> + <s:a action="createForm"> + <img src="<s:url value='/img/smallCreation_%{safeLanguage}.png' />" + alt="poll creation"/> + </s:a> + <s:a action="createForm"> + <img src="<s:url value='/img/smallVote_%{safeLanguage}.png' />" alt="vote"/> + </s:a> + <s:a action="createForm"> + <img src="<s:url value='/img/smallVoteCounting_%{safeLanguage}.png' />" + alt="voteCounting"/> + </s:a> +</div> \ No newline at end of file Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/login.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/registerUser.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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="registerUser" key="pollen.action.register" align="center"/> +</s:form> Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/registerUser.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/showUser.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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"> + + <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> Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/showUser.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp (from rev 3105, branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/updateUser.jsp) =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp (rev 0) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -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"> + + <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> Property changes on: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/user/updateUser.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/usersList.jsp =================================================================== --- branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/usersList.jsp 2012-01-23 22:29:31 UTC (rev 3109) +++ branches/pollen-2.0-beta-1/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/usersList.jsp 2012-01-23 22:31:35 UTC (rev 3110) @@ -1,194 +0,0 @@ -<%-- -#%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.usersList"/></title> - -<h1 class="title${pageLogo}"><s:text name="pollen.title.usersList"/></h1> - -<s:url id="loadUSers" action="getUsers" namespace="/json" escapeAmp="false"/> - -<s:url id="loadUser" action="getUser" namespace="/json"/> - -<script type="text/javascript"> - - jQuery(document).ready(function () { - if ('${createUserNotNull}' == 'true') { - $('#createForm').show(); - } - if ('${updateUserNotNull}' == 'true') { - $('#editForm').show(); - } - if ('${deleteUserNotNull}' == 'true') { - $('#deleteForm').show(); - } - - // listen row selection - $.addRowSelectTopic('users'); - - // to edit a selected row - $.listenRowTopic('users-editRow', function (event) { - if(!jQuery.struts2_jquery['users']) { - return; - } - var id = jQuery.struts2_jquery['users']['selectedRow']; - jQuery.getJSON("${loadUser}", { "userId":id }, function (result) { - - var user = result.user; - $('#editForm [name="updateUser.topiaId"]').val(user.id); - $('#editForm [name="updateUser.login"]').val(user.login); - $('#editForm [name="updateUser.email"]').val(user.email); - $('#editForm [name="updateUser.firstName"]').val(user.firstName); - $('#editForm [name="updateUser.lastName"]').val(user.lastName); - $('#editForm [name="updateUser.admin"]').prop('checked',false); - $('#editForm [name="updateUser.admin"]').prop('checked',user.admin); - $('#editForm').show(); - $('#createForm').hide(); - $('#deleteForm').hide(); - } - ); - }); - - // to create a new row - $.listenRowTopic('users-addRow', function(event) { - $('#createForm [name="createUser.login"]').val(""); - $('#createForm [name="createUser.email"]').val(""); - $('#createForm [name="createUser.firstName"]').val(""); - $('#createForm [name="createUser.lastName"]').val(""); - $('#createForm [name="createUser.admin"]').prop('checked',false); - $('#editForm').hide(); - $('#deleteForm').hide(); - $('#createForm').show(); - }); - - // to delete the selected row - $.listenRowTopic('users-deleteRow', function(event) { - if(!jQuery.struts2_jquery['users']) { - return; - } - var id = jQuery.struts2_jquery['users']['selectedRow']; - jQuery.getJSON("${loadUser}", { "userId":id }, function (result) { - - var user = result.user; - $('#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.admin"]').prop('checked',false); - $('#deleteForm [name="deleteUser.admin"]').prop('checked',user.admin); - $('#editForm').hide(); - $('#createForm').hide(); - $('#deleteForm').show(); - } - ); - }); - }); -</script> - -<sjg:grid id="users" dataType="json" href="%{loadUSers}" gridModel="users" - pager="true" pagerButtons="true" pagerInput="true" - navigator="true" rownumbers="false" autowidth="true" - onSelectRowTopics='users-rowSelect' editinline="false" - onCompleteTopics='users-cleanSelect' - 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.createUser\")}', icon: 'ui-icon-plus', topic: 'users-addRow' }, - 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"/> - <sjg:gridColumn name="login" title='%{getText("pollen.common.login")}' - sortable="false"/> - <sjg:gridColumn name="firstName" title='%{getText("pollen.common.firstName")}' - sortable="false"/> - <sjg:gridColumn name="lastName" title='%{getText("pollen.common.lastName")}' - sortable="false"/> - <sjg:gridColumn name="email" title='%{getText("pollen.common.email")}' - sortable="false"/> - <sjg:gridColumn name="admin" title='%{getText("pollen.common.admin")}' - sortable="false" width="100" formatter="checkbox" - editable="true" /> -</sjg:grid> - -<br/> - -<s:form id='editForm' method="POST" namespace="/admin" cssClass="hidden"> - - <s:hidden key="updateUser.topiaId" label=""/> - <s:hidden key="updateUser.login" label=""/> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation"/></legend> - <s:textfield key="updateUser.email" label="%{getText('pollen.common.email')}" - required="true"/> - <s:textfield key="updateUser.firstName" - label="%{getText('pollen.common.firstName')}"/> - <s:textfield key="updateUser.lastName" - label="%{getText('pollen.common.lastName')}"/> - <s:checkbox key="updateUser.admin" label="%{getText('pollen.common.admin')}"/> - </fieldset> - <br/> - <s:submit action="updateUser" key="pollen.action.validate" align="center"/> - -</s:form> - -<s:form id='createForm' method="POST" namespace="/admin" cssClass="hidden"> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation.toCreate"/></legend> - <s:textfield key="createUser.login" label="%{getText('pollen.common.login')}" required="true"/> - <s:textfield key="createUser.email" label="%{getText('pollen.common.email')}" required="true"/> - <s:textfield key="createUser.firstName" label="%{getText('pollen.common.firstName')}"/> - <s:textfield key="createUser.lastName" label="%{getText('pollen.common.lastName')}"/> - <s:checkbox key="createUser.admin" label="%{getText('pollen.common.admin')}"/> - </fieldset> - <br/> - <s:submit action="createUser" key="pollen.action.create" align="center"/> -</s:form> - -<s:form id='deleteForm' method="POST" namespace="/admin" cssClass="hidden"> - - <s:hidden key="deleteUser.topiaId" label=""/> - <s:hidden key="deleteUser.login" label=""/> - - <fieldset> - <legend><s:text name="pollen.fieldset.userInformation.toDelete"/></legend> - <s:textfield key="deleteUser.login" label="%{getText('pollen.common.login')}" required="true" disabled="true"/> - <s:textfield key="deleteUser.email" label="%{getText('pollen.common.email')}" required="true" disabled="true"/> - <s:textfield key="deleteUser.firstName" label="%{getText('pollen.common.firstName')}" disabled="true"/> - <s:textfield key="deleteUser.lastName" label="%{getText('pollen.common.lastName')}" disabled="true"/> - <s:checkbox key="deleteUser.admin" label="%{getText('pollen.common.admin')}" disabled="true"/> - </fieldset> - <br/> - <s:submit action="deleteUser" key="pollen.action.delete" align="center"/> -</s:form> - -
participants (1)
-
tchemit@users.chorem.org