# HG changeset patch # User Ingo Weinzierl # Date 1264153774 0 # Node ID b5733f9f386bbe9d22285e980530a2f7524abf64 # Parent 55dae5bb76db46cd8c6eec837e8b35eba1c95587 Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state. gnv/trunk@594 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 55dae5bb76db -r b5733f9f386b gnv/ChangeLog --- a/gnv/ChangeLog Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/ChangeLog Fri Jan 22 09:49:34 2010 +0000 @@ -1,3 +1,47 @@ +2010-01-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: + - Improved the design and the usibility concept ("Bedienkonzept"). + Removed the useless "draw" button after reaching the last state which + has some output modes. + - Render chart options - if chart creation is possible for this state - and show + export actions. + - Moved chart options and export actions to the left side beneath the + static and dynamic panals for parameterization. + - Removed some warnings and errors regaring html conformance. + + * src/main/webapp/styles/default.css: Made some necessary adjustments + regarding the movement of chart option and action boxes. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + action box. + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Removed pathes of xsl sheets from code and put them to a central place. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added + urls to xsl transformer for step-back links and create a dynamic ui only + if there is content for it - avoid creation of empty boxes. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Write + dynamic ui only if there is content. Some code formatting done. + + * src/main/webapp/images/back_button.png: Button to step back to a previous + state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added forwards to fis + selection and previous states. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Enabled + link to step back to fis selection. + 2010-01-20 Ingo Weinzierl Issue149 diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java --- a/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Jan 22 09:49:34 2010 +0000 @@ -18,6 +18,12 @@ */ public class ArtifactDatabaseActionBase extends Action { + public static final String XSL_SHEET_DYNAMIC = + "WEB-INF/config/templates/describe-ui.xsl"; + + public static final String XSL_SHEET_STATIC = + "WEB-INF/config/templates/describe-ui-static.xsl"; + protected final static String SUCCSESS_FORWARD_ID = "success"; protected final static String EXCEPTION_FORWARD_ID = "success"; diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Jan 22 09:49:34 2010 +0000 @@ -92,18 +92,28 @@ Node currentUI = artifactDescription.getCurrentUI(); XSLTransformer transformer = new XSLTransformer(); - String ui = transformer.transform(new XMLUtils().getNodeXPath( - currentUI, "art:dynamic"), "UTF-8", request - .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); - - request.setAttribute("ui", ui); - String staticUI = transformer - .transform( - new XMLUtils().getNodeXPath(currentUI, "art:static"), - "UTF-8", - request - .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + String url = response.encodeURL( + mapping.findForward("back").getPath()); + transformer.addParameter("back-url", url); + + String fisUrl = response.encodeURL( + mapping.findForward("selectfis").getPath()); + transformer.addParameter("selectfis", fisUrl); + + String ui = transformer.transform( + new XMLUtils().getNodeXPath(currentUI, "art:dynamic"), + "UTF-8", + request.getRealPath(XSL_SHEET_DYNAMIC + )); + + if (ui != null && ui.length() > 1) + request.setAttribute("ui", ui); + + String staticUI = transformer.transform( + new XMLUtils().getNodeXPath(currentUI, "art:static"), + "UTF-8", + request.getRealPath(XSL_SHEET_STATIC)); request.setAttribute("staticui", staticUI); Map tmpOuts = ad.getOutputModes(); diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Jan 22 09:49:34 2010 +0000 @@ -33,6 +33,7 @@ * */ public class NextArtifactStepAction extends ArtifactDatabaseActionBase { + /** * the logger, used to log exceptions and additonaly information */ @@ -117,24 +118,21 @@ Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"art:dynamic"); if (dynamicUINode != null){ - String ui = transformer - .transform( - dynamicUINode, - "UTF-8", - request - .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + String ui = transformer.transform( + dynamicUINode, + "UTF-8", + request.getRealPath(XSL_SHEET_DYNAMIC)); - request.setAttribute("ui", ui); + if (ui != null && ui.length() > 1) + request.setAttribute("ui", ui); } Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "art:static"); if (staticUINode != null){ - String staticUI = transformer - .transform( - staticUINode, - "UTF-8", - request - .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + String staticUI = transformer.transform( + staticUINode, + "UTF-8", + request.getRealPath(XSL_SHEET_STATIC)); request.setAttribute("staticui", staticUI); } } @@ -147,16 +145,11 @@ // statistic abholen und in das sessionmodell schreiben. ArtifactDescription artifactDescription; try{ - - Collection statistics = adc - .calculateStatistics(sm.getSelectedArtifactFactory(), - sm.getCurrentArtifact()); - sm.setStatistics(statistics); - artifactDescription = adc - .getCurrentStepDescription(sm - .getSelectedArtifactFactory(), sm - .getCurrentArtifact(), - true); + artifactDescription = adc.getCurrentStepDescription( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + true + ); request.setAttribute("diagramm", true); @@ -181,24 +174,22 @@ Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"art:dynamic"); if (dynamicUINode != null){ - String ui = transformer - .transform( - dynamicUINode, - "UTF-8", - request - .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + String ui = transformer.transform( + dynamicUINode, + "UTF-8", + request.getRealPath(XSL_SHEET_DYNAMIC)); - request.setAttribute("ui", ui); + if (ui != null && ui.length() > 1) + request.setAttribute("ui", ui); } Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "art:static"); if (staticUINode != null){ - String staticUI = transformer - .transform( - staticUINode, - "UTF-8", - request - .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + String staticUI = transformer.transform( + staticUINode, + "UTF-8", + request.getRealPath(XSL_SHEET_STATIC)); + request.setAttribute("staticui", staticUI); } } diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/resources/applicationMessages.properties --- a/gnv/src/main/resources/applicationMessages.properties Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Fri Jan 22 09:49:34 2010 +0000 @@ -67,12 +67,13 @@ gnviewer.output.options.export.zip.title=ZIP-Archiv exportieren gnviewer.output.options.export.wms.title=WMS-Layer bereitstellen +# export options +gnviewer.export.fieldset.title=Aktionen + height=H\u00f6he width=Breite points=Zeichne Datenpunkte - - # Fehlermeldungen: java.io.ioexception..connection.refused=Die Verbindung zur Artifaktdatenbank ist unterbrochen. Bitte probieren Sie es zu einem sp\u00e4teren Zeitpunkt erneut. diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/resources/applicationMessages_en.properties --- a/gnv/src/main/resources/applicationMessages_en.properties Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Fri Jan 22 09:49:34 2010 +0000 @@ -67,6 +67,9 @@ gnviewer.output.options.export.zip.title=Export as ZIP archive gnviewer.output.options.export.wms.title=Serve as WMS layer +# export options +gnviewer.export.fieldset.title=Actions + height=Height width=Width points=Draw data points diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/config/struts-config.xml --- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Fri Jan 22 09:49:34 2010 +0000 @@ -80,9 +80,15 @@ type="de.intevation.gnv.action.ChangeOptionsAction" scope="request" validate="false"> - + + diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl --- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Fri Jan 22 09:49:34 2010 +0000 @@ -3,18 +3,23 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/2002/xforms" xmlns:xform="http://www.w3.org/2002/xforms" - xmlns:art="http://www.intevation.de/2009/artifacts"> + xmlns:art="http://www.intevation.de/2009/artifacts" + exclude-result-prefixes="xform art"> - + + bearbeiten - - -
+
+ + +
+
@@ -22,15 +27,17 @@ - + + + @@ -40,26 +47,20 @@ - - [X] + {$edit} - --> - - - - - - - - - @@ -82,17 +83,17 @@ -
+ + +
diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/header.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -16,11 +16,11 @@ - "> -

