annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java @ 1115:f953c9a559d8

Added license file and license headers. gnv-artifacts/trunk@1260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:46:55 +0000
parents 05bf8534a35a
children dec4257ad570
rev   line source
1115
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
1 /*
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
3 *
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
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: 836
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: 836
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: 836
diff changeset
7 */
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
8
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 package de.intevation.gnv.state;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
779
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
11 import de.intevation.artifactdatabase.Config;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
12
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
13 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
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.gnv.state.exception.StateException;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
16
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import java.util.ArrayList;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 import java.util.Collection;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 import java.util.Map;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 import org.w3c.dom.Element;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 import org.w3c.dom.Node;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24 /**
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
25 * This method looks for former inserted coordinates before initialization.
803
feae2f9d6c6f Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 796
diff changeset
26 *
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
27 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 */
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29 public class PreSettingsTransferCoordinateSelectionState extends CoordinateSelectionState {
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 /**
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 * The UID of this Class.
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 */
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 private static final long serialVersionUID = -3972304838976884048L;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 private String transferPreSettingsName = null;
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 747
diff changeset
38
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 private String transferInputDataname = null;
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 /**
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 * Constructor
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 */
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 public PreSettingsTransferCoordinateSelectionState() {
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 super();
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 }
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
47
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 /**
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
49 * Lookup mechanism for former inserted data before intialization begins.
803
feae2f9d6c6f Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 796
diff changeset
50 *
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
51 * @param uuid
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
52 * @param context
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
53 * @throws StateException
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 */
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 @Override
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 public void initialize(String uuid, CallContext context)
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 throws StateException {
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 Map<String, InputData> preSettings = this.getPreSettings();
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 if (preSettings != null){
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 InputData ip = preSettings.get(transferPreSettingsName);
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
61 if (ip != null){
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62 Collection<InputData> localInputdata = new ArrayList<InputData>(1);
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 localInputdata.add(new DefaultInputData(transferInputDataname,
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 ip.getValue()));
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 this.putInputData(localInputdata, uuid);
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 }
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 747
diff changeset
68
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 super.initialize(uuid, context);
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 }
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
72
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73 /**
803
feae2f9d6c6f Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 796
diff changeset
74 *
796
a5526908f92f Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
75 * @param configuration
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
76 */
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
77 @Override
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
78 public void setup(Node configuration) {
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 747
diff changeset
79
747
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 Element preSettingsNode = (Element)Config.getNodeXPath(configuration,
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81 "presettings-transfer");
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
82 if (preSettingsNode != null){
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
83 this.transferPreSettingsName = preSettingsNode.getAttribute("presetting");
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
84 this.transferInputDataname = preSettingsNode.getAttribute("inputvalue");
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
85 }
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 super.setup(configuration);
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
87 }
a5e860f17a52 Added an new State wich will handle the Display of Coordinatevalues and fetch given Inputparameters from the Presettings and copy them to the InputValues.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88 }
836
05bf8534a35a Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 803
diff changeset
89 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org