org.ceryle.wiki.filters
Class MacronFilter

java.lang.Object
  extended by com.ecyrd.jspwiki.filters.BasicPageFilter
      extended by org.ceryle.wiki.filters.MacronFilter
All Implemented Interfaces:
PageFilter

public class MacronFilter
extends BasicPageFilter

MacronFilter is a simple JSPWiki filter that replaces ten (five upper and five lowercase) vowel codes with macron'd Unicode equivalents, using a caret (^) character following the vowel.

In some applications there has been an existing use of the tilde character (^) following a vowel but this is unfortunately used by JSPWiki to escape a wiki word from being recognized as a link. The caret shouldn't be a conflict since it has no current use within JSPWiki.

Installation

The jar file containing the filter must be available in your wiki's path, generally in $WIKIHOME/WEB-INF/lib/. Follow the JSPWiki recommendations on inclusion of a $WIKIHOME/WEB-INF/lib/filters.xml file in your wiki installation. 'filters.xml' should contain a <filter> element corresponding to each installed filter. Each <filter> element contains a <class> element containing the respective filter's class, e.g.:

  <?xml version="1.0"?>
  <pagefilters>
     <filter>
       <class>org.ceryle.wiki.filters.MacronFilter</class>
     </filter>
  </pagefilters>
 
This filter might be considered a bit slow since it must do a search and replace over an entire text ten times.

Author:
Murray Altheim

Field Summary
 
Fields inherited from class com.ecyrd.jspwiki.filters.BasicPageFilter
m_engine
 
Constructor Summary
MacronFilter()
           
 
Method Summary
 String postTranslate(WikiContext wikiContext, String content)
           
 String preTranslate(WikiContext wikiContext, String content)
           
 
Methods inherited from class com.ecyrd.jspwiki.filters.BasicPageFilter
destroy, initialize, postSave, preSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacronFilter

public MacronFilter()
Method Detail

preTranslate

public String preTranslate(WikiContext wikiContext,
                           String content)
Specified by:
preTranslate in interface PageFilter
Overrides:
preTranslate in class BasicPageFilter

postTranslate

public String postTranslate(WikiContext wikiContext,
                            String content)
Specified by:
postTranslate in interface PageFilter
Overrides:
postTranslate in class BasicPageFilter


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.