annotate gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 464:70df44021a9f

Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact. gnv-artifacts/trunk@525 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Sat, 09 Jan 2010 17:55:45 +0000
parents 3ddc22aab764
children b7bb66440cc8
rev   line source
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 *
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 package de.intevation.gnv.artifacts;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
6 import java.io.IOException;
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
7 import java.io.OutputStream;
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
8 import java.util.ArrayList;
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
9 import java.util.Collection;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10 import java.util.HashMap;
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
11 import java.util.Iterator;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import java.util.Map;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
14 import javax.xml.xpath.XPathConstants;
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
15
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 import org.apache.log4j.Logger;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import org.w3c.dom.Document;
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
18 import org.w3c.dom.Element;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 import org.w3c.dom.Node;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import org.w3c.dom.NodeList;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 import de.intevation.artifactdatabase.Config;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 import de.intevation.artifactdatabase.DefaultArtifact;
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
24 import de.intevation.artifactdatabase.XMLUtils;
70
0035862b0295 Refactoringwork done because of changes in the artifact-module
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
25 import de.intevation.artifacts.ArtifactFactory;
0035862b0295 Refactoringwork done because of changes in the artifact-module
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
26 import de.intevation.artifacts.ArtifactNamespaceContext;
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
27 import de.intevation.artifacts.CallContext;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
28 import de.intevation.artifacts.CallMeta;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29 import de.intevation.gnv.artifacts.context.GNVArtifactContext;
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
30 import de.intevation.gnv.artifacts.fis.product.Product;
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
31 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
32 import de.intevation.gnv.state.DefaultInputData;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
33 import de.intevation.gnv.state.InputData;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
34 import de.intevation.gnv.state.InputValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
35 import de.intevation.gnv.state.OutputMode;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
36 import de.intevation.gnv.state.OutputState;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
37 import de.intevation.gnv.state.State;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
38 import de.intevation.gnv.state.StateFactory;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
39 import de.intevation.gnv.state.exception.StateException;
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
40 import de.intevation.gnv.transition.Transition;
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
41 import de.intevation.gnv.transition.TransitionFactory;
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
42 import de.intevation.gnv.utils.ArtifactXMLUtilities;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 * @author Tim Englich <tim.englich@intevation.de>
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
46 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de>
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
47 *
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 public abstract class GNVArtifactBase extends DefaultArtifact {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 * the logger, used to log exceptions and additonaly information
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 * The UID of this Class
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 private static final long serialVersionUID = -8907096744400741458L;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
58
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
59 /**
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
60 * The Identifier for the Replacement of the Artifactname
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
61 */
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62 public static final String XPATH_IDENTIFIER_REPLACE = "IDENTIFIER";
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
63
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 * The XPATH to the XML-Fragment that should be used for the Configuration
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 */
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
67 public static final String XPATH_ARTIFACT_CONFIGURATION = "/artifact-database/artifacts/artifact[@name='"
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
68 + XPATH_IDENTIFIER_REPLACE
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
69 + "']";
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
70
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
71 public static final String XPATH_STATIC_NODE = "/art:result/art:ui/art:static";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
72
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
73 public static final String XPATH_INPUT_DATA = "/art:action/art:data/art:input";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
74
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
75 public static final String XPATH_INCLUDE_UI = "/art:action/art:include-ui";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
76
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
77 public static final String XPATH_TARGET_NAME = "/art:action/art:target/@name";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
78
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
79 public static final String XPATH_OUTPUT_NAME = "/art:action/art:out/@name";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
80
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
81 public static final String XPATH_OUTPUT_PARAMS = "/art:action/art:out/art:params/art:input";
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
82
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
83 /**
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
84 * The current State
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
85 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
86 protected State current = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
87
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
88 /**
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
89 * The States that can be used
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
90 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
91 protected Map<String, State> states = null;
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
92
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
93 /**
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
94 * The Transitions which can switch between the different States.
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
95 */
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
96 protected Collection<Transition> transitions = null;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
97
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
98
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
99 /**
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
100 * The current product
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
101 */
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
102 protected Product product;
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
103
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
104 /**
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
105 * The Name of the Artifact
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
106 */
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 protected String name = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
108
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
109 private ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
110
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
112 * Constructor
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
114 public GNVArtifactBase() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
115 super();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
116 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
117
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
118 /**
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
119 * @see de.intevation.artifactdatabase.DefaultArtifact#advance(org.w3c.dom.Document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
120 * de.intevation.artifacts.CallContext)
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
121 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
122 @Override
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
123 public Document advance(Document target, CallContext context) {
89
cde042a0a395 Successreporting added
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
124 log.debug("GNVArtifactBase.advance");
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
125 Document result = XMLUtils.newDocument();
88
1b12021905b9 Some CodeCleanup done.
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
126 try {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
127 if (this.current != null) {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
128 String stateName = this.readStateName(target);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
129 log.debug("Statename: " + stateName);
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
130 if (this.isStateCurrentlyReachable(stateName)) {
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
131 try {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
132 State nextStep = this.states
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
133 .get(stateName);
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
134 // 1.Calculate Results
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
135 this.current.advance(super.identifier, context.getMeta());
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
136 // 2. Transfer Results
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
137 nextStep.putInputData(this.current.getInputData(),
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
138 super.identifier);
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
139 // 3. Switch to next State
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
140 this.current = nextStep;
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
141
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
142 // 4. Initialize next Step
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
143 this.current.initialize(super.identifier, context.getMeta());
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
144
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
145 result = new ArtifactXMLUtilities()
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
146 .createSuccessReport("Advance success",
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
147 XMLUtils.newDocument());
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
148 } catch (StateException e) {
220
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
149 log.error(e, e);
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
150 result = new ArtifactXMLUtilities()
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
151 .createExceptionReport(e
ee2d4134d0b3 General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents: 217
diff changeset
152 .getLocalizedMessage(), XMLUtils
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
153 .newDocument());
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
154 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
155 } else {
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
156 String msg = "Statetransition is not supported";
88
1b12021905b9 Some CodeCleanup done.
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
157 log.error(msg);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
158 result = new ArtifactXMLUtilities().createExceptionReport(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
159 msg, XMLUtils.newDocument());
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
160 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
161 } else {
461
3ddc22aab764 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 358
diff changeset
162 String msg = "No State activated.";
88
1b12021905b9 Some CodeCleanup done.
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
163 log.error(msg);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
164 result = new ArtifactXMLUtilities().createExceptionReport(msg,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
165 XMLUtils.newDocument());
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
166 }
88
1b12021905b9 Some CodeCleanup done.
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
167 } catch (Exception e) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
168 log.error(e, e);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
169 result = new ArtifactXMLUtilities().createExceptionReport(e
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
170 .getLocalizedMessage(), XMLUtils.newDocument());
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
171 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
172 return result;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
173 }
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
174
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
175
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
176 private boolean isStateCurrentlyReachable(String stateid){
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
177 log.debug("GNVArtifactBase.isStateCurrentlyReachable "+stateid);
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
178 Iterator<Transition> it = this.transitions.iterator();
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
179 String from = this.current.getID();
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
180 while (it.hasNext()){
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
181 Transition transition = it.next();
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
182 if (transition.getFrom().equals(from)){
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
183 if (transition.getTo().equals(stateid) && transition.isValid(this.current)){
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
184 return true;
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
185 }
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
186 }
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
187 }
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
188 return false;
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
189 }
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
190
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
191 public Document initialize (CallContext context) {
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
192 Document result = XMLUtils.newDocument();
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
193 try {
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
194 this.current.initialize(super.identifier, context.getMeta());
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
195 result = new ArtifactXMLUtilities()
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
196 .createSuccessReport("Initialize success",
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
197 XMLUtils.newDocument());
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
198 } catch (StateException e) {
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
199 log.error(e,e);
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
200 result = new ArtifactXMLUtilities().createExceptionReport(e
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
201 .getLocalizedMessage(), XMLUtils.newDocument());
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
202 }
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
203 return result;
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
204 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
205
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
206 protected String readStateName(Document document) {
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
207 String returnValue = XMLUtils.xpathString(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
208 document, XPATH_TARGET_NAME, ArtifactNamespaceContext.INSTANCE);
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
209 return returnValue;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
210 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
211
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
212 protected Node getConfigurationFragment(Document document) {
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
213 log.debug("GNVArtifactBase.getConfigurationFragment");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
214 String xpathQuery = XPATH_ARTIFACT_CONFIGURATION.replaceAll(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
215 XPATH_IDENTIFIER_REPLACE, this.name);
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
216 log.debug(xpathQuery);
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
217
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
218 Element configurationNode = (Element)Config.getNodeXPath(document, xpathQuery);
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
219
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
220 String link = configurationNode.getAttribute("xlink:href");
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
221 if (link != null ){
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
222 String absolutFileName = Config.replaceConfigDir(link);
217
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 208
diff changeset
223 configurationNode = (Element)new ArtifactXMLUtilities().readConfiguration(absolutFileName);
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
224 }
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
225
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
226 return configurationNode;
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
227 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
228
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
229 /**
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
230 * @see de.intevation.artifactdatabase.DefaultArtifact#feed(org.w3c.dom.Document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
231 * de.intevation.artifacts.CallContext)
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
232 */
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
233 @Override
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
234 public Document feed(Document target, CallContext context) {
89
cde042a0a395 Successreporting added
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
235 log.debug("GNVArtifactBase.feed");
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
236 Document result = XMLUtils.newDocument();
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
237 try {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
238 if (this.current != null) {
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
239 Collection<InputData> inputData = this.parseInputData(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
240 target,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
241 XPATH_INPUT_DATA);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
242
194
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
243 if (!inputData.isEmpty()){
208
a33d59f5791a Use super.identifier as uuid. issue3
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
244 this.current.putInputData(inputData, super.identifier);
194
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
245 result = new ArtifactXMLUtilities().createSuccessReport(
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
246 "Feed success", XMLUtils.newDocument());
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
247 }else{
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
248 String msg = "No Inputdata given. Please select at least one Entry.";
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
249 log.warn(msg);
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
250 result = new ArtifactXMLUtilities().createExceptionReport(msg,
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
251 XMLUtils.newDocument());
00c1a931b9c3 Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
252 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
253 } else {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
254 String msg = "No State instantiated";
89
cde042a0a395 Successreporting added
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
255 log.warn(msg);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
256 result = new ArtifactXMLUtilities().createExceptionReport(msg,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
257 XMLUtils.newDocument());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
258 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
259 } catch (StateException e) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
260 log.error(e, e);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
261 result = new ArtifactXMLUtilities().createExceptionReport(e
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
262 .getLocalizedMessage(), XMLUtils.newDocument());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
263 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
264 return result;
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
265 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
266
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
267
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
268 /**
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
269 * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext)
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
270 */
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
271 @Override
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
272 public Document describe(Document data, CallContext context) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
273 log.debug("GNVArtifactBase.describe");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
274
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
275 Document document = createDescibeOutput(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
276 context.getMeta(),
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
277 identifier,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
278 getIncludeUIFromDocument(data)
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
279 );
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
280
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
281 // insert node for rendering product field
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
282 Element staticNode = (Element) XMLUtils.xpath(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
283 document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
284 XPATH_STATIC_NODE,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
285 XPathConstants.NODE,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
286 ArtifactNamespaceContext.INSTANCE
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
287 );
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
288
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
289 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
290 document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
291 XMLUtils.XFORM_URL,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
292 XMLUtils.XFORM_PREFIX
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
293 );
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
294
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
295 if (staticNode != null) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
296 Element staticUI = createSelectBox(creator, document, context);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
297 staticNode.insertBefore(staticUI, staticNode.getFirstChild());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
298 }
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
299
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
300 return document;
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
301 }
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
302
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
303 /**
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
304 * @see de.intevation.artifactdatabase.DefaultArtifact#setup(java.lang.String,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
305 * java.lang.Object)
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
306 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
307 @Override
70
0035862b0295 Refactoringwork done because of changes in the artifact-module
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
308 public void setup(String identifier, ArtifactFactory factory, Object context) {
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
309 log.debug("GNVArtifactBase.setup");
70
0035862b0295 Refactoringwork done because of changes in the artifact-module
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
310 super.setup(identifier, factory, context);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
311
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 73
diff changeset
312 Object localContext = context;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
313 if (context instanceof CallContext) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
314 localContext = ((CallContext) context).globalContext();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
315
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 73
diff changeset
316 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
317
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
318 if (localContext instanceof GNVArtifactContext) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
319 GNVArtifactContext gnvContext = (GNVArtifactContext) localContext;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
320 Document doc = gnvContext.getConfig();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
321 Node artifactNode = this.getConfigurationFragment(doc);
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
322
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
323 NodeList stateList = Config.getNodeSetXPath(artifactNode,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
324 "states/state");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
325 this.states = new HashMap<String, State>(stateList
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
326 .getLength());
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
327 for (int i = 0; i < stateList.getLength(); i++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
328 State tmpState = StateFactory.getInstance()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
329 .createState(stateList.item(i));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
330 if (tmpState != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
331 this.states.put(tmpState.getID(), tmpState);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
332 if (this.current == null) {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
333 this.current = tmpState;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
334 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
335 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
336 }
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
338 NodeList transitionList = Config.getNodeSetXPath(artifactNode,
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
339 "states/transition");
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
340 this.transitions = new ArrayList<Transition>(transitionList.getLength());
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
341 for (int i = 0; i < transitionList.getLength(); i++) {
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
342 Transition tmpTransition = TransitionFactory.getInstance()
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
343 .createTransition(transitionList.item(i));
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
344 if (tmpTransition != null) {
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
345 this.transitions.add(tmpTransition);
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
346 }
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
347 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
348
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
349 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
350 }
325
3eff9241ea1e Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents: 301
diff changeset
351
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
352
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
353 protected Document createDescibeOutput(CallMeta callMeta, String uuid, boolean incudeUI) {
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
354 log.debug("GNVArtifactBase.createDescibeOutput");
71
e4ecf3188bdf Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents: 70
diff changeset
355 Document document = XMLUtils.newDocument();
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
356
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
357 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
358 document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
359 ArtifactNamespaceContext.NAMESPACE_URI,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
360 ArtifactNamespaceContext.NAMESPACE_PREFIX
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
361 );
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
362 Element rootNode = this.createRootNode(document);
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
363 this.createHeader(creator, rootNode, document, "describe");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
364 this.createOutputs(creator, rootNode, document);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
365 this.createCurrentState(creator, rootNode, document);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
366 this.createReachableStates(creator, rootNode, document);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
367 this.createModel(creator, rootNode, document);
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
368 if (incudeUI){
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
369 this.createUserInterface(creator, rootNode, document, callMeta, uuid);
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
370 }
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
371
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
372 return document;
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
373 }
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
374
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
375 protected boolean getIncludeUIFromDocument(Document document){
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
376 String value = XMLUtils.xpathString(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
377 document, XPATH_INCLUDE_UI, ArtifactNamespaceContext.INSTANCE);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
378
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
379 boolean includeUI = false;
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
380 if (value != null){
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
381 includeUI = Boolean.parseBoolean(value);
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
382 }
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
383 log.debug("INCLUDE UI? " + includeUI);
222
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
384 return includeUI;
3e82b4f1c455 Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents: 220
diff changeset
385 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
386
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
387 protected Element createRootNode(Document document) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
388 Element rootNode = xmlUtilities.createArtifactElement(document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
389 "result");
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
390 document.appendChild(rootNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
391 return rootNode;
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
392 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
393
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
394 protected void createHeader(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
395 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
396 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
397 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
398 String documentType
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
399 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
400 Element typeNode = creator.create("type");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
401 creator.addAttr(typeNode, "name", documentType);
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
402 parent.appendChild(typeNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
403
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
404 Element uuidNode = creator.create("uuid");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
405 creator.addAttr(uuidNode, "value", super.identifier);
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
406 parent.appendChild(uuidNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
407
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
408 Element hashNode = creator.create("hash");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
409 creator.addAttr(hashNode, "value", this.hash());
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
410 parent.appendChild(hashNode);
89
cde042a0a395 Successreporting added
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
411 }
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
412
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
413 protected Element createSelectBox(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
414 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
415 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
416 CallContext context
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
417 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
418 RessourceFactory resource = RessourceFactory.getInstance();
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
419 CallMeta callMeta = (CallMeta) context.getMeta();
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
420 String productName = product.getName();
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
421
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
422 Element selectNode = creator.create("select1");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
423 creator.addAttr(selectNode, "ref", "product");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
424
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
425 Element labelNode = creator.create("label");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
426 labelNode.setTextContent(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
427 resource.getRessource(callMeta.getLanguages(), "product", "product")
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
428 );
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
429
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
430 Element choicesNode = creator.create("choices");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
431
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
432 Element itemNode = creator.create("item");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
433 creator.addAttr(itemNode, "selected", "true");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
434
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
435 Element choiceLabel = creator.create("label");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
436 choiceLabel.setTextContent(resource.getRessource(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
437 callMeta.getLanguages(),
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
438 productName,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
439 productName
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
440 ));
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
441
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
442 Element choiceValue = creator.create("value");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
443 choiceValue.setTextContent(productName);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
444
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
445 itemNode.appendChild(choiceLabel);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
446 itemNode.appendChild(choiceValue);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
447 choicesNode.appendChild(itemNode);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
448
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
449 selectNode.appendChild(labelNode);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
450 selectNode.appendChild(choicesNode);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
451
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
452 return selectNode;
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
453 }
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
454
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
455 protected void createReachableStates(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
456 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
457 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
458 Document document
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
459 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
460 Element stateNode = creator.create("reachable-states");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
461 if (this.current != null) {
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
462 Iterator<Transition> transitions = this.transitions.iterator();
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
463 while (transitions.hasNext()) {
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
464 Transition tmpTransition = transitions.next();
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
465 if (tmpTransition.getFrom().equals(current.getID()) &&
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
466 tmpTransition.isValid(this.current)){
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
467 Element currentNode = creator.create("state");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
468 creator.addAttr(currentNode, "name", tmpTransition.getTo());
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
469 log.debug("Reachable State: " + tmpTransition.getTo());
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
470 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
471 currentNode,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
472 "description",
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
473 this.states.get(tmpTransition.getTo()).getDescription());
337
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
474 stateNode.appendChild(currentNode);
a887074460b6 Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents: 335
diff changeset
475 }
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
476 }
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
477 }
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
478 parent.appendChild(stateNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
479 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
480
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
481 protected void createCurrentState(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
482 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
483 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
484 Document document
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
485 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
486 Element stateNode = creator.create("state");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
487 creator.addAttr(stateNode, "name", this.current.getID());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
488 creator.addAttr(stateNode, "description", this.current.getDescription());
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
489 parent.appendChild(stateNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
490 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
491
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
492 protected void createModel(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
493 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
494 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
495 Document document
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
496 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
497 Element modelNode = creator.create("model");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
498 if (this.current != null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
499 Collection<InputValue> inputValues = this.current
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
500 .getRequiredInputValues();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
501 if (inputValues != null) {
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
502 Iterator<InputValue> it = inputValues.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
503 while (it.hasNext()) {
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
504 InputValue inputValue = it.next();
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
505 Element inputNode = creator.create("input");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
506 creator.addAttr(inputNode, "name", inputValue.getName());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
507 creator.addAttr(inputNode, "type", inputValue.getType());
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
508 modelNode.appendChild(inputNode);
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
509 }
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
510 }
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
511 }
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
512 parent.appendChild(modelNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
513 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
514
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
515 protected void createUserInterface(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
516 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
517 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
518 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
519 CallMeta callMeta,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
520 String uuid
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
521 ) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
522 Element uiNode = creator.create("ui");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
523
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
524 if (this.current != null) {
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
525 this.current.describe(document, uiNode, callMeta, uuid);
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
526 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
527
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
528 parent.appendChild(uiNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
529 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
530
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
531 protected void createOutputs(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
532 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
533 Element parent,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
534 Document document
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
535 ) {
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
536 log.debug("GNVArtifactBase.createOutputs");
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
537 Element outputsNode = creator.create("outputs");
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
538 if (this.current instanceof OutputState) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
539 Collection<OutputMode> outputModes = ((OutputState) this.current)
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
540 .getOutputModes();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
541 if (outputModes != null) {
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
542 Iterator<OutputMode> it = outputModes.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
543 while (it.hasNext()) {
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
544 OutputMode outputMode = it.next();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
545 log.debug("Write Outputnode for " + outputMode.toString());
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
546 Element outputModeNode = creator.create("output");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
547 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
548 outputModeNode, "name", outputMode.getName());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
549 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
550 outputModeNode, "description", outputMode.getDescription());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
551 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
552 outputModeNode, "mime-type", outputMode.getMimeType());
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
553 outputsNode.appendChild(outputModeNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
554
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
555 Collection<InputValue> inputParameters = outputMode
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
556 .getInputParameters();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
557 if (inputParameters != null) {
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
558 Element inputParametersNode = creator.create("parameter");
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
559 outputModeNode.appendChild(inputParametersNode);
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
560 Iterator<InputValue> it2 = inputParameters.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
561 while (it2.hasNext()) {
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
562 InputValue inputValue = it2.next();
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
563 Element inputParameterNode =
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
564 creator.create("parameter");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
565 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
566 inputParameterNode, "name", inputValue.getName());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
567 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
568 inputParameterNode, "type", inputValue.getType());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
569 creator.addAttr(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
570 inputParameterNode, "value", inputValue.getDefaultValue());
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
571 inputParametersNode.appendChild(inputParameterNode);
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
572 }
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
573 }
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
574 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
575 } else {
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
576 log.warn("No Outputmodes given.");
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
577 }
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
578 }
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
579 parent.appendChild(outputsNode);
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
580 }
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
581
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
582 protected Collection<InputData> parseInputData(Document document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
583 String xPath) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
584 HashMap<String, InputData> returnValue = null;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
585
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
586 NodeList inputElemets = (NodeList) XMLUtils.xpath(document, xPath,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
587 XPathConstants.NODESET, ArtifactNamespaceContext.INSTANCE);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
588 if (inputElemets != null) {
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
589 returnValue = new HashMap<String, InputData>();
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
590
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
591 for (int i = 0; i < inputElemets.getLength(); i++) {
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
592 Element inputDataNode = (Element)inputElemets.item(i);
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
593 String name = inputDataNode.getAttribute("name");
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 194
diff changeset
594 String value = inputDataNode.getAttribute("value");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
595
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
596 if (returnValue.containsKey(name)) {
78
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
597 InputData inputData = returnValue.get(name);
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
598 inputData.concartValue(value);
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
599 log.debug(inputData.toString());
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
600 returnValue.put(name, inputData);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
601 } else {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
602 InputData inputData = new DefaultInputData(name, value);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
603
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
604 returnValue.put(name, inputData);
78
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
605 }
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
606 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
607 }
78
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
608 return returnValue.values();
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
609 }
99
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
610
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
611 /**
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
612 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document,
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
613 * java.io.OutputStream, de.intevation.artifacts.CallContext)
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
614 */
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
615 @Override
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
616 public void out(Document format, OutputStream outputStream,
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
617 CallContext context) throws IOException {
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
618 log.debug("TGNVArtifactBase.out");
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
619 try {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
620
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
621 if (current != null && current instanceof OutputState) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
622 ((OutputState) current)
299
d6c75171f1e9 Pass the xml document of the request to OutputTransition for more information about output formats of charts (png,jpeg).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 222
diff changeset
623 .out(format, this.parseInputData(
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
624 format, XPATH_OUTPUT_PARAMS),
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 337
diff changeset
625 outputStream, super.identifier, context);
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
626 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents: 325
diff changeset
627 } catch (StateException e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
628 log.error(e, e);
89
cde042a0a395 Successreporting added
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
629 throw new IOException(e.getMessage());
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
630 }
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
631 }
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 71
diff changeset
632
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
633 protected String readOutputType(Document document) {
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
634 String value = XMLUtils.xpathString(
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
635 document, XPATH_OUTPUT_NAME, ArtifactNamespaceContext.INSTANCE);
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
636 return value;
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
637 }
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
638
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
639
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
640 public void setProduct(Product product) {
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
641 this.product = product;
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
642 }
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
643 }
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
644 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org