Changeset 316:06b089ac1509
- Timestamp:
- 09/09/09 10:16:11 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@317
- Message:
-
added some comments
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r313
|
r316
|
|
| 1 | | // $Id: ObserveAction.java,v 1.23 2009-09-08 15:46:44 tgambet Exp $ |
| | 1 | // $Id: ObserveAction.java,v 1.24 2009-09-09 10:16:11 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 73 | 73 | throws ServletException, IOException { |
| 74 | 74 | |
| | 75 | // Protects the action in case that Framework is not initialized |
| 75 | 76 | super.doGet(req, resp); |
| 76 | 77 | |
| | 78 | // Objects initialization |
| 77 | 79 | FileItem aFileItemUploaded = null; |
| 78 | 80 | Map<String, Object> mapOfStringObject = new LinkedHashMap<String, Object>(); |
| … |
… |
|
| 82 | 84 | UnicornCall aUnicornCall = new UnicornCall(); |
| 83 | 85 | |
| | 86 | // Default output parameters |
| 84 | 87 | mapOfOutputParameter.put("output", "simple"); |
| 85 | 88 | mapOfOutputParameter.put("format", "xhtml10"); |
| … |
… |
|
| 87 | 90 | mapOfOutputParameter.put("mimetype", "text/html"); |
| 88 | 91 | |
| | 92 | // Retrieve parameter prefixes from unicorn.properties |
| 89 | 93 | String paramPrefix = Property.get("UNICORN_PARAMETER_PREFIX"); |
| 90 | 94 | String outParamPrefix = Property.get("UNICORN_PARAMETER_OUTPUT_PREFIX"); |
| | 95 | |
| | 96 | // queryString is the requested queryString without the ucn_lang parameter (used for language links) |
| 91 | 97 | String queryString = getQueryStringWithout(paramPrefix + "lang", req); |
| 92 | | |
| 93 | 98 | mapOfStringObject.put("queryString", queryString); |
| | 99 | // messages is the ArrayList containing the messages to display |
| 94 | 100 | mapOfStringObject.put("messages", messages); |
| 95 | 101 | |
| | 102 | // Retrieve the parameters from the request |
| 96 | 103 | Map<String, Object> reqParams; |
| 97 | 104 | try { |
| … |
… |
|
| 102 | 109 | } |
| 103 | 110 | |
| | 111 | // Process the parameters |
| 104 | 112 | for (String key : reqParams.keySet()) { |
| 105 | 113 | if (!key.startsWith(paramPrefix) && !key.startsWith(outParamPrefix)) { |
| … |
… |
|
| 182 | 190 | } |
| 183 | 191 | |
| | 192 | // Check that all mandatory parameters are set |
| 184 | 193 | if (!reqParams.containsKey(paramPrefix + "lang")) { |
| 185 | 194 | String lang = getLanguage(null, req, null); |
| … |
… |
|
| 193 | 202 | aUnicornCall.setLang(lang + "," + aLocale); |
| 194 | 203 | } |
| 195 | | |
| 196 | 204 | if (!reqParams.containsKey(paramPrefix + "task")) { |
| 197 | 205 | String task = getTask(null, messages); |
| … |
… |
|
| 201 | 209 | aUnicornCall.setTask(task); |
| 202 | 210 | } |
| 203 | | |
| 204 | 211 | if (reqParams.containsKey(paramPrefix + "uri")) { |
| 205 | 212 | if (reqParams.get(paramPrefix + "uri").equals("")) { |
| … |
… |
|
| 230 | 237 | } |
| 231 | 238 | |
| | 239 | // Launch the observation |
| 232 | 240 | try { |
| 233 | 241 | aUnicornCall.doTask(); |
| … |
… |
|
| 252 | 260 | doGet(req, resp); |
| 253 | 261 | } |
| 254 | | |
| | 262 | |
| 255 | 263 | private Map<String, Object> getRequestParameters(HttpServletRequest req) throws FileUploadException { |
| 256 | 264 | |