Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 1138:2c00570ab3bd
merged doc
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:02 +0200 |
parents | c01c220312d0 |
children |
rev | line source |
---|---|
1115
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
1 /* |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
3 * |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
7 */ |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1062
diff
changeset
|
8 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.gnv.artifacts; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 |
1117
dec4257ad570
Changed imports to fit new positions of XMLUtils and Config
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1115
diff
changeset
|
11 import de.intevation.artifacts.common.utils.Config; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
12 import de.intevation.artifactdatabase.ProxyArtifact; |
1117
dec4257ad570
Changed imports to fit new positions of XMLUtils and Config
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1115
diff
changeset
|
13 import de.intevation.artifacts.common.utils.XMLUtils; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
14 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
15 import de.intevation.artifacts.Artifact; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
16 import de.intevation.artifacts.ArtifactDatabase; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
17 import de.intevation.artifacts.ArtifactFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
18 import de.intevation.artifacts.ArtifactNamespaceContext; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
19 import de.intevation.artifacts.CallContext; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
20 import de.intevation.artifacts.CallMeta; |
1118
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
21 import de.intevation.artifacts.GlobalContext; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
22 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
23 import de.intevation.gnv.artifacts.context.GNVArtifactContext; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
24 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
25 import de.intevation.gnv.artifacts.fis.product.Product; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
26 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
27 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
28 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
29 import de.intevation.gnv.state.AutoResumeState; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
30 import de.intevation.gnv.state.DefaultInputData; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
31 import de.intevation.gnv.state.ExportMode; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
32 import de.intevation.gnv.state.InputData; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
33 import de.intevation.gnv.state.InputValue; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
34 import de.intevation.gnv.state.OutputMode; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
35 import de.intevation.gnv.state.OutputState; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
36 import de.intevation.gnv.state.State; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
37 import de.intevation.gnv.state.StateFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
38 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
39 import de.intevation.gnv.state.exception.StateException; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
40 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
41 import de.intevation.gnv.transition.Transition; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
42 import de.intevation.gnv.transition.TransitionFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
43 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
44 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
45 |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
46 import java.io.IOException; |
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
47 import java.io.OutputStream; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
48 |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
49 import java.util.ArrayList; |
56
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
50 import java.util.Collection; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 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
|
52 import java.util.Iterator; |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
53 import java.util.List; |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
54 import java.util.Locale; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 import java.util.Map; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 |
71
e4ecf3188bdf
Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents:
70
diff
changeset
|
57 import javax.xml.xpath.XPathConstants; |
e4ecf3188bdf
Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents:
70
diff
changeset
|
58 |
652
078ba6799bd2
Cleanup imports
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
636
diff
changeset
|
59 import org.apache.log4j.Logger; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
60 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 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
|
62 import org.w3c.dom.Element; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 import org.w3c.dom.Node; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 import org.w3c.dom.NodeList; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
67 * This is the major gnv artifact and handles the requests specified in |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
68 * <code>de.intevation.artifactdatabase.Artifact</code>. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
789
diff
changeset
|
69 * |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
70 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
71 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
72 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 */ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
74 public abstract class GNVArtifactBase extends GNVDefaultArtifact |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
75 implements PreSettingArtifact { |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
76 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 * 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
|
79 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 private static Logger log = Logger.getLogger(GNVArtifactBase.class); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
82 * The UID of this Class |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
83 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 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
|
85 |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
86 /** |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
87 * 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
|
88 */ |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
89 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
|
90 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 * 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
|
93 */ |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
94 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
|
95 + XPATH_IDENTIFIER_REPLACE |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
96 + "']"; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
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 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
|
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 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
|
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 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
|
103 |
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
|
104 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
|
105 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
106 public static final String XPATH_OUTPUT_NAME = "/art:action/art:out/@name"; |
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
|
107 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
108 public static final String XPATH_OUTPUT_PARAMS = "/art:action/art:out/art:params/art:input"; |
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
|
109 |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
110 public static final String INITIAL_STATE = "product"; |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
111 |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
112 /** |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
113 * The current State |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
114 */ |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
115 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
|
116 |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
117 /** |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
118 * 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
|
119 */ |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
120 protected Map<String, State> states = null; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
121 |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
122 /** |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
123 * 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
|
124 */ |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
125 protected Collection<Transition> transitions = null; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 |
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
|
127 /** |
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
|
128 * 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
|
129 */ |
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
|
130 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
|
131 |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
132 /** |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
133 * 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
|
134 */ |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 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
|
136 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 /** |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
138 * The Presettings of InputData which can be used to |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
139 * travel through the States in different Ways or |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
140 * manipulate the InputData |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
141 */ |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
142 private Map<String, InputData> preSettings = null; |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
143 |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
144 /** |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 * Constructor |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
147 public GNVArtifactBase() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 super(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
150 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
151 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
152 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
153 * This method handles request for changing the current state of an |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
154 * artifact. It is possible to step forward, backward, or to the initial |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
155 * state for choosing a fis. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
156 */ |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
157 @Override |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
158 public Document advance(Document target, CallContext context) { |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
159 log.debug("GNVArtifactBase.advance()"); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
160 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
161 Document result = XMLUtils.newDocument(); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
162 String targetState = XMLUtils.xpathString( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
163 target, XPATH_TARGET_NAME, ArtifactNamespaceContext.INSTANCE |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
164 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
165 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
166 // no current state... |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
167 if (current == null) { |
614
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
168 log.warn("No current state. Advance not possible."); |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
169 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
170 result = createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
171 result, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
172 "exceptionreport", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
173 "exception", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
174 "No State activated." |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
175 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
176 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
177 return result; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
178 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
179 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
180 State next = null; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
181 |
88
1b12021905b9
Some CodeCleanup done.
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
182 try { |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
183 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
184 // step forward |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
185 if (isStateCurrentlyReachable(targetState)) { |
614
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
186 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
187 next = states.get(targetState); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
188 |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
189 boolean success = go2NextState(context, result, next); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
190 |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
191 if (success){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
192 result = createReport( |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
193 result, "result", "success", "Advance success" |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
194 ); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
195 }else{ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
196 result = ArtifactXMLUtilities. |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
197 createExceptionReport("Error while going to next State.", |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
198 XMLUtils.newDocument()); |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
199 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
200 } |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
201 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
202 // step backward |
1062
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
203 else if((next = getPreviousState(current, targetState, context)) |
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
204 != null) |
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
205 { |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
206 |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
207 if (current != null) { |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
208 current.endOfLife(context.globalContext()); |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
209 } |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
210 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
211 current = next; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
212 |
614
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
213 // 2. Transfer Results |
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
214 current.reset(identifier); |
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
215 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
216 result = createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
217 result, "result", "success", "Advance success" |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
218 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
219 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
220 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
221 // goto initial step |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
222 else if(targetState.equals(INITIAL_STATE)) { |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
223 |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
224 String fis = product.getArtifactFactory(); |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
225 ArtifactDatabase db = context.getDatabase(); |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
226 GNVProductArtifactFactory fac = (GNVProductArtifactFactory) |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
227 db.getInternalArtifactFactory(fis); |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
228 |
1118
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
229 Artifact select = fac.createArtifact( |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
230 identifier, |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
231 (GlobalContext) context.globalContext(), |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
232 context.getMeta(), |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
233 null); |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
234 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
235 context.putContextValue(ProxyArtifact.REPLACE_PROXY, select); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
236 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
237 result = createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
238 result, "result", "success", "Advance success" |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
239 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
240 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
241 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
242 // advance not possible |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
243 else { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
244 log.warn("advance not possible for target: " + targetState); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
245 result = createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
246 result, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
247 "exceptionreport", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
248 "exception", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
249 "Statetransition not supported" |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
250 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
251 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
252 } |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
253 catch (StateException se) { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
254 log.error(se, se); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
255 result = createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
256 result, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
257 "exceptionreport", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
258 "exception", |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
259 se.getLocalizedMessage() |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
260 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
261 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
262 |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
263 return result; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
264 } |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
265 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
266 |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
267 private boolean go2NextState(CallContext context, Document result, |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
268 State next) throws StateException { |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
269 // 2. Transfer Results |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
270 next.putInputData(current.getInputData(), identifier); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
271 next.setParent(current); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
272 next.setPreSettings(this.preSettings); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
273 |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
274 // 3. Switch to next State |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
275 current = next; |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
276 |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
277 // 4. Initialize next Step |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
278 current.initialize(identifier, context); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
279 |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
280 return true; |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
281 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
282 |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
283 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
284 protected Document createReport( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
285 Document document, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
286 String nodeName, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
287 String state, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
288 String msg |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
289 ) { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
290 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
291 document, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
292 ArtifactNamespaceContext.NAMESPACE_URI, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
293 ArtifactNamespaceContext.NAMESPACE_PREFIX |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
294 ); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
295 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
296 Element reportNode = creator.create(nodeName); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
297 Element stateNode = creator.create(state); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
298 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
299 stateNode.setTextContent(msg); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
300 reportNode.appendChild(stateNode); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
301 document.appendChild(reportNode); |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
302 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
303 return document; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
304 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
305 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
306 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
307 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
308 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
309 * Step back to the previous state specified by <code>name</code>. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
310 */ |
1062
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
311 protected State getPreviousState( |
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
312 State current, String name, CallContext context) |
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
313 { |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
314 if (current == null) { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
315 return null; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
316 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
317 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
318 if (current.getID().equals(name)) { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
319 return current; |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
320 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
321 else { |
1062
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
322 current.endOfLife(context); |
58b4a07db856
Cach improvement: remove the cached elements of each visited state that is visited while stepping back to a previous state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1061
diff
changeset
|
323 return getPreviousState(current.getParent(), name, context); |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
324 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
325 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
326 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
327 |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
328 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
|
329 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
|
330 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
|
331 while (it.hasNext()){ |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
332 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
|
333 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
|
334 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
|
335 return true; |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
336 } |
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 } |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
339 return false; |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
340 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
341 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
342 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
343 public Document initialize(CallContext context) { |
325
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
344 Document result = XMLUtils.newDocument(); |
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
345 try { |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
488
diff
changeset
|
346 this.current.initialize(super.identifier, context); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
347 |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
348 if (this.current instanceof AutoResumeState){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
349 // Jump to next State using the Transitions. |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
350 State next = this.getNextReachableState(this.current); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
351 if (next != null){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
352 boolean success = go2NextState(context, result, next); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
353 if (success){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
354 result = ArtifactXMLUtilities |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
355 .createSuccessReport("Initialize success", |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
356 XMLUtils.newDocument()); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
357 }else{ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
358 result = ArtifactXMLUtilities. |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
359 createExceptionReport( |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
360 "Error while going to next State.", |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
361 XMLUtils.newDocument()); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
362 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
363 }else{ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
364 result = ArtifactXMLUtilities. |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
365 createExceptionReport("No propper State found.", |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
366 XMLUtils.newDocument()); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
367 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
368 }else{ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
369 result = ArtifactXMLUtilities |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
370 .createSuccessReport("Initialize success", |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
371 XMLUtils.newDocument()); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
372 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
373 } catch (StateException e) { |
325
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
374 log.error(e,e); |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
375 result = ArtifactXMLUtilities.createExceptionReport(e |
325
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
376 .getLocalizedMessage(), XMLUtils.newDocument()); |
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
377 } |
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
378 return result; |
3eff9241ea1e
Refactoring of the Transitionmodel.
Tim Englich <tim.englich@intevation.de>
parents:
301
diff
changeset
|
379 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
380 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
381 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
382 * Step forward to the next reachable state. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
383 * @param current Current state. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
384 * @return Reachable state. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
385 */ |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
386 protected State getNextReachableState(State current){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
387 Iterator<Transition> it = this.transitions.iterator(); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
388 String from = current.getID(); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
389 while (it.hasNext()){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
390 Transition transition = it.next(); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
391 if (transition.getFrom().equals(from)){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
392 if (transition.isValid(current)){ |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
393 return this.states.get(transition.getTo()); |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
394 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
395 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
396 } |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
397 return null; |
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
398 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
399 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
400 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
401 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
|
402 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
|
403 document, XPATH_TARGET_NAME, ArtifactNamespaceContext.INSTANCE); |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
404 return returnValue; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
405 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
406 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
407 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
408 protected Node getConfigurationFragment(Document document) { |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
409 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
|
410 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
|
411 XPATH_IDENTIFIER_REPLACE, this.name); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
412 |
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
|
413 Element configurationNode = (Element)Config.getNodeXPath(document, xpathQuery); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
414 |
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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
420 |
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
|
421 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
|
422 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
423 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
424 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
425 * Insert new data included in <code>target</code> into the current state. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
426 * @param target XML document which contains data. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
427 * @param context CallContext |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
428 * @return XML document with success or error message. |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
429 */ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
430 @Override |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
431 public Document feed(Document target, CallContext context) { |
89
cde042a0a395
Successreporting added
Tim Englich <tim.englich@intevation.de>
parents:
88
diff
changeset
|
432 log.debug("GNVArtifactBase.feed"); |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
433 RessourceFactory fac = RessourceFactory.getInstance(); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
434 Locale[] locales = fac.getLocales(); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
435 Locale locale = context.getMeta().getPreferredLocale(locales); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
436 Document result = XMLUtils.newDocument(); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
437 |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
438 try { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
439 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
|
440 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
|
441 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
|
442 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
|
443 |
194
00c1a931b9c3
Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
444 if (!inputData.isEmpty()){ |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
445 result = current.feed(context, 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
|
446 }else{ |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
447 //String msg = "No Inputdata given. Please select at least one Entry."; |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
448 String msg = fac.getRessource( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
449 locale, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
450 EXCEPTION_NO_INPUT, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
451 EXCEPTION_NO_INPUT); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
452 |
194
00c1a931b9c3
Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
453 log.warn(msg); |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
454 result = ArtifactXMLUtilities.createInputExceptionReport( |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
455 msg, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
456 XMLUtils.newDocument()); |
194
00c1a931b9c3
Catch Exception that the Calling Program could not put no InputData
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
457 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
458 } else { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
459 String msg = "No State instantiated"; |
89
cde042a0a395
Successreporting added
Tim Englich <tim.englich@intevation.de>
parents:
88
diff
changeset
|
460 log.warn(msg); |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
461 result = ArtifactXMLUtilities.createExceptionReport(msg, |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
462 XMLUtils.newDocument()); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
463 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
464 } 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
|
465 log.error(e, e); |
735
d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
Tim Englich <tim.englich@intevation.de>
parents:
725
diff
changeset
|
466 result = ArtifactXMLUtilities.createExceptionReport(e |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
467 .getLocalizedMessage(), XMLUtils.newDocument()); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
468 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
469 return result; |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
470 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
471 |
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
|
472 |
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 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
474 * Describe the current artifact. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
475 * @return The description of the current artifact. |
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
|
476 */ |
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
|
477 @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
|
478 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
|
479 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
|
480 |
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 Document document = createDescibeOutput( |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
482 context, |
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
|
483 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
|
484 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
|
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 |
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 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
|
488 } |
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
|
489 |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
490 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
491 * Initialse this artifact and insert some data if <code>data</code> |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
492 * contains necessary information for this artifact. |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
493 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
494 @Override |
1118
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
495 public void setup( |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
496 String identifier, |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
497 ArtifactFactory factory, |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
498 Object context, |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
499 CallMeta meta, |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
500 Document data |
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
501 ) { |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
502 log.debug("GNVArtifactBase.setup"); |
1118
c01c220312d0
Made it compile again with an updated ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1117
diff
changeset
|
503 super.setup(identifier, factory, context, meta, data); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
504 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
505 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
|
506 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
|
507 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
|
508 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
509 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
510 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
511 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
|
512 GNVArtifactContext gnvContext = (GNVArtifactContext) localContext; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
513 Document doc = gnvContext.getConfig(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
514 Node artifactNode = this.getConfigurationFragment(doc); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
515 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
516 NodeList stateList = Config.getNodeSetXPath(artifactNode, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
517 "states/state"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
518 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
|
519 .getLength()); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
520 for (int i = 0; i < stateList.getLength(); i++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
521 State tmpState = StateFactory.getInstance() |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
522 .createState(stateList.item(i)); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
523 if (tmpState != null) { |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
524 log.debug("Initiate new state: " + tmpState.getID()); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
525 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
|
526 if (this.current == null) { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
527 this.current = tmpState; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
528 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
529 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
530 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
531 |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
532 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
|
533 "states/transition"); |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
534 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
|
535 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
|
536 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
|
537 .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
|
538 if (tmpTransition != null) { |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
539 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
|
540 } |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
541 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
542 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
543 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
544 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
545 |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
546 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
547 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
548 * Create the xml document returned in {@link #describe(org.w3c.dom.Document, |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
549 * de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
550 */ |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
551 protected Document createDescibeOutput( |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
552 CallContext context, |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
553 String uuid, |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
554 boolean incudeUI |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
555 ) { |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
556 log.debug("GNVArtifactBase.createDescibeOutput"); |
71
e4ecf3188bdf
Integrated FIS-Artifact
Tim Englich <tim.englich@intevation.de>
parents:
70
diff
changeset
|
557 Document document = XMLUtils.newDocument(); |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
558 |
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
|
559 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
|
560 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
|
561 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
|
562 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
|
563 ); |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
564 Element rootNode = this.createRootNode(creator, 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
|
565 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
|
566 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
|
567 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
|
568 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
|
569 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
|
570 if (incudeUI){ |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
571 this.createUserInterface(creator, rootNode, document, context, uuid); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
572 } |
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
|
573 |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
574 return document; |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
575 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
576 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
577 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
578 * Determine the wish to append the user interface description to the |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
579 * describe document. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
789
diff
changeset
|
580 * |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
581 * @return True, if the user interface description should be appended, |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
582 * otherwise false. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
583 */ |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
584 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
|
585 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
|
586 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
|
587 |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
588 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
|
589 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
|
590 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
|
591 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
592 return includeUI; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
593 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
594 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
595 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
596 protected Element createRootNode( |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
597 XMLUtils.ElementCreator creator, |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
598 Document document |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
599 ) { |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
600 Element rootNode = creator.create("result"); |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
601 document.appendChild(rootNode); |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
602 return rootNode; |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
603 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
604 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
605 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
606 * Append information about the current artifact (uuid, hash). |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
607 */ |
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
|
608 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
|
609 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
|
610 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
|
611 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
|
612 String documentType |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
613 ) { |
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
|
614 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
|
615 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
|
616 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
|
617 |
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
|
618 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
|
619 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
|
620 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
|
621 |
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
|
622 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
|
623 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
|
624 parent.appendChild(hashNode); |
89
cde042a0a395
Successreporting added
Tim Englich <tim.englich@intevation.de>
parents:
88
diff
changeset
|
625 } |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
626 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
627 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
628 * Create the fis select box. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
629 */ |
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
|
630 protected Element createSelectBox( |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
631 XMLUtils.ElementCreator artCreator, |
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
|
632 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
|
633 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
|
634 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
|
635 ) { |
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
|
636 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
|
637 CallMeta callMeta = (CallMeta) context.getMeta(); |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
638 String productName = product.getName(); |
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
|
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 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
|
641 creator.addAttr(selectNode, "ref", "product"); |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
642 artCreator.addAttr(selectNode, "state", INITIAL_STATE, true); |
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
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 |
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
|
645 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
|
646 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
|
647 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
|
648 ); |
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
|
649 |
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
|
650 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
|
651 |
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
|
652 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
|
653 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
|
654 |
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
|
655 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
|
656 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
|
657 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
|
658 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
|
659 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
|
660 )); |
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
|
661 |
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
|
662 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
|
663 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
|
664 |
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
|
665 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
|
666 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
|
667 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
|
668 |
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
|
669 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
|
670 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
|
671 |
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
|
672 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
|
673 } |
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
|
674 |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
675 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
676 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
677 * Insert all reachable states into the describe document returned by |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
678 * {@link #describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
679 */ |
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
|
680 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
|
681 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
|
682 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
|
683 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
|
684 ) { |
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
|
685 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
|
686 if (this.current != null) { |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
687 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
688 // add future states |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
689 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
|
690 while (transitions.hasNext()) { |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
691 Transition tmpTransition = transitions.next(); |
614
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
692 if (tmpTransition.getFrom().equals(current.getID()) && |
337
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
693 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
|
694 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
|
695 creator.addAttr(currentNode, "name", tmpTransition.getTo()); |
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
|
696 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
|
697 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
|
698 "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
|
699 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
|
700 stateNode.appendChild(currentNode); |
a887074460b6
Last Step of the Refactoring Work on the Transition Model.
Tim Englich <tim.englich@intevation.de>
parents:
335
diff
changeset
|
701 } |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
702 } |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
703 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
704 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
705 // add old states |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
706 appendOldReachableStates(creator, stateNode, current); |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
707 } |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
708 parent.appendChild(stateNode); |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
709 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
710 |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
711 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
712 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
713 * Insert states which have been visited by this artifact into the xml |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
714 * document returned by {@link #describe(org.w3c.dom.Document, |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
715 * de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
716 */ |
473
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
717 protected void appendOldReachableStates( |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
718 XMLUtils.ElementCreator creator, |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
719 Element parent, |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
720 State state |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
721 ) { |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
722 if (state == null) |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
723 return; |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
724 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
725 while (state != null) { |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
726 Element currentNode = creator.create("state"); |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
727 creator.addAttr(currentNode, "name", state.getID()); |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
728 creator.addAttr(currentNode, "description", state.getDescription()); |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
729 parent.appendChild(currentNode); |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
730 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
731 state = state.getParent(); |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
732 } |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
733 } |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
734 |
a6a33ef35809
Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
470
diff
changeset
|
735 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
736 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
737 * Insert the current state into the xml document returned by |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
738 * {@link #describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
739 */ |
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
|
740 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
|
741 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
|
742 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
|
743 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
|
744 ) { |
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
|
745 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
|
746 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
|
747 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
|
748 parent.appendChild(stateNode); |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
749 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
750 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
751 |
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
|
752 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
|
753 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
|
754 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
|
755 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
|
756 ) { |
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
|
757 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
|
758 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
|
759 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
|
760 .getRequiredInputValues(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
761 if (inputValues != null) { |
56
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
762 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
|
763 while (it.hasNext()) { |
56
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
764 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
|
765 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
|
766 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
|
767 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
|
768 modelNode.appendChild(inputNode); |
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
769 } |
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
770 } |
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
771 } |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
772 parent.appendChild(modelNode); |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
773 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
774 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
775 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
776 * Append the user interface description to the document returned by |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
777 * {@link #describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
778 * @param creator XML element creator. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
779 * @param parent New elements are appended to this node. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
780 * @param document Current document. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
781 * @param context CallContext |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
782 * @param uuid The uuid of the artifact. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
783 */ |
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
|
784 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
|
785 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
|
786 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
|
787 Document document, |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
788 CallContext context, |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
789 String uuid |
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
|
790 ) { |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
791 XMLUtils.ElementCreator xCreator = new XMLUtils.ElementCreator( |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
792 document, |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
793 XMLUtils.XFORM_URL, |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
794 XMLUtils.XFORM_PREFIX |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
795 ); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
796 |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
797 Element uiNode = creator.create("ui"); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
798 Element staticNode = creator.create("static"); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
799 Element dynamic = creator.create("dynamic"); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
800 |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
801 uiNode.appendChild(staticNode); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
802 uiNode.appendChild(dynamic); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
803 |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
804 parent.appendChild(uiNode); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
805 |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
806 // append fis to dynamic part |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
807 appendFis(document, staticNode, context, product.getArtifactFactory()); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
808 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
809 if (this.current != null) { |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
810 Element staticUI = createSelectBox( |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
811 creator, xCreator, document, context |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
812 ); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
813 staticNode.appendChild(staticUI); |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
814 |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
815 this.current.describe( |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
488
diff
changeset
|
816 document, uiNode, context, uuid |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
817 ); |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
818 } |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
819 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
820 |
478
0e0c64c821dc
Added support to step back to the point for choosing a product.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
475
diff
changeset
|
821 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
822 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
823 * Append possible output targets to the document returned by |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
824 * {@link #describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext)} |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
825 * @param creator Used to create xml elements. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
826 * @param parent New elements are appended to this node. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
827 * @param document The current document. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
828 */ |
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
|
829 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
|
830 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
|
831 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
|
832 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
|
833 ) { |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
834 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
|
835 Element outputsNode = creator.create("outputs"); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
836 if (this.current instanceof OutputState) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
837 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
|
838 .getOutputModes(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
839 if (outputModes != null) { |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
840 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
|
841 while (it.hasNext()) { |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
842 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
|
843 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
|
844 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
|
845 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
|
846 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
|
847 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
|
848 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
|
849 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
|
850 outputModeNode, "mime-type", outputMode.getMimeType()); |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
851 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
|
852 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
853 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
|
854 .getInputParameters(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
855 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
|
856 Element inputParametersNode = creator.create("parameter"); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
857 outputModeNode.appendChild(inputParametersNode); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
858 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
|
859 while (it2.hasNext()) { |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
860 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
|
861 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
|
862 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
|
863 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
|
864 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
|
865 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
|
866 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
|
867 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
|
868 inputParameterNode, "value", inputValue.getDefaultValue()); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
869 inputParametersNode.appendChild(inputParameterNode); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
870 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
871 } |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
872 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
873 // append export modes |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
874 List<ExportMode> exportModes = outputMode.getExportModes(); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
875 if (exportModes != null) { |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
876 Element exports = creator.create("exports"); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
877 outputModeNode.appendChild(exports); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
878 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
879 for (ExportMode exp: exportModes) { |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
880 Element export = creator.create("export"); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
881 creator.addAttr( |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
882 export, "name", exp.getName()); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
883 creator.addAttr( |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
884 export, "description", exp.getDescription()); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
885 creator.addAttr( |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
886 export, "mime-type", exp.getMimeType()); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
887 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
888 exports.appendChild(export); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
889 } |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
890 } |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
891 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
892 } else { |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
893 log.warn("No Outputmodes given."); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
894 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
61
diff
changeset
|
895 } |
54
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
896 parent.appendChild(outputsNode); |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
897 } |
09b4bf848c7b
2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
898 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
899 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
900 * Parse input data from feed-document. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
901 * @param document Feed-document |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
902 * @param xPath Path to input data. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
903 * @return A collection with InputData objects. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
904 */ |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
905 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
|
906 String xPath) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
907 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
|
908 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
909 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
|
910 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
|
911 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
|
912 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
|
913 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
914 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
|
915 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
|
916 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
|
917 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
|
918 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
919 if (returnValue.containsKey(name)) { |
78
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
920 InputData inputData = returnValue.get(name); |
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
921 inputData.concartValue(value); |
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
922 log.debug(inputData.toString()); |
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
923 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
|
924 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
925 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
|
926 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
927 returnValue.put(name, inputData); |
78
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
928 } |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
929 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
930 } |
78
969faa37a11b
Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents:
77
diff
changeset
|
931 return returnValue.values(); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
932 } |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
933 |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
934 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
935 * Call an output target (e.g. chart, wms, etc.) |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
936 * @param format XML document which contains some further information about |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
937 * the desired output. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
938 * @param outputStream Stream used for writing the output. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
939 * @param context CallContext |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
940 * @throws IOException If an error occured while writing the result to the |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
941 * output stream. |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
942 */ |
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
943 @Override |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
944 public void out(Document format, OutputStream outputStream, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
945 CallContext context) throws IOException { |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
946 log.debug("TGNVArtifactBase.out"); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
947 try { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
948 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
949 if (current != null && current instanceof OutputState) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
950 ((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
|
951 .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
|
952 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
|
953 outputStream, super.identifier, context); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
954 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
325
diff
changeset
|
955 } catch (StateException e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
956 log.error(e, e); |
89
cde042a0a395
Successreporting added
Tim Englich <tim.englich@intevation.de>
parents:
88
diff
changeset
|
957 throw new IOException(e.getMessage()); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
958 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
959 } |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
71
diff
changeset
|
960 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
961 |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
962 protected static 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
|
963 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
|
964 document, XPATH_OUTPUT_NAME, ArtifactNamespaceContext.INSTANCE); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
965 return value; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
966 } |
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
|
967 |
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
|
968 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
969 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
970 * The the current product. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
971 * @param product New product. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
972 */ |
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
|
973 public void setProduct(Product product) { |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
974 this.product = product; |
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
|
975 } |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
976 |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
977 /** |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
978 * Call endOfLife of parent class and the current state. |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
979 */ |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
980 @Override |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
981 public void endOfLife(Object globalContext) { |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
982 super.endOfLife(globalContext); |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
983 |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
984 if (current != null) { |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
985 current.endOfLife(globalContext); |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
986 } |
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
479
diff
changeset
|
987 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
988 |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
989 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
990 * Retrieves a map with given InputData which have been inserted into the |
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
991 * current artifact before the parameterization began. |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
992 */ |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
993 public Map<String, InputData> getPreSettings() { |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
994 return this.preSettings; |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
995 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
735
diff
changeset
|
996 |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
997 /** |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
998 * Set InputData which are used in later states. |
598
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
999 */ |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1000 public void setPreSettings(Map<String, InputData> preSettings) { |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1001 this.preSettings = preSettings; |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1002 if (this.current != null){ |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1003 this.current.setPreSettings(preSettings); |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1004 } |
9681ac6b6527
Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents:
594
diff
changeset
|
1005 } |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1006 } |
789
0dc115cbef0d
Added javadoc for artifact package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
1007 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |