Changeset 203:f93412af7667

Show
Ignore:
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:
1 removed
7 modified

Legend:

Unmodified
Added
Removed
  • org/w3c/unicorn/UnicornCall.java

    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 $ 
    22// Author: Jean-Guilhem Rouel 
    33// (c) COPYRIGHT MIT, ERCIM and Keio, 2006. 
     
    385385                        // ucn_lang is defined in forms of index templates 
    386386                        // (xx_index.html.vm) 
    387                         String[] valOfUcnLang = this.mapOfStringParameter.get("ucn_lang"); 
     387                        String[] valOfUcnLang = this.mapOfStringParameter.get(Property.get("UNICORN_PARAMETER_PREFIX") + "lang"); 
    388388 
    389389                        // Get name of the lang parameter (defined in RDF file) 
     
    763763                        break; 
    764764                case DIRECT: 
    765                         sMimeType = this.mapOfStringParameter.get("ucn_mime")[0]; 
     765                        sMimeType = this.mapOfStringParameter.get(Property.get("UNICORN_PARAMETER_PREFIX") + "mime")[0]; 
    766766                        if (null == sMimeType || "".equals(sMimeType)) { 
    767767                                UnicornCall.logger 
  • org/w3c/unicorn/index/IndexGenerator.java

    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 $ 
    22// Author: Jean-Guilhem Rouel 
    33// (c) COPYRIGHT MIT, ERCIM and Keio, 2006. 
     
    131131                aVelocityContext.put("languages", languages); 
    132132                 
     133                aVelocityContext.put("param_prefix", Property.get("UNICORN_PARAMETER_PREFIX")); 
     134                 
    133135                for (File langFile : langFiles) { 
    134136                         
  • org/w3c/unicorn/tests/FirstServlet.java

    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 $ 
    22// Author: Jean-Guilhem Rouel 
    33// (c) COPYRIGHT MIT, ERCIM and Keio, 2006. 
     
    114114                // It is an hidden parameter of a form. 
    115115                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]; 
    118118                } 
    119119                else { 
     
    242242                                                        aUnicornCall, mapOfSpecificParameter, mapOfOutputParameter); 
    243243 
    244                                 } else if(aFileItem.getFieldName().equals("ucn_file")) { 
     244                                } else if(aFileItem.getFieldName().equals(Property.get("UNICORN_PARAMETER_PREFIX") + "file")) { 
    245245                                        aFileItemUploaded = aFileItem; 
    246246                                        aUnicornCall.setDocumentName(aFileItemUploaded.getName()); 
     
    356356 
    357357                if (sParamName.equals("lang")) { 
    358                         aUnicornCall.addParameter("ucn_lang", tStringParamValue); 
     358                        aUnicornCall.addParameter(Property.get("UNICORN_PARAMETER_PREFIX") + "lang", tStringParamValue); 
    359359                } 
    360360 
     
    388388                } 
    389389                else if (sParamName.equals("text_mime")) { 
    390                         aUnicornCall.addParameter("ucn_mime", tStringParamValue); 
     390                        aUnicornCall.addParameter(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tStringParamValue); 
    391391                } 
    392392        } 
  • org/w3c/unicorn/tests/UnicornClient.java

    r102 r203  
    1313import org.w3c.unicorn.output.OutputFormater; 
    1414import org.w3c.unicorn.output.OutputModule; 
     15import org.w3c.unicorn.util.Property; 
    1516 
    1617public class UnicornClient { 
     
    9798                                } 
    9899                                String[] tmp = {pInput[1]}; 
    99                                 mapOfParameter.put("ucn_mime", tmp); 
     100                                mapOfParameter.put(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tmp); 
    100101 
    101102                                aUnicornCall.setInputParameterValue(content); 
  • org/w3c/unicorn/tests/UnicornClientDirectInputTest.java

    r102 r203  
    1010import org.w3c.unicorn.output.OutputFormater; 
    1111import org.w3c.unicorn.output.OutputModule; 
     12import org.w3c.unicorn.util.Property; 
    1213 
    1314public class UnicornClientDirectInputTest { 
     
    2526                Map<String, String[]> mapOfParameter = new LinkedHashMap<String, String[]>(); 
    2627                String[] tmp = {"text/css"}; 
    27                 mapOfParameter.put("ucn_mime", tmp);  
     28                mapOfParameter.put(Property.get("UNICORN_PARAMETER_PREFIX") + "mime", tmp);  
    2829                aUnicornCall.setMapOfStringParameter(mapOfParameter); 
    2930 
  • resources/templates/index.vm

    r201 r203  
    33        <div> 
    44                $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);"> 
    66                        #foreach( $task in $tasklist )  
    77                                <option value="$task.getID()">$task.getLongName("${lang}")</option>  
     
    6666                                        <p class="instructions">$instruction-by-uri</p> 
    6767                                        <p> 
    68                                                 <label title="$uri_title" for="ucn_uri"> 
     68                                                <label title="$uri_title" for="${param_prefix}uri"> 
    6969                                                        $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" /> 
    7171                                                </label> 
    72                                                 <input type="hidden" name="ucn_lang" value="${lang}" /> 
     72                                                <input type="hidden" name="${param_prefix}lang" value="${lang}" /> 
    7373 
    7474                                        </p> 
     
    9696                                        <p class="instructions">$instruction-by-upload</p> 
    9797                                        <p> 
    98                                                 <label title="$instruction-by-upload" for="ucn_file"> 
     98                                                <label title="$instruction-by-upload" for="${param_prefix}file"> 
    9999                                                        $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" /> 
    102102                                                </label> 
    103103                                                 
     
    127127                                        <p class="instructions">$instruction-by-input</p> 
    128128                                        <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" /> 
    132132                                        </p>       
    133133                                        <fieldset id="opt_direct" class="options"> 
  • resources/templates/index/en_parameters.js.vm

    r170 r203  
    7777 
    7878#macro(createMimes $task) 
    79         '<select name="ucn_text_mime">' + 
     79        '<select name="${param_prefix}text_mime">' + 
    8080        #foreach($mime in $task.SupportedMimeTypes)   
    8181                        '<option value="$mime">$mime</option>' + 
     
    133133        // mimetypes dropdown 
    134134        if(method == 2) { 
    135                 document.getElementById("ucn_text_mime").innerHTML = mimeContainer[value]; 
     135                document.getElementById("${param_prefix}text_mime").innerHTML = mimeContainer[value]; 
    136136        } 
    137137} 
    138138 
    139139function init() { 
    140   var tasklists = document.getElementsByName('ucn_task'); 
     140  var tasklists = document.getElementsByName('${param_prefix}task'); 
    141141  for(var i = 0; i < tasklists.length; i++) { 
    142142    taskChanged(tasklists[i].options[tasklists[i].options.selectedIndex].value, i);