Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/action/WMSAction.java @ 970:d91ffd0e8239
Some small xpath changes for wms output regarding rev1134 (issue198).
gnv/trunk@1135 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 27 May 2010 16:51:52 +0000 |
parents | f550bd27a3f1 |
children | d1ed5c51c0de |
comparison
equal
deleted
inserted
replaced
969:3e6e07142a48 | 970:d91ffd0e8239 |
---|---|
51 "/art:meta/art:mapserver/art:map/text()"; | 51 "/art:meta/art:mapserver/art:map/text()"; |
52 | 52 |
53 public static final String XPATH_LAYER_TITLE = | 53 public static final String XPATH_LAYER_TITLE = |
54 "/art:meta/art:layer/art:title/text()"; | 54 "/art:meta/art:layer/art:title/text()"; |
55 | 55 |
56 public static final String XPATH_LAYER_TTL = | 56 public static final String XPATH_LAYER_NAME = |
57 "/art:meta/art:layer/art:ttl/text()"; | 57 "/art:meta/art:layer/art:name/text()"; |
58 | |
59 public static final String XPATH_TTL = | |
60 "/art:meta/art:mapserver/art:ttl/text()"; | |
58 | 61 |
59 /** | 62 /** |
60 * the logger, used to log exceptions and additonaly information | 63 * the logger, used to log exceptions and additonaly information |
61 */ | 64 */ |
62 private static Logger logger = Logger.getLogger(WMSAction.class); | 65 private static Logger logger = Logger.getLogger(WMSAction.class); |
122 String mapserverPath = XMLUtils.getStringXPath( | 125 String mapserverPath = XMLUtils.getStringXPath( |
123 meta, XPATH_MAPSERVER_PATH); | 126 meta, XPATH_MAPSERVER_PATH); |
124 String mapfilePath = XMLUtils.getStringXPath( | 127 String mapfilePath = XMLUtils.getStringXPath( |
125 meta, XPATH_MAPSERVER_MAPFILE); | 128 meta, XPATH_MAPSERVER_MAPFILE); |
126 String layer = XMLUtils.getStringXPath( | 129 String layer = XMLUtils.getStringXPath( |
127 meta, XPATH_LAYER_TITLE); | 130 meta, XPATH_LAYER_NAME); |
128 String tmpTTL = XMLUtils.getStringXPath( | 131 String tmpTTL = XMLUtils.getStringXPath( |
129 meta, XPATH_LAYER_TTL); | 132 meta, XPATH_TTL); |
130 layer = layer != null ? layer : artifact.getId(); | 133 layer = layer != null ? layer : artifact.getId(); |
131 | 134 |
132 String ttl = null; | 135 String ttl = null; |
133 if (tmpTTL != null) { | 136 if (tmpTTL != null) { |
134 DateFormat df = DateFormat.getDateTimeInstance( | 137 DateFormat df = DateFormat.getDateTimeInstance( |
149 } | 152 } |
150 | 153 |
151 if (logger.isDebugEnabled()) { | 154 if (logger.isDebugEnabled()) { |
152 logger.debug("Mapserver path: " + mapserverPath); | 155 logger.debug("Mapserver path: " + mapserverPath); |
153 logger.debug("Mapfile path: " + mapfilePath); | 156 logger.debug("Mapfile path: " + mapfilePath); |
154 logger.debug("Layer title: " + layer); | 157 logger.debug("Layer: " + layer); |
155 logger.debug("Layer ttl: " + ttl); | 158 logger.debug("Layer ttl: " + ttl); |
156 } | 159 } |
157 | 160 |
158 request.setAttribute("wms", true); | 161 request.setAttribute("wms", true); |
159 request.setAttribute("mapserver", mapserverPath); | 162 request.setAttribute("mapserver", mapserverPath); |
164 mapfilePath != null && | 167 mapfilePath != null && |
165 layer != null){ | 168 layer != null){ |
166 request.setAttribute("wms_published", Boolean.TRUE); | 169 request.setAttribute("wms_published", Boolean.TRUE); |
167 return super.execute(mapping, form, request, response); | 170 return super.execute(mapping, form, request, response); |
168 }else{ | 171 }else{ |
169 return super.getExceptionForward(mapping); | 172 return super.execute(mapping, form, request, response); |
170 } | 173 } |
171 } | 174 } |
172 catch (Exception e) { | 175 catch (Exception e) { |
173 logger.error(e, e); | 176 logger.error(e, e); |
174 request.setAttribute( | 177 request.setAttribute( |