C# Class Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine

Implements a view engine using the popular Velocity syntax.

For details on the syntax, check the VTL Reference Guide http://jakarta.apache.org/velocity/docs/vtl-reference-guide.html

Inheritance: ViewEngineBase, IInitializable
Afficher le fichier Open project: nats/castle-1.0.3-mono

Protected Properties

Свойство Type Description
velocity NVelocity.App.VelocityEngine

Méthodes publiques

Méthode Description
CreateJSGenerator ( IRailsEngineContext context ) : object
GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void
HasTemplate ( String templateName ) : bool

Evaluates whether the specified template exists.

Initialize ( ) : void
NVelocityViewEngine ( ) : NVelocity

Creates a new NVelocityViewEngine instance.

Process ( IRailsEngineContext context, Controller controller, String viewName ) : void

Processes the specified context.

Process ( TextWriter output, IRailsEngineContext context, Controller controller, String viewName ) : void

Processes the view - using the templateName to obtain the correct template and writes the results to the System.TextWriter. No layout is applied!

ProcessContents ( IRailsEngineContext context, Controller controller, String contents ) : void
ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void
Service ( IServiceProvider provider ) : void

Méthodes protégées

Méthode Description
BeforeApplyingLayout ( string layout, string &contents, Controller controller, IContext ctx, IRailsEngineContext context ) : void
BeforeMerge ( VelocityEngine velocityEngine, Template template, IContext context ) : void
InitializeVelocityProperties ( ExtendedProperties props ) : void

Initializes basic velocity properties. The main purpose of this method is to allow this logic to be overrided.

RenderLayout ( string layoutName, string contents, IContext ctx, IRailsEngineContext context, TextWriter output ) : void
ResolveJSTemplateName ( string templateName ) : string

Resolves the template name into a velocity JS template file name.

ResolveLayoutTemplateName ( string templateName ) : string

Resolves the layout template name into a velocity template file name.

ResolveTemplateName ( string templateName ) : string

Resolves the template name into a velocity template file name.

Private Methods

Méthode Description
CreateContext ( IRailsEngineContext context, Controller controller ) : IContext
LoadMacros ( ExtendedProperties props ) : void
ProcessLayout ( String contents, Controller controller, IContext ctx, IRailsEngineContext context ) : void
SendErrorDetails ( Exception ex, TextWriter writer ) : void

Method Details

BeforeApplyingLayout() protected méthode

protected BeforeApplyingLayout ( string layout, string &contents, Controller controller, IContext ctx, IRailsEngineContext context ) : void
layout string
contents string
controller Controller
ctx IContext
context IRailsEngineContext
Résultat void

BeforeMerge() protected méthode

protected BeforeMerge ( VelocityEngine velocityEngine, Template template, IContext context ) : void
velocityEngine NVelocity.App.VelocityEngine
template NVelocity.Template
context IContext
Résultat void

CreateJSGenerator() public méthode

public CreateJSGenerator ( IRailsEngineContext context ) : object
context IRailsEngineContext
Résultat object

GenerateJS() public méthode

public GenerateJS ( TextWriter output, IRailsEngineContext context, Controller controller, string templateName ) : void
output System.IO.TextWriter
context IRailsEngineContext
controller Controller
templateName string
Résultat void

HasTemplate() public méthode

Evaluates whether the specified template exists.
public HasTemplate ( String templateName ) : bool
templateName String
Résultat bool

Initialize() public méthode

public Initialize ( ) : void
Résultat void

InitializeVelocityProperties() protected méthode

Initializes basic velocity properties. The main purpose of this method is to allow this logic to be overrided.
protected InitializeVelocityProperties ( ExtendedProperties props ) : void
props Commons.Collections.ExtendedProperties The collection to populate.
Résultat void

NVelocityViewEngine() public méthode

Creates a new NVelocityViewEngine instance.
public NVelocityViewEngine ( ) : NVelocity
Résultat NVelocity

Process() public méthode

Processes the specified context.
public Process ( IRailsEngineContext context, Controller controller, String viewName ) : void
context IRailsEngineContext The context.
controller Controller The controller.
viewName String Name of the view.
Résultat void

Process() public méthode

Processes the view - using the templateName to obtain the correct template and writes the results to the System.TextWriter. No layout is applied!
public Process ( TextWriter output, IRailsEngineContext context, Controller controller, String viewName ) : void
output System.IO.TextWriter
context IRailsEngineContext
controller Controller
viewName String
Résultat void

ProcessContents() public méthode

public ProcessContents ( IRailsEngineContext context, Controller controller, String contents ) : void
context IRailsEngineContext
controller Controller
contents String
Résultat void

ProcessPartial() public méthode

public ProcessPartial ( TextWriter output, IRailsEngineContext context, Controller controller, string partialName ) : void
output System.IO.TextWriter
context IRailsEngineContext
controller Controller
partialName string
Résultat void

RenderLayout() protected méthode

protected RenderLayout ( string layoutName, string contents, IContext ctx, IRailsEngineContext context, TextWriter output ) : void
layoutName string
contents string
ctx IContext
context IRailsEngineContext
output System.IO.TextWriter
Résultat void

ResolveJSTemplateName() protected méthode

Resolves the template name into a velocity JS template file name.
protected ResolveJSTemplateName ( string templateName ) : string
templateName string
Résultat string

ResolveLayoutTemplateName() protected méthode

Resolves the layout template name into a velocity template file name.
protected ResolveLayoutTemplateName ( string templateName ) : string
templateName string
Résultat string

ResolveTemplateName() protected méthode

Resolves the template name into a velocity template file name.
protected ResolveTemplateName ( string templateName ) : string
templateName string
Résultat string

Service() public méthode

public Service ( IServiceProvider provider ) : void
provider IServiceProvider
Résultat void

Property Details

velocity protected_oe property

protected VelocityEngine,NVelocity.App velocity
Résultat NVelocity.App.VelocityEngine