org.apache.lenya.cms.ant
Class StaticHTMLExporter

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.lenya.cms.ant.PublicationTask
              extended by org.apache.lenya.cms.ant.StaticHTMLExporter

public class StaticHTMLExporter
extends PublicationTask

Ant task that exports a set of HTML URIs as static HTML files.


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
StaticHTMLExporter()
          Creates a new instance of StaticHTMLExporter
 
Method Summary
 void execute()
          Executes the task.
 void export(java.net.URL serverURI, java.io.File publicationDirectory, java.lang.String exportPath, java.lang.String[] uris, java.lang.String substituteExpression, java.lang.String substituteReplacement)
          Exports a set of URIs as a HTML file.
protected  java.lang.String getExpression()
          Returns the expression in the URI to be replaced.
protected  java.lang.String getPath()
          Returns the path to the exported files.
protected  java.lang.String getReplacement()
          Returns the string in the URI that replaces the expression.
protected  java.net.URL getServer()
          Returns the server URL.
protected  java.lang.String[] getUris()
          Returns the URIs to export.
 void setExpression(java.lang.String expression)
          Sets the expression in the URI to be replaced.
 void setPath(java.lang.String path)
          Sets the path to the exported files.
 void setReplacement(java.lang.String replacement)
          Sets the string in the URI that replaces the expression.
 void setServer(java.lang.String serverURL)
          Sets the server URL.
 void setUris(java.lang.String uris)
          Sets the URIs to export.
 
Methods inherited from class org.apache.lenya.cms.ant.PublicationTask
assertString, getContextPrefix, getPublication, getPublicationDirectory, getPublicationId, getServletContext
 
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
 

Constructor Detail

StaticHTMLExporter

public StaticHTMLExporter()
Creates a new instance of StaticHTMLExporter

Method Detail

getServer

protected java.net.URL getServer()
                          throws java.net.MalformedURLException
Returns the server URL.

Throws:
java.net.MalformedURLException

setServer

public void setServer(java.lang.String serverURL)
Sets the server URL.


getPath

protected java.lang.String getPath()
Returns the path to the exported files.


setPath

public void setPath(java.lang.String path)
Sets the path to the exported files.


getUris

protected java.lang.String[] getUris()
Returns the URIs to export.


setUris

public void setUris(java.lang.String uris)
Sets the URIs to export.


getExpression

protected java.lang.String getExpression()
Returns the expression in the URI to be replaced.


setExpression

public void setExpression(java.lang.String expression)
Sets the expression in the URI to be replaced.


getReplacement

protected java.lang.String getReplacement()
Returns the string in the URI that replaces the expression.


setReplacement

public void setReplacement(java.lang.String replacement)
Sets the string in the URI that replaces the expression.


export

public void export(java.net.URL serverURI,
                   java.io.File publicationDirectory,
                   java.lang.String exportPath,
                   java.lang.String[] uris,
                   java.lang.String substituteExpression,
                   java.lang.String substituteReplacement)
            throws ExportException
Exports a set of URIs as a HTML file.

Parameters:
serverURI - The server to download the file from.
publicationDirectory - The directory of the publication.
exportPath - The path to export the files to (relative to publicationDirectory).
uris - The URIs to export (relative to the publication URI).
substituteExpression - A part of the complete URIs to be substituted.
substituteReplacement - A string to replace substituteExpression.
Throws:
ExportException

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the task.

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


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.