Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/action/StoreAction.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 | af22fa5567a6 |
children | 33198e55371c |
comparison
equal
deleted
inserted
replaced
962:e7fda0ae8b92 | 963:0441e78cd900 |
---|---|
1 package de.intevation.gnv.action; | 1 package de.intevation.gnv.action; |
2 | |
3 import de.intevation.gnv.action.sessionmodel.SessionModel; | |
4 import de.intevation.gnv.action.sessionmodel.SessionModelFactory; | |
5 | |
6 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; | |
7 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; | |
8 | |
9 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; | |
10 | 2 |
11 import java.io.OutputStream; | 3 import java.io.OutputStream; |
12 | 4 |
13 import javax.servlet.http.HttpServletRequest; | 5 import javax.servlet.http.HttpServletRequest; |
14 import javax.servlet.http.HttpServletResponse; | 6 import javax.servlet.http.HttpServletResponse; |
15 | 7 |
16 import org.apache.log4j.Logger; | 8 import org.apache.log4j.Logger; |
17 | |
18 import org.apache.struts.action.ActionForm; | 9 import org.apache.struts.action.ActionForm; |
19 import org.apache.struts.action.ActionForward; | 10 import org.apache.struts.action.ActionForward; |
20 import org.apache.struts.action.ActionMapping; | 11 import org.apache.struts.action.ActionMapping; |
12 | |
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.ArtifactObject; | |
21 | 18 |
22 /** | 19 /** |
23 * This controller is used to save the current artifact to an xml file. A file | 20 * This controller is used to save the current artifact to an xml file. A file |
24 * dialog is opened to save the file to the local disk. | 21 * dialog is opened to save the file to the local disk. |
25 * | 22 * |
27 */ | 24 */ |
28 public class StoreAction extends ArtifactDatabaseActionBase { | 25 public class StoreAction extends ArtifactDatabaseActionBase { |
29 | 26 |
30 public static final String RESOURCE_DOWNLOAD_FAILURE = "no.artifact.chosen"; | 27 public static final String RESOURCE_DOWNLOAD_FAILURE = "no.artifact.chosen"; |
31 | 28 |
29 /** | |
30 * the logger, used to log exceptions and additonaly information | |
31 */ | |
32 private static Logger logger = Logger.getLogger(StoreAction.class); | 32 private static Logger logger = Logger.getLogger(StoreAction.class); |
33 | 33 |
34 /** | |
35 * Constructor | |
36 */ | |
34 public StoreAction() { | 37 public StoreAction() { |
35 super(); | 38 super(); |
36 } | 39 } |
37 | 40 |
41 @Override | |
38 public ActionForward execute( | 42 public ActionForward execute( |
39 ActionMapping mapping, | 43 ActionMapping mapping, |
40 ActionForm form, | 44 ActionForm form, |
41 HttpServletRequest request, | 45 HttpServletRequest request, |
42 HttpServletResponse response) | 46 HttpServletResponse response) |
75 out.flush(); | 79 out.flush(); |
76 out.close(); | 80 out.close(); |
77 | 81 |
78 return null; | 82 return null; |
79 } | 83 } |
80 | 84 |
85 /** | |
86 * Sets the header of the response. | |
87 * @param response the response | |
88 * @param uuid the uuid of the artifact | |
89 */ | |
81 protected void setHeaders(HttpServletResponse response, String uuid) { | 90 protected void setHeaders(HttpServletResponse response, String uuid) { |
82 String filename = "GNVArtefakt_" + uuid + ".xml"; | 91 String filename = "GNVArtefakt_" + uuid + ".xml"; |
83 | 92 |
84 response.setHeader("Content-Type", "application/xml"); | 93 response.setHeader("Content-Type", "application/xml"); |
85 response.setHeader( | 94 response.setHeader( |