Mercurial > dive4elements > gnv-client
annotate gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java @ 963:0441e78cd900
Add more Javadocs
gnv/trunk@1107 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 18 May 2010 11:09:33 +0000 |
parents | 89ade245ca7a |
children | 33198e55371c |
rev | line source |
---|---|
410
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.action; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.Collection; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import javax.servlet.http.HttpServletRequest; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import javax.servlet.http.HttpServletResponse; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.apache.log4j.Logger; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import org.apache.struts.action.ActionForm; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.apache.struts.action.ActionForward; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import org.apache.struts.action.ActionMapping; |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
963 | 13 import de.intevation.gnv.action.sessionmodel.SessionModel; |
14 import de.intevation.gnv.action.sessionmodel.SessionModelFactory; | |
15 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; | |
16 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; | |
17 import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; | |
18 | |
410
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
20 * This controller is used to display to statistic of the current |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
21 * parameterization. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
22 * |
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
|
23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
410
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 */ |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public class ShowStatisticAction extends DescribeUIAction { |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
963 | 27 /** |
28 * the logger, used to log exceptions and additonaly information | |
29 */ | |
410
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private static Logger logger = Logger.getLogger(ShowStatisticAction.class); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
963 | 33 /** |
34 * Constructor | |
35 */ | |
410
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 public ShowStatisticAction() { |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 super(); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 } |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 @Override |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 public ActionForward execute( |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 ActionMapping mapping, |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 ActionForm form, |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 HttpServletRequest request, |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 HttpServletResponse response |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 ) throws Exception |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 { |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 logger.info("show statistic"); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 SessionModel sm = SessionModelFactory.getInstance().getSessionModel( |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 request); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory.getInstance() |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 .getArtifactDatabaseClient(getLocale(request)); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 try{ |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 Collection<ArtifactStatisticsSet> statistics = |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 adc.calculateStatistics(sm.getSelectedArtifactFactory(), |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 sm.getCurrentArtifact()); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 sm.setStatistics(statistics); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 request.setAttribute("statistic", true); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 catch (Exception e) { |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 logger.error(e, e); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 } |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 return super.execute(mapping, form, request, response); |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
9602f4bffc07
Added statistic to the actions if available.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 } |
700
89ade245ca7a
Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
699
diff
changeset
|
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |