[Dive4elements-commits] [PATCH 5 of 6] Add boundToOut handling to ManagedFacets
Wald Commits
scm-commit at wald.intevation.org
Fri May 31 15:30:25 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1370006826 -7200
# Node ID 7c2a3019859205de7054040fb205e94f00896152
# Parent 1d690acf1fdbd9a78b96baa07c9de2925c357363
Add boundToOut handling to ManagedFacets.
diff -r 1d690acf1fdb -r 7c2a30198592 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java
--- 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.
diff -r 1d690acf1fdb -r 7c2a30198592 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java
--- 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;
}
/**
diff -r 1d690acf1fdb -r 7c2a30198592 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java
--- 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;
}
More information about the Dive4elements-commits
mailing list