org.objectledge.templating
Interface Templating

All Known Implementing Classes:
VelocityTemplating

public interface Templating

Templating component.

Version:
$Id: Templating.java,v 1.9 2005/12/20 09:09:31 pablo Exp $
Author:
Pawel Potempski

Method Summary
 TemplatingContext createContext()
          Create an empty TemplatingContext object.
 Template getTemplate(String name)
          Get the specified template.
 String getTemplateEncoding()
          Return the character encoding of the template files.
 void invalidateTemplate(String name)
          Invalidate template in local cache.
 void merge(TemplatingContext context, Reader source, Writer target, String name)
          Merge a template dynamically.
 void merge(TemplatingContext context, Template template, Writer target)
          Merge a template.
 void restart()
          Restart the templating service.
 boolean templateExists(String name)
          Checks if the template with a given name exists.
 

Method Detail

restart

void restart()
             throws ComponentInitializationError,
                    VirtualMachineError,
                    ThreadDeath
Restart the templating service.

Throws:
ComponentInitializationError - if anything goes wrong.
VirtualMachineError - if anything goes wrong.
ThreadDeath - if anything goes wrong.

createContext

TemplatingContext createContext()
Create an empty TemplatingContext object.

Returns:
a Context.

templateExists

boolean templateExists(String name)
Checks if the template with a given name exists.

Parameters:
name - template name.
Returns:
true if exists.

getTemplate

Template getTemplate(String name)
                     throws TemplateNotFoundException
Get the specified template.

Parameters:
name - template name.
Returns:
the template.
Throws:
TemplateNotFoundException - if does not exist.

merge

void merge(TemplatingContext context,
           Reader source,
           Writer target,
           String name)
           throws MergingException
Merge a template dynamically.

Parameters:
context - the templating context.
source - the reader with template source.
target - the writer to write the result.
name - the template name for logging purposes.
Throws:
MergingException - if something goes wrong.

merge

void merge(TemplatingContext context,
           Template template,
           Writer target)
           throws MergingException
Merge a template.

Parameters:
context - the templating context.
template - the template.
target - the writer to write the result.
Throws:
MergingException - if something goes wrong.

getTemplateEncoding

String getTemplateEncoding()
Return the character encoding of the template files.

Returns:
character encoding name.

invalidateTemplate

void invalidateTemplate(String name)
Invalidate template in local cache.

Parameters:
name - the template name.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.