com.finalist.ant.tasks.docbook
Class AbstractDocBookTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bycom.finalist.ant.tasks.docbook.AbstractDocBookTask
Direct Known Subclasses:
HTMLTask, PDFTask

public abstract class AbstractDocBookTask
extends org.apache.tools.ant.Task

AbstractDocBookTask.java This Abstract class represents a DocBook Task other classes which implements this class must inplement the execute methode to execute the task. The class can only have a child which is a XSLTParameterTask and has the name of "param" (This is a bad behaviour of ant) There are tree attributes that need to be set: docbookfile representing the xml file which contains the docbook file to be transformed xslfile the xsl file which will be used during transformation outputdir in this directory the output will be generated

Version:
$Revision: 1.1 $
Author:
Stefan Lenselink

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
AbstractDocBookTask()
           
 
Method Summary
 void addConfiguredFileset(org.apache.tools.ant.types.FileSet fileSet)
          This method addes a fileset to the current task, the files specifyed will be used for generation
 void addConfiguredParam(XSLTParameterTask task)
          Add a nested XSLTParameterTask to this task Watch it!!
protected  void doSetParameter(javax.xml.transform.Transformer transformer)
          This method sets the parameters on the given transfromer
abstract  void execute()
          This abstract method must be implemented by a implementing class to preform the execution of the task
protected  java.lang.String getBaseDir()
          This method returns the baseDir of the current docbook file Caution!
protected  java.lang.String getDocbookfile()
          Getter method for the docbookfile attribute
protected  int getNumberOfCycles()
          This method returns the total number of Cycles that will be done
protected  java.io.File getOutputFile(java.lang.String extention)
          This method returns a File to write the transformed document to
protected  javax.xml.transform.Transformer getTransformer()
          This method return the Transformer that need to be used
 void setDocbookfile(java.lang.String docbookfile)
          The setter method for the docbookfile attribute
 void setOutputdir(java.io.File outputdir)
          The setter method for the outputdir attribute
 void setVersionextention(java.lang.String versionextention)
          Setter method for the versionExtention
 void setXslfile(java.io.File xslfile)
          The setter method for the xslfile attribute
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDocBookTask

public AbstractDocBookTask()
Method Detail

setDocbookfile

public void setDocbookfile(java.lang.String docbookfile)
The setter method for the docbookfile attribute

Parameters:
docbookfile - the path of the file to be used as the docbook source file

setXslfile

public void setXslfile(java.io.File xslfile)
The setter method for the xslfile attribute

Parameters:
xslfile - the xsl file to use to transform the docbookfile

setOutputdir

public void setOutputdir(java.io.File outputdir)
The setter method for the outputdir attribute

Parameters:
outputdir - the directory to put the output

addConfiguredParam

public void addConfiguredParam(XSLTParameterTask task)
Add a nested XSLTParameterTask to this task Watch it!! the name of the taskdef MUST be param and can't be changed!!! example: If you need to change the name of the taskdef change the method in the code as well This is because of the design of ant, can't help it. implementing the TaskContainer interface and implement the addTask(Task task) method wouldn't help because a other classloader will be used to load XSLTParameterTask and so It can't be CAST

Parameters:
task - the XSLTParameterTask containing the parameters used for transformation

addConfiguredFileset

public void addConfiguredFileset(org.apache.tools.ant.types.FileSet fileSet)
This method addes a fileset to the current task, the files specifyed will be used for generation

Parameters:
fileSet - the FileSet to use

execute

public abstract void execute()
                      throws org.apache.tools.ant.BuildException
This abstract method must be implemented by a implementing class to preform the execution of the task

Throws:
org.apache.tools.ant.BuildException
See Also:
Task.execute()

getDocbookfile

protected java.lang.String getDocbookfile()
Getter method for the docbookfile attribute

Returns:
the docbook source file specifyed with the docbookfile attribute

getOutputFile

protected java.io.File getOutputFile(java.lang.String extention)
This method returns a File to write the transformed document to

Parameters:
extention - the extention which the generated file should have (normaly html or pdf)
Returns:
the full path to the file which need to be generated

getTransformer

protected javax.xml.transform.Transformer getTransformer()
                                                  throws javax.xml.transform.TransformerConfigurationException
This method return the Transformer that need to be used

Returns:
the Transformer used
Throws:
javax.xml.transform.TransformerConfigurationException - when a TransformerConfigurationException occours a TransformerConfigurationException will be thrown

getNumberOfCycles

protected int getNumberOfCycles()
This method returns the total number of Cycles that will be done

Returns:
the number of cycles

getBaseDir

protected java.lang.String getBaseDir()
This method returns the baseDir of the current docbook file Caution! the getOutputFile must be called first to prevent null returning

Returns:
the baseDir of the Docbook file
See Also:
getOutputFile(String)

doSetParameter

protected void doSetParameter(javax.xml.transform.Transformer transformer)
This method sets the parameters on the given transfromer

Parameters:
transformer - the transformer on which the parameters need te be set

setVersionextention

public void setVersionextention(java.lang.String versionextention)
Setter method for the versionExtention



Copyright © 2003-2004 SourceForge. All Rights Reserved.