001    package org.apache.torque.mojo;
002    
003    import org.apache.maven.plugin.MojoExecutionException;
004    import org.kuali.core.db.torque.KualiTorqueSchemaDumpTask;
005    
006    /**
007     * Examines the JDBC metadata of a proprietary database and exports the schema information to database agnostic XML. The
008     * generated XML contains information about tables, primary keys, unique constraints, foreign keys, indexes, sequences,
009     * and views. This goal does not export any data. See also <code>impex:exportdata</code> and <code>impex:import</code>
010     * 
011     * @goal exportschema
012     * @phase generate-sources
013     */
014    public class ExportSchemaMojo extends ExportMojo {
015    
016            /**
017             * Flag indicating whether or not tables will be processed. Default is true
018             * 
019             * @parameter expression="${processTables}" default-value="true"
020             */
021            private boolean processTables;
022    
023            /**
024             * Flag indicating whether or not views will be processed. Default is true
025             * 
026             * @parameter expression="${processViews}" default-value="true"
027             */
028            private boolean processViews;
029    
030            /**
031             * Flag indicating whether or not sequences will be processed. Default is true
032             * 
033             * @parameter expression="${processSequences}" default-value="true"
034             */
035            private boolean processSequences;
036    
037            /**
038             * The file that the schema XML will get written to
039             * 
040             * @parameter expression="${schemaXMLFile}" default-value="${basedir}/src/main/impex/${project.artifactId}.xml"
041             * @required
042             */
043            private String schemaXMLFile;
044    
045            /**
046             * Configure the Ant task
047             */
048            protected void configureTask() throws MojoExecutionException {
049    
050                    KualiTorqueSchemaDumpTask task = new KualiTorqueSchemaDumpTask();
051                    setAntTask(task);
052                    super.configureTask();
053            }
054    
055            public boolean isProcessTables() {
056                    return processTables;
057            }
058    
059            public void setProcessTables(boolean processTables) {
060                    this.processTables = processTables;
061            }
062    
063            public boolean isProcessViews() {
064                    return processViews;
065            }
066    
067            public void setProcessViews(boolean processViews) {
068                    this.processViews = processViews;
069            }
070    
071            public boolean isProcessSequences() {
072                    return processSequences;
073            }
074    
075            public void setProcessSequences(boolean processSequences) {
076                    this.processSequences = processSequences;
077            }
078    
079            public String getSchemaXMLFile() {
080                    return schemaXMLFile;
081            }
082    
083            public void setSchemaXMLFile(String schemaXMLFile) {
084                    this.schemaXMLFile = schemaXMLFile;
085            }
086    
087    }