Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java @ 945:59ae2a823e73
Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
flys-artifacts/trunk@2360 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 19 Jul 2011 10:37:57 +0000 |
parents | 68c6c75a6f7c |
children | 238145ef67da |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java Mon Jul 18 17:09:00 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java Tue Jul 19 10:37:57 2011 +0000 @@ -20,6 +20,7 @@ import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.flys.artifacts.model.ManagedFacet; +import de.intevation.flys.artifacts.model.ManagedDomFacet; public class AttributeParser { @@ -92,7 +93,7 @@ protected void parseItems(Node out, String outname) { NodeList themes = (NodeList) XMLUtils.xpath( - out, "art:theme", + out, "art:facet", XPathConstants.NODESET, ArtifactNamespaceContext.INSTANCE); @@ -105,39 +106,7 @@ for (int i = 0; i < num; i++) { Element theme = (Element) themes.item(i); - String name = theme.getAttributeNS(uri, "facet"); - if (name == null || name.length() == 0) { - continue; - } - - String uuid = theme.getAttributeNS(uri, "artifact"); - if (uuid == null || uuid.length() == 0) { - continue; - } - - String pos = theme.getAttributeNS(uri, "pos"); - if (pos == null || pos.length() == 0) { - continue; - } - - String index = theme.getAttributeNS(uri, "index"); - if (index == null || index.length() == 0) { - continue; - } - - String active = theme.getAttributeNS(uri, "active"); - if (active == null || active.length() == 0) { - continue; - } - - String description = theme.getAttributeNS(uri, "description"); - - ManagedFacet item = new ManagedFacet( - name, Integer.parseInt(index), description, uuid, - Integer.parseInt(pos), - Integer.parseInt(active)); - - addItem(outname, item); + addItem(outname, new ManagedDomFacet(theme)); } } }