- -

-
+

+ "> + + +

diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -6,29 +6,22 @@ <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> <%@page import="java.net.URLEncoder"%> -<%Object diagramm = request.getAttribute("diagramm"); -SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); -if (diagramm != null){ - String target = "chart"; - String targetCSV = "csv"; - String targetODV = "odv"; - String targetPDF = "pdf"; - String targetSVG = "svg"; - String targetZIP = "zip"; - String targetWMS = "wms"; +<% + // fetch diagramm parameter from request if the user clicked 'draw' + Object diagramm = request.getAttribute("diagramm"); + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + + String target = "chart"; + String mimeType = null; + String parameterString = ""; + boolean supportChart = sm.getOutputMode(target) != null; - boolean supportCSV = sm.getOutputMode(targetCSV) != null; - boolean supportODV = sm.getOutputMode(targetODV) != null; - boolean supportPDF = sm.getOutputMode(targetPDF) != null; - boolean supportSVG = sm.getOutputMode(targetSVG) != null; - boolean supportZIP = sm.getOutputMode(targetZIP) != null; - boolean supportWMS = sm.getOutputMode(targetWMS) != null; - String mimeType = null; - String parameterString = ""; + if (supportChart){ - mimeType = sm.getOutputMode(target).getMimeType(); + mimeType = sm.getOutputMode(target).getMimeType(); DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); - Collection op = sm.getOutputMode(target).getOutputParameters(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + if (op != null){ Iterator it = op.iterator(); while (it.hasNext()){ @@ -37,77 +30,17 @@ } } } - String mimeTypePDF = null; - if (supportPDF) { - mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); - } - String mimeTypeSVG = null; - if (supportSVG) { - mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); - mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); - } - String mimeTypeCSV = null; - if (supportCSV){ - mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); - } +%> - String mimeTypeODV = null; - if (supportODV){ - mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); - } +<%-- show chart options if output mode 'chart' is supported --%> +<% if (supportChart) { %> + +<%}%> - String mimeTypeZIP = null; - if (supportZIP) { - mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); - } - - String mimeTypeWMS = null; - if (supportWMS) { - mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); - } -%> -
- <bean:message key="gnviewer.output.options.diagramm.alt"/> +<%-- diagramm is not null if the user clicked the 'draw' button --%> +<%if (diagramm != null) { %> +
+ <bean:message key="gnviewer.output.options.diagramm.alt"/>
-
- <%if (supportChart) { %> - "> - - - <%}%> - <%if (supportPDF) { %> - "> - - - <%}%> - <%if (supportSVG) { %> - "> - - - <%}%> - <%if (supportCSV) { %> - "> - - - <%}%> - <%if (supportODV) { %> - "> - - - <%}%> - <%if (supportWMS) { %> - "> - - - <%}%> - <%if (supportZIP) { %> - "> - - - <%}%> -
- <%if (supportChart) { %> - - <%}%>
<%}%> diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -44,8 +44,8 @@ <%}%> - "/> + "/> <%}%> -
\ No newline at end of file + diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -0,0 +1,116 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + String mimeType = null; + String parameterString = ""; + + String target = "chart"; + String targetCSV = "csv"; + String targetODV = "odv"; + String targetPDF = "pdf"; + String targetSVG = "svg"; + String targetZIP = "zip"; + String targetWMS = "wms"; + + boolean supportChart = sm.getOutputMode(target) != null; + boolean supportCSV = sm.getOutputMode(targetCSV) != null; + boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportPDF = sm.getOutputMode(targetPDF) != null; + boolean supportSVG = sm.getOutputMode(targetSVG) != null; + boolean supportZIP = sm.getOutputMode(targetZIP) != null; + boolean supportWMS = sm.getOutputMode(targetWMS) != null; + + if (supportChart){ + mimeType = sm.getOutputMode(target).getMimeType(); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + } + + String mimeTypePDF = null; + if (supportPDF) { + mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG) { + mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } + String mimeTypeCSV = null; + if (supportCSV){ + mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); + } + + String mimeTypeODV = null; + if (supportODV){ + mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); + } + + String mimeTypeZIP = null; + if (supportZIP) { + mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); + } + + String mimeTypeWMS = null; + if (supportWMS) { + mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); + } +%> + +<%-- display export options if one is supported in this state --%> +<% if (supportPDF || supportSVG || supportCSV || supportODV || supportWMS || supportZIP) { %> +
+
+ + <%if (supportChart) { %> + "> + + + <%}%> + <%if (supportPDF) { %> + "> + + + <%}%> + <%if (supportSVG) { %> + "> + + + <%}%> + <%if (supportCSV) { %> + "> + + + <%}%> + <%if (supportODV) { %> + "> + + + <%}%> + <%if (supportWMS) { %> + "> + + + <%}%> + <%if (supportZIP) { %> + "> + + + <%}%> +
+
+<%}%> diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/index.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -4,37 +4,40 @@ <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> <%@page import="java.util.Iterator"%> -<%Object ui = request.getAttribute("ui"); - Object staticui = request.getAttribute("staticui"); - boolean furthertargets = true; +<% Object ui = request.getAttribute("ui"); + Object staticui = request.getAttribute("staticui"); + boolean furthertargets = true; - Object furthertargetsObject = request.getAttribute("furthertargets"); - if (furthertargetsObject != null){ - furthertargets = ((Boolean)furthertargetsObject).booleanValue(); - } + Object furthertargetsObject = request.getAttribute("furthertargets"); + if (furthertargetsObject != null){ + furthertargets = ((Boolean)furthertargetsObject).booleanValue(); + } %>
<%if (staticui == null){ %> <%} else {%> - <%=staticui.toString()%> <%}%> + <%-- render the dynamic part to feed the state and advance to the next state --%> <%if (ui != null){%> -
-
") method="post"> -
- <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> - - <%if(furthertargets){%> - "/> - <%}else{%> - "/> - <%}%> -
-
-
+
+
") method="post"> +
+ <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> + + <%if(furthertargets){%> + "/> + <%}%> +
+
+
<%}%>
+ + <%-- render chart options if existing for this state --%> + + <%-- render export options if existing for this state --%> + diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Fri Jan 22 09:49:34 2010 +0000 @@ -1,7 +1,7 @@ <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> - + <bean:message key="gnviewer.app.title"/> diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/images/back_button.png Binary file gnv/src/main/webapp/images/back_button.png has changed diff -r 55dae5bb76db -r b5733f9f386b gnv/src/main/webapp/styles/default.css --- a/gnv/src/main/webapp/styles/default.css Wed Jan 20 14:44:39 2010 +0000 +++ b/gnv/src/main/webapp/styles/default.css Fri Jan 22 09:49:34 2010 +0000 @@ -93,9 +93,6 @@ } table.static { - /* TODO ENABLE padding-top for step-back history - padding-top: 20px; - */ border: 1px solid #CCD5DE; margin: 5px 0 0 10px; padding-left: 7px; @@ -109,9 +106,18 @@ font-size: 0.8em; } +img { + border: 0px; +} + +#down { + padding-top: 20px; +} + .historyback { padding-left: 10px; vertical-align: top; + text-align: right; } .parameter { @@ -257,7 +263,7 @@ } div#export { - padding-left: 7px; + width: 325px; } /* this is a wrapper for diagramoptions and statistics*/ @@ -269,13 +275,12 @@ div#diagramoptions { /*POSITION DEFINIEREN*/ -/*border: 1px solid blue;*/ position: relative; - width: 600px; + width: 325px; } div#diagramOptionsContent { -/*display: none;*/ + width : 325px; } div#statistics {