- From: Denis Tea via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 22 Jan 2008 13:53:49 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/org/w3c/unicorn In directory hutz:/tmp/cvs-serv16178/org/w3c/unicorn Modified Files: UnicornCall.java Log Message: Internationalization : Modification of UnicornCall to add parameter lang and its value in th map of parameter. Index: UnicornCall.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/UnicornCall.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- UnicornCall.java 29 Nov 2007 14:11:59 -0000 1.6 +++ UnicornCall.java 22 Jan 2008 13:53:47 -0000 1.7 @@ -264,6 +264,7 @@ UnicornCall.logger.debug("InputFactory : " + aInputFactory + "."); UnicornCall.logger.debug("Map of string parameter : " + mapOfArrayUseParameter + "."); } + final MimeType aMimeType = aInputFactory.getMimeType(); final EnumInputMethod aEnumInputMethod = aInputFactory.getDefaultInputModule().getEnumInputMethod(); @@ -276,7 +277,6 @@ final String sObserverID = aObserver.getID(); // add only observer who handle the current mimetype if (!aObserver.canHandleMimeType(aMimeType, aEnumInputMethod)) { - if (UnicornCall.logger.isDebugEnabled()) { UnicornCall.logger.debug( "Observer " + @@ -324,6 +324,7 @@ aInputMethod.getCallParameter().getName(), aInputMethod.getCallMethod().isPost()); // add this request to request list + aRequestList.addRequest( aRequest, aObservation.getPriority(aMimeType), @@ -363,6 +364,19 @@ aInputMethod.getCallMethod().getURL().toString(), aInputMethod.getCallParameter().getName(), aInputMethod.getCallMethod().isPost()); + + // get value of ucn_lang parameter to associate it with parameter lang of the observer (if it has one). + // ucn_lang is defined in forms of index templates (xx_index.html.vm) + String[] valOfUcnLang = this.mapOfStringParameter.get("ucn_lang"); + + // get name of the lang parameter (defined in RDF file) + String observerParamLangName = aObservation.getObserver().getParamLangName(); + + // if lang parameter exists, we add name and value in parameters of the request. + if (observerParamLangName!=null && valOfUcnLang != null){ + aRequest.addParameter(observerParamLangName, valOfUcnLang[0]); + } + // add this request to request list aRequestList.addRequest( aRequest, @@ -373,6 +387,7 @@ UnicornCall.logger.debug("Request "+aRequest+" added to request list."); } // add required parameter + for (final CallParameter aCallParameter : aObserver.getCallMethod(aEnumInputMethod).getMapOfCallParameter().values()) { if (aCallParameter.isRequired() && aCallParameter.isFixed()) { aRequest.addParameter(aCallParameter.getName(), aCallParameter.getFixed()); @@ -582,6 +597,7 @@ public void addParameter ( final String sName, final String[] tStringValue) { + final String[] tStringValueLocal = mapOfStringParameter.get(sName); if (tStringValueLocal != null) { int tValuesLength = tStringValueLocal.length;
Received on Tuesday, 22 January 2008 13:53:58 UTC