org.apache.turbine.services.pull
Interface PullService

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

public interface PullService
extends Service

The Pull Service manages the creation of application tools that are available to all templates in a Turbine application. By using the Pull Service you can avoid having to make Screens to populate a context for use in a particular template. The Pull Service creates a set of tools, as specified in the TR.props file. These tools can have global scope, request scope, session scope (i.e. stored in user temp hashmap) or persistent scope (i.e. stored in user perm hashmap) The standard way of referencing these global tools is through the toolbox handle. This handle is typically $toolbox, but can be specified in the TR.props file. So, for example, if you had a UI Manager tool which created a set of UI attributes from a properties file, and one of the properties was 'bgcolor', then you could access this UI attribute with $ui.bgcolor. The identifier that is given to the tool, in this case 'ui', can be specified as well.

Version:
$Id: PullService.java,v 1.1.1.1 2001/08/16 05:09:10 jvanzyl Exp $
Author:
Jason van Zyl

Field Summary
static java.lang.String SERVICE_NAME
          The key under which this service is stored in TurbineServices.
 
Method Summary
 java.lang.String getAbsolutePathToResourcesDirectory()
          Return the absolute path of the resources directory used by application tools.
 org.apache.velocity.context.Context getGlobalContext()
          Get the context containing global tools that will be use as part of the Turbine Pull Model.
 java.lang.String getResourcesDirectory()
          Return the resources directory.
 void populateContext(org.apache.velocity.context.Context context, RunData data)
          Populate the given context with all request, session and persistent scope tools (it is assumed that the context already wraps the global context, and thus already contains the global tools).
 void refreshGlobalTools()
          Refresh the global tools .
 boolean refreshToolsPerRequest()
          Shoud we refresh the tools on each request.
 void releaseTools(org.apache.velocity.context.Context context)
          Release tool instances from the given context to the object pool
 
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
The key under which this service is stored in TurbineServices.
Method Detail

getGlobalContext

public org.apache.velocity.context.Context getGlobalContext()
Get the context containing global tools that will be use as part of the Turbine Pull Model.

populateContext

public void populateContext(org.apache.velocity.context.Context context,
                            RunData data)
Populate the given context with all request, session and persistent scope tools (it is assumed that the context already wraps the global context, and thus already contains the global tools).
Parameters:
context - a Velocity Context to populate
data - a RunData object for request specific data

getAbsolutePathToResourcesDirectory

public java.lang.String getAbsolutePathToResourcesDirectory()
Return the absolute path of the resources directory used by application tools.

getResourcesDirectory

public java.lang.String getResourcesDirectory()
Return the resources directory. This is relative to the webapp context.

refreshGlobalTools

public void refreshGlobalTools()
Refresh the global tools .

refreshToolsPerRequest

public boolean refreshToolsPerRequest()
Shoud we refresh the tools on each request. For development purposes.

releaseTools

public void releaseTools(org.apache.velocity.context.Context context)
Release tool instances from the given context to the object pool
Parameters:
context - a Velocity Context to release tools from


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