Mercurial > dive4elements > gnv-client
annotate gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java @ 681:15ac78a91d1b
Removed trailing whitespace.
gnv/trunk@852 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 29 Mar 2010 08:04:15 +0000 |
parents | 27f25b9ae9af |
children | d49e8695786c |
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; |
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
|
5 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
|
6 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
|
7 |
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
|
8 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
|
9 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
10 import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
11 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
|
12 |
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.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
|
14 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
|
15 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
|
16 |
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.ArrayList; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 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
|
19 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
|
20 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
|
21 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 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
|
23 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
|
24 |
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.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
|
26 |
12
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.ActionForm; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 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
|
29 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
|
30 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 /** |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 * @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
|
34 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
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 */ |
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
|
37 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
|
38 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 /** |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 * 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
|
41 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
42 private static Logger log = Logger |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
43 .getLogger(SelectArtifactFactoryAction.class); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
44 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 /** |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 * Constructor |
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 public NextArtifactStepAction() { |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 super(); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 /** |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
53 * @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
|
54 * org.apache.struts.action.ActionForm, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
55 * javax.servlet.http.HttpServletRequest, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
56 * 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
|
57 */ |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 @Override |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 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
|
60 HttpServletRequest request, |
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
61 HttpServletResponse response) throws Exception { |
34
25fdec8b4c69
Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
32
diff
changeset
|
62 log.debug("NextArtifactStepAction.execute"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
63 SessionModel sm = SessionModelFactory.getInstance() |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
34
diff
changeset
|
64 .getSessionModel(request); |
34
25fdec8b4c69
Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
32
diff
changeset
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 } |
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
|
78 } |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
79 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
|
80 .getInstance() |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
81 .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
|
82 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
|
83 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
|
84 // 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
|
85 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
|
86 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
|
87 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
|
88 // 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
|
89 // 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
|
90 // 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
|
91 // 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
|
92 // state. |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
93 } else { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
94 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
|
95 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
96 |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
97 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
|
98 adc.doNextStep( |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
99 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
|
100 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
|
101 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
|
102 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
|
103 ); |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
104 } |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
105 catch (ArtifactDatabaseInputException e) { |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
106 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
|
107 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
|
108 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
|
109 request.setAttribute( |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
110 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
|
111 e.getMessage()); |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
112 } |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
113 catch (Exception e) { |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
114 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
|
115 request.setAttribute( |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
116 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
|
117 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
|
118 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
119 |
395
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
120 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
|
121 request.setAttribute( |
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
122 "furthertargets", |
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
123 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
|
124 ); |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
125 } else { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 ); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
132 |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
133 request.setAttribute("diagramm", true); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
134 |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
135 } |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
136 catch (ArtifactDatabaseInputException e) { |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
137 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
|
138 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
|
139 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
|
140 request.setAttribute( |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
141 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
|
142 e.getMessage()); |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
143 } |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
409
diff
changeset
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
150 |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
151 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
|
152 } |
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 }else{ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
154 log.warn("SessionTimeout has occured"); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
665
diff
changeset
|
155 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
|
156 "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
|
157 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
|
158 } |
25fdec8b4c69
Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
32
diff
changeset
|
159 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
|
160 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
161 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
162 } |
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
|
163 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |