You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(97) |
Dec
(35) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(55) |
Mar
(21) |
Apr
(3) |
May
(7) |
Jun
(25) |
Jul
(108) |
Aug
(23) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
(6) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(13) |
Feb
|
Mar
(257) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(38) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(63) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bri...@us...> - 2003-07-16 06:45:02
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv32064/src/org/webmacro/directive Modified Files: IncludeDirective.java Log Message: More ripping out -- eliminate reference counting of Brokers, pooling of context and fastwriter; streamline Context; eliminate Clock thread hack; eliminate ascii fastwriter hack Index: IncludeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/IncludeDirective.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** IncludeDirective.java 8 Jul 2003 19:48:44 -0000 1.22 --- IncludeDirective.java 16 Jul 2003 06:44:59 -0000 1.23 *************** *** 387,391 **** // so just fall through case TYPE_TEMPLATE: ! out.write(((Template) toInclude).getBytes(out.getEncoding(), context)); break; --- 387,391 ---- // so just fall through case TYPE_TEMPLATE: ! out.write(((Template) toInclude).evaluateAsBytes(out.getEncoding(), context)); break; |
From: <wan...@us...> - 2003-07-14 09:39:23
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv26091 Modified Files: TestParseInclude.java Log Message: New test for #include as macro Index: TestParseInclude.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestParseInclude.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TestParseInclude.java 12 Jun 2003 00:47:50 -0000 1.11 --- TestParseInclude.java 14 Jul 2003 09:39:15 -0000 1.12 *************** *** 70,73 **** --- 70,76 ---- "pass"); + assertStringTemplateMatches("#include as macro \"org/webmacro/template/test_parse.wm\"", + "pass"); + // include as <something dynamic> assertStringTemplateMatches("#include \"org/webmacro/template/test_parse.wm\"", |
From: <wan...@us...> - 2003-07-11 16:24:58
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv11454 Modified Files: TestBinaryAccessor.java Log Message: Removed incorrect license Index: TestBinaryAccessor.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestBinaryAccessor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestBinaryAccessor.java 11 Jul 2003 14:53:44 -0000 1.1 --- TestBinaryAccessor.java 11 Jul 2003 16:24:55 -0000 1.2 *************** *** 1,23 **** ! /* ! * The contents of this file are subject to the Mozilla Public License Version ! * 1.1 (the "License"); you may not use this file except in compliance with the ! * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ ! * Software distributed under the License is distributed on an "AS IS" basis, ! * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for ! * the specific language governing rights and limitations under the License. ! * ! * The Initial Developer of this code is Wangjammers ! * Copyright (C) 2003 Wangjammers. ! * ! * More information about the Ignition Web-Application can be found at: ! * http://www.wangjammers.org/ignition ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of Wangjammers and/or the WebMacro project. ! * For more information on the Wangjammers and WebMacro, please see ! * <http://www.wangjammers.org/> and <http://www.webmacro.org/> ! * respectively. ! * ! */ package org.webmacro.template; --- 1,3 ---- ! package org.webmacro.template; |
From: <wan...@us...> - 2003-07-11 14:53:47
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv28232 Added Files: TestBinaryAccessor.java Log Message: New test for broken Binary Accessor --- NEW FILE: TestBinaryAccessor.java --- /* * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * * The Initial Developer of this code is Wangjammers * Copyright (C) 2003 Wangjammers. * * More information about the Ignition Web-Application can be found at: * http://www.wangjammers.org/ignition * * This software consists of voluntary contributions made by many * individuals on behalf of Wangjammers and/or the WebMacro project. * For more information on the Wangjammers and WebMacro, please see * <http://www.wangjammers.org/> and <http://www.webmacro.org/> * respectively. * */ package org.webmacro.template; import org.webmacro.Context; import java.util.Hashtable; import java.util.Map; /** * @author Marc Palmer (<a href="mailto:wj...@wa...">wj...@wa...</a>) */ public class TestBinaryAccessor extends TemplateTestCase { public TestBinaryAccessor( String name ) { super( name ); } public static class Wrapper { private Map params = new Hashtable(); public String getParameters( String key ) { return (String) params.get( key ); } public void setParameters( String key, Object value ) { params.put( key, value ); } } public void testBinaryGet() { assertStringTemplateEquals("$obj.Parameters.Name", "Marc"); } public void testBinarySet() { assertStringTemplateEquals("#set $obj.Parameters.Name = 'Eric'", ""); } public void testBinarySetGet() { assertStringTemplateEquals( "#set $obj.Parameters.Name = 'Eric'\n" + "$obj.Parameters.Name", "Eric"); } protected void stuffContext( Context context ) throws Exception { final Wrapper value = new Wrapper(); value.setParameters( "Name", "Marc"); context.put( "obj", value ); } } |
From: <wan...@us...> - 2003-07-11 12:25:46
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv5471 Modified Files: WMServlet.java Log Message: Removed redundant FastWriter code in execute() method - was causing NPEs under some conditions due to closing null FW. Index: WMServlet.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/WMServlet.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** WMServlet.java 8 Jul 2003 19:48:45 -0000 1.56 --- WMServlet.java 11 Jul 2003 12:25:43 -0000 1.57 *************** *** 550,554 **** throws IOException { - FastWriter fw = null; boolean timing = Flags.PROFILE && c.isTiming(); try --- 550,553 ---- *************** *** 591,604 **** if (timing) c.stopTiming(); } - if (timing) c.startTiming("FastWriter.close()"); - try - { - fw.close(); - fw = null; - } - finally - { - if (timing) c.stopTiming(); - } } catch (UnsupportedEncodingException e) --- 590,593 ---- *************** *** 639,658 **** } } - finally - { - try - { - if (fw != null) - { - fw.flush(); - fw.close(); - fw = null; - } - } - catch (Exception e3) - { - // ignore disconnect - } - } } --- 628,631 ---- *************** *** 722,726 **** * should analyze the data in the request, put whatever values are * required into the context, and return the appropriate view. - * @see getTemplate * @return the template to be rendered by the WebMacro engine * @exception HandlerException throw this to produce vanilla error messages --- 695,698 ---- |
From: <bri...@us...> - 2003-07-08 19:48:49
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv7814/test/unit/org/webmacro/template Modified Files: EncodingTestCase.java TemplateTestCase.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: EncodingTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/EncodingTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EncodingTestCase.java 12 Jun 2003 00:47:49 -0000 1.4 --- EncodingTestCase.java 8 Jul 2003 19:48:45 -0000 1.5 *************** *** 146,150 **** wm.getConfig("TemplateEncoding"), encoding); Template t = wm.getTemplate(TEMPLATE_FILENAME); ! String evaluated = t.evaluate(getContext(wm)).toString(); assertEquals("Template evaluated to \"" + evaluated + "\" instead of \"" + expected + "\"", evaluated, expected); --- 146,150 ---- wm.getConfig("TemplateEncoding"), encoding); Template t = wm.getTemplate(TEMPLATE_FILENAME); ! String evaluated = t.getString(getContext(wm)); assertEquals("Template evaluated to \"" + evaluated + "\" instead of \"" + expected + "\"", evaluated, expected); *************** *** 158,165 **** Template t = wm.getTemplate(TEMPLATE_FILENAME); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ! FastWriter fw = wm.getFastWriter(bos, encoding); ! t.write(fw, getContext(wm)); ! fw.flush(); ! fw.close(); assertByteArrayEquals(bos.toByteArray(), expected.getBytes(encoding)); } --- 158,162 ---- Template t = wm.getTemplate(TEMPLATE_FILENAME); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ! t.write(bos, encoding, getContext(wm)); assertByteArrayEquals(bos.toByteArray(), expected.getBytes(encoding)); } *************** *** 172,179 **** Template t = wm.getTemplate(TEMPLATE_FILENAME); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ! FastWriter fw = wm.getFastWriter(bos, "UTF8"); ! t.write(fw, getContext(wm)); ! fw.flush(); ! fw.close(); assertByteArrayEquals(bos.toByteArray(), expected.getBytes("UTF8")); } --- 169,173 ---- Template t = wm.getTemplate(TEMPLATE_FILENAME); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ! t.write(bos, "UTF8", getContext(wm)); assertByteArrayEquals(bos.toByteArray(), expected.getBytes("UTF8")); } *************** *** 185,189 **** wmUTF8.getConfig("TemplateEncoding"), "UTF8"); Template t = wmUTF8.getTemplate(TEMPLATE_FILENAME_UTF8); ! String evaluated = t.evaluate(getContext(wmUTF8)).toString(); assertEquals("Template evaluated to \"" + evaluated + "\" instead of \"" + expected + "\"", expected, evaluated); --- 179,183 ---- wmUTF8.getConfig("TemplateEncoding"), "UTF8"); Template t = wmUTF8.getTemplate(TEMPLATE_FILENAME_UTF8); ! String evaluated = t.getString(getContext(wmUTF8)); assertEquals("Template evaluated to \"" + evaluated + "\" instead of \"" + expected + "\"", expected, evaluated); Index: TemplateTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TemplateTestCase.java 12 Jun 2003 00:47:49 -0000 1.15 --- TemplateTestCase.java 8 Jul 2003 19:48:45 -0000 1.16 *************** *** 94,98 **** public String executeTemplate (Template template) throws Exception { ! return template.evaluate(_context).toString(); } --- 94,98 ---- public String executeTemplate (Template template) throws Exception { ! return template.getString(_context); } *************** *** 113,120 **** Template template = new StringTemplate(_wm.getBroker(), templateText); template.parse(); ! FastWriter fw = FastWriter.getInstance(_wm.getBroker(), null, "UTF8"); ! template.write(fw, _context); ! String output = fw.toString(); ! fw.close(); return output; } --- 113,117 ---- Template template = new StringTemplate(_wm.getBroker(), templateText); template.parse(); ! String output = template.getString(_context); return output; } |
From: <bri...@us...> - 2003-07-08 19:48:49
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv7814/test/unit/org/webmacro Modified Files: TestMultipleInstances.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: TestMultipleInstances.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/TestMultipleInstances.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestMultipleInstances.java 12 Jun 2003 00:47:49 -0000 1.6 --- TestMultipleInstances.java 8 Jul 2003 19:48:45 -0000 1.7 *************** *** 116,123 **** Broker b = wm.getBroker(); Template template = new StringTemplate(b, templateText); ! FastWriter fw = FastWriter.getInstance(b, null, "UTF8"); ! template.write(fw, context); ! String output = fw.toString(); ! fw.close(); return output; } --- 116,120 ---- Broker b = wm.getBroker(); Template template = new StringTemplate(b, templateText); ! String output = template.getString(context); return output; } |
From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/test/perf In directory sc8-pr-cvs1:/tmp/cvs-serv7814/test/perf Modified Files: SpinTest.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: SpinTest.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/perf/SpinTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpinTest.java 12 Jun 2003 00:47:49 -0000 1.3 --- SpinTest.java 8 Jul 2003 19:48:45 -0000 1.4 *************** *** 1,10 **** import org.webmacro.Context; - import org.webmacro.FastWriter; import org.webmacro.Template; import org.webmacro.WM; - import java.io.FileOutputStream; - public class SpinTest { --- 1,9 ---- + import java.io.*; + import org.webmacro.Context; import org.webmacro.Template; import org.webmacro.WM; public class SpinTest { *************** *** 32,39 **** Template t = wm.getTemplate(template); ! FastWriter fw = new FastWriter(wm.getBroker(), new FileOutputStream("/dev/null"), "US-ASCII"); ! ! t.write(fw, c); ! fw.close(); } --- 31,35 ---- Template t = wm.getTemplate(template); ! t.write(new FileOutputStream("/dev/null"), "US-ASCII", c); } |
From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro/servlet Modified Files: TemplateTool.java WMServlet.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: TemplateTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/TemplateTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TemplateTool.java 12 Jun 2003 00:47:47 -0000 1.6 --- TemplateTool.java 8 Jul 2003 19:48:44 -0000 1.7 *************** *** 99,103 **** * new context. * @param fileRef a reference to the template file ! * @throws ResourceException if the file cannot be found or parsed * @return a new MacroTemplate */ --- 99,103 ---- * new context. * @param fileRef a reference to the template file ! * @throws org.webmacro.ResourceException if the file cannot be found or parsed * @return a new MacroTemplate */ *************** *** 175,179 **** synchronized (_context) { ! return _template.evaluate(_context); } } --- 175,179 ---- synchronized (_context) { ! return _template.getString(_context); } } Index: WMServlet.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/WMServlet.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** WMServlet.java 12 Jun 2003 00:47:47 -0000 1.55 --- WMServlet.java 8 Jul 2003 19:48:45 -0000 1.56 *************** *** 32,38 **** import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; ! import java.io.IOException; ! import java.io.OutputStream; ! import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; import java.util.Locale; --- 32,36 ---- import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; ! import java.io.*; import java.lang.reflect.Method; import java.util.Locale; *************** *** 249,254 **** { resp.setContentType("text/html"); ! FastWriter out = getFastWriter(resp.getOutputStream(), ! resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); --- 247,251 ---- { resp.setContentType("text/html"); ! Writer out = resp.getWriter(); out.write("<html><head><title>WebMacro Error</title></head>"); *************** *** 539,545 **** Template tmpl = getTemplate(templateName); ! FastWriter fw = getFastWriter(out, encoding); ! tmpl.write(fw, context); ! fw.close(); } --- 536,540 ---- Template tmpl = getTemplate(templateName); ! tmpl.write(out, encoding, context); } *************** *** 583,596 **** _log.debug("Using output encoding " + encoding); ! // get a fastwriter with no output stream, forcing ! // fastwriter to buffer the output internally. // this is necessary to be compatible with JSDK 2.3 // where you can't call setContentType() after getOutputStream(), // which could be happening during the template evaluation ! fw = FastWriter.getInstance(_broker, encoding); ! tmpl.write(fw, c); // now write the FW buffer to the response output stream ! writeFastWriter(resp, fw); } finally --- 578,589 ---- _log.debug("Using output encoding " + encoding); ! // get the bytes before calling getOutputStream // this is necessary to be compatible with JSDK 2.3 // where you can't call setContentType() after getOutputStream(), // which could be happening during the template evaluation ! byte[] bytes = tmpl.getBytes(encoding, c); // now write the FW buffer to the response output stream ! writeResponseBytes(resp, bytes, encoding); } finally *************** *** 638,647 **** + "\n<pre>" + e + "</pre>\n"); ! if (fw == null) ! fw = FastWriter.getInstance(_broker); ! fw.reset(fw.getOutputStream()); ! errorTemplate.write(fw, c); ! // now write the FW buffer to the response output stream ! writeFastWriter(c.getResponse(), fw); } catch (Exception errExcept) --- 631,636 ---- + "\n<pre>" + e + "</pre>\n"); ! String err = errorTemplate.getString(c); ! c.getResponse().getWriter().write(err); } catch (Exception errExcept) *************** *** 674,680 **** * to its Writer. * @param response where to write fast writer to ! * @param fw FastWriter, that has response buffered */ ! private void writeFastWriter (HttpServletResponse response, FastWriter fw) throws IOException { --- 663,669 ---- * to its Writer. * @param response where to write fast writer to ! * @param bytes the bytes to write */ ! private void writeResponseBytes (HttpServletResponse response, byte[] bytes, String encoding) throws IOException { *************** *** 698,709 **** _log.debug("Using Writer instead of OutputStream"); } ! response.setContentLength(fw.size()); if (out != null) { ! fw.writeTo(out); } else { ! response.getWriter().write(fw.toString()); } } --- 687,698 ---- _log.debug("Using Writer instead of OutputStream"); } ! response.setContentLength(bytes.length); if (out != null) { ! out.write(bytes); } else { ! response.getWriter().write(new String(bytes, encoding)); } } *************** *** 833,836 **** --- 822,826 ---- * this will be your ServletOutputStream * @param enctype the Encoding type to use + * @deprecated */ public FastWriter getFastWriter (OutputStream out, String enctype) |
From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro/util Modified Files: WMEval.java Removed Files: Atomizer.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: WMEval.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/WMEval.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** WMEval.java 12 Jun 2003 00:47:48 -0000 1.12 --- WMEval.java 8 Jul 2003 19:48:45 -0000 1.13 *************** *** 73,77 **** private OutputStream out = System.out; private Context context; - private boolean useWebContext = false; /** * If an output file is not specified as an argument, it --- 73,76 ---- *************** *** 219,227 **** public void eval (Context context, Template rule, OutputStream out, String encoding) throws Exception { ! FastWriter w; ! w = context.getBroker().getFastWriter(out, encoding); ! context.put("FastWriter", w); // allow template writers to access the output stream! ! rule.write(w, context); ! w.flush(); } --- 218,223 ---- public void eval (Context context, Template rule, OutputStream out, String encoding) throws Exception { ! // context.put("FastWriter", w); // allow template writers to access the output stream! ! rule.write(out, encoding, context); } *************** *** 231,235 **** * is written out as well. * @param templateName The name of the template. ! * @param output An optional output. * @return The output from the evaluated template */ --- 227,231 ---- * is written out as well. * @param templateName The name of the template. ! * @param out An optional output stream. * @return The output from the evaluated template */ *************** *** 237,241 **** { Template t = wm.getTemplate(templateName); ! String val = t.evaluate(context).toString(); if (out != null) { --- 233,237 ---- { Template t = wm.getTemplate(templateName); ! String val = t.getString(context); if (out != null) { *************** *** 266,271 **** * so you can write out to the stream. * @param templateName The name of the template. ! * @param response The servlet response object and its output stream ! * @return The output from the evaluated template */ public void eval (String templateName, HttpServletRequest req, --- 262,266 ---- * so you can write out to the stream. * @param templateName The name of the template. ! * @param resp The servlet response object and its output stream */ public void eval (String templateName, HttpServletRequest req, *************** *** 275,290 **** { context = wm.getWebContext(req, resp); ! String encoding = (String) wm.getConfig(WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding == null) { encoding = resp.getCharacterEncoding(); } - FastWriter w = context.getBroker().getFastWriter(out, encoding); Template t = wm.getTemplate(templateName); ! context.put("FastWriter", w); // allow template writers to access the output stream! ! t.write(w, context); ! resp.setContentLength(w.size()); ! w.writeTo(resp.getOutputStream()); ! w.flush(); } catch (Exception e) --- 270,281 ---- { context = wm.getWebContext(req, resp); ! String encoding = wm.getConfig(WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding == null) { encoding = resp.getCharacterEncoding(); } Template t = wm.getTemplate(templateName); ! // context.put("FastWriter", w); // allow template writers to access the output stream! ! t.write(resp.getOutputStream(), encoding, context); } catch (Exception e) *************** *** 301,305 **** public String eval (Context context, Template rule) throws Exception { ! return rule.evaluate(context).toString(); } --- 292,296 ---- public String eval (Context context, Template rule) throws Exception { ! return rule.getString(context); } *************** *** 318,322 **** { Template rule = wm.getTemplate(templateResourceFile); ! String value = rule.evaluate(context).toString(); // output the file if (outputFileName == null) --- 309,313 ---- { Template rule = wm.getTemplate(templateResourceFile); ! String value = rule.getString(context); // output the file if (outputFileName == null) --- Atomizer.java DELETED --- |
From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro/engine Modified Files: StreamTemplate.java WMTemplate.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: StreamTemplate.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/StreamTemplate.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StreamTemplate.java 12 Jun 2003 00:47:45 -0000 1.30 --- StreamTemplate.java 8 Jul 2003 19:48:44 -0000 1.31 *************** *** 193,205 **** t1.parse(); - FastWriter w = FastWriter.getInstance(wm.getBroker(), encoding); - - t1.write(w, context); System.out.println("*** RESULT ***"); ! w.writeTo(System.out); ! w.close(); ! context.clear(); System.out.println("*** DONE ***"); ! //System.out.println(result); } --- 193,200 ---- t1.parse(); System.out.println("*** RESULT ***"); ! t1.write(System.out, encoding, context); System.out.println("*** DONE ***"); ! context.clear(); } Index: WMTemplate.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/WMTemplate.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** WMTemplate.java 12 Jun 2003 00:47:45 -0000 1.47 --- WMTemplate.java 8 Jul 2003 19:48:44 -0000 1.48 *************** *** 26,31 **** import org.webmacro.*; ! import java.io.IOException; ! import java.io.Reader; import java.util.Map; --- 26,30 ---- import org.webmacro.*; ! import java.io.*; import java.util.Map; *************** *** 241,250 **** * then this method will return a null string. */ ! public final Object evaluate (Context data) throws PropertyException { try { FastWriter fw = FastWriter.getInstance(_broker); ! write(fw, data); String ret = fw.toString(); fw.close(); --- 240,249 ---- * then this method will return a null string. */ ! public final String getString (Context context) throws PropertyException { try { FastWriter fw = FastWriter.getInstance(_broker); ! write(fw, context); String ret = fw.toString(); fw.close(); *************** *** 259,272 **** /** ! * A macro has a write method which takes a context and applies ! * it to the macro to create a resulting String value, which is ! * then written to the supplied stream. Something will always be ! * written to the stream, even if the operation is not really ! * successful because of a parse error (an error message will ! * be written to the stream in that case.) ! * <p> ! * @exception IOException if there is a problem writing to the Writer */ ! public final void write (FastWriter out, Context data) throws IOException, PropertyException { --- 258,300 ---- /** ! * Parse the Template against the supplied context data and ! * return it as a byte array. If the operation fails for some reason, ! * such as unable to read template or unable to introspect the context ! * then this method will return a null string. */ ! public final byte[] getBytes (String encoding, Context context) throws PropertyException ! { ! try ! { ! FastWriter fw = FastWriter.getInstance(_broker, encoding); ! write(fw, context); ! byte[] ret = fw.toByteArray(); ! fw.close(); ! return ret; ! } ! catch (IOException e) ! { ! _log.error("Template: Could not write to ByteArrayOutputStream!", e); ! return null; ! } ! } ! ! public void write(OutputStream out, Context context) ! throws PropertyException, IOException { ! FastWriter fw = FastWriter.getInstance(_broker, out); ! write(fw, context); ! fw.flush(); ! fw.close(); ! } ! ! public void write(OutputStream out, String encoding, Context context) ! throws PropertyException, IOException { ! FastWriter fw = FastWriter.getInstance(_broker, out, encoding); ! write(fw, context); ! fw.flush(); ! fw.close(); ! } ! ! public final void write (FastWriter out, Context context) throws IOException, PropertyException { *************** *** 281,285 **** { _log.error("Template: Unable to parse template: " + this, e); ! out.write(data.getEvaluationExceptionHandler() .errorString("Template failed to parse. Reason: \n" + e.toString())); --- 309,313 ---- { _log.error("Template: Unable to parse template: " + this, e); ! out.write(context.getEvaluationExceptionHandler() .errorString("Template failed to parse. Reason: \n" + e.toString())); *************** *** 288,296 **** try { ! _content.write(out, data); } catch (PropertyException e) { ! e.setContextLocation(data.getCurrentLocation()); throw e; } --- 316,324 ---- try { ! _content.write(out, context); } catch (PropertyException e) { ! e.setContextLocation(context.getCurrentLocation()); throw e; } *************** *** 305,309 **** _log.warning(warning, e); ! out.write(data.getEvaluationExceptionHandler() .warningString("Could not interpret template. Reason: \n" + warning + "\n" + e.toString())); --- 333,337 ---- _log.warning(warning, e); ! out.write(context.getEvaluationExceptionHandler() .warningString("Could not interpret template. Reason: \n" + warning + "\n" + e.toString())); |
From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro/directive Modified Files: IncludeDirective.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: IncludeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/IncludeDirective.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** IncludeDirective.java 12 Jun 2003 00:47:44 -0000 1.21 --- IncludeDirective.java 8 Jul 2003 19:48:44 -0000 1.22 *************** *** 387,391 **** // so just fall through case TYPE_TEMPLATE: ! ((Template) toInclude).write(out, context); break; --- 387,391 ---- // so just fall through case TYPE_TEMPLATE: ! out.write(((Template) toInclude).getBytes(out.getEncoding(), context)); break; |
From: <bri...@us...> - 2003-07-08 19:48:47
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro Modified Files: Broker.java FastWriter.java Template.java WM.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: Broker.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Broker.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Broker.java 12 Jun 2003 00:47:43 -0000 1.35 --- Broker.java 8 Jul 2003 19:48:44 -0000 1.36 *************** *** 366,370 **** try { ! tmpl.evaluate(argContext); } catch (Exception e) --- 366,370 ---- try { ! tmpl.getString(argContext); } catch (Exception e) *************** *** 679,682 **** --- 679,683 ---- * only want the fast writer to buffer the output. * @param enctype the Encoding type to use + * @deprecated */ public final FastWriter getFastWriter (OutputStream out, String enctype) Index: FastWriter.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/FastWriter.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** FastWriter.java 12 Jun 2003 00:47:44 -0000 1.29 --- FastWriter.java 8 Jul 2003 19:48:44 -0000 1.30 *************** *** 413,417 **** } ! public void bflush () { try --- 413,417 ---- } ! private void bflush () { try *************** *** 543,546 **** --- 543,556 ---- } return new FastWriter(broker, out, encoding); + } + + /** + * Get a new FastWriter. You must then call writeTo(..) before + * attempting to write to the FastWriter. + */ + public static FastWriter getInstance (Broker broker, OutputStream out) + throws UnsupportedEncodingException + { + return getInstance(broker, out, SAFE_UNICODE_ENCODING); } Index: Template.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Template.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Template.java 12 Jun 2003 00:47:44 -0000 1.14 --- Template.java 8 Jul 2003 19:48:44 -0000 1.15 *************** *** 24,31 **** package org.webmacro; ! import java.io.IOException; import java.util.Map; ! public interface Template extends Macro, Visitable { --- 24,31 ---- package org.webmacro; ! import java.io.*; import java.util.Map; ! public interface Template extends Visitable { *************** *** 92,95 **** --- 92,107 ---- */ public Map getMacros (); + + public void write (OutputStream out, Context context) + throws PropertyException, IOException; + + public void write (OutputStream out, String encoding, Context context) + throws PropertyException, IOException; + + public String getString(Context context) + throws PropertyException; + + public byte[] getBytes(String encoding, Context context) + throws PropertyException; } Index: WM.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/WM.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** WM.java 12 Jun 2003 00:47:44 -0000 1.41 --- WM.java 8 Jul 2003 19:48:44 -0000 1.42 *************** *** 250,253 **** --- 250,254 ---- * only want the fast writer to buffer the output. * @param enctype the Encoding type to use + * @deprecated */ final public FastWriter getFastWriter (OutputStream out, String enctype) *************** *** 420,426 **** Template tmpl = getTemplate(templateName); ! FastWriter fw = getFastWriter(out, encoding); ! tmpl.write(fw, context); ! fw.close(); } --- 421,425 ---- Template tmpl = getTemplate(templateName); ! tmpl.write(out, encoding, context); } |
From: <bri...@us...> - 2003-07-08 19:48:47
|
Update of /cvsroot/webmacro/webmacro/examples In directory sc8-pr-cvs1:/tmp/cvs-serv7814/examples Modified Files: NoServlet.java Standalone.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: NoServlet.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/examples/NoServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NoServlet.java 4 May 2001 00:39:27 -0000 1.2 --- NoServlet.java 8 Jul 2003 19:48:44 -0000 1.3 *************** *** 40,48 **** Template t = wm.getTemplate("noservlet.wm"); ! // Create FastWriter for fast output encoding ! FastWriter fw = wm.getFastWriter (System.out, "UTF8"); ! // write the template to the output, using our context ! t.write(fw, c); ! fw.close(); ! } } --- 40,44 ---- Template t = wm.getTemplate("noservlet.wm"); ! t.write(System.out, "UTF8", c); ! } } Index: Standalone.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/examples/Standalone.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Standalone.java 4 May 2001 00:39:27 -0000 1.6 --- Standalone.java 8 Jul 2003 19:48:44 -0000 1.7 *************** *** 139,159 **** Template t = _wm.getTemplate("standalone.wm"); - // Create FastWriter for fast output encoding - FastWriter fw = _wm.getFastWriter(resp.getOutputStream(), - resp.getCharacterEncoding()); // write the template to the output, using our context ! t.write(fw, c); ! fw.close(); } catch (org.webmacro.ResourceException e) { ! FastWriter out = _wm.getFastWriter(resp.getOutputStream(), ! resp.getCharacterEncoding()); ! ! out.write("ERROR! Could not locate template standalone.wm, check that your template path is set properly in WebMacro.properties"); ! out.close(); } catch (org.webmacro.ContextException e) { ! FastWriter out = _wm.getFastWriter(resp.getOutputStream(), ! resp.getCharacterEncoding()); ! out.write("ERROR! Could not locate required data in the Context."); ! out.close(); } } catch (java.io.IOException e) { --- 139,148 ---- Template t = _wm.getTemplate("standalone.wm"); // write the template to the output, using our context ! t.write(resp.getOutputStream(), resp.getCharacterEncoding(), c); } catch (org.webmacro.ResourceException e) { ! resp.getWriter().write("ERROR! Could not locate template standalone.wm, check that your template path is set properly in WebMacro.properties"); } catch (org.webmacro.ContextException e) { ! resp.getWriter().write("ERROR! Could not locate required data in the Context."); } } catch (java.io.IOException e) { |
From: <dr...@us...> - 2003-07-03 05:30:58
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/src/org/tcdi/opensource/wiki Modified Files: Wiki.java WikiDataTypes.java WikiSystem.java Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: Wiki.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/Wiki.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Wiki.java 2 Jul 2003 15:34:05 -0000 1.11 --- Wiki.java 3 Jul 2003 05:20:09 -0000 1.12 *************** *** 388,398 **** private Hashtable createStore(String name) throws Exception { Properties props = new Properties(); ! props.put("ProxyImplementation", (String) _properties.get(name + ".ProxyImplementation")); ! props.put("PartitionKey", (String) _properties.get(name + ".PartitionKey")); ! props.put("ImmutableCertificate", (String) _properties.get(name + ".ImmutableCertificate")); ! props.put("MutableCertificate", (String) _properties.get(name + ".MutableCertificate")); ! props.put("Creator", (String) _properties.get(name + ".Creator")); ! props.put("Server", (String) _properties.get(name + ".Server")); ! props.put("Port", (String) _properties.get(name + ".Port")); VLHProvider provider = VLHProvider.getInstance(); --- 388,398 ---- private Hashtable createStore(String name) throws Exception { Properties props = new Properties(); ! props.put("ProxyImplementation", _properties.get(name + ".ProxyImplementation")); ! props.put("PartitionKey", _properties.get(name + ".PartitionKey")); ! props.put("ImmutableCertificate", _properties.get(name + ".ImmutableCertificate")); ! props.put("MutableCertificate", _properties.get(name + ".MutableCertificate")); ! props.put("Creator", _properties.get(name + ".Creator")); ! props.put("Server", _properties.get(name + ".Server")); ! props.put("Port", _properties.get(name + ".Port")); VLHProvider provider = VLHProvider.getInstance(); *************** *** 432,448 **** /** - * reparse a page - */ - private void reparsePage(WikiPage page) throws Exception { - WikiPageBuilder builder = (WikiPageBuilder) this._pageBuilderClass.newInstance(); - builder.setWikiTermMatcher(this); - WikiParser parser = new WikiParser(new ByteArrayInputStream(page.getUnparsedData().getBytes())); - WikiPage tmp = parser.parse(builder); - - page.setWikiData(tmp.getData()); - this.savePage(page); - } - - /** * Is the specified String a Wiki page reference? */ --- 432,435 ---- *************** *** 509,513 **** return _pageTree; } ! private void addChildren(List pages, Map lookup, WikiPage root, int depth) { WikiData[] data = root.getData(); --- 496,511 ---- return _pageTree; } ! ! public int getPageCount() { ! return getCurrentPageNames().length; ! } ! ! /** ! * TODO: WHY DOES THIS ALWAYS RETURN 4? I don't understand. ! */ ! public int getUserCount() { ! return _userStore.size(); ! } ! private void addChildren(List pages, Map lookup, WikiPage root, int depth) { WikiData[] data = root.getData(); Index: WikiDataTypes.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/WikiDataTypes.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WikiDataTypes.java 27 Nov 2002 07:06:32 -0000 1.2 --- WikiDataTypes.java 3 Jul 2003 05:20:10 -0000 1.3 *************** *** 54,110 **** * @author Eric B. Ridge */ ! public interface WikiDataTypes ! { ! public static final int UNKNOWN = -1; ! public static final int PLAIN_TEXT = 0; ! public static final int HORIZ_LINE = 1; ! public static final int PAGE_REFERENCE = 2; ! public static final int LINE_BREAK = 3; ! public static final int PARAGRAPH_BREAK = 4; ! public static final int URL = 5; ! public static final int JAVADOC = 6; ! public static final int IMAGE = 7; ! public static final int INDENT = 8; ! ! public static final int START_INDENT = 10; ! public static final int END_INDENT = 11; ! public static final int START_INDENT_BLOCK = 12; ! public static final int END_INDENT_BLOCK = 13; ! ! public static final int START_BOLD = 20; ! public static final int END_BOLD = 21; ! ! public static final int START_UNDERLINE = 30; ! public static final int END_UNDERLINE = 31; ! ! public static final int START_ITALIC = 40; ! public static final int END_ITALIC = 41; ! ! public static final int START_URL = 50; ! public static final int END_URL = 51; ! ! public static final int START_IMAGE = 60; ! public static final int END_IMAGE = 61; ! ! public static final int START_JAVADOC = 70; ! public static final int END_JAVADOC = 71; ! ! public static final int START_COLOR = 80; ! public static final int END_COLOR = 81; ! ! public static final int START_NAMED_HEADER = 90; ! public static final int END_NAMED_HEADER = 91; ! ! public static final int START_QUOTE = 100; ! public static final int END_QUOTE = 101; ! public final static int START_LIST = 110; ! public final static int LI = 111; ! public final static int END_LIST = 112; ! public static final int EMAIL = 200; ! public static final int QUOTED_BLOCK = 201; ! public static final int SPACE = 202; ! public static final int LT = 203; ! public static final int GT = 204; } --- 54,112 ---- * @author Eric B. Ridge */ ! public interface WikiDataTypes { ! public static final int UNKNOWN = -1; ! public static final int PLAIN_TEXT = 0; ! public static final int HORIZ_LINE = 1; ! public static final int PAGE_REFERENCE = 2; ! public static final int LINE_BREAK = 3; ! public static final int PARAGRAPH_BREAK = 4; ! public static final int URL = 5; ! public static final int JAVADOC = 6; ! public static final int IMAGE = 7; ! public static final int INDENT = 8; ! public static final int START_INDENT = 10; ! public static final int END_INDENT = 11; ! public static final int START_INDENT_BLOCK = 12; ! public static final int END_INDENT_BLOCK = 13; ! public static final int START_BOLD = 20; ! public static final int END_BOLD = 21; ! ! public static final int START_UNDERLINE = 30; ! public static final int END_UNDERLINE = 31; ! ! public static final int START_ITALIC = 40; ! public static final int END_ITALIC = 41; ! ! public static final int START_URL = 50; ! public static final int END_URL = 51; ! ! public static final int START_IMAGE = 60; ! public static final int END_IMAGE = 61; ! ! public static final int START_JAVADOC = 70; ! public static final int END_JAVADOC = 71; ! ! public static final int START_COLOR = 80; ! public static final int END_COLOR = 81; ! ! public static final int START_NAMED_HEADER = 90; ! public static final int END_NAMED_HEADER = 91; ! ! public static final int START_QUOTE = 100; ! public static final int END_QUOTE = 101; ! ! public final static int START_LIST = 110; ! public final static int LI = 111; ! public final static int END_LIST = 112; ! ! public final static int START_NUMBERED_LIST = 113; ! public final static int END_NUMBERED_LIST = 114; ! ! public static final int EMAIL = 200; ! public static final int QUOTED_BLOCK = 201; ! public static final int SPACE = 202; ! public static final int LT = 203; ! public static final int GT = 204; } Index: WikiSystem.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/WikiSystem.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WikiSystem.java 2 Jul 2003 03:01:52 -0000 1.5 --- WikiSystem.java 3 Jul 2003 05:20:10 -0000 1.6 *************** *** 75,78 **** --- 75,83 ---- /** + * How many "current" pages do we have? + */ + public int getPageCount(); + + /** * @param title the title of the WikiPage to retrieve. This should be a propertly formed WikiTerm * @return the WikiPage of the specified title *************** *** 151,154 **** --- 156,161 ---- public boolean containsPage(String title); + /** How many users do we have? */ + public int getUserCount(); /** |
From: <dr...@us...> - 2003-07-03 05:30:58
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/src/org/tcdi/opensource/wiki/parser Modified Files: WikiParser.java WikiParserConstants.java WikiParserTokenManager.java wiki.jj Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: WikiParser.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/WikiParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WikiParser.java 27 Nov 2002 07:06:32 -0000 1.5 --- WikiParser.java 3 Jul 2003 05:20:08 -0000 1.6 *************** *** 58,62 **** final public WikiPage parse(WikiPageBuilder builder) throws ParseException { ! Token t; label_1: while (true) { --- 58,63 ---- final public WikiPage parse(WikiPageBuilder builder) throws ParseException { ! Token t; ! builder.begin(); label_1: while (true) { *************** *** 69,72 **** --- 70,74 ---- case GT: case LI: + case LI_NUMBERED: case COLOR: case HEADER: *************** *** 82,85 **** --- 84,88 ---- case INDENT: case WHITESPACE: + case TILDE: case ASTERISK: case UNDERSCORE: *************** *** 106,109 **** --- 109,116 ---- builder.li(); break; + case LI_NUMBERED: + t = jj_consume_token(LI_NUMBERED); + builder.liNumbered(); + break; case BOLD: t = jj_consume_token(BOLD); *************** *** 192,195 **** --- 199,206 ---- builder.space(); break; + case TILDE: + t = jj_consume_token(TILDE); + builder.word ("~"); + break; case ASTERISK: t = jj_consume_token(ASTERISK); *************** *** 226,229 **** --- 237,241 ---- } } + builder.done(); {if (true) return builder.getPage ();} throw new Error("Missing return statement in function"); *************** *** 237,241 **** final private int[] jj_la1 = new int[2]; final private int[] jj_la1_0 = {0xfffffc00,0xfffffc00,}; ! final private int[] jj_la1_1 = {0x7,0x7,}; public WikiParser(java.io.InputStream stream) { --- 249,253 ---- final private int[] jj_la1 = new int[2]; final private int[] jj_la1_0 = {0xfffffc00,0xfffffc00,}; ! final private int[] jj_la1_1 = {0x1f,0x1f,}; public WikiParser(java.io.InputStream stream) { *************** *** 335,340 **** final public ParseException generateParseException() { jj_expentries.removeAllElements(); ! boolean[] la1tokens = new boolean[35]; ! for (int i = 0; i < 35; i++) { la1tokens[i] = false; } --- 347,352 ---- final public ParseException generateParseException() { jj_expentries.removeAllElements(); ! boolean[] la1tokens = new boolean[37]; ! for (int i = 0; i < 37; i++) { la1tokens[i] = false; } *************** *** 355,359 **** } } ! for (int i = 0; i < 35; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; --- 367,371 ---- } } ! for (int i = 0; i < 37; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; Index: WikiParserConstants.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/WikiParserConstants.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WikiParserConstants.java 27 Nov 2002 07:06:32 -0000 1.2 --- WikiParserConstants.java 3 Jul 2003 05:20:08 -0000 1.3 *************** *** 61,82 **** int GT = 15; int LI = 16; ! int COLOR = 17; ! int HEADER = 18; ! int COLOR_HEADER_TERMINATE = 19; ! int RULE = 20; ! int EMAIL = 21; ! int URL = 22; ! int WIKI_TERM = 23; ! int SHORT_WIKI_TERM = 24; ! int WORD = 25; ! int NEW_PARAGRAPH = 26; ! int LINE_BREAK = 27; ! int INDENT = 28; ! int WHITESPACE = 29; ! int ASTERISK = 30; ! int UNDERSCORE = 31; ! int CARET = 32; ! int DOUBLE_LBRACKET = 33; ! int DELIMITERS = 34; int DEFAULT = 0; --- 61,84 ---- int GT = 15; int LI = 16; ! int LI_NUMBERED = 17; ! int COLOR = 18; ! int HEADER = 19; ! int COLOR_HEADER_TERMINATE = 20; ! int RULE = 21; ! int EMAIL = 22; ! int URL = 23; ! int WIKI_TERM = 24; ! int SHORT_WIKI_TERM = 25; ! int WORD = 26; ! int NEW_PARAGRAPH = 27; ! int LINE_BREAK = 28; ! int INDENT = 29; ! int WHITESPACE = 30; ! int TILDE = 31; ! int ASTERISK = 32; ! int UNDERSCORE = 33; ! int CARET = 34; ! int DOUBLE_LBRACKET = 35; ! int DELIMITERS = 36; int DEFAULT = 0; *************** *** 100,103 **** --- 102,106 ---- "\">\"", "<LI>", + "<LI_NUMBERED>", "<COLOR>", "<HEADER>", *************** *** 113,116 **** --- 116,120 ---- "<INDENT>", "<WHITESPACE>", + "\"~~\"", "\"**\"", "\"__\"", Index: WikiParserTokenManager.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/WikiParserTokenManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WikiParserTokenManager.java 12 Mar 2003 17:53:33 -0000 1.5 --- WikiParserTokenManager.java 3 Jul 2003 05:20:08 -0000 1.6 *************** *** 54,109 **** { case 0: ! if ((active0 & 0x200000000L) != 0L) { ! jjmatchedKind = 34; return 0; } ! if ((active0 & 0x100000L) != 0L) { ! jjmatchedKind = 34; [...1226 lines suppressed...] "DEFAULT", }; private SimpleCharStream input_stream; ! private final int[] jjrounds = new int[58]; ! private final int[] jjstateSet = new int[116]; protected char curChar; public WikiParserTokenManager(SimpleCharStream stream) *************** *** 886,890 **** int i; jjround = 0x80000001; ! for (i = 53; i-- > 0;) jjrounds[i] = 0x80000000; } --- 912,916 ---- int i; jjround = 0x80000001; ! for (i = 58; i-- > 0;) jjrounds[i] = 0x80000000; } Index: wiki.jj =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/parser/wiki.jj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wiki.jj 12 Mar 2003 17:53:33 -0000 1.8 --- wiki.jj 3 Jul 2003 05:20:08 -0000 1.9 *************** *** 84,87 **** --- 84,88 ---- | < GT: ">" > | < LI: (<NL>)+ "-" (<WHITESPACE>)+ > + | < LI_NUMBERED: (<NL>)+ "#" (<WHITESPACE>)+ > | < COLOR: "^" (<ALPHANUM>)+ > | < HEADER: "^@" (<ALPHANUM>)* > *************** *** 97,100 **** --- 98,102 ---- | < INDENT: <SPACE> <SPACE> > | < WHITESPACE: <SPACE> | <TAB> > + | < TILDE: "~~" > | < ASTERISK: "**" > | < UNDERSCORE: "__" > *************** *** 104,113 **** } ! WikiPage parse (WikiPageBuilder builder) : { Token t;} ! { ( t = <LT> { builder.lt(); } | t = <GT> { builder.gt(); } | t = <LI> { builder.li(); } | t = <BOLD> { builder.bold(); } | t = <UNDERLINE> { builder.underline(); } --- 106,118 ---- } ! WikiPage parse (WikiPageBuilder builder) : { ! Token t; ! builder.begin(); ! } { ( t = <LT> { builder.lt(); } | t = <GT> { builder.gt(); } | t = <LI> { builder.li(); } + | t = <LI_NUMBERED> { builder.liNumbered(); } | t = <BOLD> { builder.bold(); } | t = <UNDERLINE> { builder.underline(); } *************** *** 162,165 **** --- 167,171 ---- | t = <INDENT> { builder.indent(2); } | t = <WHITESPACE> { builder.space(); } + | t = <TILDE> { builder.word ("~"); } | t = <ASTERISK> { builder.word ("*"); } | t = <UNDERSCORE> { builder.word ("_"); } *************** *** 170,173 **** --- 176,180 ---- | t = <QUOTED_BLOCK> { builder.quotedBlock (t.image.substring(2, t.image.length()-2)); } )* { + builder.done(); return builder.getPage (); } |
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/src/org/tcdi/opensource/wiki/servlet Modified Files: DiffPageAction.java EditPageAction.java SavePageAction.java WikiServlet.java Added Files: PreviewPageAction.java Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server --- NEW FILE: PreviewPageAction.java --- package org.tcdi.opensource.wiki.servlet; import org.tcdi.opensource.wiki.WikiSystem; import org.tcdi.opensource.wiki.WikiUser; import org.tcdi.opensource.wiki.WikiPage; import org.webmacro.servlet.WebContext; import java.util.ConcurrentModificationException; import java.util.List; import java.util.ArrayList; import java.util.StringTokenizer; /** * Created by IntelliJ IDEA. * User: e_ridge * Date: Jul 2, 2003 * Time: 11:34:53 PM * To change this template use Options | File Templates. */ public class PreviewPageAction implements PageAction { /** * can only save a page if the request is POST and "?save=<pagename>" is * in the request */ public boolean accept(WikiSystem wiki, WebContext wc, WikiUser user) { // and then only accept if this is a get request return wc.getRequest().getMethod().equalsIgnoreCase("POST") && wc.getForm ("preview") != null && wc.getForm("preview").equals("true"); } /** * do the saving of the page. When we're done, we redirect to the page * so the user can view his changes. */ public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageAction.PageActionException { if (page != null && page.getIsModerated() && !user.getIsModerator()) throw new PageActionException ("This page can only be saved by moderators"); try { String text = wc.getForm ("TEXT"); String pageName = wc.getForm ("save"); page = wiki.createPage(pageName, user.getIdentifier(), text); wiki.parsePage(page); wc.put ("Page", page); } catch (Exception e) { e.printStackTrace(); throw new PageAction.PageActionException (e.toString()); } } /** * no template for saving */ public String getTemplateName(WikiSystem wiki, WikiPage page) { return "preview.wm"; } /** * the page name is whatever is behind the "?save=<pagename>" request * parameter. */ public String getWikiPageName(WikiSystem wiki, WebContext wc) { return null; } } Index: DiffPageAction.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet/DiffPageAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DiffPageAction.java 2 Jul 2003 06:55:13 -0000 1.1 --- DiffPageAction.java 3 Jul 2003 05:20:09 -0000 1.2 *************** *** 57,78 **** public static class DiffHelper { ! private List _changes; ! public DiffHelper (Diff.change changes) { ! _changes = new ArrayList(); while (changes != null) { ! _changes.add (changes); changes = changes.link; } } ! public List getChanges() { ! return _changes; } ! public boolean isModified (int line_no) { ! for (Iterator itr = _changes.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); ! if (line_no < ch.line0+ch.deleted && line_no <= ch.line1 + ch.inserted && line_no >= ch.line0 && line_no >=ch.line1 && ch.deleted > 0 && ch.inserted > 0) return true; } --- 57,123 ---- public static class DiffHelper { ! private List _changeList; ! private String[] _currentLines; ! private String[] _oldLines; ! ! public DiffHelper (WikiSystem wiki, WikiPage old, WikiPage current) throws Exception { ! _currentLines = WikiUtil.delimitedToArray(wiki.getPageRenderer().render(current), "\n"); ! _oldLines = WikiUtil.delimitedToArray(wiki.getPageRenderer().render(old), "\n"); ! ! Diff diff = new Diff (_oldLines, _currentLines); ! Diff.change changes = diff.diff(Diff.forwardScript); ! ! _changeList = new ArrayList(); while (changes != null) { ! _changeList.add (changes); changes = changes.link; } } ! public String[] getCurrentLines() { ! return _currentLines; } ! public String[] getOldLines() { ! return _oldLines; ! } ! ! public List getChangeList() { ! return _changeList; ! } ! ! public boolean isStartOfDiffLeft (int line_no) { ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); ! if (line_no == ch.line0) ! return true; ! } ! return false; ! } ! ! public boolean isStartOfDiffRight (int line_no) { ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { ! Diff.change ch = (Diff.change) itr.next(); ! if (line_no == ch.line1) ! return true; ! } ! return false; ! } ! ! public boolean isModifiedLeft (int line_no) { ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { ! Diff.change ch = (Diff.change) itr.next(); ! if (line_no >= ch.line0 && line_no < ch.line0+Math.min(ch.inserted, ch.deleted) ! && ch.inserted > 0 && ch.deleted > 0) ! return true; ! } ! return false; ! } ! public boolean isModifiedRight (int line_no) { ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { ! Diff.change ch = (Diff.change) itr.next(); ! if (line_no >= ch.line1 && line_no < ch.line1+Math.min(ch.deleted, ch.inserted) ! && ch.inserted > 0 && ch.deleted > 0) return true; } *************** *** 81,88 **** public boolean isDeleted(int line_no) { ! if (isModified(line_no)) return false; ! for (Iterator itr = _changes.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (ch.line0 + ch.deleted > line_no && ch.line0 <= line_no) --- 126,133 ---- public boolean isDeleted(int line_no) { ! if (isModifiedLeft(line_no)) return false; ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (ch.line0 + ch.deleted > line_no && ch.line0 <= line_no) *************** *** 93,100 **** public boolean isInserted(int line_no) { ! if (isModified(line_no)) return false; ! for (Iterator itr = _changes.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no >= ch.line1 && line_no < ch.line1 + ch.inserted) --- 138,145 ---- public boolean isInserted(int line_no) { ! if (isModifiedLeft(line_no)) return false; ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no >= ch.line1 && line_no < ch.line1 + ch.inserted) *************** *** 105,112 **** public int getDeleteCount(int line_no) { ! if (isModified(line_no)) return 0; ! for (Iterator itr = _changes.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no == ch.line1) --- 150,157 ---- public int getDeleteCount(int line_no) { ! if (isModifiedRight(line_no)) return 0; ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no == ch.line1) *************** *** 116,123 **** } public int getInsertCount(int line_no) { ! if (isModified(line_no)) return 0; ! for (Iterator itr = _changes.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no == ch.line0) --- 161,168 ---- } public int getInsertCount(int line_no) { ! if (isModifiedRight(line_no)) return 0; ! for (Iterator itr = _changeList.iterator(); itr.hasNext();) { Diff.change ch = (Diff.change) itr.next(); if (line_no == ch.line0) *************** *** 156,171 **** boolean is_current = tmp.getVersion() == currentPage.getVersion(); ! String[] currentPageLines = WikiUtil.delimitedToArray(currentPage.getUnparsedData(), "\n"); ! String[] oldPageLines = WikiUtil.delimitedToArray(oldPage.getUnparsedData(), "\n"); ! ! Diff diff = new Diff(oldPageLines, currentPageLines); ! Diff.change changes = diff.diff(Diff.forwardScript); wc.put ("IsCurrent", is_current); wc.put ("CurrentPage", currentPage); wc.put ("OldPage", oldPage); ! wc.put ("CurrentPageLines", currentPageLines); ! wc.put ("OldPageLines", oldPageLines); ! wc.put ("DiffHelper", new DiffHelper (changes)); } catch (Exception e) { e.printStackTrace(); --- 201,210 ---- boolean is_current = tmp.getVersion() == currentPage.getVersion(); ! DiffHelper helper = new DiffHelper (wiki, oldPage, currentPage); wc.put ("IsCurrent", is_current); wc.put ("CurrentPage", currentPage); wc.put ("OldPage", oldPage); ! wc.put ("DiffHelper", helper); } catch (Exception e) { e.printStackTrace(); Index: EditPageAction.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet/EditPageAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EditPageAction.java 5 Jan 2002 20:27:29 -0000 1.2 --- EditPageAction.java 3 Jul 2003 05:20:09 -0000 1.3 *************** *** 74,78 **** throw new PageAction.PageActionException ("This page can only be edited by moderators"); ! wc.put ("PageName", wc.getForm ("edit")); } --- 74,80 ---- throw new PageAction.PageActionException ("This page can only be edited by moderators"); ! String pageName = wc.getForm("edit"); ! pageName = WikiUtil.formatAsWikiTitle(pageName); ! wc.put ("PageName", pageName); } Index: SavePageAction.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet/SavePageAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SavePageAction.java 27 Nov 2002 07:06:32 -0000 1.4 --- SavePageAction.java 3 Jul 2003 05:20:09 -0000 1.5 *************** *** 94,98 **** boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); ! String pageName = wc.getForm ("save"); // create the page --- 94,98 ---- boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); ! String pageName = getWikiPageName(wiki, wc); // create the page *************** *** 142,146 **** */ public String getWikiPageName(WikiSystem wiki, WebContext wc) { ! return wc.getForm ("save"); } --- 142,148 ---- */ public String getWikiPageName(WikiSystem wiki, WebContext wc) { ! String pageName = wc.getForm ("save"); ! pageName = WikiUtil.formatAsWikiTitle(pageName); ! return pageName; } Index: WikiServlet.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WikiServlet.java 2 Jul 2003 06:55:13 -0000 1.5 --- WikiServlet.java 3 Jul 2003 05:20:09 -0000 1.6 *************** *** 135,139 **** // something bad happened while performing the action // TODO: Handle error and error template ourselves ! e.printStackTrace(); throw new HandlerException (e.toString()); } finally { --- 135,139 ---- // something bad happened while performing the action // TODO: Handle error and error template ourselves ! log("Error handling request", e); throw new HandlerException (e.toString()); } finally { |
From: <dr...@us...> - 2003-07-03 05:30:57
|
Update of /cvsroot/webmacro/wiki In directory sc8-pr-cvs1:/tmp/cvs-serv7466a Removed Files: wiki.jar wiki1.ipr wiki1.iws Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server --- wiki.jar DELETED --- --- wiki1.ipr DELETED --- --- wiki1.iws DELETED --- |
From: <dr...@us...> - 2003-07-03 05:30:51
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv8831/src/org/tcdi/opensource/wiki/servlet Modified Files: IndexPageAction.java Log Message: ah hah! found the NPE that I've been seeing Index: IndexPageAction.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/servlet/IndexPageAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IndexPageAction.java 2 Jul 2003 03:01:52 -0000 1.2 --- IndexPageAction.java 3 Jul 2003 05:30:48 -0000 1.3 *************** *** 56,62 **** public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageAction.PageActionException { ! String letter = wc.getForm("LETTER"); ! if (letter != null) ! user.setAttribute("LastIndexPageLetter", letter); } public String getTemplateName(WikiSystem wiki, WikiPage page) { --- 56,64 ---- public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageAction.PageActionException { ! if (user != null) { ! String letter = wc.getForm("LETTER"); ! if (letter != null) ! user.setAttribute("LastIndexPageLetter", letter); ! } } public String getTemplateName(WikiSystem wiki, WikiPage page) { |
From: <dr...@us...> - 2003-07-03 05:24:38
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/renderer In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/src/org/tcdi/opensource/wiki/renderer Modified Files: HTMLPageRenderer.java TextPageRenderer.java WikiPageRenderer.java Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: HTMLPageRenderer.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/renderer/HTMLPageRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HTMLPageRenderer.java 27 Nov 2002 07:06:32 -0000 1.6 --- HTMLPageRenderer.java 3 Jul 2003 05:20:08 -0000 1.7 *************** *** 133,137 **** sb.append ("<pre>") .append (replace (replace (text, "<", "<"), ">", ">")) ! .append ("</pre>"); return sb.toString (); --- 133,137 ---- sb.append ("<pre>") .append (replace (replace (text, "<", "<"), ">", ">")) ! .append ("</pre>\n"); return sb.toString (); *************** *** 226,230 **** protected String renderHorizLine() { ! return "<hr>"; } --- 226,230 ---- protected String renderHorizLine() { ! return "<hr>\n"; } *************** *** 250,270 **** protected String renderLineBreak() { ! return "<br>"; } protected String renderParagraphBreak() { ! return "<br><br>"; } protected String renderStartList() { ! return "<ul>"; } protected String renderListItem() { return "<li>"; - } - - protected String renderEndList() { - return "</ul>"; } --- 250,278 ---- protected String renderLineBreak() { ! return "<br>\n"; } protected String renderParagraphBreak() { ! return "<br><br>\n"; } + protected String renderStartNumberedList() { + return "<ol>\n"; + } + + protected String renderEndNumberedList() { + return "</ol>\n"; + } + protected String renderStartList() { ! return "<ul>\n"; } + protected String renderEndList() { + return "</ul>\n"; + } + protected String renderListItem() { return "<li>"; } Index: TextPageRenderer.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/renderer/TextPageRenderer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TextPageRenderer.java 27 Nov 2002 07:06:32 -0000 1.5 --- TextPageRenderer.java 3 Jul 2003 05:20:09 -0000 1.6 *************** *** 164,175 **** } ! protected String renderListItem() { ! return "* "; } ! protected String renderEndList() { return ""; } protected String renderLineBreak() { return System.getProperty ("line.separator"); --- 164,186 ---- } ! protected String renderEndList() { ! return ""; } ! private int _number = 0; ! protected String renderStartNumberedList() { ! _number = 1; ! return "\n"; ! } ! ! protected String renderEndNumberedList() { ! _number = 0; return ""; } + protected String renderListItem() { + return _number > 0 ? "" + (++_number) : "* "; + } + protected String renderLineBreak() { return System.getProperty ("line.separator"); Index: WikiPageRenderer.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/renderer/WikiPageRenderer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WikiPageRenderer.java 27 Nov 2002 07:06:32 -0000 1.5 --- WikiPageRenderer.java 3 Jul 2003 05:20:09 -0000 1.6 *************** *** 162,173 **** break; - case WikiDataTypes.LI: - str = renderListItem(); - break; - case WikiDataTypes.END_LIST: str = renderEndList(); break; // @deprecated "image" is now a URL type. case WikiDataTypes.IMAGE: --- 162,181 ---- break; case WikiDataTypes.END_LIST: str = renderEndList(); break; + + case WikiDataTypes.START_NUMBERED_LIST: + str = renderStartNumberedList(); + break; + + case WikiDataTypes.END_NUMBERED_LIST: + str = renderEndNumberedList(); + break; + case WikiDataTypes.LI: + str = renderListItem(); + break; + // @deprecated "image" is now a URL type. case WikiDataTypes.IMAGE: *************** *** 241,247 **** protected abstract String renderStartList(); - protected abstract String renderListItem(); protected abstract String renderEndList(); ! protected abstract String renderBoldStart (); protected abstract String renderBoldEnd (); --- 249,257 ---- protected abstract String renderStartList(); protected abstract String renderEndList(); ! protected abstract String renderStartNumberedList(); ! protected abstract String renderEndNumberedList(); ! protected abstract String renderListItem(); ! protected abstract String renderBoldStart (); protected abstract String renderBoldEnd (); |
From: <dr...@us...> - 2003-07-03 05:20:40
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/builder In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/src/org/tcdi/opensource/wiki/builder Modified Files: DefaultPageBuilder.java WikiPageBuilder.java Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: DefaultPageBuilder.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/builder/DefaultPageBuilder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DefaultPageBuilder.java 27 Nov 2002 07:06:32 -0000 1.6 --- DefaultPageBuilder.java 3 Jul 2003 05:20:07 -0000 1.7 *************** *** 50,55 **** --- 50,58 ---- */ public class DefaultPageBuilder implements WikiPageBuilder { + protected static final short LIST_TYPE_NORMAL = 0; + protected static final short LIST_TYPE_NUMBERED = 1; protected WikiTermMatcher _matcher; protected boolean _bold, _underline, _italic, _color, _header, _space, _list; + protected short _listType; protected String _currentHeader = null; protected StringBuffer _text = new StringBuffer (); *************** *** 65,68 **** --- 68,79 ---- } + public void begin() { + // nothing to do here + } + + public void done() { + finishFormatting (); + } + public void setWikiTermMatcher (WikiTermMatcher matcher) { _matcher = matcher; *************** *** 93,100 **** public void li() { ! if (!_list) { newData(); _currentData.setType(WikiDataTypes.START_LIST); _list = true; } newData(); --- 104,114 ---- public void li() { ! if (_list && _listType != LIST_TYPE_NORMAL) ! endList(); ! if (!_list) { newData(); _currentData.setType(WikiDataTypes.START_LIST); _list = true; + _listType = LIST_TYPE_NORMAL; } newData(); *************** *** 102,105 **** --- 116,146 ---- } + public void liNumbered() { + if (_list && _listType != LIST_TYPE_NUMBERED) + endList(); + if (!_list) { + newData(); + _currentData.setType(WikiDataTypes.START_NUMBERED_LIST); + _list = true; + _listType = LIST_TYPE_NUMBERED; + } + newData(); + _currentData.setType(WikiDataTypes.LI); + } + + private void endList() { + newData(); + switch (_listType) { + case LIST_TYPE_NORMAL: + _currentData.setType(WikiDataTypes.END_LIST); + break; + + case LIST_TYPE_NUMBERED: + _currentData.setType(WikiDataTypes.END_NUMBERED_LIST); + break; + } + _list = false; + } + public void underline() { newData (); *************** *** 169,178 **** public void paragraph() { finishFormatting (); ! if (_list) { ! newData(); ! _currentData.setType(WikiDataTypes.END_LIST); ! _list = false; ! ! } newData (); _currentData.setType (WikiDataTypes.PARAGRAPH_BREAK); --- 210,215 ---- public void paragraph() { finishFormatting (); ! if (_list) ! endList(); newData (); _currentData.setType (WikiDataTypes.PARAGRAPH_BREAK); Index: WikiPageBuilder.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/builder/WikiPageBuilder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WikiPageBuilder.java 27 Nov 2002 07:06:32 -0000 1.4 --- WikiPageBuilder.java 3 Jul 2003 05:20:07 -0000 1.5 *************** *** 53,56 **** --- 53,62 ---- public interface WikiPageBuilder extends WikiTermMatcher { + /** called when the page building process first begins */ + public void begin(); + + /** called when the page building process is complete */ + public void done(); + /** * A WikiPageBuilder should use a <code>WikiTermMatcher</code> *************** *** 109,112 **** --- 115,121 ---- /** a bulleted list item */ public void li (); + + /** a numbered bulleted list item */ + public void liNumbered (); /** add a URL */ |
Update of /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/builds/www.webmacro.org/templates Modified Files: diff.wm edit.wm optionsbar.wm register.wm view.wm Added Files: preview.wm Removed Files: user_admin.wm Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server --- NEW FILE: preview.wm --- #set $Response.ContentType = "text/html" #if ($Page) #set $PageName = $Page.Title #end <html><head><title>WebMacro: $WikiUtil.unformatWikiTitle($PageName)</title> #if ($Page) { #set $space = ", " #if ($Page.RelatedTitles) { <META name="keywords" content=" #if ($Page) #begin#foreach $pageTitle in $Page.RelatedTitles #begin $pageTitle $space #end #end"> } #if ($Page.Author) { <META name="author" content="$Wiki.getUser($Page.Author).Name"> } #if ($Page.UnparsedData) { <META name="description" content="$Page.Title: $Page.UnparsedData.substring(0, $Math.min($Page.UnparsedData.length(), 100)) ..."> } } <link rel="stylesheet" type="text/css" href=site-style.css> </head> <body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 id="body" onLoad='window.focus();'> <table border=0 width="100%"> <tr> <td colspan=3 align=right><form><input type='button' value='Close Window' onClick='window.close();'></form></td> </tr> <tr> <td class="LeftMenu" valign=top width="120"> #include as template "leftmenu.wm" </td> <td width="8"> </td> <td valign=top> #if ($Page) { $Renderer.render($Page) } #else { You have requested a page that doesn't exist. #if ($User) { But that's okay!<p> You can create the page $PageName by <a href="ControllerPage?edit=$WikiUtil.formatAsWikiTitle($PageName)">clicking here</a>. } } </tr> </table> </body> </html> Index: diff.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/diff.wm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** diff.wm 2 Jul 2003 06:55:13 -0000 1.1 --- diff.wm 3 Jul 2003 05:20:06 -0000 1.2 *************** *** 8,13 **** } #else { ! #if ($DiffHelper.Changes.size() == 1) { 1 difference } ! #else {$DiffHelper.Changes.size() differences } <table border=1 width="100%" cellspacing=1 cellpadding=2> <tr> --- 8,13 ---- } #else { ! #if ($DiffHelper.ChangeList.size() == 1) { 1 difference } ! #else {$DiffHelper.ChangeList.size() differences } <table border=1 width="100%" cellspacing=1 cellpadding=2> <tr> *************** *** 24,52 **** <tr><th colspan=3>Legend</th></tr> <tr><td class='deleted_line'>Deleted</td><td class='inserted_line'>Inserted</td></tr> ! <tr><td class='modified_line'>Modified</td><td></td></tr> </table> </td> <tr> <td valign=top width="50%"> ! #foreach $line in $OldPageLines indexing $idx from 0 { ! #count $i from 1 to $DiffHelper.getInsertCount($idx) {<br>} ! #if($DiffHelper.isModified($idx)){<span class='modified_line'> #wiki{$line}</span><br>} ! #elseif($DiffHelper.isDeleted($idx)){<span class='deleted_line'> #wiki{$line}</span><br>} ! #else{<span class='unchanged_line'>#wiki{$line}</span><br>} } </td> <td valign=top width="50%"> ! #foreach $line in $CurrentPageLines indexing $idx from 0 { ! #count $i from 1 to $DiffHelper.getDeleteCount($idx) {<br>} ! #if($DiffHelper.isModified($idx)){<span class='modified_line'> #wiki{$line}</span><br>} ! #elseif($DiffHelper.isInserted($idx)){<span class='inserted_line'> #wiki{$line}</span><br>} ! #else{<span class='unchanged_line'>#wiki{$line}</span><br>} } ! </td> ! </tr> </table> - } - #include as template "footer.wm" --- 24,47 ---- <tr><th colspan=3>Legend</th></tr> <tr><td class='deleted_line'>Deleted</td><td class='inserted_line'>Inserted</td></tr> ! <tr><td class='modified_line'>Modified</td><td class='unchanged_line'>Unchanged</td></tr> </table> </td> <tr> <td valign=top width="50%"> ! #foreach $line in $DiffHelper.OldLines indexing $idx from 0 { ! #if($DiffHelper.isModifiedLeft($idx)){<span class='modified_line'>$line</span>} ! #elseif($DiffHelper.isDeleted($idx)){<span class='deleted_line'>$line</span>} ! #else{<span class='unchanged_line'>$line</span>} } </td> <td valign=top width="50%"> ! #foreach $line in $DiffHelper.CurrentLines indexing $idx from 0 { ! #if($DiffHelper.isModifiedRight($idx)){<span class='modified_line'>$line</span>} ! #elseif($DiffHelper.isInserted($idx)){<span class='inserted_line'>$line</span>} ! #else{<span class='unchanged_line'>$line</span>} } ! </td></tr> </table> } #include as template "footer.wm" Index: edit.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/edit.wm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edit.wm 2 Jul 2003 03:01:52 -0000 1.2 --- edit.wm 3 Jul 2003 05:20:07 -0000 1.3 *************** *** 1,5 **** #include as template "header.wm" ! <form action="$Request.RequestURI" method=POST> <input type=hidden name="save" value="$PageName"> #if ($Page) { --- 1,5 ---- #include as template "header.wm" ! <form action="$Request.RequestURI" method=POST target='_top'> <input type=hidden name="save" value="$PageName"> #if ($Page) { *************** *** 39,46 **** <p> ! <input type=button value="Cancel" onClick="top.location.href='$PageName';" ! > <input type=submit value="Save"> </form> ! #include as template "footer.wm" --- 39,55 ---- <p> ! <input type='hidden' name='preview' value='false' > <input type=button value="Cancel" onClick="top.location.href='$PageName';" ! > <input type=button onClick=" ! window.open('', 'PREVIEW', 'scrollbars=yes,resizeable=yes,menubar=no,status=no,width=640,height=480'); ! this.form.target = 'PREVIEW'; ! this.form.preview.value = 'true'; ! this.form.submit(); ! " value="Preview" ! > <input type=submit onClick=" ! this.form.preview.value='false'; ! this.form.target='_top'; ! this.form.submit();" value="Save"> </form> ! #include as template "footer.wm" \ No newline at end of file Index: optionsbar.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/optionsbar.wm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** optionsbar.wm 2 Jul 2003 06:55:13 -0000 1.4 --- optionsbar.wm 3 Jul 2003 05:20:07 -0000 1.5 *************** *** 15,19 **** } ! || <a href="DiffPage?PAGE=$Page.Title">Diff to previous version</a> #if ($User && $Wiki.isAdministrator($User)) { --- 15,21 ---- } ! #if ($Page) { ! || <a href="DiffPage?PAGE=$Page.Title">Diff to previous version</a> ! } #if ($User && $Wiki.isAdministrator($User)) { Index: register.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/register.wm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** register.wm 2 Jul 2003 03:01:52 -0000 1.2 --- register.wm 3 Jul 2003 05:20:07 -0000 1.3 *************** *** 9,16 **** Thank you for taking the time to register. You are now able to edit any non-moderated page on this site (any page with an Edit link in the upper-left corner).<p> ! ! You can also create your own home page. We suggest you use ! <a href="ControllerPage?edit=$User.FirstName$User.LastName">$User.FirstName$User.LastName</a> ! as the page name. </td> --- 9,16 ---- Thank you for taking the time to register. You are now able to edit any non-moderated page on this site (any page with an Edit link in the upper-left corner).<p> ! ! #set $userPageName = "$WikiUtil.formatAsWikiTitle($User.FirstName)$WikiUtil.formatAsWikiTitle($User.LastName)" ! To learn how to use this Wiki, feel free to create your own homepage. ! We suggest you name it <b><a href="ControllerPage?edit=$userPageName">$userPageName</a></b>. </td> Index: view.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/view.wm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** view.wm 2 Jul 2003 03:01:52 -0000 1.2 --- view.wm 3 Jul 2003 05:20:07 -0000 1.3 *************** *** 21,24 **** </tr> </table> - #include as template "footer.wm" --- 21,23 ---- --- user_admin.wm DELETED --- |
From: <dr...@us...> - 2003-07-03 05:20:40
|
Update of /cvsroot/webmacro/wiki/builds/www.webmacro.org/etc In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/builds/www.webmacro.org/etc Modified Files: Wiki.properties Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: Wiki.properties =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/etc/Wiki.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Wiki.properties 2 Jul 2003 06:55:13 -0000 1.5 --- Wiki.properties 3 Jul 2003 05:20:06 -0000 1.6 *************** *** 6,9 **** --- 6,10 ---- org.tcdi.opensource.wiki.servlet.FindPagesAction \ org.tcdi.opensource.wiki.servlet.EditPageAction \ + org.tcdi.opensource.wiki.servlet.PreviewPageAction \ org.tcdi.opensource.wiki.servlet.SavePageAction \ org.tcdi.opensource.wiki.servlet.LoginAction \ *************** *** 53,57 **** # who are the administrators? # administrators are allowed to do user-administration stuff ! Administrators: e_ridge;lane;justin;BrianGoetz --- 54,58 ---- # who are the administrators? # administrators are allowed to do user-administration stuff ! Administrators: e_ridge;lane;justin;BrianGoetz;wangjammer5 |
From: <dr...@us...> - 2003-07-03 05:20:40
|
Update of /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/admin In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/builds/www.webmacro.org/templates/admin Modified Files: user_list.wm Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server Index: user_list.wm =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/admin/user_list.wm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** user_list.wm 7 Feb 2003 15:24:46 -0000 1.2 --- user_list.wm 3 Jul 2003 05:20:06 -0000 1.3 *************** *** 24,27 **** --- 24,29 ---- } + <p> + ## $Wiki.getUserCount() total Users<br> <table border=0> <tr> |
From: <dr...@us...> - 2003-07-03 05:20:10
|
Update of /cvsroot/webmacro/wiki/builds/www.webmacro.org In directory sc8-pr-cvs1:/tmp/cvs-serv7466a/builds/www.webmacro.org Removed Files: resources.jar Log Message: - fixed rendering issues with DiffPage - add begin() and done() notifications to the page builder - add parser/renderer supported for numbered lists - fix rendering bug with: ~~ - fix bugs where one could create a page with all lower-case letters (also cleaned up filesystem of production webserver) - add ability to Preview before Saving a page edit - cleanup "thank you for registering" page a little bit - don't show the "Diff to Previous" link if we're not actually viewing a valid page - attempt to convince WMServlet to log my exception stack traces so I can hunt down the cause of a few NPE's I've seen in the error log on the production server --- resources.jar DELETED --- |