org.apache.lenya.cms.task
Class AntTask

java.lang.Object
  extended by org.apache.lenya.cms.task.AbstractTask
      extended by org.apache.lenya.cms.task.AntTask
All Implemented Interfaces:
org.apache.avalon.framework.parameters.Parameterizable, Task

public class AntTask
extends AbstractTask

An object of this class is used to execute Ant tasks. The task parameters are:


Field Summary
static java.lang.String ANT_PREFIX
           
static java.lang.String BUILDFILE
           
static java.lang.String CONTEXT_PREFIX
           
static java.text.DateFormat dateFormat
           
static java.lang.String DEFAULT_BUILDFILE
           
static java.lang.String LOG_PATH
           
static java.lang.String PARAMETER_LOGFILE
           
static java.lang.String PROPERTIES_PREFIX
           
static java.lang.String PUBLICATION_DIRECTORY
           
static java.lang.String PUBLICATION_ID
           
static java.lang.String SERVLET_CONTEXT_PATH
           
static java.lang.String TARGET
           
 
Fields inherited from interface org.apache.lenya.cms.task.Task
DEFAULT_PREFIX, FAILURE, NAMESPACE, PARAMETER_CONTEXT_PREFIX, PARAMETER_PUBLICATION_ID, PARAMETER_SERVER_PORT, PARAMETER_SERVER_URI, PARAMETER_SERVLET_CONTEXT, SUCCESS
 
Constructor Summary
AntTask()
           
 
Method Summary
 void execute(java.lang.String servletContextPath)
          Execute the task.
 void executeAntTarget(java.lang.String servletContextPath, java.lang.String contextPrefix, java.lang.String publicationId, java.io.File publicationDirectory, java.io.File buildFile, java.lang.String target, java.util.Map arguments, java.util.Map properties, java.io.File logFile)
          Executes an Ant target.
protected  java.io.File getDefaultLogFile(java.io.File publicationDirectory)
          Returns the filename of the logfile to write.
 
Methods inherited from class org.apache.lenya.cms.task.AbstractTask
getParameters, getResult, parameterize, setLabel, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormat

public static final java.text.DateFormat dateFormat

PUBLICATION_DIRECTORY

public static final java.lang.String PUBLICATION_DIRECTORY
See Also:
Constant Field Values

PUBLICATION_ID

public static final java.lang.String PUBLICATION_ID
See Also:
Constant Field Values

SERVLET_CONTEXT_PATH

public static final java.lang.String SERVLET_CONTEXT_PATH
See Also:
Constant Field Values

CONTEXT_PREFIX

public static final java.lang.String CONTEXT_PREFIX
See Also:
Constant Field Values

BUILDFILE

public static final java.lang.String BUILDFILE
See Also:
Constant Field Values

TARGET

public static final java.lang.String TARGET
See Also:
Constant Field Values

ANT_PREFIX

public static final java.lang.String ANT_PREFIX
See Also:
Constant Field Values

PROPERTIES_PREFIX

public static final java.lang.String PROPERTIES_PREFIX
See Also:
Constant Field Values

DEFAULT_BUILDFILE

public static final java.lang.String DEFAULT_BUILDFILE
See Also:
Constant Field Values

LOG_PATH

public static final java.lang.String LOG_PATH

PARAMETER_LOGFILE

public static final java.lang.String PARAMETER_LOGFILE
See Also:
Constant Field Values
Constructor Detail

AntTask

public AntTask()
Method Detail

executeAntTarget

public void executeAntTarget(java.lang.String servletContextPath,
                             java.lang.String contextPrefix,
                             java.lang.String publicationId,
                             java.io.File publicationDirectory,
                             java.io.File buildFile,
                             java.lang.String target,
                             java.util.Map arguments,
                             java.util.Map properties,
                             java.io.File logFile)
                      throws ExecutionException
Executes an Ant target.

Parameters:
buildFile - The build XML file.
target - The name of the target to execute.
arguments - A map mapping the command-line arguments to their values.
properties - A map mapping the project properties to their values.
servletContextPath - The context-path of the servlet
contextPrefix - The context-prefix of the servlet
publicationId - The publication-id
publicationDirectory - The directory of the publication
logFile - The file where the log should go to
Throws:
ExecutionException - if the execution failed

getDefaultLogFile

protected java.io.File getDefaultLogFile(java.io.File publicationDirectory)
Returns the filename of the logfile to write.

Parameters:
publicationDirectory - for which publication the filename of the logfile is requested
Returns:
the file path for the log file

execute

public void execute(java.lang.String servletContextPath)
             throws ExecutionException
Execute the task. All parameters must have been set with parameterize().

Parameters:
servletContextPath - The servlet context path.
Throws:
ExecutionException - when the execution of the task failed.


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