com.xpn.xwiki.render
Class XWikiVelocityRenderer

java.lang.Object
  extended bycom.xpn.xwiki.render.XWikiVelocityRenderer
All Implemented Interfaces:
XWikiRenderer

public class XWikiVelocityRenderer
extends java.lang.Object
implements XWikiRenderer


Field Summary
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
XWikiVelocityRenderer()
           
 
Method Summary
static boolean evaluate(org.apache.velocity.context.Context context, java.io.Writer writer, java.lang.String logTag, java.io.InputStream instream)
           
static boolean evaluate(org.apache.velocity.context.Context context, java.io.Writer writer, java.lang.String logTag, java.io.Reader reader)
          Renders the input reader using the context into the output writer.
static java.lang.String evaluate(java.lang.String content, java.lang.String name, org.apache.velocity.VelocityContext vcontext)
           
static java.lang.String evaluate(java.lang.String content, java.lang.String name, org.apache.velocity.VelocityContext vcontext, XWikiContext context)
           
 void flushCache()
           
static org.apache.velocity.VelocityContext prepareContext(XWikiContext context)
           
 java.lang.String render(java.lang.String content, XWikiDocument contentdoc, XWikiDocument doc, XWikiContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Constructor Detail

XWikiVelocityRenderer

public XWikiVelocityRenderer()
Method Detail

render

public java.lang.String render(java.lang.String content,
                               XWikiDocument contentdoc,
                               XWikiDocument doc,
                               XWikiContext context)
Specified by:
render in interface XWikiRenderer

flushCache

public void flushCache()
Specified by:
flushCache in interface XWikiRenderer

prepareContext

public static org.apache.velocity.VelocityContext prepareContext(XWikiContext context)

evaluate

public static java.lang.String evaluate(java.lang.String content,
                                        java.lang.String name,
                                        org.apache.velocity.VelocityContext vcontext)

evaluate

public static java.lang.String evaluate(java.lang.String content,
                                        java.lang.String name,
                                        org.apache.velocity.VelocityContext vcontext,
                                        XWikiContext context)

evaluate

public static boolean evaluate(org.apache.velocity.context.Context context,
                               java.io.Writer writer,
                               java.lang.String logTag,
                               java.io.InputStream instream)
                        throws org.apache.velocity.exception.ParseErrorException,
                               org.apache.velocity.exception.MethodInvocationException,
                               org.apache.velocity.exception.ResourceNotFoundException,
                               java.io.IOException
Throws:
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
org.apache.velocity.exception.ResourceNotFoundException
java.io.IOException

evaluate

public static boolean evaluate(org.apache.velocity.context.Context context,
                               java.io.Writer writer,
                               java.lang.String logTag,
                               java.io.Reader reader)
                        throws org.apache.velocity.exception.ParseErrorException,
                               org.apache.velocity.exception.MethodInvocationException,
                               org.apache.velocity.exception.ResourceNotFoundException,
                               java.io.IOException
Renders the input reader using the context into the output writer. To be used when a template is dynamically constructed, or want to use Velocity as a token replacer.

Parameters:
context - context to use in rendering input string
writer - Writer in which to render the output
logTag - string to be used as the template name for log messages in case of error
reader - Reader containing the VTL to be rendered
Returns:
true if successful, false otherwise. If false, see Velocity runtime log
Throws:
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
org.apache.velocity.exception.ResourceNotFoundException
java.io.IOException
Since:
Velocity v1.1


Copyright 2003 Ludovic Dubost