Author: glandais Date: 2008-03-13 19:33:30 +0000 (Thu, 13 Mar 2008) New Revision: 1333 Added: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/SimExplorerPage.java Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityHelper.java trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityVisitorTreeNode.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDelete.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDownload.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementHistory.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementList.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementManage.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementMetadata.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPage.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPageDetail.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/tools/WebEntityVisitor.java trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDelete.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDownload.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementList.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementManage.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementMetadata.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/GroupList.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/Login.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserEdit.tml trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserList.tml Log: Bookmarkable URLs Action string to enum page Redirect to requested URL after login Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityHelper.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityHelper.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityHelper.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -60,31 +60,31 @@ public static enum Action { /** DOWNLOAD. */ - DOWNLOAD("", ActionAvailabilty.SWING, ExplorationApplication.class, Result.class, Library.class), + DOWNLOAD(null, ActionAvailabilty.SWING, ExplorationApplication.class, Result.class, Library.class), /** The DOWNLOADATTACHMENT. */ - DOWNLOADATTACHMENT("download", ActionAvailabilty.WEB, Attachment.class), + DOWNLOADATTACHMENT(SimExplorerPage.ElementDownload, ActionAvailabilty.WEB, Attachment.class), /** EXPORT. */ - EXPORT("export", ActionAvailabilty.BOTH, ExplorationApplication.class, Result.class, Library.class), + EXPORT(SimExplorerPage.ElementDownload, ActionAvailabilty.BOTH, ExplorationApplication.class, Result.class, Library.class), /** IMPORT. */ - IMPORT("", ActionAvailabilty.SWING, ExplorationApplication.class, Library.class), + IMPORT(null, ActionAvailabilty.SWING, ExplorationApplication.class, Library.class), /** DELETE. */ - DELETE("delete", ActionAvailabilty.BOTH, ExplorationApplication.class, ExplorationData.class), + DELETE(SimExplorerPage.ElementDelete, ActionAvailabilty.BOTH, ExplorationApplication.class, ExplorationData.class), /** HISTORY. */ - HISTORY("history", ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class, Library.class, Component.class), + HISTORY(SimExplorerPage.ElementHistory, ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class, Library.class, Component.class), /** RIGHTS. */ - RIGHTS("rights", ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class), + RIGHTS(SimExplorerPage.ElementRights, ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class), /** DETAILS. */ - DETAILS("details", ActionAvailabilty.WEB), + DETAILS(SimExplorerPage.ElementDetail, ActionAvailabilty.WEB), /** METADATA. */ - METADATA("metadata", ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class); + METADATA(SimExplorerPage.ElementMetadata, ActionAvailabilty.WEB, ExplorationApplication.class, ExplorationData.class); /** The classes. */ private List<Class<?>> classes; @@ -93,7 +93,7 @@ private List<String> types; /** The action name. */ - private String actionName; + private SimExplorerPage page; /** The availabilty. */ private ActionAvailabilty availabilty; @@ -136,8 +136,8 @@ * * @return the action name */ - public String getActionName() { - return actionName; + public SimExplorerPage getPage() { + return page; } /** @@ -156,8 +156,8 @@ * @param actionAvailabilty the action availabilty * @param classes the classes */ - private Action(String actionName, ActionAvailabilty actionAvailabilty, Class<?>... classes) { - this.actionName = actionName; + private Action(SimExplorerPage page, ActionAvailabilty actionAvailabilty, Class<?>... classes) { + this.page = page; this.availabilty = actionAvailabilty; this.classes = Arrays.asList(classes); this.types = new ArrayList<String>(classes.length); Modified: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityVisitorTreeNode.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityVisitorTreeNode.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/EntityVisitorTreeNode.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -18,7 +18,11 @@ package fr.cemagref.simexplorer.is.entities; import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.Deque; +import java.util.List; import fr.cemagref.simexplorer.is.entities.data.LoggableElement; @@ -43,7 +47,7 @@ /** The node stack. */ private Deque<TN> nodeStack; - + /** * Visit a loggable element * Added: trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/SimExplorerPage.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/SimExplorerPage.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-entities/src/java/fr/cemagref/simexplorer/is/entities/SimExplorerPage.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -0,0 +1,80 @@ +/* +* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* 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 General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* ##% */ +package fr.cemagref.simexplorer.is.entities; + +import static org.codelutin.i18n.I18n.n_; + +/** + * The Enum SimExplorerPage. + */ +public enum SimExplorerPage { + + /** The Element delete. */ + ElementDelete("ElementDelete", n_("simexplorer.ui.web.delete.action")), + + /** The Element detail. */ + ElementDetail("ElementDetail", n_("simexplorer.ui.web.details.action")), + + /** The Element download. */ + ElementDownload("ElementDownload", n_("simexplorer.ui.web.export.action")), + + /** The Element history. */ + ElementHistory("ElementHistory", n_("simexplorer.ui.web.history.action")), + + /** The Element metadata. */ + ElementMetadata("ElementMetadata", n_("simexplorer.ui.web.metadata.action")), + + /** The Element rights. */ + ElementRights("ElementRights", n_("simexplorer.ui.web.rights.action")); + + /** The tapestry page name. */ + private String tapestryPageName; + + /** The caption key. */ + private String captionKey; + + /** + * Instantiates a new simexplorer page. + * + * @param pageName the page name + * @param captionKey the caption key + */ + private SimExplorerPage(String pageName, String captionKey) { + this.tapestryPageName = pageName; + this.captionKey = captionKey; + } + + /** + * Gets the page name. + * + * @return the page name + */ + public String getPageName() { + return tapestryPageName; + } + + /** + * Gets the caption. + * + * @return the caption + */ + public String getCaption() { + return captionKey; + } + +} Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -30,8 +30,11 @@ import org.apache.tapestry.services.PersistentLocale; import org.apache.tapestry.services.RequestGlobals; +import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.storage.SearchColumn; import fr.cemagref.simexplorer.is.ui.web.pages.ElementList; +import fr.cemagref.simexplorer.is.ui.web.pages.Login; +import fr.cemagref.simexplorer.is.ui.web.pages.security.ProtectedPage; /** * AbstractPage.java @@ -42,7 +45,7 @@ * Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $ */ @IncludeStylesheet("css/Layout.css") -public class Layout { +public class Layout extends ProtectedPage { /** The persistent locale. */ @Inject @@ -61,6 +64,9 @@ @InjectPage private ElementList elementList; + @InjectPage + private Login loginPage; + /** The request globals. */ @Inject private RequestGlobals requestGlobals; @@ -143,7 +149,7 @@ public Object onActionFromLogout() { HttpSession session = requestGlobals.getHTTPServletRequest().getSession(); session.invalidate(); - return elementList; + return loginPage; } /** @@ -152,16 +158,18 @@ * @return the login name */ public String getLoginName() { - return elementList.getUserLogged().getLogin(); + return getUserLogged().getLogin(); } /** * Gets the logged. * * @return the logged + * @throws SimExplorerException */ - public boolean getLogged() { - return elementList.isUserLogged(); + public boolean getLogged() throws SimExplorerException { + getUserRights(); + return isUserLogged(); } /** @@ -170,7 +178,7 @@ * @return the administrator */ public boolean getAdministrator() { - return elementList.isUserAdmin(); + return isUserAdmin(); } /** @@ -179,7 +187,7 @@ * @return the super administrator */ public boolean getSuperAdministrator() { - return elementList.isUserSuperAdmin(); + return isUserSuperAdmin(); } /** @@ -218,4 +226,14 @@ this.searchColumn = searchColumn; } + @Override + public String getWindowTitle() { + return null; + } + + @Override + public boolean hasAccessToPage() { + return true; + } + } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDelete.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDelete.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDelete.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -62,7 +62,7 @@ /** The element detail. */ @InjectPage - private ElementDetail elementDetail; + private ElementList elementList; /** * Page loaded. @@ -96,7 +96,7 @@ public Object onActionFromConfirm() throws SimExplorerException { RemoteStorageService.getStorageService().deleteElement(getToken(), getMetadata().getUuid(), getMetadata().getVersion().toString()); - return elementDetail; + return elementList; } /** @@ -108,7 +108,7 @@ */ public Object onActionFromConfirmAll() throws SimExplorerException { RemoteStorageService.getStorageService().deleteElement(getToken(), getMetadata().getUuid()); - return elementDetail; + return elementList; } /** @@ -130,32 +130,6 @@ } /** - * On action from detail element using. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromDetailElementUsedBy(String context) throws SimExplorerException { - return onDetails(context); - } - - /** - * On action from detail element used by any version. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromDetailElementUsedByAnyVersion(String context) throws SimExplorerException { - return onDetails(context); - } - - /** * Gets the used by. * * @return the used by Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDetail.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -20,8 +20,6 @@ import java.util.ArrayList; import java.util.List; -import org.apache.tapestry.ComponentResources; -import org.apache.tapestry.ioc.annotations.Inject; import org.codelutin.tapestry.beans.TreeNode; import fr.cemagref.simexplorer.is.ui.web.tools.WebEntityVisitor; @@ -65,305 +63,4 @@ return nodes; } -// /** -// * Generate header. -// * -// * @param caption the caption -// * -// * @return the string -// */ -// private String generateHeader(String caption) { -// StringBuilder sb = new StringBuilder(); -// sb.append("<b>"); -// sb.append(caption); -// sb.append("</b>"); -// return sb.toString(); -// } -// -// /** -// * Generate exploration application. -// * -// * @return the tree node -// */ -// private TreeNode generateExplorationApplication() { -// TreeNode node; -// node = new TreeNode(); -// -// node.setType(TreeNode.TYPE_FOLDER); -// -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.applicationexploration"), -// getMetadata().getName(), getElement().getMetaData().getVersion().toString(), getElement() -// .getMetaData(), true, "metadata", "export", "history", "delete")); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// TreeNode node1 = new TreeNode(); -// node1.setType(TreeNode.TYPE_FOLDER); -// node1.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.components"), "", "")); -// node1.setChildren(generateComponents((ExplorationApplication) getElement())); -// children.add(node1); -// -// TreeNode node2 = new TreeNode(); -// node2.setType(TreeNode.TYPE_FOLDER); -// node2.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.explorations"), "", "")); -// node2.setChildren(generateExplorations((ExplorationApplication) getElement())); -// children.add(node2); -// -// node.setChildren(children); -// return node; -// } -// -// /** -// * Generate explorations. -// * -// * @param explorationApplication the exploration application -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateExplorations(ExplorationApplication explorationApplication) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (ExplorationData data : explorationApplication.getExplorations().getElements()) { -// res.add(generateExplorationData(data)); -// } -// return res; -// } -// -// /** -// * Generate exploration data. -// * -// * @param explorationData the exploration data -// * -// * @return the tree node -// */ -// private TreeNode generateExplorationData(ExplorationData explorationData) { -// TreeNode explorationDataNode = new TreeNode(); -// explorationDataNode.setType(TreeNode.TYPE_FOLDER); -// -// explorationDataNode.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.explorationdata"), -// explorationData.getMetaData().getName(), explorationData.getMetaData().getVersion().toString(), -// explorationData.getMetaData(), true, "metadata", "history", "delete")); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// -// children.add(generateResult(explorationData)); -// -// TreeNode node1 = new TreeNode(); -// node1.setType(TreeNode.TYPE_FOLDER); -// node1.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.values"), -// generateHeader(getMessages().get("simexplorer.ui.web.type")), generateHeader(getMessages().get( -// "simexplorer.ui.web.value")))); -// node1.setChildren(generateValues(explorationData)); -// children.add(node1); -// -// explorationDataNode.setChildren(children); -// return explorationDataNode; -// } -// -// /** -// * Generate values. -// * -// * @param explorationData the exploration data -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateValues(ExplorationData explorationData) { -// List<ConstantValue> values = explorationData.getConstantValues().getElements(); -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (ConstantValue value : values) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// node.setColumns(generateStringArray(value.getConstant().getName(), value.getConstant().getType() -// .getSimpleName(), value.getValue())); -// res.add(node); -// } -// -// return res; -// } -// -// /** -// * Generate result. -// * -// * @param explorationData the exploration data -// * -// * @return the tree node -// */ -// private TreeNode generateResult(ExplorationData explorationData) { -// TreeNode res = new TreeNode(); -// res.setType(TreeNode.TYPE_DOCUMENT); -// -// res.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.result"), "", "", explorationData -// .getMetaData(), false, "export")); -// return res; -// } -// -// /** -// * Generate components. -// * -// * @param explorationApplication the exploration application -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateComponents(ExplorationApplication explorationApplication) { -// List<Component> components = explorationApplication.getComponents().getElements(); -// List<TreeNode> res = new ArrayList<TreeNode>(); -// -// for (Component component : components) { -// res.add(generateComponent(component)); -// } -// -// return res; -// } -// -// /** -// * Inits the node. -// * -// * @return the tree node -// */ -// private TreeNode initNode() { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_FOLDER); -// return node; -// } -// -// /** -// * Generate component. -// * -// * @param component the component -// * -// * @return the tree node -// */ -// private TreeNode generateComponent(Component component) { -// TreeNode componentNode = new TreeNode(); -// componentNode.setType(TreeNode.TYPE_FOLDER); -// -// componentNode.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.component"), component -// .getMetaData().getName(), component.getMetaData().getVersion().toString(), component -// .getMetaData(), true, "metadata", "history", "delete")); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// -// TreeNode node; -// -// node = initNode(); -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.constant"), -// generateHeader(getMessages().get("simexplorer.ui.web.name")), generateHeader(getMessages().get( -// "simexplorer.ui.web.type")))); -// node.setChildren(generateConstants(component.getConstants())); -// -// children.add(node); -// node = initNode(); -// -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.structures"), "", "")); -// node.setChildren(generateStructures(component.getStructures())); -// -// children.add(node); -// node = initNode(); -// -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.codes"), generateHeader(getMessages() -// .get("simexplorer.ui.web.language")), generateHeader(getMessages().get("simexplorer.ui.web.code")))); -// node.setChildren(generateCodes(component.getCodes())); -// -// children.add(node); -// node = initNode(); -// -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.libraries"), "", "")); -// node.setChildren(generateLibraries(component)); -// -// children.add(node); -// -// componentNode.setChildren(children); -// return componentNode; -// } -// -// /** -// * Generate libraries. -// * -// * @param component the component -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateLibraries(Component component) { -// List<Library> libraries = component.getLibraries(); -// -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (Library library : libraries) { -// TreeNode node = generateLibrary(library); -// -// res.add(node); -// } -// return res; -// } -// -// /** -// * Generate library. -// * -// * @param library the library -// * -// * @return the tree node -// */ -// private TreeNode generateLibrary(Library library) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.library"), library.getMetaData() -// .getName(), library.getMetaData().getVersion().toString(), library.getMetaData(), true, "metadata", -// "export")); -// return node; -// } -// -// /** -// * Generate codes. -// * -// * @param codes the codes -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateCodes(List<Code> codes) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (Code code : codes) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.code"), code.getLanguage(), code -// .getCode())); -// res.add(node); -// } -// return res; -// } -// -// /** -// * Generate structures. -// * -// * @param structures the structures -// * -// * @return the list< tree node> -// */ -// @SuppressWarnings("unused") -// private List<TreeNode> generateStructures(List<Structure> structures) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (Structure structure : structures) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.structure"), "", "")); -// res.add(node); -// } -// return res; -// } -// -// /** -// * Generate constants. -// * -// * @param constants the constants -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateConstants(List<Constant> constants) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (Constant constant : constants) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// node.setColumns(generateStringArray(getMessages().get("simexplorer.ui.web.constant"), constant.getName(), -// constant.getType().getSimpleName())); -// res.add(node); -// } -// return res; -// } - } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDownload.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDownload.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementDownload.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -20,21 +20,14 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.List; -import java.util.StringTokenizer; -import org.apache.tapestry.ComponentResources; -import org.apache.tapestry.StreamResponse; -import org.apache.tapestry.ioc.annotations.Inject; import org.codelutin.tapestry.beans.TreeNode; -import fr.cemagref.simexplorer.is.entities.attachment.Attachment; -import fr.cemagref.simexplorer.is.entities.data.LoggableElement; +import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.service.remote.RemoteStorageService; -import fr.cemagref.simexplorer.is.ui.web.tools.AttachmentStreamResponse; import fr.cemagref.simexplorer.is.ui.web.tools.WebEntityVisitor; -import fr.cemagref.simexplorer.is.ui.web.tools.XMLAttachment; import fr.cemagref.simexplorer.is.ui.web.tools.ZipAttachment; /** @@ -42,6 +35,8 @@ */ public class ElementDownload extends ElementPageDetail { + private static final Class<?>[] clazzes = new Class<?>[] { ExplorationApplication.class }; + /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.ui.web.pages.security.ProtectedPage#getWindowTitle() */ @@ -51,25 +46,6 @@ } /** - * On action from download xml. - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromDownloadXML() throws SimExplorerException { - - Object response; - - MetaData mde = getMetadata(); - - InputStream stream = RemoteStorageService.getStorageService().retrieveElementXML(getToken(), mde.getUuid(), - mde.getVersion().toString()); - response = new XMLAttachment(stream, mde.getName() + "." + mde.getUuid() + ".v" + mde.getVersion()); - - return response; - } - - /** * On action from download full. * * @return the object @@ -87,8 +63,6 @@ return response; } - - /** * Headers of tree grid. * @@ -111,206 +85,10 @@ public List<TreeNode> getNodes() { List<TreeNode> nodes = new ArrayList<TreeNode>(); WebEntityVisitor webEntityVisitor = new WebEntityVisitor(getResources(), getMessages()); + // FIXME visit only attachment nodes + //nodes.add(webEntityVisitor.treeNodeVisit(getElement(), clazzes)); nodes.add(webEntityVisitor.treeNodeVisit(getElement())); return nodes; } -// /** -// * Generate nodes. -// * -// * @return the tree node -// */ -// private TreeNode generateNodes() { -// TreeNode node = null; -// if (getElement() instanceof ExplorationApplication) { -// node = generateExplorationApplication(); -// } -// if (getElement() instanceof ExplorationData) { -// node = generateExplorationData((ExplorationData) getElement()); -// } -// if (getElement() instanceof Component) { -// node = generateComponent((Component) getElement()); -// } -// if (getElement() instanceof Library) { -// node = generateLibrary((Library) getElement()); -// } -// return node; -// } -// -// /** -// * Generate exploration application. -// * -// * @return the tree node -// */ -// private TreeNode generateExplorationApplication() { -// TreeNode node; -// node = new TreeNode(); -// -// node.setType(TreeNode.TYPE_FOLDER); -// -// node.setColumns(generateStringArray("Application exploration", getMetadata().getName())); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// TreeNode node1 = new TreeNode(); -// node1.setType(TreeNode.TYPE_FOLDER); -// node1.setColumns(generateStringArray("Components")); -// node1.setChildren(generateComponents((ExplorationApplication) getElement())); -// children.add(node1); -// -// TreeNode node2 = new TreeNode(); -// node2.setType(TreeNode.TYPE_FOLDER); -// node2.setColumns(generateStringArray("Explorations")); -// node2.setChildren(generateExplorations((ExplorationApplication) getElement())); -// children.add(node2); -// -// node.setChildren(children); -// return node; -// } -// -// /** -// * Generate explorations. -// * -// * @param explorationApplication the exploration application -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateExplorations(ExplorationApplication explorationApplication) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (ExplorationData explorationData : explorationApplication.getExplorations().getElements()) { -// res.add(generateExplorationData(explorationData)); -// } -// return res; -// } -// -// /** -// * Generate exploration data. -// * -// * @param explorationData the exploration data -// * -// * @return the tree node -// */ -// private TreeNode generateExplorationData(ExplorationData explorationData) { -// TreeNode explorationDataNode = new TreeNode(); -// explorationDataNode.setType(TreeNode.TYPE_FOLDER); -// -// explorationDataNode -// .setColumns(generateStringArray("Exploration data", explorationData.getMetaData().getName())); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// -// List<Attachment> attachments = explorationData.getAttachments(); -// -// for (Attachment attachment : attachments) { -// children.add(generateDownload(explorationData, attachment)); -// } -// explorationDataNode.setChildren(children); -// -// return explorationDataNode; -// } -// -// /** -// * Generate components. -// * -// * @param explorationApplication the exploration application -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateComponents(ExplorationApplication explorationApplication) { -// List<Component> components = explorationApplication.getComponents().getElements(); -// List<TreeNode> res = new ArrayList<TreeNode>(); -// -// for (Component component : components) { -// res.add(generateComponent(component)); -// } -// -// return res; -// } -// -// /** -// * Generate component. -// * -// * @param component the component -// * -// * @return the tree node -// */ -// private TreeNode generateComponent(Component component) { -// TreeNode componentNode = new TreeNode(); -// componentNode.setType(TreeNode.TYPE_FOLDER); -// -// componentNode.setColumns(generateStringArray("Component", component.getMetaData().getName())); -// -// List<TreeNode> children = new ArrayList<TreeNode>(); -// -// TreeNode node; -// -// node = new TreeNode(); -// node.setType(TreeNode.TYPE_FOLDER); -// -// node.setColumns(generateStringArray("Libraries")); -// node.setChildren(generateLibraries(component.getLibraries())); -// -// children.add(node); -// -// componentNode.setChildren(children); -// return componentNode; -// } -// -// /** -// * Generate libraries. -// * -// * @param libraries the libraries -// * -// * @return the list< tree node> -// */ -// private List<TreeNode> generateLibraries(List<Library> libraries) { -// List<TreeNode> res = new ArrayList<TreeNode>(); -// for (Library library : libraries) { -// TreeNode node = generateLibrary(library); -// res.add(node); -// } -// return res; -// } -// -// /** -// * Generate library. -// * -// * @param library the library -// * -// * @return the tree node -// */ -// private TreeNode generateLibrary(Library library) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_FOLDER); -// -// List<Attachment> attachments = library.getAttachments(); -// List<TreeNode> children = new ArrayList<TreeNode>(); -// for (Attachment attachment : attachments) { -// children.add(generateDownload(library, attachment)); -// } -// node.setChildren(children); -// -// node.setColumns(generateStringArray("Library", library.getMetaData().getName())); -// return node; -// } -// -// /** -// * Generate download. -// * -// * @param explorationData the exploration data -// * @param attachment the attachment -// * -// * @return the tree node -// */ -// private TreeNode generateDownload(LoggableElement explorationData, Attachment attachment) { -// TreeNode node = new TreeNode(); -// node.setType(TreeNode.TYPE_DOCUMENT); -// -// String context = explorationData.getMetaData().getUuid() + "," + explorationData.getMetaData().getVersion() -// + "," + attachment.getUniqueId(); -// -// node.setColumns(generateStringArray(attachment.getContentType().getDescription(), attachment.getDataHash(), -// generateString(attachment.getFileName(), "downloadFile", context))); -// return node; -// } - } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementHistory.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementHistory.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementHistory.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -24,6 +24,7 @@ import org.apache.tapestry.annotations.Persist; import org.codelutin.tapestry.beans.TreeNode; +import fr.cemagref.simexplorer.is.entities.SimExplorerPage; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; @@ -181,8 +182,9 @@ MetaData mde = RemoteStorageService.getStorageService().getMetadata(getToken(), getMetadata().getUuid(), version.toString()); String[] columns = generateStringArray(generateString(mde.getVersion().toString(), - "details", mde), mde.getName(), mde.getDescription(), DATE_FORMAT - .format(mde.getCreationDate()), generateActions(mde, false, "metadata", "export", "delete", "details")); + SimExplorerPage.ElementDetail, mde), mde.getName(), mde.getDescription(), DATE_FORMAT.format(mde + .getCreationDate()), generateActions(mde, false, SimExplorerPage.ElementDetail, + SimExplorerPage.ElementMetadata, SimExplorerPage.ElementDownload, SimExplorerPage.ElementDelete)); node.setColumns(columns); node.setObject(mde.getVersion()); node.setType(TreeNode.TYPE_DOCUMENT); Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementList.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementList.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementList.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -17,11 +17,8 @@ * ##% */ package fr.cemagref.simexplorer.is.ui.web.pages; -import java.util.StringTokenizer; - import org.apache.tapestry.ComponentResources; import org.apache.tapestry.annotations.Component; -import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.annotations.Retain; import org.apache.tapestry.beaneditor.BeanModel; @@ -31,7 +28,6 @@ import de.hsofttec.t5components.annotations.SetterGetter; import fr.cemagref.simexplorer.is.entities.EntityTypeEnum; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; -import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.storage.SearchColumn; import fr.cemagref.simexplorer.is.ui.web.components.SimGrid; import fr.cemagref.simexplorer.is.ui.web.grid.ElementDataSource; @@ -60,10 +56,6 @@ @SetterGetter private MetaData _element; - /** The element detail. */ - @InjectPage - private ElementDetail elementDetail; - /** The query. */ @Persist private String query; @@ -141,23 +133,6 @@ return _element.getUuid() + "," + _element.getVersion(); } - /** - * On action from detail element. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromDetailElement(String context) throws SimExplorerException { - StringTokenizer st = new StringTokenizer(context, ","); - String uuid = st.nextToken(); - String version = st.nextToken(); - elementDetail.setup(uuid, version); - return elementDetail; - } - /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.ui.web.pages.security.ProtectedPage#getWindowTitle() */ Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementManage.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementManage.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementManage.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -66,14 +66,6 @@ /** The _element. */ private MetaData element; - /** The element detail. */ - @InjectPage - private ElementDetail elementDetail; - - /** The element rights. */ - @InjectPage - private ElementRights elementRights; - /** The user edit. */ @InjectPage private UserEdit userEdit; @@ -187,23 +179,6 @@ } /** - * On action from detail element. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromDetailElement(String context) throws SimExplorerException { - StringTokenizer st = new StringTokenizer(context, ","); - String uuid = st.nextToken(); - String version = st.nextToken(); - elementDetail.setup(uuid, version); - return elementDetail; - } - - /** * On action from view user. * * @param actorid the actorid @@ -278,23 +253,6 @@ } /** - * On action from rights. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromRights(String context) throws SimExplorerException { - StringTokenizer st = new StringTokenizer(context, ","); - String uuid = st.nextToken(); - String version = st.nextToken(); - elementRights.setup(uuid, version); - return elementRights; - } - - /** * Gets the element. * * @return the element Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementMetadata.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementMetadata.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementMetadata.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -107,28 +107,4 @@ return _element.getUuid() + "," + _element.getVersion(); } - /** - * On action from detail element used. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromDetailElementUsed(String context) throws SimExplorerException { - return onDetails(context); - } - - /** - * On action from detail element using. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromDetailElementUsing(String context) throws SimExplorerException { - return onDetails(context); - } - } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPage.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPage.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPage.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -17,6 +17,8 @@ * ##% */ package fr.cemagref.simexplorer.is.ui.web.pages; +import java.util.StringTokenizer; + import org.apache.tapestry.annotations.Persist; import fr.cemagref.simexplorer.is.entities.data.LoggableElement; @@ -46,6 +48,22 @@ } /** + * On activate. + * + * @param context the context + * + * @throws SimExplorerException the sim explorer exception + */ + public void onActivate(String context) throws SimExplorerException { + if (context != null && !context.equals("")) { + StringTokenizer st = new StringTokenizer(context, ","); + String uuid = st.nextToken(); + String version = st.nextToken(); + this.setup(uuid, version); + } + } + + /** * Gets the element. * * @return the element Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPageDetail.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPageDetail.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ElementPageDetail.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -27,9 +27,9 @@ import org.apache.tapestry.Link; import org.apache.tapestry.StreamResponse; -import org.apache.tapestry.annotations.InjectPage; import org.codelutin.tapestry.beans.TreeNode; +import fr.cemagref.simexplorer.is.entities.SimExplorerPage; import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.data.Descriptor; import fr.cemagref.simexplorer.is.entities.data.LoggableElement; @@ -46,127 +46,15 @@ /** The Constant DATE_FORMAT for formatting dates. */ public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss.SSS"); - /** The element export. */ - @InjectPage - private ElementDownload elementDownload; - - /** The element history. */ - @InjectPage - private ElementHistory elementHistory; - - /** The element delete. */ - @InjectPage - private ElementDelete elementDelete; - - /** The element rights. */ - @InjectPage - private ElementRights elementRights; - - /** The element detail. */ - @InjectPage - private ElementDetail elementDetail; - - /** The element metadata. */ - @InjectPage - private ElementMetadata elementMetadata; - /** - * Prepare page. + * On download file. * - * @param page the page * @param context the context * * @return the object - * @throws SimExplorerException - */ - private Object preparePage(ElementPage page, String context) throws SimExplorerException { - StringTokenizer st = new StringTokenizer(context, ","); - String uuid = st.nextToken(); - String version = st.nextToken(); - page.setup(uuid, version); - return page; - } - - /** - * On export. * - * @param context the context - * - * @return the object - * @throws SimExplorerException + * @throws SimExplorerException the sim explorer exception */ - public Object onExport(String context) throws SimExplorerException { - return preparePage(elementDownload, context); - } - - /** - * On history. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onHistory(String context) throws SimExplorerException { - return preparePage(elementHistory, context); - } - - /** - * On delete. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onDelete(String context) throws SimExplorerException { - return preparePage(elementDelete, context); - } - - /** - * On rights. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onRights(String context) throws SimExplorerException { - return preparePage(elementRights, context); - } - - /** - * On details. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onDetails(String context) throws SimExplorerException { - return preparePage(elementDetail, context); - } - - /** - * On metadata. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onMetadata(String context) throws SimExplorerException { - return preparePage(elementMetadata, context); - } - - /** - * On download file. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ public Object onDownloadFile(String context) throws SimExplorerException { StreamResponse response = null; @@ -190,18 +78,18 @@ return response; } - + /** * Generate string. * * @param actionCaption the action caption - * @param action the action * @param context the context + * @param page the page * * @return the string */ - protected String generateString(String actionCaption, String action, String context) { - Link link = getResources().createActionLink(action, false, context); + protected String generateString(String actionCaption, SimExplorerPage page, String context) { + Link link = getResources().createPageLink(page.getPageName(), false, context); StringBuffer sb = new StringBuffer(""); sb.append("<a href=\""); sb.append(link.toString()); @@ -215,14 +103,14 @@ * Generate string. * * @param actionCaption the action caption - * @param action the action * @param element the element + * @param page the page * * @return the string */ - protected String generateString(String actionCaption, String action, MetaData element) { + protected String generateString(String actionCaption, SimExplorerPage page, MetaData element) { String context = element.getUuid() + "," + element.getVersion(); - return generateString(actionCaption, action, context); + return generateString(actionCaption, page, context); } /** @@ -230,23 +118,22 @@ * * @param element the element * @param security the security - * @param actions the actions + * @param pages the pages * * @return the string */ - protected String generateActions(MetaData element, boolean security, String... actions) { + protected String generateActions(MetaData element, boolean security, SimExplorerPage... pages) { StringBuilder sb = new StringBuilder(""); String res; - for (String anAction : actions) { + for (SimExplorerPage page : pages) { sb.append("<br>"); - sb - .append(generateString(getMessages().get("simexplorer.ui.web." + anAction + ".action"), anAction, - element)); + sb.append(generateString(getMessages().get(page.getCaption()), page, element)); } if (security) { sb.append("<br>"); - sb.append(generateString(getMessages().get("simexplorer.ui.web.rights.action"), "rights", element)); + sb.append(generateString(getMessages().get(SimExplorerPage.ElementRights.getCaption()), + SimExplorerPage.ElementRights, element)); } res = sb.substring(4); @@ -266,7 +153,7 @@ * @return the string[] */ protected String[] generateStringArray(String s1, String s2, String s3, MetaData element, boolean security, - String... actions) { + SimExplorerPage... actions) { List<String> result = new ArrayList<String>(); result.add(s1); result.add(s2); @@ -327,7 +214,7 @@ nodes.add(simpleNode(getMessages().get("simexplorer.ui.web.metadata.parentversion"), generateString(m .getParentUuid() - + " - " + m.getParentVersion(), "details", parentContext))); + + " - " + m.getParentVersion(), SimExplorerPage.ElementDetail, parentContext))); } nodes.add(descriptorsNode(getElement().getDescriptors())); Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.StringTokenizer; import org.apache.tapestry.ValueEncoder; import org.apache.tapestry.annotations.InjectPage; @@ -74,7 +75,8 @@ * Sets the up. * * @param groupId the new up - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception */ void setup(int groupId) throws SimExplorerException { this.usersInGroup = new ArrayList<User>(); @@ -96,10 +98,24 @@ } /** + * On activate. + * + * @param context the context + * + * @throws SimExplorerException the sim explorer exception + */ + public void onActivate(String context) throws SimExplorerException { + if (context != null && !context.equals("")) { + this.setup(Integer.parseInt(context)); + } + } + + /** * On success. * * @return the object - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception */ public Object onSuccess() throws SimExplorerException { if (group.getId() == null) { @@ -140,7 +156,8 @@ * Gets the users. * * @return the users - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception */ public List<User> getUsers() throws SimExplorerException { List<User> result = new ArrayList<User>(); @@ -153,7 +170,8 @@ * Gets the groups. * * @return the groups - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception */ public List<Group> getGroups() throws SimExplorerException { List<Group> result = new ArrayList<Group>(); Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -111,43 +111,6 @@ } /** - * On action from edit. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromEdit(Integer context) throws SimExplorerException { - groupEdit.setup(context); - return groupEdit; - } - - /** - * On edit. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onEdit(Integer context) throws SimExplorerException { - return onActionFromEdit(context); - } - - /** - * On action from add. - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromAdd() throws SimExplorerException { - groupEdit.setup(-1); - return groupEdit; - } - - /** * Gets the model. * * @return the model @@ -196,7 +159,7 @@ node.setChildren(childrenNodes); } - Link link = getResources().createActionLink("edit", false, group.getId()); + Link link = getResources().createPageLink("GroupEdit", false, group.getId()); StringBuffer sb = new StringBuffer(""); sb.append("<a href=\""); sb.append(link.toString()); Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -17,6 +17,7 @@ * ##% */ package fr.cemagref.simexplorer.is.ui.web.pages; +import java.io.IOException; import java.util.Arrays; import org.apache.tapestry.annotations.ApplicationState; @@ -26,12 +27,15 @@ import org.apache.tapestry.corelib.components.Form; import org.apache.tapestry.ioc.Messages; import org.apache.tapestry.ioc.annotations.Inject; +import org.apache.tapestry.services.RequestGlobals; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.service.AuthenticationServiceHelper; import fr.cemagref.simexplorer.is.service.remote.RemoteSecurityService; -/** The Class Login. */ +/** + * The Class Login. + */ public class Login { /** The user. */ @@ -55,6 +59,10 @@ @ApplicationState private String token; + /** The request globals. */ + @Inject + private RequestGlobals requestGlobals; + /** The messages. */ @Inject private Messages messages; @@ -67,18 +75,25 @@ * On success. * * @return the object - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception + * @throws IOException */ - public Object onSuccessFromFormLogin() throws SimExplorerException { + public Object onSuccessFromFormLogin() throws SimExplorerException, IOException { // on hache directement le password pour ne pas le transmettre en clair char[] chars = password.toCharArray(); String pass = AuthenticationServiceHelper.computeHash(chars); // reset du tableau Arrays.fill(chars, (char) 0); password = null; + token = RemoteSecurityService.getAuthentificationService().loginUser(user, pass); if (token != null && !token.equals("")) { - return elementList; + Object fromURL = requestGlobals.getRequest().getSession(false).getAttribute("fromURL"); + if (fromURL == null) { + return elementList; + } + requestGlobals.getResponse().sendRedirect((String) fromURL); } formLogin.recordError(messages.get("simexplorer.ui.web.login.invalid")); return this; @@ -88,7 +103,8 @@ * On success from form request account. * * @return the object - * @throws SimExplorerException + * + * @throws SimExplorerException the sim explorer exception */ public Object onSuccessFromFormRequestAccount() throws SimExplorerException { RemoteSecurityService.getAuthentificationService().requestAccount(login, mail); Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -130,6 +130,19 @@ } /** + * On activate. + * + * @param context the context + * + * @throws SimExplorerException the sim explorer exception + */ + public void onActivate(String context) throws SimExplorerException { + if (context != null && !context.equals("")) { + this.setup(Integer.parseInt(context)); + } + } + + /** * On success. * * @return the object @@ -306,21 +319,4 @@ return _element.getUuid() + "," + _element.getVersion(); } - /** - * On action from detail element using. - * - * @param context the context - * - * @return the object - * - * @throws SimExplorerException the sim explorer exception - */ - public Object onActionFromDetailElement(String context) throws SimExplorerException { - StringTokenizer st = new StringTokenizer(context, ","); - String uuid = st.nextToken(); - String version = st.nextToken(); - elementDetail.setup(uuid, version); - return elementDetail; - } - } Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -18,7 +18,6 @@ package fr.cemagref.simexplorer.is.ui.web.pages; import org.apache.tapestry.ComponentResources; -import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Retain; import org.apache.tapestry.beaneditor.BeanModel; import org.apache.tapestry.ioc.annotations.Inject; @@ -53,10 +52,6 @@ @Inject private ComponentResources resources; - /** The user edit. */ - @InjectPage - private UserEdit userEdit; - /* (non-Javadoc) * @see fr.cemagref.simexplorer.is.ui.web.pages.security.ProtectedPage#getWindowTitle() */ @@ -97,48 +92,6 @@ } /** - * On action from edit. - * - * @param context the context - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromEdit(Integer context) throws SimExplorerException { - userEdit.setup(context); - return userEdit; - } - - /** - * On action from add. - * - * @return the object - * @throws SimExplorerException - */ - public Object onActionFromAdd() throws SimExplorerException { - userEdit.setup(-1); - return userEdit; - } - - /** - * Gets the user edit. - * - * @return the user edit - */ - public UserEdit getUserEdit() { - return userEdit; - } - - /** - * Sets the user edit. - * - * @param userEdit the new user edit - */ - public void setUserEdit(UserEdit userEdit) { - this.userEdit = userEdit; - } - - /** * Gets the model. * * @return the model Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/security/ProtectedPage.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -22,12 +22,14 @@ import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.Messages; import org.apache.tapestry.ioc.annotations.Inject; +import org.apache.tapestry.services.RequestGlobals; import org.codelutin.i18n.I18n; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.exceptions.SimExplorerSecurityException; import fr.cemagref.simexplorer.is.security.entities.User; import fr.cemagref.simexplorer.is.service.remote.RemoteSecurityService; +import fr.cemagref.simexplorer.is.ui.web.pages.Login; /** * The Class ProtectedPage. @@ -38,6 +40,9 @@ @ApplicationState private String token; + @Inject + private RequestGlobals requestGlobals; + /** The user. */ @Persist private User user; @@ -71,8 +76,11 @@ */ Object onActivate() throws SimExplorerException { getUserRights(); - if (!userLogged) + if (!userLogged) { + String fromURL = requestGlobals.getRequest().getPath(); + requestGlobals.getRequest().getSession(true).setAttribute("fromURL", fromURL); return "Login"; + } if (!hasAccessToPage()) throw new SimExplorerSecurityException(); return null; @@ -83,7 +91,7 @@ * * @throws SimExplorerException the sim explorer exception */ - private void getUserRights() throws SimExplorerException { + public void getUserRights() throws SimExplorerException { user = computeUserLogged(); if (user != null) { userLogged = true; @@ -114,7 +122,11 @@ private User computeUserLogged() throws SimExplorerException { User loggedUser = null; if (token != null) { - loggedUser = RemoteSecurityService.getAuthentificationService().getLoggedUser(token); + try { + loggedUser = RemoteSecurityService.getAuthentificationService().getLoggedUser(token); + } catch (Exception e) { + loggedUser = null; + } } return loggedUser; } @@ -124,7 +136,7 @@ * * @return true, if successful */ - abstract boolean hasAccessToPage(); + public abstract boolean hasAccessToPage(); /** * Gets the window title. Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/tools/WebEntityVisitor.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/tools/WebEntityVisitor.java 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/tools/WebEntityVisitor.java 2008-03-13 19:33:30 UTC (rev 1333) @@ -30,20 +30,33 @@ import fr.cemagref.simexplorer.is.entities.EntityHelper; import fr.cemagref.simexplorer.is.entities.EntityTypeEnum; import fr.cemagref.simexplorer.is.entities.EntityVisitorTreeNode; +import fr.cemagref.simexplorer.is.entities.SimExplorerPage; import fr.cemagref.simexplorer.is.entities.EntityHelper.Action; import fr.cemagref.simexplorer.is.entities.EntityHelper.ActionAvailabilty; import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.data.LoggableElement; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; +/** + * The Class WebEntityVisitor. + */ public class WebEntityVisitor extends EntityVisitorTreeNode<TreeNode> { + /** The resources. */ private ComponentResources resources; + /** The messages. */ private Messages messages; + /** The last le. */ private LoggableElement lastLE; + /** + * Instantiates a new web entity visitor. + * + * @param resources the resources + * @param messages the messages + */ public WebEntityVisitor(ComponentResources resources, Messages messages) { super(); this.resources = resources; @@ -59,8 +72,8 @@ * * @return the string */ - protected String generateString(String actionCaption, String action, String context) { - Link link = resources.createActionLink(action, false, context); + protected String generateString(String actionCaption, SimExplorerPage action, String context) { + Link link = resources.createPageLink(action.getPageName(), false, context); StringBuffer sb = new StringBuffer(""); sb.append("<a href=\""); sb.append(link.toString()); @@ -79,11 +92,14 @@ * * @return the string */ - protected String generateString(String actionCaption, String action, MetaData element) { + protected String generateString(String actionCaption, SimExplorerPage action, MetaData element) { String context = element.getUuid() + "," + element.getVersion(); return generateString(actionCaption, action, context); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.entities.EntityVisitorTreeNode#createNode(fr.cemagref.simexplorer.is.entities.Entity, boolean) + */ protected TreeNode createNode(Entity v, boolean allowedChildren) { TreeNode treeNode = new TreeNode(); treeNode.setChildren(new ArrayList<TreeNode>()); @@ -118,8 +134,8 @@ if ((action.getAvailabilty() == ActionAvailabilty.WEB || action.getAvailabilty() == ActionAvailabilty.BOTH) && action.accept(v)) { sb.append("<br>"); - sb.append(generateString(messages.get("simexplorer.ui.web." + action.getActionName() + ".action"), - action.getActionName(), le.getMetaData())); + sb.append(generateString(messages.get(action.getPage().getCaption()), action.getPage(), le + .getMetaData())); } } @@ -131,7 +147,14 @@ String context = le.getMetaData().getUuid() + "," + le.getMetaData().getVersion() + "," + ((Attachment) v).getUniqueId(); sb.append("<br>"); - sb.append(generateString(messages.get("simexplorer.ui.web.export.action"), "downloadFile", context)); + + Link link = resources.createActionLink("downloadFile", false, context); + sb.append("<a href=\""); + sb.append(link.toString()); + sb.append("\">"); + sb.append(messages.get("simexplorer.ui.web.export.action")); + sb.append("</a>"); + } if (sb.length() > 0) { Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDelete.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDelete.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDelete.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -9,8 +9,8 @@ <table t:type="SimGrid" source="usedBy" row="listMetadata" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElementUsedBy" - context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" + context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> @@ -23,8 +23,8 @@ <table t:type="SimGrid" source="usedByAllVersions" row="listMetadata" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElementUsedByAnyVersion" - context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" + context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDownload.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDownload.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementDownload.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -1,8 +1,6 @@ <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" title="${windowtitle}"> - <p><t:actionlink t:id="downloadXML">${message:simexplorer.ui.web.export.downloadxml}</t:actionlink> - </p> <p><t:actionlink t:id="downloadFull">${message:simexplorer.ui.web.export.downloadfull}</t:actionlink> </p> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementList.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementList.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementList.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -5,7 +5,7 @@ <table t:id="elementListGrid" t:type="SimGrid" source="elements" row="element" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElement" context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementManage.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementManage.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementManage.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -15,7 +15,7 @@ <table t:id="elementListGrid" t:type="SimGrid" source="elements" row="element" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElement" context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> <t:parameter name="ownerCell"> <t:loop source="owners" value="actor"> @@ -38,7 +38,7 @@ </t:loop> </t:parameter> <t:parameter name="rightsCell"> - <t:actionlink t:id="rights" context="${detailElementContext}">${message:simexplorer.ui.web.rights.action}</t:actionlink> + <t:pagelink t:page="ElementRights" context="${detailElementContext}">${message:simexplorer.ui.web.rights.action}</t:pagelink> </t:parameter> </table> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementMetadata.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementMetadata.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/ElementMetadata.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -15,8 +15,8 @@ <table t:type="SimGrid" source="elementsUsing" row="element" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElementUsed" - context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" + context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> @@ -27,8 +27,8 @@ <table t:type="SimGrid" source="elementsUsedBy" row="element" model="model"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElementUsing" - context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" + context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/GroupList.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/GroupList.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/GroupList.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -4,14 +4,14 @@ <p> <table t:type="SimGrid" source="groups" row="group" model="model"> <t:parameter name="editCell"> - <t:actionlink t:id="edit" context="group.id">${message:simexplorer.ui.web.modify}</t:actionlink> + <t:pagelink t:page="GroupEdit" context="group.id">${message:simexplorer.ui.web.modify}</t:pagelink> </t:parameter> <t:parameter name="deleteCell"> <t:actionlink t:id="delete" context="group.id">${message:simexplorer.ui.web.delete}</t:actionlink> </t:parameter> </table> </p> - <p><t:actionlink t:id="add">${message:simexplorer.ui.web.addgroup}</t:actionlink></p> + <p><t:pagelink t:page="GroupEdit" context="-1">${message:simexplorer.ui.web.addgroup}</t:pagelink></p> <p>${message:simexplorer.ui.web.groupHierarchy} :</p> <table t:type="cl/TreeGrid" source="groupNodes" Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/Login.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/Login.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/Login.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -31,6 +31,6 @@ <input t:type="Submit" t:value="${message:simexplorer.ui.web.login.requestaccount}" /></div> </t:form> + - </t:layout> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserEdit.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserEdit.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserEdit.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -47,8 +47,8 @@ <table t:type="SimGrid" source="elementsOwnedBy" row="element" model="metadataModel"> <t:parameter name="uuidCell"> - <t:actionlink t:id="detailElement" - context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:actionlink> + <t:pagelink t:page="ElementDetail" + context="${detailElementContext}">${message:simexplorer.ui.web.elementlist.details}</t:pagelink> </t:parameter> </table> </t:if> Modified: trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserList.tml =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserList.tml 2008-03-13 17:23:51 UTC (rev 1332) +++ trunk/simexplorer-is/simexplorer-is-web/src/main/webapp/UserList.tml 2008-03-13 19:33:30 UTC (rev 1333) @@ -4,13 +4,13 @@ <table t:type="SimGrid" source="users" row="user" model="model"> <t:parameter name="editCell"> - <t:actionlink t:id="edit" context="user.id">${message:simexplorer.ui.web.modify}</t:actionlink> + <t:pagelink t:page="UserEdit" context="user.id">${message:simexplorer.ui.web.modify}</t:pagelink> </t:parameter> <t:parameter name="deleteCell"> <t:actionlink t:id="delete" context="user.id">${message:simexplorer.ui.web.delete}</t:actionlink> </t:parameter> </table> - <t:actionlink t:id="add">${message:simexplorer.ui.web.adduser}</t:actionlink> + <t:pagelink t:page="UserEdit" context="-1">${message:simexplorer.ui.web.adduser}</t:pagelink> </t:layout>