Mercurial > dive4elements > gnv-client
annotate gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java @ 1145:dfe1ac687c7f tip
added tags
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:16:15 +0200 |
parents | 28a0628b11b0 |
children |
rev | line source |
---|---|
1022
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1008
diff
changeset
|
1 /* |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1008
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1008
diff
changeset
|
3 * |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1008
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:
1008
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:
1008
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:
1008
diff
changeset
|
7 */ |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1008
diff
changeset
|
8 |
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:
diff
changeset
|
9 package de.intevation.gnv.action; |
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:
diff
changeset
|
10 |
706
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
11 import java.util.Locale; |
703
21ad44ccdb84
Tooltip text of the back-button became language specific (issue227).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
699
diff
changeset
|
12 import java.util.ResourceBundle; |
21ad44ccdb84
Tooltip text of the back-button became language specific (issue227).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
699
diff
changeset
|
13 |
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:
diff
changeset
|
14 import javax.servlet.http.HttpServletRequest; |
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:
diff
changeset
|
15 import javax.servlet.http.HttpServletResponse; |
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:
966
diff
changeset
|
16 import javax.servlet.http.HttpSession; |
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:
diff
changeset
|
17 import javax.xml.xpath.XPathConstants; |
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:
diff
changeset
|
18 |
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:
diff
changeset
|
19 import org.apache.log4j.Logger; |
682
d3062dc8626a
Application is now sensitive to changes of the preferred browser language in the current session (issue30).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
681
diff
changeset
|
20 import org.apache.struts.Globals; |
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:
diff
changeset
|
21 import org.apache.struts.action.ActionForm; |
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:
diff
changeset
|
22 import org.apache.struts.action.ActionForward; |
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:
diff
changeset
|
23 import org.apache.struts.action.ActionMapping; |
963 | 24 import org.w3c.dom.Node; |
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:
diff
changeset
|
25 |
963 | 26 import de.intevation.gnv.action.sessionmodel.SessionModel; |
27 import de.intevation.gnv.action.sessionmodel.SessionModelFactory; | |
28 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; | |
29 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; | |
30 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; | |
31 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; | |
32 import de.intevation.gnv.util.ArtifactNamespaceContext; | |
33 import de.intevation.gnv.util.XMLUtils; | |
34 import de.intevation.gnv.util.XSLTransformer; | |
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:
diff
changeset
|
35 |
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:
diff
changeset
|
36 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
37 * This controller is called to fetch the current artifact description using the |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
38 * describe operation. The describe document is used to feed an XSL transformer |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
39 * that parses the xml and creats html output representing the parameter panel. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
40 * The html code is stored as attribute on the request object which is queried |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
41 * in a jsp page later. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
42 * |
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
|
43 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
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:
diff
changeset
|
44 */ |
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:
diff
changeset
|
45 public class DescribeUIAction extends ArtifactDatabaseActionBase { |
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:
diff
changeset
|
46 |
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:
diff
changeset
|
47 public static final String XPATH_DYNAMIC_UI = "art:dynamic"; |
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:
diff
changeset
|
48 public static final String XPATH_STATIC_UI = "art:static"; |
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:
diff
changeset
|
49 |
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:
diff
changeset
|
50 public static final String XSL_SHEET_DYNAMIC = |
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:
diff
changeset
|
51 "WEB-INF/config/templates/describe-ui.xsl"; |
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:
diff
changeset
|
52 |
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:
diff
changeset
|
53 public static final String XSL_SHEET_STATIC = |
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:
diff
changeset
|
54 "WEB-INF/config/templates/describe-ui-static.xsl"; |
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:
diff
changeset
|
55 |
963 | 56 /** |
57 * the logger, used to log exceptions and additonaly information | |
58 */ | |
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:
diff
changeset
|
59 private static Logger logger = Logger.getLogger(DescribeUIAction.class); |
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:
diff
changeset
|
60 |
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:
diff
changeset
|
61 |
963 | 62 /** |
63 * Constructor | |
64 */ | |
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:
diff
changeset
|
65 public DescribeUIAction() { |
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:
diff
changeset
|
66 super(); |
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:
diff
changeset
|
67 } |
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:
diff
changeset
|
68 |
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:
diff
changeset
|
69 |
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:
diff
changeset
|
70 @Override |
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:
diff
changeset
|
71 public ActionForward execute( |
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:
diff
changeset
|
72 ActionMapping mapping, |
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:
diff
changeset
|
73 ActionForm form, |
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:
diff
changeset
|
74 HttpServletRequest request, |
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:
diff
changeset
|
75 HttpServletResponse response |
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:
diff
changeset
|
76 ) throws Exception |
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:
diff
changeset
|
77 { |
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:
966
diff
changeset
|
78 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:
966
diff
changeset
|
79 // session timed out before |
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:
966
diff
changeset
|
80 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:
966
diff
changeset
|
81 } |
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:
966
diff
changeset
|
82 |
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:
diff
changeset
|
83 logger.info("describe user interface"); |
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:
diff
changeset
|
84 try { |
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:
diff
changeset
|
85 // render describe document and create user interface |
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:
diff
changeset
|
86 SessionModel sm = SessionModelFactory.getInstance().getSessionModel( |
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:
diff
changeset
|
87 request); |
706
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
88 Locale tmp = sm.getCurrentLocale(); |
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
89 Locale locale = tmp != null ? tmp : request.getLocale(); |
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:
diff
changeset
|
90 |
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:
diff
changeset
|
91 ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory |
706
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
92 .getInstance().getArtifactDatabaseClient(locale); |
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
93 request.getSession().setAttribute(Globals.LOCALE_KEY, locale); |
715
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
94 ArtifactObject artifactFactory = sm.getSelectedArtifactFactory(); |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
95 |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
96 if (artifactFactory == null) { |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
97 logger.error("No connection to artifact server."); |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
98 request.setAttribute( |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
99 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
100 "java.io.ioexception..connection.refused"); |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
101 |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
102 return super.getExceptionForward(mapping); |
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
103 } |
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:
diff
changeset
|
104 |
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:
diff
changeset
|
105 ArtifactDescription artifactDescription = |
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:
diff
changeset
|
106 adc.getCurrentStepDescription( |
715
0aeac0fe5db2
Fixed broken error messages that are displayed if the artifact server is down (issue236, issue242).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
706
diff
changeset
|
107 artifactFactory, |
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:
diff
changeset
|
108 sm.getCurrentArtifact(), |
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:
diff
changeset
|
109 true); |
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:
diff
changeset
|
110 |
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:
diff
changeset
|
111 Node currentUI = artifactDescription.getCurrentUI(); |
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:
diff
changeset
|
112 if (currentUI != null) { |
703
21ad44ccdb84
Tooltip text of the back-button became language specific (issue227).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
699
diff
changeset
|
113 ResourceBundle res = ResourceBundle.getBundle( |
706
2659a5b1fa1e
Added a link (and a controller) to toggle between german and english language (issue254).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
703
diff
changeset
|
114 "applicationMessages", locale); |
1008
1b42a86184f6
Removed the changes of rev1206 and 1214.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1002
diff
changeset
|
115 String editText = res.getString( |
966
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
116 "gnviewer.history.back.button"); |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
117 String exampleLinestring = res.getString( |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
118 "gnviewer.example.linestring"); |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
119 String examplePolygon = res.getString( |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
120 "gnviewer.example.polygon"); |
703
21ad44ccdb84
Tooltip text of the back-button became language specific (issue227).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
699
diff
changeset
|
121 |
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:
diff
changeset
|
122 XSLTransformer transformer = new XSLTransformer(); |
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:
diff
changeset
|
123 |
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:
diff
changeset
|
124 String url = response.encodeURL( |
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:
diff
changeset
|
125 mapping.findForward("back").getPath()); |
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:
diff
changeset
|
126 transformer.addParameter("back-url", url); |
703
21ad44ccdb84
Tooltip text of the back-button became language specific (issue227).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
699
diff
changeset
|
127 transformer.addParameter("edit", editText); |
966
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
128 transformer.addParameter("example-polygon", examplePolygon); |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
129 transformer.addParameter( |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
130 "example-linestring", |
13de46229f63
I18N of links to insert example linestrings/polygons (issue272).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
963
diff
changeset
|
131 exampleLinestring); |
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:
diff
changeset
|
132 |
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:
diff
changeset
|
133 String fisUrl = response.encodeURL( |
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:
diff
changeset
|
134 mapping.findForward("selectfis").getPath()); |
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:
diff
changeset
|
135 transformer.addParameter("selectfis", fisUrl); |
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:
diff
changeset
|
136 |
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:
diff
changeset
|
137 // fetch dynamic part from describe document and transform it |
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:
diff
changeset
|
138 Node dynamicNode = (Node) XMLUtils.xpath( |
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:
diff
changeset
|
139 currentUI, |
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:
diff
changeset
|
140 XPATH_DYNAMIC_UI, |
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:
diff
changeset
|
141 XPathConstants.NODE, |
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:
diff
changeset
|
142 ArtifactNamespaceContext.INSTANCE |
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:
diff
changeset
|
143 ); |
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:
diff
changeset
|
144 |
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:
diff
changeset
|
145 String ui = transformer.transform( |
1008
1b42a86184f6
Removed the changes of rev1206 and 1214.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1002
diff
changeset
|
146 dynamicNode, |
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:
diff
changeset
|
147 "UTF-8", |
1008
1b42a86184f6
Removed the changes of rev1206 and 1214.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1002
diff
changeset
|
148 request.getRealPath(XSL_SHEET_DYNAMIC |
1b42a86184f6
Removed the changes of rev1206 and 1214.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1002
diff
changeset
|
149 )); |
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:
diff
changeset
|
150 |
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:
diff
changeset
|
151 if (ui != null && ui.length() > 1) |
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:
diff
changeset
|
152 request.setAttribute("ui", ui); |
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:
diff
changeset
|
153 |
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:
diff
changeset
|
154 // fetch static part from describe document and transform it |
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:
diff
changeset
|
155 Node staticNode = (Node) XMLUtils.xpath( |
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:
diff
changeset
|
156 currentUI, |
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:
diff
changeset
|
157 XPATH_STATIC_UI, |
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:
diff
changeset
|
158 XPathConstants.NODE, |
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:
diff
changeset
|
159 ArtifactNamespaceContext.INSTANCE |
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:
diff
changeset
|
160 ); |
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:
diff
changeset
|
161 |
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:
diff
changeset
|
162 String staticUI = transformer.transform( |
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:
diff
changeset
|
163 staticNode, |
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:
diff
changeset
|
164 "UTF-8", |
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:
diff
changeset
|
165 request.getRealPath(XSL_SHEET_STATIC)); |
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:
diff
changeset
|
166 |
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:
diff
changeset
|
167 if (staticUI != null && staticUI.length() > 1) |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
409
diff
changeset
|
168 request.setAttribute("staticui", staticUI); |
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:
diff
changeset
|
169 } |
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:
diff
changeset
|
170 |
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:
diff
changeset
|
171 return super.execute(mapping, form, request, response); |
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:
diff
changeset
|
172 } |
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:
diff
changeset
|
173 catch (Exception e) { |
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:
diff
changeset
|
174 logger.error(e, e); |
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:
diff
changeset
|
175 request.setAttribute( |
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:
diff
changeset
|
176 CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, |
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:
diff
changeset
|
177 e.getMessage()); |
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:
diff
changeset
|
178 |
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:
diff
changeset
|
179 return super.getExceptionForward(mapping); |
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:
diff
changeset
|
180 } |
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:
diff
changeset
|
181 } |
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:
diff
changeset
|
182 } |
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:
diff
changeset
|
183 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |