annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java @ 6152:0587819960c3

Waterlevel differences & bed height differences: Add new model LinearInterpolated intented to unify the two very similiar calculations. The focus of the current implementation is correctness and not speed! The fact that the data sets more mostly sorted by station is not exploited. Doing so would improve performance significantly.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 02 Jun 2013 17:52:53 +0200
parents cc7df824d5c4
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4051
diff changeset
9 package org.dive4elements.river.artifacts.model;
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import org.w3c.dom.Document;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import org.w3c.dom.Element;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.w3c.dom.Node;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4051
diff changeset
15 import org.dive4elements.artifacts.ArtifactNamespaceContext;
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1813
diff changeset
18 /**
1636
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
19 * Use an Element (DOM) to store the information about a facet.
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
20 * The intent of this facet type is to represent a facet
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
21 * stored in an Collection attribute. Different facets can have different
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
22 * attributes that we need to parse, but the only thing ManagedFacets need
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
23 * to do, is to adjust the attributes "active" and "position". So, those
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
24 * values are set directly on the Element, the other attributes aren't
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
25 * touched.
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
26 */
6139
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
27 public class ManagedDomFacet extends ManagedFacet
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
28 {
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 protected Element facet;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 public ManagedDomFacet(Element facet) {
1715
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
33 super(null, -1, null, null, -1, -1, -1);
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 this.facet = facet;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 public int getIndex() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 if (this.index < 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 String index = facet.getAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 ArtifactNamespaceContext.NAMESPACE_URI, "index");
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 if (index != null && index.length() > 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 this.index = Integer.parseInt(index);
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 return this.index;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public String getName() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 if (this.name == null || this.name.length() == 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 String name = facet.getAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 ArtifactNamespaceContext.NAMESPACE_URI, "facet");
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 this.name = name;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 return this.name;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 public String getDescription() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 if (this.description == null || this.description.length() == 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 String description = facet.getAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 ArtifactNamespaceContext.NAMESPACE_URI, "description");
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 this.description = description;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 return this.description;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 public int getPosition() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 if (this.position < 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 String position = facet.getAttributeNS(
1636
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
83 ArtifactNamespaceContext.NAMESPACE_URI,
1637
866c1f37f2bd Fix getPosition() in ManagedDomFacet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1636
diff changeset
84 "pos");
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 if (position != null && position.length() > 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 this.position = Integer.parseInt(position);
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 return this.position;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 public void setPosition(int position) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 this.position = position;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98
1636
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
99 // TODO Evaluate whether other set/getAttributes also need
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
100 // to use the NAMESPACE_PREFIX.
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 facet.setAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 ArtifactNamespaceContext.NAMESPACE_URI,
1636
c2edf0032cf8 Squash a bug about wrongly named position attribute ('pos' vs 'art:pos').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 945
diff changeset
103 ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "pos",
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 String.valueOf(position));
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 public int getActive() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 if (this.active < 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 String active = facet.getAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 ArtifactNamespaceContext.NAMESPACE_URI, "active");
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 if (active != null && active.length() > 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 this.active = Integer.parseInt(active);
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 return this.active;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 public void setActive(int active) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 this.active = active;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 facet.setAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 ArtifactNamespaceContext.NAMESPACE_URI,
1813
b3a67d946568 Fix bug where wrong attribute was set.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1715
diff changeset
129 "art:active",
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 String.valueOf(active));
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 @Override
1715
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
135 public int getVisible() {
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
136 if (this.visible < 0) {
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
137 String visible = facet.getAttributeNS(
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
138 ArtifactNamespaceContext.NAMESPACE_URI, "visible");
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
139
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
140 if (visible != null && visible.length() > 0) {
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
141 this.visible = Integer.parseInt(visible);
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
142 }
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
143 }
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
144
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
145 return this.visible;
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
146 }
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
147
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
148
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
149 @Override
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
150 public void setVisible(int visible) {
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
151 this.visible = visible;
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
152
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
153 facet.setAttributeNS(
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
154 ArtifactNamespaceContext.NAMESPACE_URI,
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
155 "visible",
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
156 String.valueOf(getVisible()));
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
157 }
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
158
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
159
a70e0cbc5e02 Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1646
diff changeset
160 @Override
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 public String getArtifact() {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162 if (this.uuid == null || this.uuid.length() == 0) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163 String uuid = facet.getAttributeNS(
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 ArtifactNamespaceContext.NAMESPACE_URI, "artifact");
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 this.uuid = uuid;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
167 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 return this.uuid;
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
170 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
171
6139
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
172 @Override
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
173 public String getBoundToOut() {
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
174 if (boundToOut == null) {
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
175 String bondageAttr = this.facet.getAttributeNS(
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
176 ArtifactNamespaceContext.NAMESPACE_URI,
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
177 "boundToOut");
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
178 if (bondageAttr != null && !bondageAttr.isEmpty()) {
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
179 boundToOut = bondageAttr;
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
180 }
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
181 }
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
182 return boundToOut;
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
183 }
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
184
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
185
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
186 @Override
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
187 public void setBoundToOut(String value) {
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
188 boundToOut = value;
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
189
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
190 facet.setAttributeNS(
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
191 ArtifactNamespaceContext.NAMESPACE_URI,
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
192 ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "boundToOut",
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
193 getBoundToOut());
7c2a30198592 Add boundToOut handling to ManagedFacets.
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
194 }
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195
1813
b3a67d946568 Fix bug where wrong attribute was set.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1715
diff changeset
196 /**
b3a67d946568 Fix bug where wrong attribute was set.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1715
diff changeset
197 * Import into document.
b3a67d946568 Fix bug where wrong attribute was set.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1715
diff changeset
198 * @param doc Document to be imported to.
b3a67d946568 Fix bug where wrong attribute was set.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1715
diff changeset
199 */
945
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 @Override
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201 public Node toXML(Document doc) {
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
202 return doc.importNode(facet, true);
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
203 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
204 }
59ae2a823e73 Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
205 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org