annotate gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java @ 1022:28a0628b11b0

Added license file and license header. gnv/trunk@1258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:15:08 +0000
parents 33198e55371c
children
rev   line source
1022
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
1 /*
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
3 *
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
5 * Read the file LGPL.txt coming with the software for details
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
7 */
28a0628b11b0 Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 991
diff changeset
8
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 package de.intevation.gnv.action;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
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: 390
diff changeset
11 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: 390
diff changeset
12 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: 390
diff changeset
13
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: 390
diff changeset
14 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: 390
diff changeset
15 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory;
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: 390
diff changeset
16
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: 390
diff changeset
17 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: 390
diff changeset
18 import de.intevation.gnv.artifactdatabase.objects.InputParameter;
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: 390
diff changeset
19 import de.intevation.gnv.artifactdatabase.objects.OutputMode;
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: 390
diff changeset
20 import de.intevation.gnv.artifactdatabase.objects.OutputParameter;
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: 390
diff changeset
21
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 import java.io.OutputStream;
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: 390
diff changeset
23
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24 import java.util.ArrayList;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 import java.util.Collection;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
26 import java.util.Iterator;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 import javax.servlet.http.HttpServletRequest;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29 import javax.servlet.http.HttpServletResponse;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30
29
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
31 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: 390
diff changeset
32
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 import org.apache.struts.action.ActionForm;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 import org.apache.struts.action.ActionForward;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 import org.apache.struts.action.ActionMapping;
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 /**
690
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
38 * This controller calls the out operation of the server directly. Html img-tags
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
39 * in jsp pages use this action to fetch charts and histograms.
699
af22fa5567a6 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 690
diff changeset
40 *
684
57fa8019fbdc Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 683
diff changeset
41 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
681
15ac78a91d1b Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 583
diff changeset
42 *
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 */
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 public class DoOutputAction extends ArtifactDatabaseActionBase {
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 /**
29
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
47 * the logger, used to log exceptions and additonaly information
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
48 */
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
49 private static Logger log = Logger.getLogger(DoOutputAction.class);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
50
29
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
51 /**
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 * Constructor
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 */
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 public DoOutputAction() {
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 super();
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 }
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57
690
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
58
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 @Override
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 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
61 HttpServletRequest request,
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
62 HttpServletResponse response) throws Exception {
991
33198e55371c Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 699
diff changeset
63 if (isSessionExhausted(request)) {
33198e55371c Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 699
diff changeset
64 return sessionExhaustedForward(mapping, form, request, response);
33198e55371c Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 699
diff changeset
65 }
33198e55371c Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 699
diff changeset
66
29
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
67 log.debug("DoOutputAction.execute");
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
68 try {
583
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
69 String target = request.getParameter("target");
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
70 String mimeType = request.getParameter("mimetype");
583
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
71 String mode = request.getParameter("mode");
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
72
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
73 log.debug("Target: " + target);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
74 log.debug("MimeType: " + mimeType);
583
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
75 log.debug("ExportMode: " + mode);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
76
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
77 // TODO Check if is propper;
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
78
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
79 SessionModel sm = SessionModelFactory.getInstance()
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
80 .getSessionModel(request);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
81 OutputMode outputMode = sm.getOutputMode(target);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
82 if (outputMode != null && outputMode.getMimeType().equals(mimeType)) {
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
83 Collection<OutputParameter> inputParameter = outputMode
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
84 .getOutputParameters();
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
85 Collection<InputParameter> ips = null;
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
86 if (inputParameter != null) {
575
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
87 ips = new ArrayList<InputParameter>(inputParameter.size()+1);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
88 Iterator<OutputParameter> it = inputParameter.iterator();
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
89 while (it.hasNext()) {
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
90 String name = it.next().getName();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
91 String[] values = request.getParameterValues(name);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
92 InputParameter ip = new DefaultInputParameter(name,
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
93 values);
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
94 ips.add(ip);
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
95 }
575
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
96
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
97 if (request.getParameter("bintype") != null) {
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
98 InputParameter ip = new DefaultInputParameter(
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
99 "bintype", request.getParameterValues("bintype"));
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
100 ips.add(ip);
a634d5ee961d Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 409
diff changeset
101 }
30
07e9c137a2f1 Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents: 29
diff changeset
102 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
103
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
104 ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory
40
23a4f196d7d6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 38
diff changeset
105 .getInstance()
23a4f196d7d6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 38
diff changeset
106 .getArtifactDatabaseClient(getLocale(request));
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
107
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
108 this.setHeaders(target, mimeType, response, request);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
109
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
110 OutputStream outputStream = response.getOutputStream();
583
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
111 adc.doOutput(
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
112 sm.getSelectedArtifactFactory(),
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
113 sm.getCurrentArtifact(),
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
114 outputStream,
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
115 target,
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
116 mode,
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
117 mimeType,
2f3d885fed09 Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 575
diff changeset
118 ips);
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
119
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
120 outputStream.flush();
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
121 outputStream.close();
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
122 } else {
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
123 if (outputMode == null) {
390
f2e2053ecf23 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
124 log.error("Outputmode is not supported.");
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
125 } else if (!outputMode.getMimeType().equals(mimeType)) {
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
126 log.error("MimeType " + mimeType
390
f2e2053ecf23 Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant.
Tim Englich <tim.englich@intevation.de>
parents: 40
diff changeset
127 + " wis not supported.");
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
128 }
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
129 // TODO FIXME: Fehlerbehandlung
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
130 }
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
131 return super.execute(mapping, form, request, response);
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
132 } catch (Exception e) {
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
133 log.error(e, e);
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
134 request.setAttribute(
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
135 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
136 .getMessage());
34
25fdec8b4c69 Added Global Errorhandling to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 30
diff changeset
137 return super.getExceptionForward(mapping);
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
138 }
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
139 }
36
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
140
ad381cc47217 Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents: 35
diff changeset
141 protected void setHeaders(String target, String mimeType,
38
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
142 HttpServletResponse response,
fccf90761825 Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents: 36
diff changeset
143 HttpServletRequest request) {
29
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
144 response.setHeader("Content-Type", mimeType);
bba8fd97e549 Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents: 13
diff changeset
145 }
13
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
146
2535158e2687 Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
147 }
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: 390
diff changeset
148 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org