org.apache.lenya.cms.task
Class AntTask
java.lang.Object
org.apache.lenya.cms.task.AbstractTask
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:
publication-id
: the publication ID
buildfile (optional)
: the location of the build file
relative to the publication directory. If this parameter is
not provided, the file is loaded from DEFAULT_BUILDFILE
.
target (optional)
: the build target. If this parameter
is not provided, the default target is executed.
ant.*
: the command-line parameters for Ant (not implemented yet!)
properties.*
: the project properties
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AntTask
public AntTask()
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 servletcontextPrefix
- The context-prefix of the servletpublicationId
- The publication-idpublicationDirectory
- The directory of the publicationlogFile
- 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.