org.enhydra.barracuda.taskdefs
Class GenerateSSIs

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.enhydra.barracuda.taskdefs.GenerateSSIs

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

The purpose of this taskdef is to parse a source file (or fileset) and create ssi's from it. This is useful for the mockup process, when you want to edit your mockups in a single HTML file and then have pieces of it automatically written out to .ssi files.

The tags are valid HTML comments that follow a format that looks like this (where 'foo' can be the name of any ssi file):


...

When the taskdef sees these tags it will write the contents to the target ssi file IFF the source file is newer than the ssi file or force="true".

The taskdef also allows you to specify a touchpattern (defaults to *.shtml); if the taskdef writes ssi files in that directory, it will also update the timestamp on all the files in that directory that match the touch pattern. This is useful for causing XMLC to automatically recompile these files the next time you do a full build.

Author:
Christian Cryder

Field Summary
protected  java.io.File file
           
protected  java.util.List filesets
           
protected  boolean force
           
protected  java.lang.String touchpattern
           
protected  int verbosity
           
 
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
GenerateSSIs()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet set)
          Adds a set of files (nested fileset attribute).
 void execute()
          Performs the copy operation.
protected  void processFiles(java.util.List fileList)
          process the list of qualified files.
 void setFile(java.io.File file)
          Sets a single source file to copy.
 void setForce(boolean force)
          Force the regeneration of SSIs
 void setTouchpattern(java.lang.String touchPattern)
          Specify a pattern of files to be touched if we end up rewriting any .ssi files (this defaults to *.shtml")
 void setVerbose(boolean verbose)
          Used to force listing of all names of copied files.
protected  void validateAttributes()
          Ensure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, 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
 

Field Detail

file

protected java.io.File file

filesets

protected java.util.List filesets

touchpattern

protected java.lang.String touchpattern

force

protected boolean force

verbosity

protected int verbosity
Constructor Detail

GenerateSSIs

public GenerateSSIs()
Method Detail

setFile

public void setFile(java.io.File file)
Sets a single source file to copy.


setTouchpattern

public void setTouchpattern(java.lang.String touchPattern)
Specify a pattern of files to be touched if we end up rewriting any .ssi files (this defaults to *.shtml")


setForce

public void setForce(boolean force)
Force the regeneration of SSIs


setVerbose

public void setVerbose(boolean verbose)
Used to force listing of all names of copied files.


addFileset

public void addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files (nested fileset attribute).


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Performs the copy operation.

Overrides:
execute in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException

validateAttributes

protected void validateAttributes()
                           throws org.apache.tools.ant.BuildException
Ensure we have a consistent and legal set of attributes, and set any internal flags necessary based on different combinations of attributes.

org.apache.tools.ant.BuildException

processFiles

protected void processFiles(java.util.List fileList)
process the list of qualified files. We will read each of these files looking for tags that indicate output should be redirected to a .ssi file. The tags are valid HTML comments that follow a format that looks like this:


...



Copyright © 2001 Enhydra.org