- From: Julien Grand-Mourcel via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 13 Sep 2007 09:49:42 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv10355/org/w3c/css/css
Modified Files:
StyleSheetGenerator.java
Log Message:
Getting the default css version through config file
Removing the velocity initialization (now done in the IndexGenerator class)
Index: StyleSheetGenerator.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGenerator.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- StyleSheetGenerator.java 23 Aug 2007 09:18:44 -0000 1.14
+++ StyleSheetGenerator.java 13 Sep 2007 09:49:39 -0000 1.15
@@ -18,7 +18,6 @@
import org.apache.velocity.app.Velocity;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.MethodInvocationException;
import org.w3c.css.error.ErrorReportHTML;
import org.w3c.css.parser.CssError;
import org.w3c.css.parser.CssErrorToken;
@@ -145,6 +144,7 @@
context.put("no_errors_report", new Boolean(false));
context.put("charset", ac.getContentEncoding());
context.put("cssversion", ac.getCssVersion());
+ context.put("css_profile", ac.getProfile());
context.put("css", ac.getMsg().getString(ac.getCssVersion()));
context.put("css_link", getURLProperty("@url-base_"+ac.getCssVersion()));
context.put("is_valid", (errors.getErrorCount() == 0) ? "true" : "false");
@@ -158,8 +158,6 @@
produceStyleSheet();
try {
- Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, this.getClass().getResource("").getPath());
- Velocity.init();
template = Velocity.getTemplate(template_file);
} catch (ResourceNotFoundException rnfe) {
System.err.println(rnfe.getMessage());
@@ -167,9 +165,6 @@
} catch (ParseErrorException pee) {
System.err.println(pee.getMessage());
pee.printStackTrace();
- } catch (MethodInvocationException mie) {
- System.err.println(mie.getMessage());
- mie.printStackTrace();
} catch (Exception e) {
System.err.println(e.getMessage());
e.printStackTrace();
@@ -413,10 +408,12 @@
/**
* Display the output
+ * @require VelocityContext to be set and init()
*/
public void print(PrintWriter out) {
this.out = out;
try {
+ // Velocity context must have been setup in IndexGenerator
template.merge(context, out);
} catch (Exception e) {
new ErrorReportHTML(ac, title, "", e).print(out);
Received on Thursday, 13 September 2007 09:49:45 UTC