annotate gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java @ 150:c5408b0f34c7

Now the UI will compelte be shown if the User has done an Mistake entering values to input-fields eg. Coordinates or formatted Date-Strings. issue 35 gnv/trunk@242 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 19 Oct 2009 10:30:28 +0000
parents 23a4f196d7d6
children d6b82c585f1f
rev   line source
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 *
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 package de.intevation.gnv.action;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.util.ArrayList;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.util.Collection;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8 import java.util.Iterator;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10 import javax.servlet.http.HttpServletRequest;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11 import javax.servlet.http.HttpServletResponse;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13 import org.apache.log4j.Logger;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 import org.apache.struts.action.ActionForm;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 import org.apache.struts.action.ActionForward;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 import org.apache.struts.action.ActionMapping;
18
87002cbd194c Static UI -integration an some refactoringwork done
Tim Englich <tim.englich@intevation.de>
parents: 17
diff changeset
17 import org.w3c.dom.Node;
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 import de.intevation.gnv.action.sessionmodel.SessionModel;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import de.intevation.gnv.action.sessionmodel.SessionModelFactory;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
32
0f4362d75e9e Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
24 import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticValue;
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
26 import de.intevation.gnv.artifactdatabase.objects.InputParameter;
18
87002cbd194c Static UI -integration an some refactoringwork done
Tim Englich <tim.englich@intevation.de>
parents: 17
diff changeset
27 import de.intevation.gnv.util.XMLUtils;
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 import de.intevation.gnv.util.XSLTransformer;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 * @author Tim Englich <tim.englich@intevation.de>
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
32 *
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 public class NextArtifactStepAction extends ArtifactDatabaseActionBase {
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 * the logger, used to log exceptions and additonaly information
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 */
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
38 private static Logger log = Logger
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
39 .getLogger(SelectArtifactFactoryAction.class);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
40
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 * Constructor
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 public NextArtifactStepAction() {
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 super();
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 }
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
47
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 /**
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
49 * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
50 * org.apache.struts.action.ActionForm,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
51 * javax.servlet.http.HttpServletRequest,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
52 * javax.servlet.http.HttpServletResponse)
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 @Override
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 public ActionForward execute(ActionMapping mapping, ActionForm form,
38
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
56 HttpServletRequest request,
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
57 HttpServletResponse response) throws Exception {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
58 log.debug("NextArtifactStepAction.execute");
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
59 SessionModel sm = SessionModelFactory.getInstance()
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
60 .getSessionModel(request);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
61 ArtifactDescription ad = sm.getArtifactDescription();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
62 Collection<String> inputParameter = ad.getInputParameter();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
63 Collection<InputParameter> ips = null;
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
64 if (inputParameter != null) {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
65 ips = new ArrayList<InputParameter>(inputParameter.size());
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
66 Iterator<String> it = inputParameter.iterator();
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
67 while (it.hasNext()) {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
68 String name = it.next();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
69 String[] values = request.getParameterValues(name);
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
70 InputParameter ip = new DefaultInputParameter(name, values);
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
71 ips.add(ip);
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
72 }
19
1557bea6cb55 Do some Imporvements for Userfriendly exceptionhandling.
Tim Englich <tim.englich@intevation.de>
parents: 18
diff changeset
73 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
74 ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory
40
23a4f196d7d6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 38
diff changeset
75 .getInstance()
23a4f196d7d6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 38
diff changeset
76 .getArtifactDatabaseClient(getLocale(request));
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
77 if (ad.getReachableStates() != null
38
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
78 && !ad.getReachableStates().isEmpty()) {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
79 // TODO: Woher kommt der zu erreichende Status;
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
80 String target = null;
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
81 if (ad.getReachableStates().size() > 1) {
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
82 target = request.getParameter("product"); // TODO HACK for
38
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
83 // Propducts every
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
84 // other Step has
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
85 // currently only
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
86 // one reachable
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
87 // state.
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
88 } else {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
89 target = ad.getReachableStates().iterator().next();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
90 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
91
150
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
92 ArtifactDescription artifactDescription;
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
93 try {
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
94 artifactDescription = adc.doNextStep(sm.getSelectedArtifactFactory(),
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
95 sm.getCurrentArtifact(),
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
96 target, ips);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
97 } catch (Exception e) {
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
98 log.error(e, e);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
99 request.setAttribute(
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
100 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
101 .getMessage());
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
102 artifactDescription = sm.getArtifactDescription();
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
103 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
104
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
105 Node currentUI = artifactDescription.getCurrentUI();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
106 XSLTransformer transformer = new XSLTransformer();
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
107 String ui = transformer
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
108 .transform(
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
109 new XMLUtils().getNodeXPath(currentUI,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
110 "dynamic"),
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
111 "UTF-8",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
112 request
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
113 .getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
114
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
115 request.setAttribute("ui", ui);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
116
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
117 String staticUI = transformer
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
118 .transform(
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
119 new XMLUtils()
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
120 .getNodeXPath(currentUI, "static"),
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
121 "UTF-8",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
122 request
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
123 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
124 request.setAttribute("staticui", staticUI);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
125
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
126 request.setAttribute("furthertargets",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
127 (ad.getReachableStates() != null && !ad
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
128 .getReachableStates().isEmpty()));
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
129
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
130 } else {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
131 // statistic abholen und in das sessionmodell schreiben.
150
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
132 ArtifactDescription artifactDescription;
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
133 try{
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
134 adc.doFeed(sm.getSelectedArtifactFactory(), sm
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
135 .getCurrentArtifact(), ips);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
136
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
137 Collection<ArtifactStatisticValue> statistics = adc
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
138 .calculateStatistics(sm.getSelectedArtifactFactory(),
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
139 sm.getCurrentArtifact());
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
140 sm.setStatistics(statistics);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
141 artifactDescription = adc
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
142 .getCurrentStepDescription(sm
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
143 .getSelectedArtifactFactory(), sm
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
144 .getCurrentArtifact());
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
145
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
146 request.setAttribute("diagramm", true);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
147
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
148 } catch (Exception e) {
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
149 log.error(e, e);
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
150 request.setAttribute(
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
151 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
152 .getMessage());
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
153 artifactDescription = sm.getArtifactDescription();
c5408b0f34c7 Now the UI will compelte be shown if the User has done an Mistake entering
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
154 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
155
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
156 Node currentUI = artifactDescription.getCurrentUI();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
157 XSLTransformer transformer = new XSLTransformer();
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
158 String ui = transformer
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
159 .transform(
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
160 new XMLUtils().getNodeXPath(currentUI,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
161 "dynamic"),
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
162 "UTF-8",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
163 request
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
164 .getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
165
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
166 request.setAttribute("ui", ui);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
167
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
168 String staticUI = transformer
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
169 .transform(
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
170 new XMLUtils()
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
171 .getNodeXPath(currentUI, "static"),
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
172 "UTF-8",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
173 request
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
174 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
175 request.setAttribute("staticui", staticUI);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
176
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
177 request.setAttribute("furthertargets", false);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
178 }
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
179 return super.execute(mapping, form, request, response);
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
180 }
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
181
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182 }

http://dive4elements.wald.intevation.org