annotate gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java @ 683:d49e8695786c

Ordered imports. Removed needless imports. Removed empty headers. gnv/trunk@855 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 29 Mar 2010 09:10:25 +0000
parents 15ac78a91d1b
children 57fa8019fbdc
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 package de.intevation.gnv.action;
683
d49e8695786c Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 681
diff changeset
2
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
3 import de.intevation.gnv.action.sessionmodel.SessionModel;
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
4 import de.intevation.gnv.action.sessionmodel.SessionModelFactory;
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
5
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
6 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient;
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
7 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory;
683
d49e8695786c Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 681
diff changeset
8
665
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
9 import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException;
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
10
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
11 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
12 import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter;
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
13 import de.intevation.gnv.artifactdatabase.objects.InputParameter;
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 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
16 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
17 import java.util.Iterator;
395
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
18 import java.util.Map;
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 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
21 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
22
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 import org.apache.log4j.Logger;
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
24
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 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
26 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
27 import org.apache.struts.action.ActionMapping;
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28
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 * @author Tim Englich <tim.englich@intevation.de>
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
31 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de)
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
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 */
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
34 public class NextArtifactStepAction extends DescribeUIAction {
408
b5733f9f386b Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 401
diff changeset
35
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 * 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
38 */
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
39 private static Logger log = Logger
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
40 .getLogger(SelectArtifactFactoryAction.class);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
41
12
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 /**
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 * Constructor
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 public NextArtifactStepAction() {
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 super();
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
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 /**
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
50 * @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
51 * org.apache.struts.action.ActionForm,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
52 * javax.servlet.http.HttpServletRequest,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
53 * 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
54 */
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 @Override
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 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
57 HttpServletRequest request,
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
58 HttpServletResponse response) throws Exception {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
59 log.debug("NextArtifactStepAction.execute");
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
60 SessionModel sm = SessionModelFactory.getInstance()
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 34
diff changeset
61 .getSessionModel(request);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
62 ArtifactDescription ad = sm.getArtifactDescription();
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
63 if (ad != null){
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
64 Collection<String> inputParameter = ad.getInputParameter();
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
65 Collection<InputParameter> ips = null;
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
66 if (inputParameter != null) {
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
67 ips = new ArrayList<InputParameter>(inputParameter.size());
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
68 Iterator<String> it = inputParameter.iterator();
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
69 while (it.hasNext()) {
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
70 String name = it.next();
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
71 String[] values = request.getParameterValues(name);
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
72 InputParameter ip = new DefaultInputParameter(name, values);
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
73 ips.add(ip);
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
74 }
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
75 }
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
76 ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
77 .getInstance()
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
78 .getArtifactDatabaseClient(getLocale(request));
395
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
79 Map outs = ad.getOutputModes();
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
80 if (outs == null || outs.isEmpty()) {
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
81 // TODO: Woher kommt der zu erreichende Status;
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
82 String target = null;
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
83 if (ad.getReachableStates().size() > 1) {
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
84 target = request.getParameter("product"); // TODO HACK for
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
85 // Propducts every
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
86 // other Step has
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
87 // currently only
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
88 // one reachable
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
89 // state.
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
90 } else {
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
91 target = ad.getReachableStates().iterator().next();
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
92 }
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
93
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
94 try {
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
95 adc.doNextStep(
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
96 sm.getSelectedArtifactFactory(),
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
97 sm.getCurrentArtifact(),
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
98 target,
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
99 ips
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
100 );
665
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
101 }
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
102 catch (ArtifactDatabaseInputException e) {
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
103 log.debug("================ CATCH ME ======================");
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
104 log.debug("===== ERROR MSG: " + e.getMessage());
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
105 log.error(e, e);
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
106 request.setAttribute(
665
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
107 CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID,
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
108 e.getMessage());
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
109 }
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
110 catch (Exception e) {
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
111 log.error(e, e);
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
112 request.setAttribute(
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
113 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID,
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
114 e.getMessage());
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
115 }
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
116
395
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
117 Map tmpOuts = ad.getOutputModes();
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
118 request.setAttribute(
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
119 "furthertargets",
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
120 tmpOuts == null || tmpOuts.isEmpty()
79378c4babde Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 394
diff changeset
121 );
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
122 } else {
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
123 try{
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
124 adc.getCurrentStepDescription(
408
b5733f9f386b Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 401
diff changeset
125 sm.getSelectedArtifactFactory(),
b5733f9f386b Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 401
diff changeset
126 sm.getCurrentArtifact(),
b5733f9f386b Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 401
diff changeset
127 true
b5733f9f386b Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 401
diff changeset
128 );
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
129
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
130 request.setAttribute("diagramm", true);
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
131
665
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
132 }
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
133 catch (ArtifactDatabaseInputException e) {
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
134 log.debug("================ CATCH ME ======================");
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
135 log.debug("===== ERROR MSG: " + e.getMessage());
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
136 log.error(e, e);
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
137 request.setAttribute(
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
138 CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID,
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
139 e.getMessage());
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
140 }
27f25b9ae9af Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
141 catch (Exception e) {
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
142 log.error(e, e);
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
143 request.setAttribute(
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
144 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID,
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
145 e.getMessage());
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
146 }
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
147
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
148 request.setAttribute("furthertargets", false);
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
149 }
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
150 }else{
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
151 log.warn("SessionTimeout has occured");
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 665
diff changeset
152 request.setAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID,
163
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
153 "SessionTimeout has occured");
1fe52a0cbd1f Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents: 157
diff changeset
154 new FetchArtifactFactoriesAction().execute(mapping, form, request, response);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
155 }
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 32
diff changeset
156 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
157 }
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
158
4ebe57b170d3 Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
159 }
409
df78178e1180 Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
160 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org