annotate gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java @ 991:33198e55371c

Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection. gnv/trunk@1192 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 Jun 2010 15:13:08 +0000
parents 0441e78cd900
children 28a0628b11b0
rev   line source
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.action;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import javax.servlet.http.HttpServletRequest;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import javax.servlet.http.HttpServletResponse;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import org.apache.log4j.Logger;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import org.apache.struts.action.ActionForm;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import org.apache.struts.action.ActionForward;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import org.apache.struts.action.ActionMapping;
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
963
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
11 import de.intevation.gnv.action.sessionmodel.SessionModel;
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
12 import de.intevation.gnv.action.sessionmodel.SessionModelFactory;
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
13
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 /**
690
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
15 * This controller is called to display charts.<br>
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
16 * An attribute 'chart' on the request object is activated which inserts an
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
17 * image calling a chart output of the server.
254f062e334b Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 684
diff changeset
18 *
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
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 */
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 public class CreateChartAction extends DescribeUIAction {
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
963
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
23 /**
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
24 * the logger, used to log exceptions and additonaly information
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
25 */
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 private static Logger logger = Logger.getLogger(CreateChartAction.class);
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
963
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
29 /**
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
30 * Constructor
0441e78cd900 Add more Javadocs
Tim Englich <tim.englich@intevation.de>
parents: 690
diff changeset
31 */
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 public CreateChartAction() {
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 super();
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 }
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 @Override
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public ActionForward execute(
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 ActionMapping mapping,
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 ActionForm form,
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 HttpServletRequest request,
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 HttpServletResponse response)
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 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: 963
diff changeset
44 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: 963
diff changeset
45 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: 963
diff changeset
46 }
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: 963
diff changeset
47
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 logger.debug("Create chart.");
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49
587
602521c3fac3 Reset diagram options after switching from chart to histogram or the other way around (issue190).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 571
diff changeset
50 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(
602521c3fac3 Reset diagram options after switching from chart to histogram or the other way around (issue190).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 571
diff changeset
51 request);
602521c3fac3 Reset diagram options after switching from chart to histogram or the other way around (issue190).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 571
diff changeset
52 sm.setDiagrammOptions(null);
571
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 request.setAttribute("chart", true);
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 return super.execute(mapping, form, request, response);
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 }
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 }
f2ba58011a2d Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org