org.apache.torque.mojo
Class DataDumpMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.TexenTaskMojo
          extended by org.apache.torque.mojo.DataModelTaskMojo
              extended by org.apache.torque.mojo.DataDumpMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class DataDumpMojo
extends DataModelTaskMojo

Reads the content of tables from thh database and stores the data in XML files.

Author:
Raphael Pieroni (rafale_at_codehaus.org), Thomas Fischer

Field Summary
static String PROJECT_CONTEXT_PROPERTY
          The context property for the name of the project.
 
Fields inherited from class org.apache.torque.mojo.DataModelTaskMojo
TARGET_DATABASE_CONTEXT_PROPERTY
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
DataDumpMojo()
          Creates a new SQLMojo object.
 
Method Summary
protected  void configureTask()
          Configures the Texen task which is wrapped by this mojo.
protected  String getControlTemplate()
          Returns the path to the control template.
 String getDriver()
          Returns the fully qualified class name of the database driver.
protected  org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
          Returns the context properties for the Texen task.
 String getPassword()
          Returns the password of the database user.
 String getProjectName()
          Returns the name of the project, which is used as prefix for the generated table names and the name of the datadtd.
 String getUrl()
          Returns the connect URL to the database.
 String getUser()
          Returns the database user.
 String getXmlFile()
          Returns the name of the xml file to process.
 void setDriver(String driver)
          Sets the fully qualified class name of the database driver.
 void setPassword(String password)
          Sets the password of the database user.
 void setProjectName(String projectName)
          Sets the name of the project, which is used as prefix for the generated table names and the name of the datadtd.
 void setUrl(String url)
          Sets the connect URL to the database.
 void setUser(String user)
          Sets the database user.
 void setXmlFile(String xmlFile)
          Sets the name of the xml file to process.
 
Methods inherited from class org.apache.torque.mojo.DataModelTaskMojo
execute, getReportFile, getSchemaDir, getSchemaExcludes, getSchemaIncludes, getSqlDbMap, getTargetDatabase, getTargetPackage, isRunOnlyOnSchemaChange, schemaChanged, setReportFile, setRunOnlyOnSchemaChange, setSchemaDir, setSchemaExcludes, setSchemaIncludes, setSqlDbMap, setTargetDatabase, setTargetPackage
 
Methods inherited from class org.apache.torque.mojo.TexenTaskMojo
generateContextProperties, getAntProject, getContextPropertiesPath, getGeneratorTask, getOutputDir, getProject, getTemplatePath, getUseClasspath, getUserContextProperties, setContextPropertiesPath, setGeneratorTask, setOutputDir, setProject, setTemplatePath, setUseClasspath, setUserContextProperties
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECT_CONTEXT_PROPERTY

public static final String PROJECT_CONTEXT_PROPERTY
The context property for the name of the project.

See Also:
Constant Field Values
Constructor Detail

DataDumpMojo

public DataDumpMojo()
Creates a new SQLMojo object.

Method Detail

getControlTemplate

protected String getControlTemplate()
Returns the path to the control template.

Specified by:
getControlTemplate in class DataModelTaskMojo
Returns:
"data/Control.vm"

getMojoContextProperties

protected org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
Returns the context properties for the Texen task.

Specified by:
getMojoContextProperties in class TexenTaskMojo
Returns:
The PropertiesConfiguration containing all context properties, not null.

configureTask

protected void configureTask()
                      throws org.apache.maven.plugin.MojoExecutionException
Configures the Texen task which is wrapped by this mojo. In this implementation, the context properties, useClasspath, the output directory, the control template, the schema Fileset, the target package, the target database and the xml file are set.

Overrides:
configureTask in class DataModelTaskMojo
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs when setting the Tasks properties.
See Also:
TexenTaskMojo.configureTask()

getDriver

public String getDriver()
Returns the fully qualified class name of the database driver.

Returns:
the fully qualified class name of the database driver.

setDriver

public void setDriver(String driver)
Sets the fully qualified class name of the database driver.

Parameters:
driver - the fully qualified class name of the database driver.

getPassword

public String getPassword()
Returns the password of the database user.

Returns:
the password of the database user.

setPassword

public void setPassword(String password)
Sets the password of the database user.

Parameters:
password - the password of the database user.

getUrl

public String getUrl()
Returns the connect URL to the database.

Returns:
the connect URL to the database.

setUrl

public void setUrl(String url)
Sets the connect URL to the database.

Parameters:
url - the connect URL to the database.

getUser

public String getUser()
Returns the database user.

Returns:
the userId of the database user.

setUser

public void setUser(String user)
Sets the database user.

Parameters:
user - the userId of the database user.

getProjectName

public String getProjectName()
Returns the name of the project, which is used as prefix for the generated table names and the name of the datadtd.

Returns:
the name of the project.

setProjectName

public void setProjectName(String projectName)
Sets the name of the project, which is used as prefix for the generated table names and the name of the datadtd.

Parameters:
project - the name of the project.

getXmlFile

public String getXmlFile()
Returns the name of the xml file to process.

Returns:
the name of the xml file to process.

setXmlFile

public void setXmlFile(String xmlFile)
Sets the name of the xml file to process.

Parameters:
project - the name of the xml file to process.


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.