org.tm4j.vtl
Interface TM4JVelocityConfiguration

All Known Implementing Classes:
TM4JVelocityConfigurationBase, TM4JXMLVelocityConfiguration

public interface TM4JVelocityConfiguration


Nested Class Summary
static class TM4JVelocityConfiguration.ConfigurationScope
           
 
Field Summary
static TM4JVelocityConfiguration.ConfigurationScope SCOPE_INSTANCES
           
static TM4JVelocityConfiguration.ConfigurationScope SCOPE_SELF
           
static TM4JVelocityConfiguration.ConfigurationScope SCOPE_SUBCLASSES
           
 
Method Summary
 LoadableTM getLoadable(java.lang.String topicMapName)
          Returns the LoadableTM implementation that represents the interface to load or unload the specified topic map
 java.lang.String[] getLoadables()
           
 PageInfo getPageInfo(org.tm4j.topicmap.TopicMap tm, java.lang.String piClass)
           
 RenderInfo getRenderInfo(org.tm4j.topicmap.Topic topic)
          Returns the rendering information for the specified topic.
 java.lang.String getTemplateAndPageInfo(org.tm4j.topicmap.Topic t, org.apache.velocity.context.Context ctxt)
          Processes the configuration to find the PageInfo implementation to extract context information for the specified topic and the template to use to render the topic.
 void setUpContext(org.apache.velocity.context.Context ctxt, java.io.File baseDir)
          Sets up the global application context which contains information about the providers, loadable topic maps and the default pre-configured helper objects.
 void topicmapLoaded(org.tm4j.topicmap.TopicMapProvider provider, java.lang.String tmName, org.tm4j.topicmap.TopicMap tm)
          Invoked when the application loads a new topic map.
 void topicmapUnloaded(org.tm4j.topicmap.TopicMapProvider provider, java.lang.String tmName, org.tm4j.topicmap.TopicMap tm)
          Invoked when the application unloads a topic map.
 

Field Detail

SCOPE_SELF

public static final TM4JVelocityConfiguration.ConfigurationScope SCOPE_SELF

SCOPE_INSTANCES

public static final TM4JVelocityConfiguration.ConfigurationScope SCOPE_INSTANCES

SCOPE_SUBCLASSES

public static final TM4JVelocityConfiguration.ConfigurationScope SCOPE_SUBCLASSES
Method Detail

setUpContext

public void setUpContext(org.apache.velocity.context.Context ctxt,
                         java.io.File baseDir)
                  throws FactoryInitialisationException
Sets up the global application context which contains information about the providers, loadable topic maps and the default pre-configured helper objects.

Parameters:
ctxt - the Velocity Context to be loaded with information about providers, loadable topic maps and with pre-configured helper objects.
baseDir - the base directory to use when resolving paths in the configuration file
Throws:
FactoryInitialisationException

getTemplateAndPageInfo

public java.lang.String getTemplateAndPageInfo(org.tm4j.topicmap.Topic t,
                                               org.apache.velocity.context.Context ctxt)
Processes the configuration to find the PageInfo implementation to extract context information for the specified topic and the template to use to render the topic.

Parameters:
t - the topic to be rendered
ctxt - the Velocity context into which information extracted by the PageInfo for the topic should be placed.
Returns:
the name of the template to be used to render the topic.

topicmapLoaded

public void topicmapLoaded(org.tm4j.topicmap.TopicMapProvider provider,
                           java.lang.String tmName,
                           org.tm4j.topicmap.TopicMap tm)
Invoked when the application loads a new topic map. The implementation of this method can be used to ensure that PageInfo objects are created for the topic map in question.


topicmapUnloaded

public void topicmapUnloaded(org.tm4j.topicmap.TopicMapProvider provider,
                             java.lang.String tmName,
                             org.tm4j.topicmap.TopicMap tm)
Invoked when the application unloads a topic map. The implementation of this method can be used to free up the PageInfo objects created when the topic map was loaded.


getLoadables

public java.lang.String[] getLoadables()

getLoadable

public LoadableTM getLoadable(java.lang.String topicMapName)
Returns the LoadableTM implementation that represents the interface to load or unload the specified topic map

Parameters:
topicMapName - the symbolic name assigned to the topic map in the configuration file.
Returns:
the LoadableTM implementation that represents the topic map identified by topicMapName

getRenderInfo

public RenderInfo getRenderInfo(org.tm4j.topicmap.Topic topic)
Returns the rendering information for the specified topic. This consists of the name of the template to use to render the topic and the PageInfo implementation used to extract a bean from the topic.

Parameters:
topic -
Returns:
A RenderInfo object wrapping the name of the page information extractor class and the template name

getPageInfo

public PageInfo getPageInfo(org.tm4j.topicmap.TopicMap tm,
                            java.lang.String piClass)