org.apache.turbine.services.freemarker
Interface FreeMarkerService

All Superinterfaces:
Initable, Service
All Known Implementing Classes:
TurbineFreeMarkerService

public interface FreeMarkerService
extends Service

Implementations of the FreeMarkerService interface.

Version:
$Id: FreeMarkerService.java,v 1.2 2002/06/07 21:22:45 henning Exp $
Author:
John D. McNally

Field Summary
static java.lang.String CONTEXT
          Deprecated. The name used as a key in TurbineInfo when storing the Context.
static java.lang.String SERVICE_NAME
          Deprecated. The name used to specify this service in TurbineResources.properties.
 
Method Summary
 java.lang.String getBasePath()
          Deprecated. Gets the base path for the FreeMarker templates.
 freemarker.template.Template getCachedTemplate(java.lang.String templateName)
          Deprecated. Return a FreeMarker template from the cache.
 freemarker.template.SimpleHash getContext()
          Deprecated. Create a context needed by the FreeMarker template.
 freemarker.template.SimpleHash getContext(RunData data)
          Deprecated. Create a context from the RunData object.
 freemarker.template.SimpleHash getContext(javax.servlet.ServletRequest req)
          Deprecated. Create a context needed by the FreeMarker template.
 freemarker.template.Template getNonCachedTemplate(java.lang.String templateName)
          Deprecated. Return a FreeMarker template.
 java.lang.String handleRequest(freemarker.template.SimpleHash context, java.lang.String templateName, boolean cache)
          Deprecated. Process the request and fill in the template with the values you set in the WebContext.
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
Deprecated. 
The name used to specify this service in TurbineResources.properties.

CONTEXT

public static final java.lang.String CONTEXT
Deprecated. 
The name used as a key in TurbineInfo when storing the Context.
Method Detail

getContext

public freemarker.template.SimpleHash getContext()
Deprecated. 
Create a context needed by the FreeMarker template. This method just returns an SimpleHash with the request parameters copied into a model called request.
Returns:
SimpleHash which can be used as the model for a template.

getContext

public freemarker.template.SimpleHash getContext(javax.servlet.ServletRequest req)
Deprecated. 
Create a context needed by the FreeMarker template. This method just returns an SimpleHash with the request parameters copied into a model called request.
Parameters:
req - A ServletRequest.
Returns:
SimpleHash which can be used as the model for a template.

getContext

public freemarker.template.SimpleHash getContext(RunData data)
Deprecated. 
Create a context from the RunData object. Values found in RunData are copied into the modelRoot under similar names as they can be found in RunData. e.g. data.serverName, data.parameters.form_field_name data.acl.permissions.can_write_file. Some default links are also made available under links.
Parameters:
data - The Turbine RunData object.
Returns:
a SimpleHash populated with RunData data.

handleRequest

public java.lang.String handleRequest(freemarker.template.SimpleHash context,
                                      java.lang.String templateName,
                                      boolean cache)
                               throws TurbineException
Deprecated. 
Process the request and fill in the template with the values you set in the WebContext.
Parameters:
context - A SimpleHash with the context.
templateName - A String with the filename of the template.
cache - True if the parsed template should be cached.
Returns:
The processed template as a String.
Throws:
TurbineException - Any exception trown while processing will be wrapped into a TurbineException and rethrown.

getBasePath

public java.lang.String getBasePath()
Deprecated. 
Gets the base path for the FreeMarker templates.
Returns:
The base path for the FreeMarker templates.

getNonCachedTemplate

public freemarker.template.Template getNonCachedTemplate(java.lang.String templateName)
                                                  throws java.io.IOException
Deprecated. 
Return a FreeMarker template. It will not be added to the cache.
Parameters:
templateName - A String with the name of the template.
Returns:
A Template.
Throws:
IOException, - if there was an I/O problem.

getCachedTemplate

public freemarker.template.Template getCachedTemplate(java.lang.String templateName)
Deprecated. 
Return a FreeMarker template from the cache. If the template has not been cached yet, it will be added to the cache.
Parameters:
templateName - A String with the name of the template.
Returns:
A Template.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.