Mercurial > dive4elements > river
changeset 6139:7c2a30198592
Add boundToOut handling to ManagedFacets.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 31 May 2013 15:27:06 +0200 |
parents | 1d690acf1fdb |
children | 60b94dec104b |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java |
diffstat | 3 files changed, 34 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java Fri May 31 15:24:53 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java Fri May 31 15:27:06 2013 +0200 @@ -13,6 +13,7 @@ import org.w3c.dom.Node; import org.dive4elements.artifacts.ArtifactNamespaceContext; +import org.dive4elements.artifacts.common.utils.XMLUtils; /** @@ -24,13 +25,13 @@ * values are set directly on the Element, the other attributes aren't * touched. */ -public class ManagedDomFacet extends ManagedFacet { +public class ManagedDomFacet extends ManagedFacet +{ protected Element facet; public ManagedDomFacet(Element facet) { super(null, -1, null, null, -1, -1, -1); - this.facet = facet; } @@ -169,6 +170,29 @@ return this.uuid; } + @Override + public String getBoundToOut() { + if (boundToOut == null) { + String bondageAttr = this.facet.getAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, + "boundToOut"); + if (bondageAttr != null && !bondageAttr.isEmpty()) { + boundToOut = bondageAttr; + } + } + return boundToOut; + } + + + @Override + public void setBoundToOut(String value) { + boundToOut = value; + + facet.setAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "boundToOut", + getBoundToOut()); + } /** * Import into document.
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Fri May 31 15:24:53 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Fri May 31 15:27:06 2013 +0200 @@ -41,12 +41,18 @@ public ManagedFacet(String name, int index, String desc, String uuid, int pos, int active, int visible) { + this(name, index, desc, uuid, pos, active, visible, null); + } + + public ManagedFacet(String name, int index, String desc, String uuid, + int pos, int active, int visible, String boundToOut) { super(index, name, desc); this.uuid = uuid; this.position = pos; this.active = active; this.visible = visible; + this.boundToOut = boundToOut; } /**
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java Fri May 31 15:24:53 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java Fri May 31 15:27:06 2013 +0200 @@ -46,7 +46,8 @@ uuid, pos, active, - visible); + visible, + facet.getBoundToOut()); this.facet = facet; }