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