net.larsan.urd.ant
Class WebsiteCompiler

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--net.larsan.urd.ant.WebsiteCompiler

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

Ant task for building the Urd/Norna website. This task uses a univerial template for all pages to compile. It then scans a directry looking for file with suffixes '.body' or 'xbody'. The body type being plain HTML and the xBody type being XML documents.

The XML document processing needs a root directory to find it's stylesheets. For now this will be the build root directory. This might change.

The task then writes the result to an output directory.

For property substitutions the task support a simple nested proprty structure:

    <property name="" value="" />

You can also use the specielized property "dateProperty" which will insert the current date according to a format (simple date format syntax):

    <dateProperty name="" format="" />

Properties are values enclosed in "${xxx}" within the source. There is also a more generalized substitution mechanism that can take any string label and replace it with another value:

    <substitution label="" value="" />

So in short, this task requires the following attibutes:

      'template' - template to use
      'outputDir' - directory to write to
      'inputDir' - directory to scan
 

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Niilsson
See Also:
Compiler

Nested Class Summary
static class WebsiteCompiler.PDate
           
static class WebsiteCompiler.Property
           
static class WebsiteCompiler.Substitute
           
 
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
WebsiteCompiler()
           
 
Method Summary
 WebsiteCompiler.PDate createDateProperty()
           
 WebsiteCompiler.Property createProperty()
           
 WebsiteCompiler.Substitute createSubstitution()
           
 void execute()
          Execute task.
 void setInputDir(java.io.File inputDir)
           
 void setOutputDir(java.io.File outputDir)
           
 void setTemplate(java.io.File template)
           
 
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
 

Constructor Detail

WebsiteCompiler

public WebsiteCompiler()
Method Detail

setTemplate

public void setTemplate(java.io.File template)

setInputDir

public void setInputDir(java.io.File inputDir)

setOutputDir

public void setOutputDir(java.io.File outputDir)

createProperty

public WebsiteCompiler.Property createProperty()

createSubstitution

public WebsiteCompiler.Substitute createSubstitution()

createDateProperty

public WebsiteCompiler.PDate createDateProperty()

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute task. This method fails on io and xml errors, and if input or output directory attributes or the template file are not set.

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