jvanzyl     01/09/26 23:16:16

  Modified:    src/tdk/apps/2 build.properties build.xml
  Log:
  - using the torque data sql task for populating the security system
    with a set of initial values. these are very cool tasks and i
    would like to integrate them fully into the TDK. totally nifty
    for moving project data around. could even be used for some nifty
    db syncing.
  
  Revision  Changes    Path
  1.11      +3 -0      jakarta-turbine-tdk/src/tdk/apps/2/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/2/build.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- build.properties  2001/09/22 18:14:58     1.10
  +++ build.properties  2001/09/27 06:16:16     1.11
  @@ -66,3 +66,6 @@
   OMControlTemplate = om/Control.vm
   idTableControlTemplate = sql/id-table/Control.vm
   securityControlTemplate = sql/security/Control.vm
  +DataDTDControlTemplate = data/Control.vm
  +DataDumpControlTemplate = data/dump/Control.vm
  +DataSQLControlTemplate = sql/load/Control.vm
  
  
  
  1.24      +109 -103  jakarta-turbine-tdk/src/tdk/apps/2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/apps/2/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- build.xml 2001/09/26 18:41:16     1.23
  +++ build.xml 2001/09/27 06:16:16     1.24
  @@ -24,6 +24,38 @@
     </path>
   
     <!-- ================================================================ -->
  +  <!-- S E C U R I T Y                                                  -->
  +  <!-- ================================================================ -->
  +
  +  <target 
  +    name="turbine-security-sql"
  +    depends="init-tasks"
  +    description="Creates SQL to initialize the security system.">
  +
  +    <echo>
  +      +-----------------------------------------------+
  +      |                                               |
  +      | Generating SQL from data XML !                |
  +      | Woo hoo!                                      |
  +      |                                               |
  +      +-----------------------------------------------+
  +    </echo>
  +
  +    <torque-datasql
  +      contextProperties="${build.properties}"
  +      controlTemplate="${DataSQLControlTemplate}"
  +      outputDirectory="${src.dir}/sql"
  +      templatePath="${templatePath}"
  +      outputFile="turbine-security.sql"
  +      xmlFile="${conf.dir}/turbine-schema.xml"
  +      dataXmlFile="${conf.dir}/turbine-security.xml"
  +      dataDTD="${conf.dir}/turbine-security.dtd"
  +      databaseName="${databaseName}"
  +      targetDatabase="${database}"
  +    />
  +  </target>
  +  
  +  <!-- ================================================================ -->
     <!-- D E P L O Y M E N T  T A R G E T S                               -->
     <!-- ================================================================ -->
   
  @@ -120,6 +152,12 @@
     <!-- ================================================================ -->
   
     <target name="init-tasks" depends="setup">
  +    
  +    <taskdef name="torque-datasql"
  +      classname="org.apache.turbine.torque.TorqueDataSQLTask">
  +      <classpath refid="classpath"/>
  +    </taskdef>
  +    
       <taskdef name="torque-sql" 
         classname="org.apache.turbine.torque.TorqueSQLTask">
         <classpath refid="classpath"/>
  @@ -149,6 +187,11 @@
         classname="jstyle.FormatTask">
         <classpath refid="classpath"/>
       </taskdef>
  +    
  +    <taskdef name="sql-tdk"
  +      classname="org.apache.tdk.task.SQLExec">
  +      <classpath refid="classpath"/>
  +    </taskdef>
     </target>
   
     <!-- ================================================================ -->
  @@ -243,12 +286,14 @@
       depends="init-tasks"
       description="--> generates the sql-script for your project">
   
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating SQL for YOUR Turbine project! |"/>
  -    <echo message="| Woo hoo!                                 |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating SQL for YOUR Turbine project! |
  +      | Woo hoo!                                 |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
   
       <torque-sql
         contextProperties="${build.properties}"
  @@ -273,14 +318,16 @@
       name="project-om" 
       depends="init-tasks"
       description="--> generates the peer-based object model for your project">
  -
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating Peer-based Object Model for   |"/>
  -    <echo message="| YOUR Turbine project! Woo hoo!           |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
   
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating Peer-based Object Model for   |
  +      | YOUR Turbine project! Woo hoo!           |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
  +    
       <torque-om
         contextProperties="${build.properties}"
         controlTemplate="${OMControlTemplate}"
  @@ -315,11 +362,13 @@
       depends="init-tasks"
       description="--> generates the sql-script for the Turbine base system">
   
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating SQL for Turbine base system!  |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating SQL for Turbine base system!  |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
   
       <torque-sql
         controlTemplate="${SQLControlTemplate}"
  @@ -329,7 +378,6 @@
         xmlFile="${conf.dir}/turbine-schema.xml"
         targetDatabase="${database}"
       />
  -
     </target>
   
     <!-- ================================================================ -->
  @@ -344,22 +392,23 @@
       name="turbine-id-table-sql" 
       depends="init-tasks">
   
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating SQL for YOUR Turbine project! |"/>
  -    <echo message="| Woo hoo!                                 |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating SQL for YOUR Turbine project! |
  +      | Woo hoo!                                 |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
   
       <torque-sql
         controlTemplate="${SQLControlTemplate}"
         outputDirectory="${src.dir}/sql"
         templatePath="${templatePath}"
  -      outputFile="id-table-schema.sql"
  +      outputFile="turbine-id-table-schema.sql"
         xmlFile="${conf.dir}/id-table-schema.xml"
         targetDatabase="${database}"
       />
  -
     </target>
   
     <!-- ================================================================ -->
  @@ -370,12 +419,14 @@
       name="turbine-id-table-init-sql" 
       depends="init-tasks">
   
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating TURBINE initialization SQL    |"/>
  -    <echo message="| for ID Broker system!                    |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating TURBINE initialization SQL    |
  +      | for ID Broker system!                    |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
   
       <torque-sql
         contextProperties="sql/id-table/turbine.props"
  @@ -386,7 +437,6 @@
         xmlFile="${conf.dir}/turbine-schema.xml"
         targetDatabase="${database}"
       />
  -
     </target>
   
     <!-- ================================================================ -->
  @@ -397,12 +447,14 @@
       name="project-id-table-init-sql" 
       depends="init-tasks">
   
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating PROJECT initialization SQL    |"/>
  -    <echo message="| for ID Broker system!                    |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  +    <echo>
  +      +------------------------------------------+
  +      |                                          |
  +      | Generating PROJECT initialization SQL    |
  +      | for ID Broker system!                    |
  +      |                                          |
  +      +------------------------------------------+
  +    </echo>
   
       <torque-sql
         contextProperties="sql/id-table/project.props"
  @@ -413,35 +465,6 @@
         xmlFile="${conf.dir}/${tdk.project}-schema.xml"
         targetDatabase="${database}"
       />
  -
  -  </target>
  -
  -  <!-- ================================================================ -->
  -  <!-- T U R B I N E  S E C U R I T Y  S Y S T E M  S Q L               -->
  -  <!-- ================================================================ -->
  -
  -  <target 
  -    name="turbine-security-sql" 
  -    depends="init-tasks">
  -
  -    <echo message="+------------------------------------------+"/>
  -    <echo message="|                                          |"/>
  -    <echo message="| Generating Turbine security system SQL!  |"/>
  -    <echo message="|                                          |"/>
  -    <echo message="+------------------------------------------+"/>
  -    
  -    <!-- This could probably be a simple texen task -->
  -    
  -    <torque-sql
  -      contextProperties="sql/id-table/project.props"
  -      controlTemplate="${securityControlTemplate}"
  -      templatePath="${templatePath}"
  -      outputDirectory="${src.dir}/sql"
  -      outputFile="turbine-security.sql"
  -      xmlFile="${conf.dir}/${tdk.project}-schema.xml"
  -      targetDatabase="${database}"
  -    />
  -
     </target>
   
     <!-- ================================================================ -->
  @@ -451,23 +474,11 @@
     <target 
       name="turbine-insert-sql" 
       description="--> insert turbine sql">
  -    
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" value="${src.dir}/sql/turbine-schema.sql"/>
  -    </antcall>
  -
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" value="${src.dir}/sql/turbine-security.sql"/>
  -    </antcall>
  -
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" value="${src.dir}/sql/id-table-schema.sql"/>
  -    </antcall>
   
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" value="${src.dir}/sql/turbine-id-table-init.sql"/>
  +    <antcall target="insert-sql-files">
  +      <param name="dir" value="${src.dir}/sql"/>
  +      <param name="include" value="turbine*.sql"/>
       </antcall>
  -
     </target>
   
     <!-- ================================================================ -->
  @@ -478,14 +489,10 @@
       name="project-insert-sql" 
       description="--> insert project sql">
       
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" value="${src.dir}/sql/${tdk.project}-schema.sql"/>
  +    <antcall target="insert-sql-files">
  +      <param name="dir" value="${src.dir}/sql"/>
  +      <param name="include" value="${tdk.project}*.sql"/>
       </antcall>
  -    
  -    <antcall target="insert-sql-file">
  -      <param name="sqlFile" 
