W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2009

2006/unicorn/src/org/w3c/unicorn Framework.java,1.16,1.17

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 02 Oct 2009 16:52:12 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MtlMa-0006UD-JU@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv24919/src/org/w3c/unicorn

Modified Files:
	Framework.java 
Log Message:
adds EscapeTool to all contexts
+ clone language properties for LanguageAction

Index: Framework.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/Framework.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Framework.java	1 Oct 2009 17:32:24 -0000	1.16
+++ Framework.java	2 Oct 2009 16:52:10 -0000	1.17
@@ -29,6 +29,8 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
 import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.tools.generic.EscapeTool;
+import org.w3c.unicorn.action.LanguageAction;
 import org.w3c.unicorn.contract.Observer;
 import org.w3c.unicorn.contract.WADLUnmarshaller;
 import org.w3c.unicorn.contract.WADLUnmarshallerXPath;
@@ -103,6 +105,7 @@
 		languages = new TreeMap<String, String>();
 		mapOfObserver = new LinkedHashMap<String, Observer>();
 		mapOfReponseParser = new LinkedHashMap<String, ResponseParser>();
+		LanguageAction.setLanguageProperties(new TreeMap<String, Properties>());
 	}
 	
 	/**
@@ -423,6 +426,7 @@
 			defaultProps = Language.load(defaultLanguageFile);
 			logger.debug("> Found language (default): " + defaultProps.getProperty("lang") + " - " + defaultProps.getProperty("language"));
 			defaultProps.put("complete", "true");
+			LanguageAction.addLanguageProperties(defaultProps);
 			languageProperties.put(Property.get("DEFAULT_LANGUAGE"), defaultProps);
 		} catch (IllegalArgumentException e) {
 			logger.warn(e.getMessage());
@@ -441,6 +445,7 @@
 			try {
 				Properties props = Language.load(langFile);
 				logger.debug("> Found language: " + props.getProperty("lang") + " - " + props.getProperty("language"));
+				LanguageAction.addLanguageProperties(props);
 				Language.complete(props, defaultProps);
 				languageProperties.put(props.getProperty("lang"), props);
 			} catch (IllegalArgumentException e) {
@@ -480,6 +485,7 @@
 			for (Object key : langProps.keySet()) {
 		    	context.put((String) key, langProps.get(key));
 		    }
+			context.put("esc", new EscapeTool());
 			context.put("tasklist", mapOfTask);
 			context.put("param_prefix", Property.get("UNICORN_PARAMETER_PREFIX"));
 			context.put("languages", languages);
Received on Friday, 2 October 2009 16:52:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC