Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java @ 1326:974c6b3700de
Use the theme index to identify the correct style.
flys-client/trunk@2968 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 14 Oct 2011 08:36:29 +0000 |
parents | c4c957a9c092 |
children | b18b32269a3f |
comparison
equal
deleted
inserted
replaced
1325:2f5fbfeda1d4 | 1326:974c6b3700de |
---|---|
127 | 127 |
128 Element e = (Element) themes.item(0); | 128 Element e = (Element) themes.item(0); |
129 NodeList items = e.getElementsByTagName("theme"); | 129 NodeList items = e.getElementsByTagName("theme"); |
130 | 130 |
131 for (int i = 0; i < items.getLength(); i++) { | 131 for (int i = 0; i < items.getLength(); i++) { |
132 cia.appendStyle(getStyle ((Element) items.item(i))); | 132 Style s = getStyle ((Element) items.item(i)); |
133 if(s == null) { | |
134 throw new ServerException(ERROR_NO_STYLES_FOUND); | |
135 } | |
136 else { | |
137 cia.appendStyle(s); | |
138 } | |
133 } | 139 } |
134 | 140 |
135 return cia; | 141 return cia; |
136 } | 142 } |
137 | 143 |
195 NodeList list = element.getElementsByTagName("field"); | 201 NodeList list = element.getElementsByTagName("field"); |
196 Style style = new Style(); | 202 Style style = new Style(); |
197 | 203 |
198 style.setName (element.getAttribute("name")); | 204 style.setName (element.getAttribute("name")); |
199 style.setFacet (element.getAttribute("facet")); | 205 style.setFacet (element.getAttribute("facet")); |
206 try { | |
207 int ndx = Integer.parseInt(element.getAttribute("index")); | |
208 style.setIndex (ndx); | |
209 } | |
210 catch(NumberFormatException nfe) { | |
211 return null; | |
212 } | |
200 for(int i = 0; i < list.getLength(); i++) { | 213 for(int i = 0; i < list.getLength(); i++) { |
201 Element e = (Element) list.item(i); | 214 Element e = (Element) list.item(i); |
202 StyleSetting set = new StyleSetting ( | 215 StyleSetting set = new StyleSetting ( |
203 e.getAttribute("name"), | 216 e.getAttribute("name"), |
204 e.getAttribute("default"), | 217 e.getAttribute("default"), |