annotate gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java @ 157:013d47662161

Switched the Communication for Describe-Calls to the artifact-database from get to post. Added the possibility to tell the artifact-database that the ui should not be delivered in describe-responses. gnv/trunk@285 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 05 Nov 2009 14:53:24 +0000
parents d6b82c585f1f
children 1fe52a0cbd1f
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();
154
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
106 if (currentUI != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
107 XSLTransformer transformer = new XSLTransformer();
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
108 Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"dynamic");
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
109 if (dynamicUINode != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
110 String ui = transformer
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
111 .transform(
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
112 dynamicUINode,
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
113 "UTF-8",
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
114 request
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
115 .getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
116
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
117 request.setAttribute("ui", ui);
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
118 }
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
119
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
120 Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "static");
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
121 if (staticUINode != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
122 String staticUI = transformer
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
123 .transform(
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
124 staticUINode,
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
125 "UTF-8",
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
126 request
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
127 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
128 request.setAttribute("staticui", staticUI);
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
129 }
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
130 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
131 request.setAttribute("furthertargets",
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
132 (ad.getReachableStates() != null && !ad
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
133 .getReachableStates().isEmpty()));
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
134
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
135 } else {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
136 // 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
137 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
138 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
139 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
140 .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
141
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 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
143 .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
144 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
145 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
146 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
147 .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
148 .getSelectedArtifactFactory(), sm
157
013d47662161 Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents: 154
diff changeset
149 .getCurrentArtifact(),
013d47662161 Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents: 154
diff changeset
150 true);
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
151
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 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
153
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 } 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
155 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
156 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
157 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
158 .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
159 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
160 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
161
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
162 Node currentUI = artifactDescription.getCurrentUI();
154
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
163 if (currentUI != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
164 XSLTransformer transformer = new XSLTransformer();
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
165 Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"dynamic");
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
166 if (dynamicUINode != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
167 String ui = transformer
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
168 .transform(
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
169 dynamicUINode,
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
170 "UTF-8",
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
171 request
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
172 .getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
173
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
174 request.setAttribute("ui", ui);
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
175 }
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
176
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
177 Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "static");
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
178 if (staticUINode != null){
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
179 String staticUI = transformer
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
180 .transform(
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
181 staticUINode,
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
182 "UTF-8",
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
183 request
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
184 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
185 request.setAttribute("staticui", staticUI);
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
186 }
d6b82c585f1f Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58.
Tim Englich <tim.englich@intevation.de>
parents: 150
diff changeset
187 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
188 request.setAttribute("furthertargets", false);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
189 }
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
190 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
191 }
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
192
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
193 }

http://dive4elements.wald.intevation.org