1 2 package org.roller.presentation.velocity.plugins.radeox; 3 4 import org.apache.commons.lang.StringEscapeUtils; 5 import org.apache.commons.logging.Log; 6 import org.apache.commons.logging.LogFactory; 7 import org.apache.velocity.context.Context; 8 import org.radeox.EngineManager; 9 import org.radeox.engine.context.BaseRenderContext; 10 import org.radeox.engine.context.RenderContext; 11 import org.roller.pojos.WeblogEntryData; 12 import org.roller.presentation.RollerRequest; 13 import org.roller.presentation.velocity.PagePlugin; 14 15 18 public class WikiPlugin implements PagePlugin 19 { 20 protected String name = "Radeox Wiki"; 21 protected String description = "Allows use of Radeox formatting to generate HTML. " + 22 "See the <a HREF='http://radeox.org/space/snipsnap-help' target='radeox'>Radeox</a> site."; 23 24 private static Log mLogger = 25 LogFactory.getFactory().getInstance(WikiPlugin.class); 26 27 public WikiPlugin() 28 { 29 mLogger.debug("Radeox WikiPlugin instantiated."); 30 } 31 32 public String toString() { return name; } 33 34 37 public void init(RollerRequest rreq, Context ctx) 38 { 39 ctx.put("wikiRenderer",this); 40 } 41 42 48 public String render( String src ) 49 { 50 RenderContext context = new BaseRenderContext(); 51 return EngineManager.getInstance().render(src, context); 52 } 53 54 public String render( WeblogEntryData entry, boolean skipFlag) 55 { 56 return render( entry.getText() ); 57 } 58 59 public String getName() { return name; } 60 public String getDescription() { return StringEscapeUtils.escapeJavaScript(description); } 61 } 62 | Popular Tags |