W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2010

commit: initVelocity() initializes Velocity before contexts

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 10 Jun 2010 14:54:28 -0400
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1OMmtY-0007jd-5d@blinky.w3.org>
changeset:   1180:a58fbfa5bca7
user:        Thomas Gambet <tgambet@w3.org>
date:        Thu Jun 10 11:32:52 2010 -0400
files:       src/org/w3c/unicorn/Framework.java
description:
initVelocity() initializes Velocity before contexts


diff -r 8f6d2fc383d5 -r a58fbfa5bca7 src/org/w3c/unicorn/Framework.java
--- a/src/org/w3c/unicorn/Framework.java	Thu Jun 10 11:18:19 2010 -0400
+++ b/src/org/w3c/unicorn/Framework.java	Thu Jun 10 11:32:52 2010 -0400
@@ -127,6 +127,7 @@
 			initTasklists();
 			initVelocity();
 			isUcnInitialized = true;
+			logger.info("Unicorn initialized successfully.");
 		} catch (InitializationFailedException e) {
 			logger.fatal(e.getMessage(), e);
 		}
@@ -558,9 +559,25 @@
 	}
 	
 	public static void initVelocity() throws InitializationFailedException {	
-		// Creating velocity contexts
+
 		logger.debug("-------------------------------------------------------");
 		logger.debug("Initializing Velocity");
+		
+		// Creating velocity engine
+		velocityEngine = new VelocityEngine();
+		Properties bProperties = Property.getProps("velocity.properties");
+		bProperties.put(Velocity.FILE_RESOURCE_LOADER_PATH,
+				Property.get("PATH_TO_TEMPLATES") + "," + 
+				Property.get("PATH_TO_TEMPLATES")+"includes/");
+		logger.debug("> Initializing velocity engine with FILE_RESOURCE_LOADER_PATH: " + Property.get("PATH_TO_TEMPLATES"));
+		try {
+			velocityEngine.init(bProperties);
+			logger.debug("> Velocity engine successfully initialized");
+		} catch (Exception e) {
+			throw new InitializationFailedException("Error instanciating velocity engine: " + e.getMessage());
+		}
+		
+		// Creating velocity contexts
 		for (ULocale locale : languageProperties.keySet()) {
 			VelocityContext context = new VelocityContext();
 			Properties langProps = languageProperties.get(locale);
@@ -581,24 +598,7 @@
 		}
 		logger.debug("> " + languageContexts.size() + " velocity context(s) created");
 		
-		// Creating velocity engine
-		velocityEngine = new VelocityEngine();
-		Properties bProperties = Property.getProps("velocity.properties");
-		bProperties.put(Velocity.FILE_RESOURCE_LOADER_PATH,
-				Property.get("PATH_TO_TEMPLATES") + "," + 
-				Property.get("PATH_TO_TEMPLATES")+"includes/");
-		logger.debug("> Initializing velocity engine with FILE_RESOURCE_LOADER_PATH: " + Property.get("PATH_TO_TEMPLATES"));
-		try {
-			velocityEngine.init(bProperties);
-			logger.debug("> Velocity engine successfully initialized");
-		} catch (Exception e) {
-			throw new InitializationFailedException("Error instanciating velocity engine: " + e.getMessage());
-		}
-		
 		logger.info("OK - Velocity successfully initialized");
-		
-		logger.info("Unicorn initialized successfully.");
-		isUcnInitialized = true;
 	}
 	
 	private static void loadConfigFile(String path, boolean addUnicornHome) throws FileNotFoundException, IOException {		
Received on Thursday, 10 June 2010 18:56:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:20 GMT