Mercurial > dive4elements > gnv-client
annotate gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java @ 401:002a4d38c16d
Added a link to jump back to the fis selection.
gnv/trunk@568 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 18 Jan 2010 16:21:54 +0000 |
parents | 79378c4babde |
children | b5733f9f386b |
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; |
395
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
9 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
|
10 |
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.HttpServletRequest; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 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
|
13 |
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.log4j.Logger; |
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.ActionForm; |
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.ActionForward; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 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
|
18 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
|
19 |
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.SessionModel; |
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.action.sessionmodel.SessionModelFactory; |
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.ArtifactDatabaseClient; |
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.client.ArtifactDatabaseClientFactory; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
163
diff
changeset
|
25 import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; |
12
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.DefaultInputParameter; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 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
|
28 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
|
29 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
|
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 * @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
|
33 * |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 */ |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 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
|
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 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
93 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
94 ArtifactDescription artifactDescription; |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
95 try { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
96 artifactDescription = adc.doNextStep(sm.getSelectedArtifactFactory(), |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
97 sm.getCurrentArtifact(), |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
98 target, ips); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
99 } catch (Exception e) { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
100 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
|
101 request.setAttribute( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
102 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
103 .getMessage()); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
104 artifactDescription = sm.getArtifactDescription(); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
105 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
106 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
107 Node currentUI = artifactDescription.getCurrentUI(); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
108 if (currentUI != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
109 XSLTransformer transformer = new XSLTransformer(); |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
110 String url = response.encodeURL( |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
111 mapping.findForward("back").getPath()); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
112 transformer.addParameter("back-url", url); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
113 |
401
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
114 String fisUrl = response.encodeURL( |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
115 mapping.findForward("selectfis").getPath()); |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
116 transformer.addParameter("selectfis", fisUrl); |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
117 |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
286
diff
changeset
|
118 Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"art:dynamic"); |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
119 if (dynamicUINode != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
120 String ui = transformer |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
121 .transform( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
122 dynamicUINode, |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
123 "UTF-8", |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
124 request |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
125 .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
126 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
127 request.setAttribute("ui", ui); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
128 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
129 |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
286
diff
changeset
|
130 Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "art:static"); |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
131 if (staticUINode != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
132 String staticUI = transformer |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
133 .transform( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
134 staticUINode, |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
135 "UTF-8", |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
136 request |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
137 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
138 request.setAttribute("staticui", staticUI); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
139 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
140 } |
395
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
141 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
|
142 request.setAttribute( |
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
143 "furthertargets", |
79378c4babde
Fixed a bug which prevented the user to draw charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
394
diff
changeset
|
144 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
|
145 ); |
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 } else { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
147 // statistic abholen und in das sessionmodell schreiben. |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
148 ArtifactDescription artifactDescription; |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
149 try{ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
150 |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
163
diff
changeset
|
151 Collection<ArtifactStatisticsSet> statistics = adc |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
152 .calculateStatistics(sm.getSelectedArtifactFactory(), |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
153 sm.getCurrentArtifact()); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
154 sm.setStatistics(statistics); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
155 artifactDescription = adc |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
156 .getCurrentStepDescription(sm |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
157 .getSelectedArtifactFactory(), sm |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
158 .getCurrentArtifact(), |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
159 true); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
160 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
161 request.setAttribute("diagramm", true); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
162 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
163 } catch (Exception e) { |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
164 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
|
165 request.setAttribute( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
166 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
167 .getMessage()); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
168 artifactDescription = sm.getArtifactDescription(); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
169 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
170 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
171 Node currentUI = artifactDescription.getCurrentUI(); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
172 if (currentUI != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
173 XSLTransformer transformer = new XSLTransformer(); |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
174 String url = response.encodeURL( |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
175 mapping.findForward("back").getPath()); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
176 transformer.addParameter("back-url", url); |
401
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
177 |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
178 String fisUrl = response.encodeURL( |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
179 mapping.findForward("selectfis").getPath()); |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
180 transformer.addParameter("selectfis", fisUrl); |
002a4d38c16d
Added a link to jump back to the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
395
diff
changeset
|
181 |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
286
diff
changeset
|
182 Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"art:dynamic"); |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
183 if (dynamicUINode != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
184 String ui = transformer |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
185 .transform( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
186 dynamicUINode, |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
187 "UTF-8", |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
188 request |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
189 .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
190 |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
191 request.setAttribute("ui", ui); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
192 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
193 |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
286
diff
changeset
|
194 Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "art:static"); |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
195 if (staticUINode != null){ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
196 String staticUI = transformer |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
197 .transform( |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
198 staticUINode, |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
199 "UTF-8", |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
200 request |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
201 .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
202 request.setAttribute("staticui", staticUI); |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
203 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
204 } |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
205 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
|
206 } |
163
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
207 }else{ |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
208 log.warn("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
|
209 request.setAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, |
1fe52a0cbd1f
Catch NPE and tell the user that the Session has expired. issue80
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
210 "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
|
211 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
|
212 } |
25fdec8b4c69
Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
32
diff
changeset
|
213 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
|
214 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
215 |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
216 } |