org.barracudamvc.taskdefs
Class GenerateSSIs

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.barracudamvc.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  String excludepattern
           
protected  File file
           
protected  List filesets
           
protected  boolean force
           
protected  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(List fileList)
          process the list of qualified files.
 void setExcludepattern(String excludePattern)
          Specify a pattern of files to be excluded in the touch process (defaults to null)
 void setFile(File file)
          Sets a single source file to copy.
 void setForce(boolean force)
          Force the regeneration of SSIs
 void setTouchpattern(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, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
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 File file

filesets

protected List filesets

touchpattern

protected String touchpattern

excludepattern

protected String excludepattern

force

protected boolean force

verbosity

protected int verbosity
Constructor Detail

GenerateSSIs

public GenerateSSIs()
Method Detail

setFile

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


setTouchpattern

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


setExcludepattern

public void setExcludepattern(String excludePattern)
Specify a pattern of files to be excluded in the touch process (defaults to null)


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.

Throws:
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.

Throws:
org.apache.tools.ant.BuildException

processFiles

protected void processFiles(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 © 2004 BarracudaMVC.org All Rights Reserved.