[hmath-commits] org.hmath.server/WEB-INF/src/org/hartmath/server/filter CachedWikipediaParser.java,1
Status: Pre-Alpha
Brought to you by:
jsurfer
From: Klaus H. <js...@us...> - 2004-05-02 12:43:15
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32636/WEB-INF/src/org/hartmath/server/filter Modified Files: CachedWikipediaParser.java CachedWikipediaFilter.java Log Message: misc changes Index: CachedWikipediaFilter.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter/CachedWikipediaFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CachedWikipediaFilter.java 25 Apr 2004 18:50:07 -0000 1.1 --- CachedWikipediaFilter.java 2 May 2004 12:43:07 -0000 1.2 *************** *** 16,20 **** * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ - package org.hartmath.server.filter; --- 16,19 ---- *************** *** 30,35 **** import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ! import org.hartmath.server.cache.DummyCachedPage; ! import org.hartmath.server.cache.ICachedPage; import org.hartmath.server.taglib.MathSniffer; import org.radeox.api.engine.ImageRenderEngine; --- 29,34 ---- import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ! import org.hartmath.server.cache.DummyCachedPageGenerator; ! import org.hartmath.server.cache.ICachedPageGenerator; import org.hartmath.server.taglib.MathSniffer; import org.radeox.api.engine.ImageRenderEngine; *************** *** 50,56 **** /** * Parse the input and transform it for the most used wiki patterns */ public class CachedWikipediaFilter extends FilterSupport implements CacheFilter, IWikipediaFilterConstants { ! public static final DummyCachedPage DUMMY_CACHED_PAGE = new DummyCachedPage(); public class InvalidInputException extends Exception { --- 49,59 ---- /** * Parse the input and transform it for the most used wiki patterns + * + * Parts of the Wiki Syntax are borrowed from Wikipedia.org and SnipSnap.org + * + * @see org.hartmath.server.filter.CachedWikipediaParser */ public class CachedWikipediaFilter extends FilterSupport implements CacheFilter, IWikipediaFilterConstants { ! public static final DummyCachedPageGenerator DUMMY_CACHED_PAGE = new DummyCachedPageGenerator(); public class InvalidInputException extends Exception { *************** *** 423,431 **** } ! public String filter(String input, FilterContext context, MacroRepository macros, ICachedPage compiler, int recursionLevel) { try { if (++recursionLevel > RECURSION_LIMIT) { String error = "<span class=\"error\">Error - recursion limit exceeded.</span>"; ! compiler.compileHTML(error); return error; } --- 426,434 ---- } ! public String filter(String input, FilterContext context, MacroRepository macros, ICachedPageGenerator compiler, int recursionLevel) { try { if (++recursionLevel > RECURSION_LIMIT) { String error = "<span class=\"error\">Error - recursion limit exceeded.</span>"; ! compiler.addHTML(error); return error; } *************** *** 447,451 **** } String error = "<span class=\"error\">Error in Parser.</span>"; ! compiler.compileHTML(error); return error; } --- 450,454 ---- } String error = "<span class=\"error\">Error in Parser.</span>"; ! compiler.addHTML(error); return error; } *************** *** 454,458 **** String input, FilterContext context, ! ICachedPage compiler, MacroRepository macros, int recursionLevel) { --- 457,461 ---- String input, FilterContext context, ! ICachedPageGenerator compiler, MacroRepository macros, int recursionLevel) { Index: CachedWikipediaParser.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter/CachedWikipediaParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CachedWikipediaParser.java 25 Apr 2004 18:50:07 -0000 1.1 --- CachedWikipediaParser.java 2 May 2004 12:43:07 -0000 1.2 *************** *** 1,6 **** /* ! * Created on 21.04.2004 * ! * To change the template for this generated file go to Window - Preferences - Java - Code Generation - Code and Comments */ package org.hartmath.server.filter; --- 1,18 ---- /* ! * This file is part of the "HMath MathML BLOG/Wiki Engine". * [...1633 lines suppressed...] ! fResultBufferHeader.append("<ol>"); createToC((ArrayList) toc.get(i)); ! fResultBufferHeader.append("</ol>"); } else { ! fResultBufferHeader.append(toc.get(i)); } } *************** *** 1881,1885 **** private void unexpectedTag(String tag) { ! fResult.append("<div class=\"error\">Unexpected end for tag: <" + tag + "></div>"); } --- 1933,1937 ---- private void unexpectedTag(String tag) { ! fResultBuffer.append("<div class=\"error\">Unexpected end for tag: <" + tag + "></div>"); } |