changeset 408:b5733f9f386b

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
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 22 Jan 2010 09:49:34 +0000
parents 55dae5bb76db
children df78178e1180
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl gnv/src/main/webapp/WEB-INF/jsp/header.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/index.jsp gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp gnv/src/main/webapp/images/back_button.png gnv/src/main/webapp/styles/default.css
diffstat 17 files changed, 330 insertions(+), 210 deletions(-) [+]
line wrap: on
line diff
--- 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 <ingo.weinzierl@intevation.de>
+
+	* 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 <ingo.weinzierl@intevation.de>
 
 	  Issue149
--- 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";
 
--- 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();
--- 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<ArtifactStatisticsSet> 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);
                         }
                     }
--- 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.
--- 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
--- 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">
-                <forward
+            <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
+            <forward
+                name="back"
+                path="/gnv/back.do"/>
+            <forward
+                name="selectfis"
+                path="/gnv/selectFis.do"/>
         </action>
        </action-mappings>
        
--- 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">
 
-    <xsl:output method="html" version="1.0" encoding="UTF-8" omit-xml-declaration="no" />
+    <xsl:output
+        method="html" version="1.0" encoding="UTF-8" omit-xml-declaration="no" />
 
     <xsl:param name="back-url"/>
     <xsl:param name="selectfis"/>
+    <xsl:param name="edit">bearbeiten</xsl:param>
 
     <!-- start parsing document -->
     <xsl:template match="*">
-        <table class="static">
-            <xsl:apply-templates />
-        </table>
+        <div id="down">
+            <table class="static">
+                <xsl:apply-templates />
+            </table>
+        </div>
     </xsl:template>
 
     
@@ -22,15 +27,17 @@
     <xsl:template match="xform:select">
         <xsl:variable name="state" select="@art:state" />
         <tr>
-            <!-- TODO Remove this link to render links to jump back in history
-            <td class="historyback">
-                <xsl:if test="$state != ''">
-                    <a href="{$back-url}?target={$state}">[X]</a>
-                </xsl:if>
-            </td>
-            -->
             <th class="parameter"><xsl:value-of select="xform:label" /></th>
             <td><xsl:apply-templates select="xform:choices" /></td>
+            <td class="historyback">
+            <!--
+                <xsl:if test="$state != ''">
+                    <a href="{$back-url}?target={$state}">
+                        <img title="{$edit}" alt="{$edit}" src="images/back_button.png"/>
+                    </a>
+                </xsl:if>
+            -->
+            </td>
         </tr>
     </xsl:template>
 
@@ -40,26 +47,20 @@
         <xsl:variable name="state" select="@art:state" />
         <xsl:variable name="fis" select="@art:fis" />
         <tr>
-            <!-- TODO Remove this link to render links to jump back in history
+            <th class="parameter"><xsl:value-of select="xform:label" /></th>
+            <td><xsl:apply-templates select="xform:choices" /></td>
             <td class="historyback">
+                <!--
                 <xsl:if test="$state != ''">
-                    <a href="{$back-url}?target={$state}">[X]</a>
+                    <a href="{$back-url}?target={$state}">
+                        <img title="{$edit}" alt="{$edit}" src="images/back_button.png"/>
+                    </a>
                 </xsl:if>
+                -->
                 <xsl:if test="$fis">
-                    <a href="{$selectfis}">[X]</a>
+                    <a href="{$selectfis}"><img title="{$edit}" alt="{$edit}" src="images/back_button.png"/></a>
                 </xsl:if>
             </td>
-            -->
-            <!-- TODO Remove when-clause which disables the fis select box .
-                 TODO Just render the 'otherwise' part -->
-            <xsl:choose>
-                <xsl:when test="$fis">
-                </xsl:when>
-                <xsl:otherwise>
-                    <th class="parameter"><xsl:value-of select="xform:label" /></th>
-                    <td><xsl:apply-templates select="xform:choices" /></td>
-                </xsl:otherwise>
-            </xsl:choose>
         </tr>
     </xsl:template>
 
@@ -82,17 +83,17 @@
     <xsl:template match="xform:group">
         <xsl:variable name="state" select="@art:state" />
         <tr>
-            <!-- TODO Remove this link to render links to jump back in history
-            <td class="historyback">
-                <xsl:if test="$state != ''">
-                    <a href="{$back-url}?target={$state}">[X]</a>
-                </xsl:if>
-            </td>
-            -->
             <th class="parameter"><xsl:value-of select="xform:label" /></th>
             <td>
                 <table><xsl:apply-templates select="xform:input" /></table>
             </td>
+            <td class="historyback">
+                <!--
+                <xsl:if test="$state != ''">
+                    <a href="{$back-url}?target={$state}"><img title="{$edit}" alt="{$edit}" src="images/back_button.png"/></a>
+                </xsl:if>
+                -->
+            </td>
         </tr>
     </xsl:template>
 
--- 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 @@
 	
 	
 	</div>
-	<a href="<html:rewrite action="/start"/>">
-		<h1>
-			<bean:message key="gnviewer.app.title" />
-		</h1>
-	</a>
+    <h1>
+        <a href="<html:rewrite action="/start"/>">
+            <bean:message key="gnviewer.app.title" />
+        </a>
+    </h1>
 	
 	<div id="project">
 		<label style="font-weight:bold;">
--- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp	Wed Jan 20 14:44:39 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp	Fri Jan 22 09:49:34 2010 +0000
@@ -1,4 +1,5 @@
 <div id="diagramoptions">
-    <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp"></jsp:include>
+    <%--
     <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp"></jsp:include>
