org.apache.velocity.texen.ant
Class TexenTask

java.lang.Object
  |
  +--org.apache.tools.ant.Task
        |
        +--org.apache.velocity.texen.ant.TexenTask

public class TexenTask
extends org.apache.tools.ant.Task

An ant task for generating output by using Velocity

Version:
$Id: TexenTask.java,v 1.21 2001/03/23 18:10:03 jvanzyl Exp $
Author:
Jason van Zyl

Field Summary
protected  Configuration contextProperties
          These are properties that are fed into the initial context from a properties file.
protected  java.lang.String controlTemplate
          This is the control template that governs the output.
protected  java.lang.String outputDirectory
          This is where texen will place all the output that is a product of the generation process.
protected  java.lang.String outputFile
          This is the file where the generated text will be placed.
protected  java.lang.String templatePath
          This is where Velocity will look for templates using the file template loader.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, project, target, taskName, taskType, wrapper
 
Constructor Summary
TexenTask()
           
 
Method Summary
 void execute()
          Execute the input script with WM
 Configuration getContextProperties()
          Set the context properties that will be fed into the initial context be the generating process starts.
 java.lang.String getControlTemplate()
          Get the control template for the generating process.
 java.lang.String getOutputDirectory()
          Get the output directory.
 java.lang.String getOutputFile()
          Get the output file for the generation process.
 java.lang.String getTemplatePath()
          Get the path where Velocity will look for templates using the file template loader.
 Context initControlContext()
           
protected  void populateInitialContext(Context context)
          Place some useful object in the initial context.
 void setContextProperties(java.io.File file)
          Set the context properties that will be fed into the initial context be the generating process starts.
 void setControlTemplate(java.lang.String controlTemplate)
          Get the control template for the generating process.
 void setOutputDirectory(java.io.File outputDirectory)
          Set the output directory.
 void setOutputFile(java.lang.String outputFile)
          Set the output file for the generation process.
 void setTemplatePath(java.io.File templatePath)
          Set the path where Velocity will look for templates using the file template loader.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setProject, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

controlTemplate

protected java.lang.String controlTemplate
This is the control template that governs the output. It may or may not invoke the services of worker templates.

templatePath

protected java.lang.String templatePath
This is where Velocity will look for templates using the file template loader.

outputDirectory

protected java.lang.String outputDirectory
This is where texen will place all the output that is a product of the generation process.

outputFile

protected java.lang.String outputFile
This is the file where the generated text will be placed.

contextProperties

protected Configuration contextProperties
These are properties that are fed into the initial context from a properties file. This is simply a convenient way to set some values that you wish to make available in the context. These values are not critical, like the template path or or output path, but allow a convenient way to set a value that may be specific to a particular generation task. For example, if you are generating scripts to allow user to automatically create a database, then you might want the $databaseName to be placed in the initial context so that it is available in a script that might look something like the following: #!bin/sh echo y | mysqladmin create $databaseName The value of $databaseName isn't critical to output, and you obviously don't want to change the ant task to simply take a database name. So initial context values can be set with properties file.
Constructor Detail

TexenTask

public TexenTask()
Method Detail

setControlTemplate

public void setControlTemplate(java.lang.String controlTemplate)
Get the control template for the generating process.

getControlTemplate

public java.lang.String getControlTemplate()
Get the control template for the generating process.

setTemplatePath

public void setTemplatePath(java.io.File templatePath)
Set the path where Velocity will look for templates using the file template loader.

getTemplatePath

public java.lang.String getTemplatePath()
Get the path where Velocity will look for templates using the file template loader.

setOutputDirectory

public void setOutputDirectory(java.io.File outputDirectory)
Set the output directory. It will be created if it doesn't exist.

getOutputDirectory

public java.lang.String getOutputDirectory()
Get the output directory.

setOutputFile

public void setOutputFile(java.lang.String outputFile)
Set the output file for the generation process.

getOutputFile

public java.lang.String getOutputFile()
Get the output file for the generation process.

setContextProperties

public void setContextProperties(java.io.File file)
Set the context properties that will be fed into the initial context be the generating process starts.

getContextProperties

public Configuration getContextProperties()
Set the context properties that will be fed into the initial context be the generating process starts.

initControlContext

public Context initControlContext()

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute the input script with WM
Overrides:
execute in class org.apache.tools.ant.Task

populateInitialContext

protected void populateInitialContext(Context context)
Place some useful object in the initial context.
Parameters:
Context - initial context


Copyright © 2001 Apache Software Foundation. All Rights Reserved.