comparison gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java @ 407:55dae5bb76db

Fixed issue149. Render the chart if there are output modes existing for this state - not if there are further states. TODO: We should check if there is an output mode named 'chart' before rendering a chart. gnv/trunk@583 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 20 Jan 2010 14:44:39 +0000
parents 416ff31f6273
children b5733f9f386b
comparison
equal deleted inserted replaced
406:a8f0e9fbc81b 407:55dae5bb76db
3 */ 3 */
4 package de.intevation.gnv.action; 4 package de.intevation.gnv.action;
5 5
6 import java.util.Collection; 6 import java.util.Collection;
7 import java.util.Iterator; 7 import java.util.Iterator;
8 import java.util.Map;
8 9
9 import javax.servlet.http.HttpServletRequest; 10 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse; 11 import javax.servlet.http.HttpServletResponse;
11 12
12 import org.apache.log4j.Logger; 13 import org.apache.log4j.Logger;
66 String value = request.getParameter(parameter.getName()); 67 String value = request.getParameter(parameter.getName());
67 if (parameter.getType().equalsIgnoreCase("boolean")){ 68 if (parameter.getType().equalsIgnoreCase("boolean")){
68 if (value == null){ 69 if (value == null){
69 value = "false"; 70 value = "false";
70 } 71 }
72 else {
73 value = "true";
74 }
71 } 75 }
72 diagrammOptions.setValue(parameter.getName(),value); 76 diagrammOptions.setValue(parameter.getName(),value);
73 77
74 } 78 }
75 sm.setDiagrammOptions(diagrammOptions); 79 sm.setDiagrammOptions(diagrammOptions);
99 new XMLUtils().getNodeXPath(currentUI, "art:static"), 103 new XMLUtils().getNodeXPath(currentUI, "art:static"),
100 "UTF-8", 104 "UTF-8",
101 request 105 request
102 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); 106 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
103 request.setAttribute("staticui", staticUI); 107 request.setAttribute("staticui", staticUI);
104 request.setAttribute("furthertargets",
105 (ad.getReachableStates() != null && !ad
106 .getReachableStates().isEmpty()));
107 108
108 if (ad.getReachableStates() != null 109 Map tmpOuts = ad.getOutputModes();
109 && !ad.getReachableStates().isEmpty()) { 110 if (tmpOuts == null || tmpOuts.isEmpty()) {
110 } else { 111 request.setAttribute("furthertargets", true);
112 }
113 else {
111 request.setAttribute("diagramm", true); 114 request.setAttribute("diagramm", true);
112 } 115 }
116
113 return super.execute(mapping, form, request, response); 117 return super.execute(mapping, form, request, response);
114 } catch (Exception e) { 118 } catch (Exception e) {
115 log.error(e, e); 119 log.error(e, e);
116 request.setAttribute( 120 request.setAttribute(
117 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e 121 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e

http://dive4elements.wald.intevation.org