Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java @ 6139:7c2a30198592
Add boundToOut handling to ManagedFacets.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 31 May 2013 15:27:06 +0200 |
parents | af13ceeba52a |
children | cc7df824d5c4 |
comparison
equal
deleted
inserted
replaced
6138:1d690acf1fdb | 6139:7c2a30198592 |
---|---|
11 import org.w3c.dom.Document; | 11 import org.w3c.dom.Document; |
12 import org.w3c.dom.Element; | 12 import org.w3c.dom.Element; |
13 import org.w3c.dom.Node; | 13 import org.w3c.dom.Node; |
14 | 14 |
15 import org.dive4elements.artifacts.ArtifactNamespaceContext; | 15 import org.dive4elements.artifacts.ArtifactNamespaceContext; |
16 import org.dive4elements.artifacts.common.utils.XMLUtils; | |
16 | 17 |
17 | 18 |
18 /** | 19 /** |
19 * Use an Element (DOM) to store the information about a facet. | 20 * Use an Element (DOM) to store the information about a facet. |
20 * The intent of this facet type is to represent a facet | 21 * The intent of this facet type is to represent a facet |
22 * attributes that we need to parse, but the only thing ManagedFacets need | 23 * attributes that we need to parse, but the only thing ManagedFacets need |
23 * to do, is to adjust the attributes "active" and "position". So, those | 24 * to do, is to adjust the attributes "active" and "position". So, those |
24 * values are set directly on the Element, the other attributes aren't | 25 * values are set directly on the Element, the other attributes aren't |
25 * touched. | 26 * touched. |
26 */ | 27 */ |
27 public class ManagedDomFacet extends ManagedFacet { | 28 public class ManagedDomFacet extends ManagedFacet |
29 { | |
28 | 30 |
29 protected Element facet; | 31 protected Element facet; |
30 | 32 |
31 public ManagedDomFacet(Element facet) { | 33 public ManagedDomFacet(Element facet) { |
32 super(null, -1, null, null, -1, -1, -1); | 34 super(null, -1, null, null, -1, -1, -1); |
33 | |
34 this.facet = facet; | 35 this.facet = facet; |
35 } | 36 } |
36 | 37 |
37 | 38 |
38 @Override | 39 @Override |
167 } | 168 } |
168 | 169 |
169 return this.uuid; | 170 return this.uuid; |
170 } | 171 } |
171 | 172 |
173 @Override | |
174 public String getBoundToOut() { | |
175 if (boundToOut == null) { | |
176 String bondageAttr = this.facet.getAttributeNS( | |
177 ArtifactNamespaceContext.NAMESPACE_URI, | |
178 "boundToOut"); | |
179 if (bondageAttr != null && !bondageAttr.isEmpty()) { | |
180 boundToOut = bondageAttr; | |
181 } | |
182 } | |
183 return boundToOut; | |
184 } | |
185 | |
186 | |
187 @Override | |
188 public void setBoundToOut(String value) { | |
189 boundToOut = value; | |
190 | |
191 facet.setAttributeNS( | |
192 ArtifactNamespaceContext.NAMESPACE_URI, | |
193 ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "boundToOut", | |
194 getBoundToOut()); | |
195 } | |
172 | 196 |
173 /** | 197 /** |
174 * Import into document. | 198 * Import into document. |
175 * @param doc Document to be imported to. | 199 * @param doc Document to be imported to. |
176 */ | 200 */ |