-</div>
\ No newline at end of file
+    --%>
+</div>
--- 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<OutputParameter> op = sm.getOutputMode(target).getOutputParameters();
+       Collection<OutputParameter> op  = sm.getOutputMode(target).getOutputParameters();
+
        if (op != null){
            Iterator<OutputParameter> 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) { %>
+    <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp"></jsp:include>
+<%}%>
 
-    String mimeTypeZIP = null;
-    if (supportZIP) {
-        mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType();
-    }
-
-    String mimeTypeWMS = null;
-    if (supportWMS) {
-        mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType();
-    }
-%>
-<div id="diagram">
-        <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.diagramm.alt"/>'/>
+<%-- diagramm is not null if the user clicked the 'draw' button --%>
+<%if (diagramm != null) { %>
+    <div id="diagram">
+        <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&amp;target="+target+parameterString+"&amp;uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.diagramm.alt"/>'/>
         <br/>
-        <div id="export">
-            <%if (supportChart) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>">
-                <img src="images/diagram_export.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportPDF) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>">
-                <img src="images/pdf.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportSVG) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>">
-                <img src="images/svg.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportCSV) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
-                <img src="images/data_export.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportODV) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>">
-                <img src="images/data_export.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportWMS) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeWMS+"&target="+targetWMS+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>">
-                <img src="images/map_go.png" border="0"/>
-            </a>
-            <%}%>
-            <%if (supportZIP) { %>
-            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeZIP+"&target="+targetZIP+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.zip.title"/>">
-                <img src="images/disk.png" border="0"/>
-            </a>
-            <%}%>
-        </div>
-        <%if (supportChart) { %>
-        <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp"></jsp:include>
-        <%}%>
     </div>
 <%}%>
--- 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 @@
            <%}%>
            </table>
            <input type="hidden" name="target" value="<%=target%>"/>
-           <input type="submit" value="<bean:message key="gnviewer.select.button"/>"/>
+           <input type="submit" value="<bean:message key="gnviewer.draw.button"/>"/>
            <%}%>
         </form>
     </fieldset>
-</div>
\ No newline at end of file
+</div>
--- /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<OutputParameter> op  = sm.getOutputMode(target).getOutputParameters();
+
+       if (op != null){
+           Iterator<OutputParameter> it = op.iterator();
+           while (it.hasNext()){
+               OutputParameter parameter = it.next(); 
+               parameterString = parameterString +"&amp;"+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) { %>
+    <div id="export">
+        <fieldset>
+            <legend><bean:message key="gnviewer.export.fieldset.title"/></legend>
+            <%if (supportChart) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&amp;target="+target+parameterString+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>">
+                <img src="images/diagram_export.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportPDF) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&amp;target="+targetPDF+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>">
+                <img src="images/pdf.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportSVG) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&amp;target="+targetSVG+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>">
+                <img src="images/svg.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportCSV) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&amp;target="+targetCSV+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
+                <img src="images/data_export.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportODV) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&amp;target="+targetODV+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>">
+                <img src="images/data_export.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportWMS) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeWMS+"&amp;target="+targetWMS+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>">
+                <img src="images/map_go.png" border="0"/>
+            </a>
+            <%}%>
+            <%if (supportZIP) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeZIP+"&amp;target="+targetZIP+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.zip.title"/>">
+                <img src="images/disk.png" border="0"/>
+            </a>
+            <%}%>
+        </fieldset>
+    </div>
+<%}%>
--- 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();
+    }
 %>
     <div>
     <%if (staticui == null){ %>
         <jsp:include page="includes/display_fis_inc.jsp"></jsp:include>
     <%} else {%>
-        <jsp:include page="includes/display_fis_inc.jsp"></jsp:include>
         <%=staticui.toString()%>
     <%}%>
     
+    <%-- render the dynamic part to feed the state and advance to the next state --%>
     <%if (ui != null){%>
-    <div id="timeseriesfilter">
-        <form id="fisSelectionForm" onsubmit="displayOverlay()" action="<%=response.encodeURL("next.do")%>") method="post">
-           <fieldset>
-            <%=ui != null ? ui.toString().replaceAll("&nbsp;", "") : "" %>
-           
-            <%if(furthertargets){%>
-            <input type="submit" value="<bean:message key="gnviewer.select.button"/>"/>
-            <%}else{%>
-            <input type="submit" value="<bean:message key="gnviewer.draw.button"/>"/>
-            <%}%>
-            </fieldset>
-        </form>
-    </div>
+        <div id="timeseriesfilter">
+            <form id="fisSelectionForm" onsubmit="displayOverlay()" action="<%=response.encodeURL("next.do")%>") method="post">
+               <fieldset>
+                <%=ui != null ? ui.toString().replaceAll("&nbsp;", "") : "" %>
+               
+                <%if(furthertargets){%>
+                <input type="submit" value="<bean:message key="gnviewer.select.button"/>"/>
+                <%}%>
+                </fieldset>
+            </form>
+        </div>
     <%}%>
     </div>
+
+    <%-- render chart options if existing for this state --%>
     <jsp:include page="includes/display_diagramm_inc.jsp"></jsp:include>
+
+    <%-- render export options if existing for this state --%>
+    <jsp:include page="includes/display_export_inc.jsp"></jsp:include>
--- 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 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
-<html xhtml="true" locale="true">
+<html xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <title>
             <bean:message key="gnviewer.app.title"/>
Binary file gnv/src/main/webapp/images/back_button.png has changed
--- 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 {

http://dive4elements.wald.intevation.org