Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java Thu Oct 13 16:30:55 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java Fri Oct 14 08:36:29 2011 +0000 @@ -129,7 +129,13 @@ NodeList items = e.getElementsByTagName("theme"); for (int i = 0; i < items.getLength(); i++) { - cia.appendStyle(getStyle ((Element) items.item(i))); + Style s = getStyle ((Element) items.item(i)); + if(s == null) { + throw new ServerException(ERROR_NO_STYLES_FOUND); + } + else { + cia.appendStyle(s); + } } return cia; @@ -197,6 +203,13 @@ style.setName (element.getAttribute("name")); style.setFacet (element.getAttribute("facet")); + try { + int ndx = Integer.parseInt(element.getAttribute("index")); + style.setIndex (ndx); + } + catch(NumberFormatException nfe) { + return null; + } for(int i = 0; i < list.getLength(); i++) { Element e = (Element) list.item(i); StyleSetting set = new StyleSetting (