NVelocity.Http
Class NVelocityHandler

Field Summary
string CONTENT_TYPE
System.Web.HttpContext context
string CONTEXT
string DEFAULT_CONTENT_TYPE
string DEFAULT_OUTPUT_ENCODING
string pathTranslated
string REQUEST
string requestType
string RESPONSE
string url

Fields inherited from class NVelocity.Http.HandlerSkeleton
toolboxManager

Constructor Summary
NVelocityHandler()
        Initializes a new instance of the NVelocityHandler class.

Property Summary
bool IsReusable
         Implement the IHttpHandler interface method, return true because the class is poolable

Method Summary
NVelocity.Context.IContext CreateContext(System.Web.HttpContext context)
void Error(System.Web.HttpContext context, System.Exception cause)
NVelocity.Template GetTemplate(string name, string encoding)
         Retrieves the requested template with the specified character encoding.
NVelocity.Template GetTemplate(string name)
         Retrieves the requested template.
NVelocity.Template HandleRequest(System.Web.HttpContext context, NVelocity.Context.IContext ctx)
void Init(System.Web.HttpContext context, string requestType, string url, string pathTranslated)
         Implementation of IHttpHandler method, called by container upon loading (is Isreusable returns true, instances may be pooled)
void MergeTemplate(NVelocity.Template template, NVelocity.Context.IContext ctx, System.IO.TextWriter response)
         merges the template with the context. Only override this if you really, really really need to. (And don't call us with questions if it breaks :)
void ProcessRequest(System.Web.HttpContext context)
         Handles all requests
void RequestCleanup(System.Web.HttpContext context, NVelocity.Context.IContext ctx)
         cleanup routine called at the end of the request processing sequence allows a derived class to do resource cleanup or other end of process cycle tasks
void SetContentType(System.Web.HttpContext context)
         Sets the content type of the response. This is available to be overriden by a derived class. The default implementation is : response.setContentType( defaultContentType ); where defaultContentType is set to the value of the default.contentType property, or "text/html" if that is not set.

Methods inherited from class NVelocity.Http.HandlerSkeleton
InitVelocity, LoadConfiguration, LoadToolbox

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

CONTENT_TYPE

public string CONTENT_TYPE


context

protected System.Web.HttpContext context


CONTEXT

public string CONTEXT


DEFAULT_CONTENT_TYPE

public string DEFAULT_CONTENT_TYPE


DEFAULT_OUTPUT_ENCODING

public string DEFAULT_OUTPUT_ENCODING


pathTranslated

protected string pathTranslated


REQUEST

public string REQUEST


requestType

protected string requestType


RESPONSE

public string RESPONSE


url

protected string url

Constructor Detail

NVelocityHandler

protected NVelocityHandler()

Initializes a new instance of the NVelocityHandler class.

Property Detail

IsReusable

public bool IsReusable

Implement the IHttpHandler interface method, return true because the class is poolable

Method Detail

CreateContext

protected NVelocity.Context.IContext CreateContext(System.Web.HttpContext context)


Error

protected void Error(System.Web.HttpContext context,
                     System.Exception cause)


GetTemplate

public NVelocity.Template GetTemplate(string name,
                                      string encoding)

Retrieves the requested template with the specified character encoding.

Parameters:
name - The file name of the template to retrieve relative to the template root.
encoding - encoding the character encoding of the template
Returns:
The requested template.

GetTemplate

public NVelocity.Template GetTemplate(string name)

Retrieves the requested template.

Parameters:
name - The file name of the template to retrieve relative to the template root.
Returns:
teh requested template

HandleRequest

protected NVelocity.Template HandleRequest(System.Web.HttpContext context,
                                           NVelocity.Context.IContext ctx)


Init

public void Init(System.Web.HttpContext context,
                 string requestType,
                 string url,
                 string pathTranslated)

Implementation of IHttpHandler method, called by container upon loading (is Isreusable returns true, instances may be pooled)

Parameters:
context -
requestType -
url -
pathTranslated -

MergeTemplate

protected void MergeTemplate(NVelocity.Template template,
                             NVelocity.Context.IContext ctx,
                             System.IO.TextWriter response)

merges the template with the context. Only override this if you really, really really need to. (And don't call us with questions if it breaks :)

Parameters:
template - template object returned by the handleRequest() method
ctx - context created by the CreateContext() method
response - TextWriter to write to (i.e. Response.Output)

ProcessRequest

public void ProcessRequest(System.Web.HttpContext context)

Handles all requests

Parameters:
context - HttpContext for current request

RequestCleanup

protected void RequestCleanup(System.Web.HttpContext context,
                              NVelocity.Context.IContext ctx)

cleanup routine called at the end of the request processing sequence allows a derived class to do resource cleanup or other end of process cycle tasks

Parameters:
context - HttpContext passed from client
ctx - velocity context create by the CreateContext() method

SetContentType

protected void SetContentType(System.Web.HttpContext context)

Sets the content type of the response. This is available to be overriden by a derived class. The default implementation is : response.setContentType( defaultContentType ); where defaultContentType is set to the value of the default.contentType property, or "text/html" if that is not set.

Parameters:
context - HttpContext for current request