value="${src.dir}/sql/${tdk.project}-id-table-init.sql"/>
  -    </antcall>
  -  
     </target>
   
     <!-- ================================================================ -->
  @@ -500,23 +507,25 @@
     </target>
     
     <target 
  -    name="insert-sql-file" 
  -    depends="setDatabaseUrl">
  +    name="insert-sql-files" 
  +    depends="init-tasks,setDatabaseUrl">
       
  -    <echo message="Inserting SQL file ---------> ${sqlFile}"/>
  +    <echo message="SQL Directory ---------> ${dir}"/>
  +    <echo message="SQL Include   ---------> ${include}"/>
       
       <property name="sqlInsert.databaseUrl" value="${databaseUrl}"/>
  -    <sql
  +    <sql-tdk
         driver="${databaseDriver}"
         url="${sqlInsert.databaseUrl}"
         userid="${databaseUser}"
         password="${databasePassword}"
  -      src="${sqlFile}"
         autocommit="true"
  -      onerror="continue"
  -    >
  +      onerror="continue">
         <classpath refid="classpath"/>
  -    </sql>
  +      <fileset dir="${dir}">
  +        <include name="${include}"/>
  +      </fileset>
  +    </sql-tdk>
     </target>
   
     <!-- ================================================================ -->
  @@ -539,7 +548,7 @@
       <filter token="DATABASE_USER" value="${databaseUser}"/>
       <filter token="DATABASE_PASSWORD" value="${databasePassword}"/>
       <filter token="DATABASE_HOST" value="${databaseHost}"/>
  -    <filter token="DATABASE_DEFAULT" value="default"/>
  +    <filter token="DATABASE_DEFAULT" value="${tdk.project}"/>
       
       <property name="database.descriptor" 
value="${master.conf.dir}/database/${database}"/>
       <property name="database.name" value="${tdk.project}"/>
  @@ -557,7 +566,6 @@
         file="${conf.dir}/tmp"
         tofile="${conf.dir}/TurbineResources.properties" 
       />
  -
     </target>
   
     <!-- =================================================================== -->
  @@ -596,9 +604,7 @@
         optimize="${optimize}">
               
         <classpath refid="classpath"/>
  -
       </javac>
  -  
     </target>
     
     <!-- =================================================================== -->
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to