Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java @ 1522:df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
flys-client/trunk@3699 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Jan 2012 09:14:17 +0000 |
parents | ab8eb2f544f2 |
children | 252c22237fe7 |
rev | line source |
---|---|
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import javax.xml.xpath.XPathConstants; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
9 import org.w3c.dom.Element; |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Node; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.NodeList; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
13 import org.apache.log4j.Logger; |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
14 |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.common.utils.ClientProtocolUtils; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifacts.common.utils.XMLUtils; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.client.shared.model.ArtifactDescription; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.client.shared.model.DataItem; |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
21 import de.intevation.flys.client.shared.model.DataList; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
22 import de.intevation.flys.client.shared.model.DefaultArtifactDescription; |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.client.shared.model.DefaultData; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.flys.client.shared.model.DefaultDataItem; |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
25 import de.intevation.flys.client.shared.model.DefaultOutputMode; |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
26 import de.intevation.flys.client.shared.model.IntegerRangeData; |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
27 import de.intevation.flys.client.shared.model.OutputMode; |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
28 import de.intevation.flys.client.shared.model.Recommendation; |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
29 import de.intevation.flys.client.shared.model.WQDataItem; |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 /** |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 * This factory class helps creating an {@link ArtifactDescription} based on the |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 * DESCRIBE document of an artifact returned by the artifact server. Use the |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 * {@link createArtifactDescription(org.w3c.dom.Document)} method with the |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 * DESCRIBE document to create such an {@link ArtifactDescription}. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 */ |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 public class ArtifactDescriptionFactory { |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
42 private static final Logger logger = |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
43 Logger.getLogger(ArtifactDescriptionFactory.class); |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
44 |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
45 |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 public static final String XPATH_STATE_NAME = "@art:name"; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
48 public static final String XPATH_UIPROVIDER = "@art:uiprovider"; |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
49 |
32
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
50 public static final String XPATH_REACHABLE_STATE = "art:state"; |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
51 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
52 public static final String XPATH_STATIC_STATE_NODE = "art:state"; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
53 |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
54 public static final String XPATH_STATIC_DATA_NODE = "art:data"; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
55 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
56 public static final String XPATH_STATIC_ITEM_NODE = "art:item"; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
57 |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
58 public static final String XPATH_RECOMMENDED_ARTIFACTS = |
808
3187b268b311
Repaired broken XPath expression.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
807
diff
changeset
|
59 "/art:result/art:recommended-artifacts//*[@factory]"; |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
60 |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 /** |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 * This method creates the {@link ArtifactDescription} of the DESCRIBE |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 * document <i>doc</i>. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * @param doc A DESCRIBE document. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 * @return the {@link ArtifactDescription}. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 */ |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 public static ArtifactDescription createArtifactDescription(Document doc) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
70 logger.debug("ArtifactDescriptionFactory.createArtifactDescription"); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 Node currentState = ClientProtocolUtils.getCurrentState(doc); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 Node staticNode = ClientProtocolUtils.getStaticUI(doc); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 Node dynamicNode = ClientProtocolUtils.getDynamicUI(doc); |
32
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
75 Node reachable = ClientProtocolUtils.getReachableStates(doc); |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
76 NodeList outputs = ClientProtocolUtils.getOutputModes(doc); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 String state = (String) XMLUtils.xpath( |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 currentState, |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 XPATH_STATE_NAME, |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 XPathConstants.STRING, |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 ArtifactNamespaceContext.INSTANCE); |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
83 |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
84 logger.debug("Current state name: " + state); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
86 DataList currentData = extractCurrentData(dynamicNode, state); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
87 DataList[] old = extractOldData(staticNode); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
88 String[] states = extractReachableStates(reachable); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
89 OutputMode[] outs = extractOutputModes(outputs); |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
90 Recommendation[] rec = extractRecommendedArtifacts(doc); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
92 return new DefaultArtifactDescription( |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
93 old, |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
94 currentData, |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
95 state, |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
96 states, |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
97 outs, |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
98 rec); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 /** |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 * This method extracts the data that the user is able to enter in the |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 * current state of the artifact. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 * @param dynamicNode The dynamic node of the DESCRIBE document. |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
107 * @param state The name of the current state. |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 * @return A {@link Data} object that represents the data which might be |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 * entered by the user in the current state or null, if no data might be |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 * entered. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 */ |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
113 protected static DataList extractCurrentData(Node dynamicNode, String state) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
114 logger.debug("ArtifactDescriptionFactory.extractCurrentData"); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
116 NodeList data = ClientProtocolUtils.getSelectNode(dynamicNode); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
117 String uiProvider = extractUIProvider(dynamicNode); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
119 if (data == null || data.getLength() == 0) { |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
120 return null; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
121 } |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
123 int dataNum = data.getLength(); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
124 DataList list = new DataList(state, dataNum, uiProvider); |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
125 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
126 for (int i = 0; i < dataNum; i++) { |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
127 Element d = (Element) data.item(i); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
128 String label = ClientProtocolUtils.getLabel(d); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
129 String name = XMLUtils.xpathString( |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
130 d, "@art:name", ArtifactNamespaceContext.INSTANCE); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
131 String type = XMLUtils.xpathString( |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
132 d, "@art:type", ArtifactNamespaceContext.INSTANCE); |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
133 |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
134 logger.debug("Create new IntegerRangeData object for: " + name); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
135 logger.debug("New Data is from type: " + type); |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
136 |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
137 if (type == null || type.length() == 0) { |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
138 NodeList choices = ClientProtocolUtils.getItemNodes(d); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
139 DataItem[] dataItems = extractCurrentDataItems(choices); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
140 DataItem def = extractDefaultDataItem(d); |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
141 |
1522
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
142 list.add(new DefaultData(name, label, null, dataItems, def)); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
143 } |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
144 else if (type.equals("intrange")) { |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
145 String min = ClientProtocolUtils.getMinNode(d); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
146 String max = ClientProtocolUtils.getMaxNode(d); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
147 |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
148 try { |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
149 int lower = Integer.parseInt(min); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
150 int upper = Integer.parseInt(max); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
151 list.add(new IntegerRangeData(name, label, lower, upper)); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
152 } |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
153 catch (NumberFormatException nfe) { |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
154 logger.warn("NumberFormatException: ", nfe); |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
155 } |
df9baca681a0
Added a new Data type IntegerRangeData that stores min and max integer values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1367
diff
changeset
|
156 } |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
157 } |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
158 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
159 return list; |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 } |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 /** |
515
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
164 * This method extracts the default value of a Data object. |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
165 * |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
166 * @param data The data object node. |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
167 * |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
168 * @return the default DataItem. |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
169 */ |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
170 protected static DataItem extractDefaultDataItem(Node data) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
171 logger.debug("ArtifactDescriptionFactory.extractDefaultDataItem"); |
515
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
172 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
173 String value = XMLUtils.xpathString( |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
174 data, "@art:defaultValue", ArtifactNamespaceContext.INSTANCE); |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
175 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
176 String label = XMLUtils.xpathString( |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
177 data, "@art:defaultLabel", ArtifactNamespaceContext.INSTANCE); |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
178 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
179 if (value != null && label != null) { |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
180 return new DefaultDataItem(label, null, value); |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
181 } |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
182 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
183 return null; |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
184 } |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
185 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
186 |
27ffaf628b54
The default values/labels for Data objects are read from DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
65
diff
changeset
|
187 /** |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 * This method extract the {@link DataItem}s of the DESCRIBE document. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 * @param items The items in the DESCRIBE document. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 * |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 * @return the {@link DataItem}s. |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 */ |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 protected static DataItem[] extractCurrentDataItems(NodeList items) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
195 logger.debug("ArtifactDescriptionFactory.extractCurrentDataItems"); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 if (items == null || items.getLength() == 0) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
198 logger.debug("No data items found."); |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 return null; |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 } |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 int count = items.getLength(); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 List<DataItem> dataItems = new ArrayList<DataItem>(count); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 for (int i = 0; i < count; i++) { |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 Node item = items.item(i); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 String label = ClientProtocolUtils.getLabel(item); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 String value = ClientProtocolUtils.getValue(item); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
211 double[] mmQ = extractMinMaxQValues(item); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
212 double[] mmW = extractMinMaxWValues(item); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
213 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
214 if (mmQ != null || mmW != null) { |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
215 dataItems.add(new WQDataItem(label, null, value, mmQ, mmW)); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
216 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
217 else { |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
218 dataItems.add(new DefaultDataItem(label, null, value)); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
219 } |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 } |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 return (DataItem[]) dataItems.toArray(new DataItem[count]); |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 } |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
224 |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
225 |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
226 protected static double[] extractMinMaxQValues(Node item) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
227 logger.debug("ArtifactDescriptionFactory.extractMinMaxQValues"); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
228 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
229 if (item == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
230 logger.debug("This node is empty - no min/max Q values."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
231 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
232 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
233 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
234 Node node = (Node) XMLUtils.xpath( |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
235 item, |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
236 "art:range[@art:type='Q']", |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
237 XPathConstants.NODE, |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
238 ArtifactNamespaceContext.INSTANCE); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
239 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
240 if (node == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
241 logger.debug("No min/max Q values found."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
242 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
243 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
244 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
245 return extractMinMaxValues(node); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
246 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
247 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
248 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
249 protected static double[] extractMinMaxWValues(Node item) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
250 logger.debug("ArtifactDescriptionFactory.extractMinMaxWValues"); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
251 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
252 if (item == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
253 logger.debug("This node is empty - no min/max W values."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
254 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
255 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
256 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
257 Node node = (Node) XMLUtils.xpath( |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
258 item, |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
259 "art:range[@art:type='W']", |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
260 XPathConstants.NODE, |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
261 ArtifactNamespaceContext.INSTANCE); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
262 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
263 if (node == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
264 logger.debug("No min/max W values found."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
265 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
266 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
267 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
268 return extractMinMaxValues(node); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
269 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
270 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
271 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
272 protected static double[] extractMinMaxValues(Node node) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
273 logger.debug("ArtifactDescriptionFactory.extractMinMaxValues"); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
274 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
275 String minStr = XMLUtils.xpathString( |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
276 node, "art:min/text()", ArtifactNamespaceContext.INSTANCE); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
277 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
278 String maxStr = XMLUtils.xpathString( |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
279 node, "art:max/text()", ArtifactNamespaceContext.INSTANCE); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
280 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
281 if (maxStr == null || minStr == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
282 logger.debug("No min/max values found."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
283 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
284 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
285 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
286 try { |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
287 double min = Double.valueOf(minStr); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
288 double max = Double.valueOf(maxStr); |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
289 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
290 return new double[] { min, max }; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
291 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
292 catch (NumberFormatException nfe) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
293 logger.debug("Error while parsing min/max values."); |
565
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
294 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
295 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
296 return null; |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
297 } |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
298 |
a078ba1c139d
Introduced a client side input validation for the adapted WQ panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
515
diff
changeset
|
299 |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
300 /** |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
301 * This method extracts the data objects from the data node of the static ui |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
302 * part of the DESCRIBE document. |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
303 * |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
304 * @param staticNode The static ui node of the DESCRIBE. |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
305 * |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
306 * @return the DataList objects. |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
307 */ |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
308 protected static DataList[] extractOldData(Node staticNode) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
309 logger.debug("ArtifactDescriptionFactory.extractOldData()"); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
310 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
311 NodeList stateNodes = (NodeList) XMLUtils.xpath( |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
312 staticNode, |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
313 XPATH_STATIC_STATE_NODE, |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
314 XPathConstants.NODESET, |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
315 ArtifactNamespaceContext.INSTANCE); |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
316 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
317 if (stateNodes == null || stateNodes.getLength() == 0) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
318 logger.debug("No old items found."); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
319 return null; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
320 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
321 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
322 int count = stateNodes.getLength(); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
323 DataList[] data = new DataList[count]; |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
324 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
325 for (int i = 0; i < count; i++) { |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
326 Node tmp = stateNodes.item(i); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
327 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
328 String name = XMLUtils.xpathString( |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
329 tmp, "@art:name", ArtifactNamespaceContext.INSTANCE); |
52
1d0be51ab93b
The DataList has a label now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
330 String uiprovider = XMLUtils.xpathString( |
1d0be51ab93b
The DataList has a label now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
331 tmp, "@art:uiprovider", ArtifactNamespaceContext.INSTANCE); |
1d0be51ab93b
The DataList has a label now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
332 String label = XMLUtils.xpathString( |
1d0be51ab93b
The DataList has a label now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
333 tmp, "@art:label", ArtifactNamespaceContext.INSTANCE); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
334 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
335 NodeList dataNodes = (NodeList) XMLUtils.xpath( |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
336 tmp, |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
337 XPATH_STATIC_DATA_NODE, |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
338 XPathConstants.NODESET, |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
339 ArtifactNamespaceContext.INSTANCE); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
340 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
341 if (dataNodes == null || dataNodes.getLength() == 0) { |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
342 continue; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
343 } |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
344 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
345 int size = dataNodes.getLength(); |
52
1d0be51ab93b
The DataList has a label now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
346 DataList list = new DataList(name, size, uiprovider, label); |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
347 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
348 for (int j = 0; j < size; j++) { |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
349 Node dataNode = dataNodes.item(j); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
350 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
351 String dName = XMLUtils.xpathString( |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
352 dataNode, "@art:name", ArtifactNamespaceContext.INSTANCE); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
353 String dType = XMLUtils.xpathString( |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
354 dataNode, "@art:type", ArtifactNamespaceContext.INSTANCE); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
355 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
356 DataItem[] items = extractOldDataItems(dataNode); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
357 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
358 list.add(new DefaultData(dName, dName, dType, items)); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
359 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
360 data[i] = list; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
361 } |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
362 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
363 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
364 return data; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
365 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
366 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
367 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
368 /** |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
369 * This method extracts the data items from the data nodes that are placed |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
370 * in the static ui part of the DESCRIBE document. |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
371 * |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
372 * @param dataNode A data node that contains items. |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
373 * |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
374 * @return a list of DataItems. |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
375 */ |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
376 protected static DataItem[] extractOldDataItems(Node dataNode) { |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
377 NodeList itemList = (NodeList) XMLUtils.xpath( |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
378 dataNode, |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
379 XPATH_STATIC_ITEM_NODE, |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
380 XPathConstants.NODESET, |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
381 ArtifactNamespaceContext.INSTANCE); |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
382 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
383 if (itemList == null || itemList.getLength() == 0) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
384 logger.debug("No old data items found."); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
385 return null; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
386 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
387 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
388 int count = itemList.getLength(); |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
389 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
390 DataItem[] items = new DataItem[count]; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
391 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
392 for (int i = 0; i < count; i++) { |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
393 Node tmp = itemList.item(i); |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
394 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
395 String value = XMLUtils.xpathString( |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
396 tmp, "@art:value", ArtifactNamespaceContext.INSTANCE); |
61
f983d5ce6402
Display human readable strings of the selected values in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
52
diff
changeset
|
397 String label = XMLUtils.xpathString( |
f983d5ce6402
Display human readable strings of the selected values in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
52
diff
changeset
|
398 tmp, "@art:label", ArtifactNamespaceContext.INSTANCE); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
399 |
61
f983d5ce6402
Display human readable strings of the selected values in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
52
diff
changeset
|
400 items[i] = new DefaultDataItem(label, label, value); |
34
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
401 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
402 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
403 return items; |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
404 } |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
405 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
406 |
bf84bcd4e11b
Parse static data from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
32
diff
changeset
|
407 /** |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
408 * This method extracts the UIProvider specified by the data node. |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
409 * |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
410 * @param data The data node. |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
411 * |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
412 * @return the UIProvider that is specified in the data node. |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
413 */ |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
414 protected static String extractUIProvider(Node ui) { |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
415 return (String) XMLUtils.xpath( |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
416 ui, |
22
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
417 XPATH_UIPROVIDER, |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
418 XPathConstants.STRING, |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
419 ArtifactNamespaceContext.INSTANCE); |
a85bac235069
Implemented code to parse the UIProvider that should be used for a current state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
16
diff
changeset
|
420 } |
32
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
421 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
422 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
423 /** |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
424 * This method extracts the reachable states of the current artifact. |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
425 * |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
426 * @param reachable The reachable states node. |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
427 * |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
428 * @return an array with identifiers of reachable states. |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
429 */ |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
430 protected static String[] extractReachableStates(Node reachable) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
431 logger.debug("ArtifactDescriptionFactory.extractReachableStates()"); |
32
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
432 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
433 NodeList list = (NodeList) XMLUtils.xpath( |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
434 reachable, |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
435 XPATH_REACHABLE_STATE, |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
436 XPathConstants.NODESET, |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
437 ArtifactNamespaceContext.INSTANCE); |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
438 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
439 if (list == null || list.getLength() == 0) { |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
440 return null; |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
441 } |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
442 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
443 int count = list.getLength(); |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
444 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
445 String[] states = new String[count]; |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
446 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
447 for (int i = 0; i < count; i++) { |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
448 Node state = list.item(i); |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
449 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
450 String name = XMLUtils.xpathString( |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
451 state, "@art:name", ArtifactNamespaceContext.INSTANCE); |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
452 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
453 states[i] = name; |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
454 } |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
455 |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
456 return states; |
88c530c25968
Added a service for the ADVANCE operation and a service that bundles FEED and ADVANCE in a single service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
22
diff
changeset
|
457 } |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
458 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
459 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
460 /** |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
461 * This method extract available output modes of the the current artifact. |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
462 * |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
463 * @param outputs A list of nodes that contain information about output |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
464 * modes. |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
465 * |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
466 * @return an array of Output modes. |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
467 */ |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
468 protected static OutputMode[] extractOutputModes(NodeList outputs) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
469 logger.debug("ArtifactDescriptionFactory.extractOutputModes"); |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
470 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
471 if (outputs == null || outputs.getLength() == 0) { |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
472 return null; |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
473 } |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
474 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
475 int size = outputs.getLength(); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
476 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
477 List<OutputMode> outs = new ArrayList<OutputMode>(size); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
478 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
479 for (int i = 0; i < size; i++) { |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
480 Node out = outputs.item(i); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
481 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
482 String name = XMLUtils.xpathString( |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
483 out, "@art:name", ArtifactNamespaceContext.INSTANCE); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
484 String desc = XMLUtils.xpathString( |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
485 out, "@art:description", ArtifactNamespaceContext.INSTANCE); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
486 String mimeType = XMLUtils.xpathString( |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
487 out, "@art:mime-type", ArtifactNamespaceContext.INSTANCE); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
488 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
489 if (name != null) { |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
490 outs.add(new DefaultOutputMode(name, desc, mimeType)); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
491 } |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
492 else { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
493 logger.debug("Found an invalid output mode."); |
65
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
494 } |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
495 } |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
496 |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
497 return (OutputMode[]) outs.toArray(new OutputMode[size]); |
8f719fa1a691
The output modes of an artifact are extracted from DESCRIBE document and put into the ArtifactDescription.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
498 } |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
499 |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
500 |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
501 protected static Recommendation[] extractRecommendedArtifacts(Document doc){ |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
839
diff
changeset
|
502 logger.debug("ArtifactDescriptionFactory.extractRecommendedArtifacts."); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
503 |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
504 NodeList list = (NodeList) XMLUtils.xpath( |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
505 doc, |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
506 XPATH_RECOMMENDED_ARTIFACTS, |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
507 XPathConstants.NODESET, |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
508 ArtifactNamespaceContext.INSTANCE); |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
509 |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
510 int num = list != null ? list.getLength() : 0; |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
511 |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
512 Recommendation[] rec = new Recommendation[num]; |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
513 |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
514 for (int i = 0; i < num; i++) { |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
515 Element e = (Element) list.item(i); |
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
516 String factory = e.getAttribute("factory"); |
836
0fe456332785
Datacage: s/db-ids/ids/g to unify system and user specific loading.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
808
diff
changeset
|
517 String index = e.getAttribute("ids"); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
518 |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
519 if (factory != null && factory.length() > 0) { |
839
6a1cd38e6e18
Made Recommendation a class for direct use.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
836
diff
changeset
|
520 rec[i] = new Recommendation(factory, index); |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
521 } |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
522 } |
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
523 |
807
6f65e70fa11d
Repaired broken recommendation parsing from Artifact's DESCRIBE document (which structure has changed).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
524 return rec; |
803
653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
525 } |
16
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
526 } |
f8a5f2c5e2b7
The DESCRIBE document returned by the artifact server is parsed after calling create() of the artifact service and a new Artifact is created with an ArtifactDescription that contains the UUID, HASH, und the current Data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
527 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |