net.sf.jasperreports.ant
Class JRAntXmlExportTask

java.lang.Object
  extended by MatchingTask
      extended by net.sf.jasperreports.ant.JRAntXmlExportTask

public class JRAntXmlExportTask
extends MatchingTask

Ant task for batch-exporting generated report files. Works like the built-in javac Ant task.

This task can take the following arguments:

Of these arguments, the src and destdir are required. When this task executes, it will recursively scan the src and destdir looking for generated report files to export. This task makes its export decision based on timestamp and only JRPRINT files that have no corresponding file in the target directory or where the destination report design file is older than the source file will be exported.

Version:
$Id: JRAntXmlExportTask.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Constructor Summary
JRAntXmlExportTask()
           
 
Method Summary
protected  void checkParameters()
          Checks that all required attributes have been set and that the supplied values are valid.
 Path createClasspath()
          Adds a path to the classpath.
 Path createSrc()
          Adds a path for export source.
 void execute()
          Executes the task.
protected  void export()
          Performs the export of the selected report files.
protected  void scanDir(java.io.File srcdir, java.io.File destdir, java.lang.String[] files)
          Scans the directory looking for source files to be exported.
protected  void scanSrc()
          Scans the source directories looking for source files to be exported.
 void setDestdir(java.io.File destdir)
          Sets the destination directory into which the report files should be exported.
 void setSrcdir(Path srcdir)
          Sets the source directories to find the XML report design files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRAntXmlExportTask

public JRAntXmlExportTask()
Method Detail

setSrcdir

public void setSrcdir(Path srcdir)
Sets the source directories to find the XML report design files.

Parameters:
srcdir - source path

createSrc

public Path createSrc()
Adds a path for export source.

Returns:
source path

setDestdir

public void setDestdir(java.io.File destdir)
Sets the destination directory into which the report files should be exported.

Parameters:
destdir - destination directory

createClasspath

public Path createClasspath()
Adds a path to the classpath.

Returns:
classpath to use when updating the report

execute

public void execute()
             throws BuildException
Executes the task.

Throws:
BuildException

checkParameters

protected void checkParameters()
                        throws BuildException
Checks that all required attributes have been set and that the supplied values are valid.

Throws:
BuildException

scanSrc

protected void scanSrc()
                throws BuildException
Scans the source directories looking for source files to be exported.

Throws:
BuildException

scanDir

protected void scanDir(java.io.File srcdir,
                       java.io.File destdir,
                       java.lang.String[] files)
Scans the directory looking for source files to be exported. The results are returned in the instance variable reportFilesMap.

Parameters:
srcdir - source directory
destdir - destination directory
files - included file names

export

protected void export()
               throws BuildException
Performs the export of the selected report files.

Throws:
BuildException


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com