Changeset 203:f93412af7667
- Timestamp:
- 07/28/09 10:56:56 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@204
- Message:
-
Modifying UNICORN_PARAMETER_PREFIX now works
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r184
|
r203
|
|
| 1 | | // $Id: UnicornCall.java,v 1.23 2008-09-25 17:37:43 jean-gui Exp $ |
| | 1 | // $Id: UnicornCall.java,v 1.24 2009-07-28 10:56:56 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 385 | 385 | // ucn_lang is defined in forms of index templates |
| 386 | 386 | // (xx_index.html.vm) |
| 387 | | String[] valOfUcnLang = this.mapOfStringParameter.get("ucn_lang"); |
| | 387 | String[] valOfUcnLang = this.mapOfStringParameter.get(Property.get("UNICORN_PARAMETER_PREFIX") + "lang"); |
| 388 | 388 | |
| 389 | 389 | // Get name of the lang parameter (defined in RDF file) |
| … |
… |
|
| 763 | 763 | break; |
| 764 | 764 | case DIRECT: |
| 765 | | sMimeType = this.mapOfStringParameter.get("ucn_mime")[0]; |
| | 765 | sMimeType = this.mapOfStringParameter.get(Property.get("UNICORN_PARAMETER_PREFIX") + "mime")[0]; |
| 766 | 766 | if (null == sMimeType || "".equals(sMimeType)) { |
| 767 | 767 | UnicornCall.logger |
-
|
r201
|
r203
|
|
| 1 | | // $Id: IndexGenerator.java,v 1.11 2009-07-28 10:38:37 tgambet Exp $ |
| | 1 | // $Id: IndexGenerator.java,v 1.12 2009-07-28 10:56:56 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 131 | 131 | aVelocityContext.put("languages", languages); |
| 132 | 132 | |
| | 133 | aVelocityContext.put("param_prefix", Property.get("UNICORN_PARAMETER_PREFIX")); |
| | 134 | |
| 133 | 135 | for (File langFile : langFiles) { |
| 134 | 136 | |
-
|
r192
|
r203
|
|
| 1 | | // $Id: FirstServlet.java,v 1.14 2009-07-22 14:54:21 tgambet Exp $ |
| | 1 | // $Id: FirstServlet.java,v 1.15 2009-07-28 10:56:56 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 114 | 114 | // It is an hidden parameter of a form. |
| 115 | 115 | String templateLang = null; |
| 116 | | if (aHttpServletRequest.getParameterValues("ucn_lang") != null){ |
| 117 | | templateLang = aHttpServletRequest.getParameterValues("ucn_lang")[0]; |
| | 116 | if (aHttpServletRequest.getParameterValues(Property.get("UNICORN_PARAMETER_PREFIX") + "lang") != null){ |
| | 117 | templateLang = aHttpServletRequest.getParameterValues(Property.get("UNICORN_PARAMETER_PREFIX") + "lang")[0]; |
| 118 | 118 | } |
| 119 | 119 | else { |
| … |
… |
|
| 242 | 242 | aUnicornCall, mapOfSpecificParameter, mapOfOutputParameter); |
| 243 | 243 | |
| 244 | | } else if(aFileItem.getFieldName().equals("ucn_file")) { |
| | 244 | } else if(aFileItem.getFieldName().equals(Property.get("UNICORN_PARAMETER_PREFIX") + "file")) { |
| 245 | 245 | aFileItemUploaded = aFileItem; |
| 246 | 246 | aUnicornCall.setDocumentName(aFileItemUploaded.getName()); |
| … |
… |
|
| 356 | 356 | |
| 357 | 357 | if (sParamName.equals("lang")) { |
| 358 | | aUnicornCall.addParameter("ucn_lang", tStringParamValue); |
| | 358 | aUnicornCall.addParameter(Property.get("UNICORN_PARAMETER_PREFIX") + "lang", tStringParamValue); |
| 359 | 359 | } |
| 360 | 360 | |
| … |
… |
|
| 388 | 388 | } |
| 389 | 389 | else if (sParamName.equals("text_mime")) { |
| 390 | | aUnicornCall.addParameter("ucn_mime", tStringParamValue); |
| | 390 | aUnicornCall.addParameter(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tStringParamValue); |
| 391 | 391 | } |
| 392 | 392 | } |
-
|
r102
|
r203
|
|
| 13 | 13 | import org.w3c.unicorn.output.OutputFormater; |
| 14 | 14 | import org.w3c.unicorn.output.OutputModule; |
| | 15 | import org.w3c.unicorn.util.Property; |
| 15 | 16 | |
| 16 | 17 | public class UnicornClient { |
| … |
… |
|
| 97 | 98 | } |
| 98 | 99 | String[] tmp = {pInput[1]}; |
| 99 | | mapOfParameter.put("ucn_mime", tmp); |
| | 100 | mapOfParameter.put(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tmp); |
| 100 | 101 | |
| 101 | 102 | aUnicornCall.setInputParameterValue(content); |
-
|
r102
|
r203
|
|
| 10 | 10 | import org.w3c.unicorn.output.OutputFormater; |
| 11 | 11 | import org.w3c.unicorn.output.OutputModule; |
| | 12 | import org.w3c.unicorn.util.Property; |
| 12 | 13 | |
| 13 | 14 | public class UnicornClientDirectInputTest { |
| … |
… |
|
| 25 | 26 | Map<String, String[]> mapOfParameter = new LinkedHashMap<String, String[]>(); |
| 26 | 27 | String[] tmp = {"text/css"}; |
| 27 | | mapOfParameter.put("ucn_mime", tmp); |
| | 28 | mapOfParameter.put(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tmp); |
| 28 | 29 | aUnicornCall.setMapOfStringParameter(mapOfParameter); |
| 29 | 30 | |
-
|
r201
|
r203
|
|
| 3 | 3 | <div> |
| 4 | 4 | $task: |
| 5 | | <select name="ucn_task" onchange="javascript:taskChanged(this.options[this.options.selectedIndex].value, $i);"> |
| | 5 | <select name="${param_prefix}task" onchange="javascript:taskChanged(this.options[this.options.selectedIndex].value, $i);"> |
| 6 | 6 | #foreach( $task in $tasklist ) |
| 7 | 7 | <option value="$task.getID()">$task.getLongName("${lang}")</option> |
| … |
… |
|
| 66 | 66 | <p class="instructions">$instruction-by-uri</p> |
| 67 | 67 | <p> |
| 68 | | <label title="$uri_title" for="ucn_uri"> |
| | 68 | <label title="$uri_title" for="${param_prefix}uri"> |
| 69 | 69 | $uri: |
| 70 | | <input type="text" name="ucn_uri" id="ucn_uri" size="45" /> |
| | 70 | <input type="text" name="${param_prefix}uri" id="${param_prefix}uri" size="45" /> |
| 71 | 71 | </label> |
| 72 | | <input type="hidden" name="ucn_lang" value="${lang}" /> |
| | 72 | <input type="hidden" name="${param_prefix}lang" value="${lang}" /> |
| 73 | 73 | |
| 74 | 74 | </p> |
| … |
… |
|
| 96 | 96 | <p class="instructions">$instruction-by-upload</p> |
| 97 | 97 | <p> |
| 98 | | <label title="$instruction-by-upload" for="ucn_file"> |
| | 98 | <label title="$instruction-by-upload" for="${param_prefix}file"> |
| 99 | 99 | $local_file |
| 100 | | <input type="file" id="ucn_file" name="ucn_file" size="30" /> |
| 101 | | <input type="hidden" name="ucn_lang" value="fr" /> |
| | 100 | <input type="file" id="${param_prefix}file" name="${param_prefix}file" size="30" /> |
| | 101 | <input type="hidden" name="${param_prefix}lang" value="fr" /> |
| 102 | 102 | </label> |
| 103 | 103 | |
| … |
… |
|
| 127 | 127 | <p class="instructions">$instruction-by-input</p> |
| 128 | 128 | <p> |
| 129 | | <textarea name="ucn_text" rows="12" cols="70"></textarea> |
| 130 | | <span id="ucn_text_mime"></span> |
| 131 | | <input type="hidden" name="ucn_lang" value="fr" /> |
| | 129 | <textarea name="${param_prefix}text" rows="12" cols="70"></textarea> |
| | 130 | <span id="${param_prefix}text_mime"></span> |
| | 131 | <input type="hidden" name="${param_prefix}lang" value="fr" /> |
| 132 | 132 | </p> |
| 133 | 133 | <fieldset id="opt_direct" class="options"> |
-
|
r170
|
r203
|
|
| 77 | 77 | |
| 78 | 78 | #macro(createMimes $task) |
| 79 | | '<select name="ucn_text_mime">' + |
| | 79 | '<select name="${param_prefix}text_mime">' + |
| 80 | 80 | #foreach($mime in $task.SupportedMimeTypes) |
| 81 | 81 | '<option value="$mime">$mime</option>' + |
| … |
… |
|
| 133 | 133 | // mimetypes dropdown |
| 134 | 134 | if(method == 2) { |
| 135 | | document.getElementById("ucn_text_mime").innerHTML = mimeContainer[value]; |
| | 135 | document.getElementById("${param_prefix}text_mime").innerHTML = mimeContainer[value]; |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | function init() { |
| 140 | | var tasklists = document.getElementsByName('ucn_task'); |
| | 140 | var tasklists = document.getElementsByName('${param_prefix}task'); |
| 141 | 141 | for(var i = 0; i < tasklists.length; i++) { |
| 142 | 142 | taskChanged(tasklists[i].options[tasklists[i].options.selectedIndex].value, i); |