portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r784916 - in /portals/jetspeed-2/portal/trunk/jetspeed-installer/etc: ant-installer/antinstall-config-min.xml ant-installer/antinstall-config.xml ant-installer/build.xml database/build.xml
Date Mon, 15 Jun 2009 18:54:51 GMT
Author: rwatler
Date: Mon Jun 15 18:54:51 2009
New Revision: 784916

URL: http://svn.apache.org/viewvc?rev=784916&view=rev
Log:
JS2-1034: Add DB Export, Init, and Import to installers, (initial commit)

Modified:
    portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config-min.xml
    portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config.xml
    portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/build.xml
    portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml

Modified: portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config-min.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config-min.xml?rev=784916&r1=784915&r2=784916&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config-min.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config-min.xml Mon Jun 15 18:54:51 2009
@@ -29,12 +29,36 @@
 
   <page type="input" name="intro" displayText="Welcome to the Jetspeed Enterprise Portal 2.2.1-SNAPSHOT">
     <comment displayText="" />
-    <comment displayText="This installer will guide you through setting up the Jetspeed Portal." />
+    <comment displayText="This installer will guide you through setting up the Jetspeed Portal or" />
+    <comment displayText="performing portal database maintenance tasks." />
   </page>
 
   <page type="license" name="license" displayText="License conditions" resource="/LICENSE-ant-install.txt"></page>
 
-  <page type="input" name="properties" displayText="Installation location">
+  <page type="input" name="chooseOperation" displayText="Choose installation operation to perform">
+    <comment displayText="Please select the operation the installer is to perform." />
+    <comment displayText="" />
+    <select property="operation" displayText="Operation" defaultValue="">
+      <option text="Install Jetspeed Portal" value="install" />
+      <option text="Export Jetspeed Portal database" value="exportdb" />
+      <option text="Initialize Jetspeed Portal database" value="initdb" />
+      <option text="Import Jetspeed Portal database" value="importdb" />
+    </select>
+  </page>
+
+  <page type="input" name="exportProperties" displayText="Export data files location" ifProperty="${operation}=exportdb">
+    <directory property="exportDataDir" defaultValue="${java.user.home}/Jetspeed-Data-Files"
+      defaultValueWin="C:\Apache\Jetspeed-Data-Files" displayText="Select export files directory" create="true"
+      checkExists="true" />
+  </page>
+
+  <page type="input" name="importProperties" displayText="Import data files location" ifProperty="${operation}=importdb">
+    <directory property="importDataDir" defaultValue="${java.user.home}/Jetspeed-Data-Files"
+      defaultValueWin="C:\Apache\Jetspeed-Data-Files" displayText="Select import files directory"
+      checkExists="true" />
+  </page>
+
+  <page type="input" name="properties" displayText="Installation location" ifProperty="${operation}=install">
     <directory property="installDir" defaultValue="${java.user.home}/Jetspeed-2.2.1-SNAPSHOT"
       defaultValueWin="C:\Apache\Jetspeed-2.2.1-SNAPSHOT" displayText="Select an installation directory" create="true"
       checkExists="true" />
@@ -42,7 +66,15 @@
     <comment displayText="Warning: on Windows, the location must not contain spaces." bold="true"/>
   </page>
 
-  <page type="input" name="requiredComponents" displayText="Components selection">
+  <page type="input" name="properties" displayText="Temporary installation location" ifProperty="${operation}!=install">
+    <comment displayText="Select temporary directory requried by installer if necessary." />
+    <comment displayText="" />
+    <directory property="installDir" defaultValue="${java.java.io.tmpdir}/Jetspeed-2.2.1-SNAPSHOT"
+      displayText="Enter temporary directory"/>
+  </page>
+
+  <page type="input" name="requiredComponents" displayText="Components selection" ifProperty="${operation}=install">
+    <hidden property="setupDBAntTarget" value="runSetupNoDB" />
     <comment displayText="Jetspeed Enterprise Portal version 2.2.1-SNAPSHOT" bold="true" />
     <target displayText="Tomcat 6.0.18 Webserver" target="install" defaultValue="true" force="true" />
     <checkbox displayText="Jetspeed Portal" property="dummy" defaultValue="true" force="true" />
@@ -51,12 +83,11 @@
     <checkbox displayText="Store PSML in the database?" property="dbImportPsml" defaultValue="false" />
   </page>
 
-  <page type="input" name="databaseSelection" displayText="Database selection">
+  <page type="input" name="databaseSelection" displayText="Database selection" ifProperty="${operation}=install">
     <hidden property="checkdb" value="false" />
     <hidden property="dbvalid" value="false" />
     <hidden property="db.type" value="derby" />
     <hidden property="dbDisplayName" value="Derby"/>
-    <hidden property="setupDBAntTarget" value="runSetupDB" />
 
     <comment displayText="Please select the target database type you want to use for the portal." />
     <select property="dbName" displayText="Database type" defaultValue="derby">
@@ -71,6 +102,23 @@
     </select>
   </page>
 
+  <page type="input" name="databaseSelection" displayText="Database selection" ifProperty="${operation}!=install">
+    <hidden property="checkdb" value="false" />
+    <hidden property="dbvalid" value="false" />
+    <hidden property="db.type" value="derby" />
+    <hidden property="dbDisplayName" value="Derby"/>
+
+    <comment displayText="Please select the target portal database type." />
+    <select property="dbName" displayText="Database type" defaultValue="derby">
+      <option text="DB2" value="db2" />
+      <option text="MSSQL" value="mssql" />
+      <option text="MySql" value="mysql" />
+      <option text="PostgreSQL" value="postgres" />
+      <option text="Oracle (9i or higher)" value="oracle" />
+      <option text="SapDB" value="sapdb" />
+    </select>
+  </page>
+
   <page type="input" name="mysql" displayText="MySQL Database connection parameters" ifProperty="${dbName}=mysql">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
@@ -181,6 +229,14 @@
       displayText="JDBC driver" checkExists="true" />
   </page>
 
+  <page type="input" name="noDBCheck" displayText="Skipping database connection check"
+    ifProperty="(${checkdb}=false) AND (${dbName}!=manual)">
+    <hidden property="dbvalid" value="true" />
+    <hidden property="setupDBAntTarget" value="runSetupDB" />
+    <comment displayText="No database connection check required for selected ${dbDisplayName}" />
+    <comment displayText="database type, press Next to continue..." />
+  </page>
+
   <page type="input" name="preDBCheck" displayText="Testing the database connection"
     ifProperty="(${checkdb}=true) AND (${dbvalid}=false)" postDisplayTarget="antinstaller-checkdb">
     <hidden property="db.type" value="${dbName}" />
@@ -190,7 +246,7 @@
     <hidden property="jdbc.driver.class" value="${jdbcDriverClass}" />
     <hidden property="jdbc.driver.jar" value="${jdbcDriverJar}" />
     <hidden property="setupDBAntTarget" value="runSetupDB" />
-    <comment displayText="Press Next to test the database connection.." />
+    <comment displayText="Press Next to test the database connection..." />
   </page>
 
   <page type="input" name="dbCheckFailed" displayText="Connection to the database failed"
@@ -203,14 +259,14 @@
     <comment displayText="Continuing now will otherwise require manual setup of the database."/>
   </page>
 
-  <page type="input" name="beforeInstall" displayText="Before your install.." ifProperty="(${dbName}=manual) OR (${setupDBAntTarget}=runSetupNoDB)">
+  <page type="input" name="beforeInstall" displayText="Before your install..."
+    ifProperty="(${operation}=install) AND (${setupDBAntTarget}=runSetupNoDB)">
     <hidden property="db.username" value="" />
     <hidden property="db.password" value="" />
     <hidden property="jdbc.url" value="" />
     <hidden property="jdbc.driver.class" value="" />
     <hidden property="jdbc.driver.jar" value="" />
-    <hidden property="setupDBAntTarget" value="runSetupNoDB" />
-    <comment displayText="Jetspeed will be installed without yet a configured database to:" bold="true"/>
+    <comment displayText="Jetspeed will be installed without a configured database to:" bold="true"/>
     <comment displayText="  ${installDir}"/>
     <comment displayText="Warning: all content in this directory will be deleted first!" bold="true"/>
     <comment displayText=""/>
@@ -221,7 +277,8 @@
     <comment displayText="Initialize the database by running ant from the database directory." />
   </page>
 
-  <page type="input" name="beforeInstall" displayText="Before you install.." ifProperty="${setupDBAntTarget}=runSetupDB">
+  <page type="input" name="beforeInstall" displayText="Before you install..."
+    ifProperty="(${operation}=install) AND (${setupDBAntTarget}=runSetupDB)">
     <comment displayText="Jetspeed will be installed using a ${dbDisplayName} database to:" bold="true"/>
     <comment displayText="  ${installDir}"/>
     <comment displayText="Warning: all content in this directory will be deleted first!" bold="true"/>
@@ -234,6 +291,44 @@
     <comment displayText="Reinitialize the database by running ant from the database directory." />
   </page>
 
+  <page type="input" name="beforeDBInit" displayText="Before you initialze the database..."
+    ifProperty="(${operation}=initdb) AND (${dbvalid}=true)">
+    <target displayText="Initialze Jetspeed Database" target="initdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database will be reset and initialized." bold="true"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
+  <page type="input" name="beforeDBExport" displayText="Before you export the database..."
+    ifProperty="(${operation}=exportdb) AND (${dbvalid}=true)">
+    <target displayText="Export Jetspeed Database" target="exportdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database data will be exported to:" bold="true"/>
+    <comment displayText="  ${exportDataDir}"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
+  <page type="input" name="beforeDBImport" displayText="Before you import the database..."
+    ifProperty="(${operation}=importdb) AND (${dbvalid}=true)">
+    <target displayText="Import Jetspeed Database" target="importdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database data will be imported from:" bold="true"/>
+    <comment displayText="  ${importDataDir}"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
   <page type="progress" name="progress" displayText="Installation progress" />
 
 </installer>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config.xml?rev=784916&r1=784915&r2=784916&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/antinstall-config.xml Mon Jun 15 18:54:51 2009
@@ -26,23 +26,55 @@
 <installer ui="swing,text" verbose="false" lookAndFeel="jgoodies" name="Jetspeed Enterprise Portal 2.2.1-SNAPSHOT Installer"
   windowIcon="/resources/feather-small.png" defaultImageResource="/resources/Jetspeed_blue_med.png" minJavaVersion="1.5"
   wide="700:250" antialiased="true">
-  
+
   <page type="input" name="intro" displayText="Welcome to the Jetspeed Enterprise Portal 2.2.1-SNAPSHOT">
     <comment displayText="" />
-    <comment displayText="This installer will guide you through setting up the Jetspeed Portal." />
+    <comment displayText="This installer will guide you through setting up the Jetspeed Portal or" />
+    <comment displayText="performing portal database maintenance tasks." />
   </page>
-  
+
   <page type="license" name="license" displayText="License conditions" resource="/LICENSE-ant-install.txt"></page>
-  
-  <page type="input" name="properties" displayText="Installation location">
+
+  <page type="input" name="chooseOperation" displayText="Choose installation operation to perform">
+    <comment displayText="Please select the operation the installer is to perform." />
+    <comment displayText="" />
+    <select property="operation" displayText="Operation" defaultValue="">
+      <option text="Install Jetspeed Portal" value="install" />
+      <option text="Export Jetspeed Portal database" value="exportdb" />
+      <option text="Initialize Jetspeed Portal database" value="initdb" />
+      <option text="Import Jetspeed Portal database" value="importdb" />
+    </select>
+  </page>
+
+  <page type="input" name="exportProperties" displayText="Export data files location" ifProperty="${operation}=exportdb">
+    <directory property="exportDataDir" defaultValue="${java.user.home}/Jetspeed-Data-Files"
+      defaultValueWin="C:\Apache\Jetspeed-Data-Files" displayText="Select export files directory" create="true"
+      checkExists="true" />
+  </page>
+
+  <page type="input" name="importProperties" displayText="Import data files location" ifProperty="${operation}=importdb">
+    <directory property="importDataDir" defaultValue="${java.user.home}/Jetspeed-Data-Files"
+      defaultValueWin="C:\Apache\Jetspeed-Data-Files" displayText="Select import files directory"
+      checkExists="true" />
+  </page>
+
+  <page type="input" name="properties" displayText="Installation location" ifProperty="${operation}=install">
     <directory property="installDir" defaultValue="${java.user.home}/Jetspeed-2.2.1-SNAPSHOT"
       defaultValueWin="C:\Apache\Jetspeed-2.2.1-SNAPSHOT" displayText="Select an installation directory" create="true"
       checkExists="true" />
     <comment displayText=""/>
     <comment displayText="Warning: on Windows, the location must not contain spaces." bold="true"/>
   </page>
-  
-  <page type="input" name="requiredComponents" displayText="Components selection">
+
+  <page type="input" name="properties" displayText="Temporary installation location" ifProperty="${operation}!=install">
+    <comment displayText="Select temporary directory requried by installer if necessary." />
+    <comment displayText="" />
+    <directory property="installDir" defaultValue="${java.java.io.tmpdir}/Jetspeed-2.2.1-SNAPSHOT"
+      displayText="Enter temporary directory"/>
+  </page>
+
+  <page type="input" name="requiredComponents" displayText="Components selection" ifProperty="${operation}=install">
+    <hidden property="setupDBAntTarget" value="runSetupNoDB" />
     <comment displayText="Jetspeed Enterprise Portal version 2.2.1-SNAPSHOT" bold="true" />
     <target displayText="Tomcat 6.0.18 Webserver" target="install" defaultValue="true" force="true" />
     <checkbox displayText="Jetspeed Portal" property="dummy" defaultValue="true" force="true" />
@@ -53,14 +85,13 @@
     <checkbox displayText="JPetstore Portlets" property="dummy" defaultValue="true" force="true" />
     <checkbox displayText="Store PSML in the database?" property="dbImportPsml" defaultValue="false" />
   </page>
-  
-  <page type="input" name="databaseSelection" displayText="Database selection">
+
+  <page type="input" name="databaseSelection" displayText="Database selection" ifProperty="${operation}=install">
     <hidden property="checkdb" value="false" />
     <hidden property="dbvalid" value="false" />
     <hidden property="db.type" value="derby" />
     <hidden property="dbDisplayName" value="Derby"/>
-    <hidden property="setupDBAntTarget" value="runSetupDB" />
-    
+
     <comment displayText="Please select the target database type you want to use for the portal." />
     <select property="dbName" displayText="Database type" defaultValue="derby">
       <option text="DB2" value="db2" />
@@ -73,117 +104,142 @@
       <option text="Manual database setup" value="manual" />
     </select>
   </page>
-  
+
+  <page type="input" name="databaseSelection" displayText="Database selection" ifProperty="${operation}!=install">
+    <hidden property="checkdb" value="false" />
+    <hidden property="dbvalid" value="false" />
+    <hidden property="db.type" value="derby" />
+    <hidden property="dbDisplayName" value="Derby"/>
+
+    <comment displayText="Please select the target portal database type." />
+    <select property="dbName" displayText="Database type" defaultValue="derby">
+      <option text="DB2" value="db2" />
+      <option text="MSSQL" value="mssql" />
+      <option text="MySql" value="mysql" />
+      <option text="PostgreSQL" value="postgres" />
+      <option text="Oracle (9i or higher)" value="oracle" />
+      <option text="SapDB" value="sapdb" />
+    </select>
+  </page>
+
   <page type="input" name="mysql" displayText="MySQL Database connection parameters" ifProperty="${dbName}=mysql">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="MySQL"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the MySQL database." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String"
       defaultValue="jdbc:mysql://localhost:3306/&lt;dbname&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname" defaultValue="com.mysql.jdbc.Driver" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}mysql-connector-java-5.1.7.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
   <page type="input" name="postgres" displayText="PostgreSQL Database connection parameters"
     ifProperty="${dbName}=postgres">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="PostgreSQL"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the PostgreSQL database." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String"
       defaultValue="jdbc:postgresql://localhost:5432/&lt;dbname&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname" defaultValue="org.postgresql.Driver" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}postgresql-8.1-405.jdbc3.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
   <page type="input" name="sapdb" displayText="SapDB Database connection parameters" ifProperty="${dbName}=sapdb">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="SapDB"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the SapDB database." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String" defaultValue="jdbc:sapdb://localhost/&lt;dbname&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname" defaultValue="com.sap.dbtech.jdbc.DriverSapDB" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}sapdb-jdbc-bin-7.4.04.03a.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
   <page type="input" name="oracle" displayText="Oracle Database connection parameters" ifProperty="${dbName}=oracle">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="Oracle"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the Oracle database." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String"
       defaultValue="jdbc:oracle:thin:@localhost:1521:&lt;instance&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname" defaultValue="oracle.jdbc.driver.OracleDriver" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}ojdbc14.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
   <page type="input" name="mssql" displayText="Microsoft SQL Server connection parameters"
     ifProperty="${dbName}=mssql">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="MSSQL"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the Microsoft SQL Server." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String"
       defaultValue="jdbc:jtds:sqlserver://localhost:1433/&lt;dbname&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname"
       defaultValue="net.sourceforge.jtds.jdbc.Driver" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}jtds-1.2.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
   <page type="input" name="db2" displayText="DB2 Database connection parameters" ifProperty="${dbName}=db2">
     <hidden property="checkdb" value="true" />
     <hidden property="dbvalid" value="false" />
     <hidden property="dbDisplayName" value="DB2"/>
-    
+
     <comment displayText="Please fill in the fields below for connecting to the DB2 database." />
-    
+
     <text property="dbUser" displayText="Database User Name" defaultValue="" />
     <text property="dbPassword" displayText="Database Password" defaultValue="" />
-    
+
     <text property="jdbcUrl" displayText="JDBC Connection String"
       defaultValue="jdbc:db2://localhost:1527/&lt;dbname&gt;" />
     <text property="jdbcDriverClass" displayText="JDBC Driver Classname" defaultValue="COM.ibm.db2.jdbc.app.DB2Driver" />
-    
+
     <file property="jdbcDriverJar" defaultValue="${java.user.home}${java.file.separator}db2jcc.jar"
       displayText="JDBC driver" checkExists="true" />
   </page>
-  
+
+  <page type="input" name="noDBCheck" displayText="Skipping database connection check"
+    ifProperty="(${checkdb}=false) AND (${dbName}!=manual)">
+    <hidden property="dbvalid" value="true" />
+    <hidden property="setupDBAntTarget" value="runSetupDB" />
+    <comment displayText="No database connection check required for selected ${dbDisplayName}" />
+    <comment displayText="database type, press Next to continue..." />
+  </page>
+
   <page type="input" name="preDBCheck" displayText="Testing the database connection"
     ifProperty="(${checkdb}=true) AND (${dbvalid}=false)" postDisplayTarget="antinstaller-checkdb">
     <hidden property="db.type" value="${dbName}" />
@@ -193,27 +249,27 @@
     <hidden property="jdbc.driver.class" value="${jdbcDriverClass}" />
     <hidden property="jdbc.driver.jar" value="${jdbcDriverJar}" />
     <hidden property="setupDBAntTarget" value="runSetupDB" />
-    <comment displayText="Press Next to test the database connection.." />
+    <comment displayText="Press Next to test the database connection..." />
   </page>
-  
+
   <page type="input" name="dbCheckFailed" displayText="Connection to the database failed"
     ifProperty="(${checkdb}=true) AND (${dbvalid}=false)">
     <hidden property="checkdb" value="false" />
     <hidden property="setupDBAntTarget" value="runSetupNoDB" />
-    
+
     <comment displayText="Please go back and specify the correct database configuration parameters." bold="true" />
     <comment displayText="" />
     <comment displayText="Continuing now will otherwise require manual setup of the database."/>
   </page>
-  
-  <page type="input" name="beforeInstall" displayText="Before your install.." ifProperty="(${dbName}=manual) OR (${setupDBAntTarget}=runSetupNoDB)">
+
+  <page type="input" name="beforeInstall" displayText="Before your install..."
+    ifProperty="(${operation}=install) AND (${setupDBAntTarget}=runSetupNoDB)">
     <hidden property="db.username" value="" />
     <hidden property="db.password" value="" />
     <hidden property="jdbc.url" value="" />
     <hidden property="jdbc.driver.class" value="" />
     <hidden property="jdbc.driver.jar" value="" />
-    <hidden property="setupDBAntTarget" value="runSetupNoDB" />
-    <comment displayText="Jetspeed will be installed without yet a configured database to:" bold="true"/>
+    <comment displayText="Jetspeed will be installed without a configured database to:" bold="true"/>
     <comment displayText="  ${installDir}"/>
     <comment displayText="Warning: all content in this directory will be deleted first!" bold="true"/>
     <comment displayText=""/>
@@ -223,8 +279,9 @@
     <comment displayText="file provided in the same directory before running ant." />
     <comment displayText="Initialize the database by running ant from the database directory." />
   </page>
-  
-  <page type="input" name="beforeInstall" displayText="Before you install.." ifProperty="${setupDBAntTarget}=runSetupDB">
+
+  <page type="input" name="beforeInstall" displayText="Before you install..."
+    ifProperty="(${operation}=install) AND (${setupDBAntTarget}=runSetupDB)">
     <comment displayText="Jetspeed will be installed using a ${dbDisplayName} database to:" bold="true"/>
     <comment displayText="  ${installDir}"/>
     <comment displayText="Warning: all content in this directory will be deleted first!" bold="true"/>
@@ -236,7 +293,45 @@
     <comment displayText="file provided in the same directory before running ant." />
     <comment displayText="Reinitialize the database by running ant from the database directory." />
   </page>
-  
+
+  <page type="input" name="beforeDBInit" displayText="Before you initialze the database..."
+    ifProperty="(${operation}=initdb) AND (${dbvalid}=true)">
+    <target displayText="Initialze Jetspeed Database" target="initdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database will be reset and initialized." bold="true"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
+  <page type="input" name="beforeDBExport" displayText="Before you export the database..."
+    ifProperty="(${operation}=exportdb) AND (${dbvalid}=true)">
+    <target displayText="Export Jetspeed Database" target="exportdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database data will be exported to:" bold="true"/>
+    <comment displayText="  ${exportDataDir}"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
+  <page type="input" name="beforeDBImport" displayText="Before you import the database..."
+    ifProperty="(${operation}=importdb) AND (${dbvalid}=true)">
+    <target displayText="Import Jetspeed Database" target="importdb" defaultValue="true" force="true" />
+    <comment displayText=""/>
+    <comment displayText="Jetspeed ${dbDisplayName} database data will be imported from:" bold="true"/>
+    <comment displayText="  ${importDataDir}"/>
+    <comment displayText=""/>
+    <comment displayText="Note: Jetspeed will be temporarily installed to" />
+    <comment displayText="  ${installDir}"/>
+    <comment displayText="during this operation and removed afterward." />
+    <comment displayText=""/>
+  </page>
+
   <page type="progress" name="progress" displayText="Installation progress" />
-  
+
 </installer>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/build.xml?rev=784916&r1=784915&r2=784916&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/build.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/ant-installer/build.xml Mon Jun 15 18:54:51 2009
@@ -23,12 +23,13 @@
 
   <property file="ant.install.properties" />
 
-  <target name="install">
-    <echo>Starting the installation</echo>
+  <target name="setupInstallation">
 
+    <echo>Starting the installation</echo>
     <condition property="jdk15Installed">
       <equals arg1="${ant.java.version}" arg2="1.5" />
     </condition>
+    <mkdir dir="${installDir}"/>
 
     <echo>Deleting all content from the installation target directory</echo>
     <delete includeemptydirs="true">
@@ -50,14 +51,12 @@
     </delete>
     <chmod perm="700" dir="${installDir}/bin" includes="**/*.sh" />
 
-   	<echo>Setting up the database configuration</echo>
+    <echo>Setting up the database configuration</echo>
     <condition property="jdbcjar" value="${installDir}/database/lib/derby-10.3.2.1.jar">
       <equals arg1="${jdbc.driver.jar}" arg2="" />
     </condition>
-    
     <property name="jdbcjar" value="${jdbc.driver.jar}" />
     <copy failonerror="false" todir="${installDir}/lib" file="${jdbcjar}" />
-
     <move file="${installDir}/database/database.properties.template" tofile="${installDir}/database/database.properties"
       overwrite="true">
       <filterset begintoken="@" endtoken="@">
@@ -70,25 +69,29 @@
       </filterset>
     </move>
 
-  	<echo>Moving pages out of jetspeed webapp</echo>
+  </target>
+
+  <target name="install" depends="setupInstallation">
+
+    <echo>Moving pages out of jetspeed webapp</echo>
     <move file="${installDir}/webapps/jetspeed/WEB-INF/pages" todir="${installDir}" />
     <move file="${installDir}/webapps/jetspeed/WEB-INF/conf/jetspeed.properties" 
         tofile="${installDir}/webapps/jetspeed/WEB-INF/conf/jetspeed.properties.unfiltered"/>
     <move file="${installDir}/webapps/jetspeed/WEB-INF/conf/jetspeed.properties.unfiltered" 
         tofile="${installDir}/webapps/jetspeed/WEB-INF/conf/jetspeed.properties"
-       	overwrite="true">
-		 <!-- note that the $ is escaped here -->
+        overwrite="true">
+         <!-- note that the $ is escaped here -->
        <filterset begintoken="psml.pages.path" endtoken="$${applicationRoot}/WEB-INF/pages">
          <filter token=" = " value="psml.pages.path = $${applicationRoot}/../../pages" />
        </filterset>
     </move>
 
     <echo>Setting up the Jetspeed database (if selected)</echo>
-    <ant antfile="${installDir}/database/build.xml" target="${setupDBAntTarget}" dir="${installDir}/database" />
+    <ant antfile="${installDir}/database/build.xml" target="${setupDBAntTarget}" dir="${installDir}/database" inheritAll="true" />
 
- </target>
+  </target>
 
-  <target name="antinstaller-checkdb" depends="">
+  <target name="antinstaller-checkdb">
 
     <checkConnection driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" password="${dbPassword}">
       <classpath>
@@ -96,6 +99,41 @@
       </classpath>
     </checkConnection>
     <antinstaller-property name="dbvalid" value="true" />
+
+  </target>
+
+  <target name="initdb" depends="setupInstallation">
+
+    <echo>Reset and initialize Jetspeed database</echo>
+    <ant antfile="${installDir}/database/build.xml" target="initDB" dir="${installDir}/database" inheritAll="true" />
+
+    <echo>Deleting temporary installation target directory</echo>
+    <delete dir="${installDir}"/>
+
+  </target>
+
+  <target name="exportdb" depends="setupInstallation">
+
+    <echo>Export all data from Jetspeed database</echo>
+    <mkdir dir="${exportDataDir}"/>
+    <delete includeemptydirs="true">
+      <fileset dir="${exportDataDir}" includes="**/*"/>
+    </delete>
+    <ant antfile="${installDir}/database/build.xml" target="exportDB" dir="${installDir}/database" inheritAll="true" />
+
+    <echo>Deleting temporary installation target directory</echo>
+    <delete dir="${installDir}"/>
+
+  </target>
+
+  <target name="importdb" depends="setupInstallation">
+
+    <echo>Import all data into Jetspeed database</echo>
+    <ant antfile="${installDir}/database/build.xml" target="importDB" dir="${installDir}/database" inheritAll="true" />
+
+    <echo>Deleting temporary installation target directory</echo>
+    <delete dir="${installDir}"/>
+
   </target>
 
 </project>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml?rev=784916&r1=784915&r2=784916&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml Mon Jun 15 18:54:51 2009
@@ -19,233 +19,302 @@
 -->
 <project name="JetspeedDatabaseSetup" default="setupDB" basedir=".">
 
-	<property file="${basedir}/database.properties" />
-	<property file="build.properties" />
+    <property file="${basedir}/database.properties" />
+    <property file="build.properties" />
 
-	<condition property="_db.username" value="">
-		<equals arg1="${db.type}" arg2="derby" />
-	</condition>
-	<property name="_db.username" value="${db.username}" />
-	<condition property="_db.password" value="">
-		<equals arg1="${db.type}" arg2="derby" />
-	</condition>
-	<property name="_db.password" value="${db.password}" />
-	<condition property="_jdbc.url" value="jdbc:derby:${basedir}/derby/productiondb;create=true">
-		<equals arg1="${db.type}" arg2="derby" />
-	</condition>
-	<property name="_jdbc.url" value="${jdbc.url}" />
-	<condition property="_jdbc.driver.class" value="org.apache.derby.jdbc.EmbeddedDriver">
-		<equals arg1="${db.type}" arg2="derby" />
-	</condition>
-	<property name="_jdbc.driver.class" value="${jdbc.driver.class}" />
+    <condition property="_db.username" value="">
+        <equals arg1="${db.type}" arg2="derby" />
+    </condition>
+    <property name="_db.username" value="${db.username}" />
+    <condition property="_db.password" value="">
+        <equals arg1="${db.type}" arg2="derby" />
+    </condition>
+    <property name="_db.password" value="${db.password}" />
+    <condition property="_jdbc.url" value="jdbc:derby:${basedir}/derby/productiondb;create=true">
+        <equals arg1="${db.type}" arg2="derby" />
+    </condition>
+    <property name="_jdbc.url" value="${jdbc.url}" />
+    <condition property="_jdbc.driver.class" value="org.apache.derby.jdbc.EmbeddedDriver">
+        <equals arg1="${db.type}" arg2="derby" />
+    </condition>
+    <property name="_jdbc.driver.class" value="${jdbc.driver.class}" />
 
-	<property name="jetspeedWebInfDir" value="${basedir}/../webapps/${portalName}/WEB-INF" />
+    <property name="jetspeedWebInfDir" value="${basedir}/../webapps/${portalName}/WEB-INF" />
     <property name="org.apache.portals.logdir" value="${basedir}/../logs" />
 
-	<target name="setupDB">
+    <path id="installationClasspath">
+        <fileset dir="${basedir}/../lib">
+            <include name="**/*.jar" />
+        </fileset>
+        <fileset dir="${jetspeedWebInfDir}/lib">
+            <include name="**/*.jar" />
+        </fileset>
+        <fileset dir="${basedir}/lib">
+            <include name="**/*.jar" />
+        </fileset>
+        <pathelement location="${basedir}/../lib" />
+        <pathelement location="${jetspeedWebInfDir}/classes" />
+    </path>
+
+    <property name="org.apache.jetspeed.database.user" value="${_db.username}"/>
+    <property name="org.apache.jetspeed.database.password" value="${_db.password}"/>
+    <property name="org.apache.jetspeed.database.url" value="${_jdbc.url}"/>
+    <property name="org.apache.jetspeed.database.driver" value="${_jdbc.driver.class}"/>
+    <property name="org.apache.portals.logdir" value="${org.apache.portals.logdir}"/>
+    <propertyset id="installationProps">
+        <propertyref name="org.apache.jetspeed.database.user"/>
+        <propertyref name="org.apache.jetspeed.database.password"/>
+        <propertyref name="org.apache.jetspeed.database.url"/>
+        <propertyref name="org.apache.jetspeed.database.driver"/>
+        <propertyref name="org.apache.portals.logdir"/>
+    </propertyset>
+
+    <target name="setupDB">
+
+        <echo>Setting up the Jetspeed database for ${db.type}</echo>
+
+        <echo>All existing Jetspeed data is going to be deleted from the database.</echo>
+        <echo>
+        </echo>
+        <echo>Selected database configuration:</echo>
+        <echo>
+        </echo>
+        <echo>database type: ${db.type}</echo>
+        <echo>username: ${_db.username}</echo>
+        <echo>jdbc url: ${_jdbc.url}</echo>
+        <echo>
+        </echo>
+        <echo>Make sure that the appropriate jdbc driver jar for the ${db.type} database is placed in the Tomcat shared/lib folder.</echo>
+        <echo>For using the Derby database, the correct driver jar is available in the lib folder.</echo>
+        <echo>
+        </echo>
+        <echo>Also make sure Tomcat is not running before continuing.</echo>
+        <echo>
+        </echo>
+        <input validargs="y,n" defaultvalue="n" addproperty="do.continue">Are you sure to continue?</input>
+        <condition property="failSetup">
+            <equals arg1="n" arg2="${do.continue}" />
+        </condition>
+
+        <antcall target="checkInput" />
+
+    </target>
+
+    <target name="runSetupDB" depends="checkDerby,checkImportPsml,generateStandardDB,generateDerbyDB,copyJetspeedContext,filterSpringFilterKey,seedDB,dbPsml" />
+
+    <target name="runSetupNoDB" depends="checkImportPsml,copyJetspeedContext,filterSpringFilterKey" />
+
+    <target name="initDB" depends="checkDerby" unless="_derby">
+
+        <echo>Initialize Jetspeed database</echo>
+
+        <antcall target="generateStandardDB" />
+
+        <echo>Initialize Jetspeed database complete!</echo>
+
+    </target>
+
+    <target name="exportDB" depends="checkDerby" unless="_derby" if="exportDataDir">
+
+        <echo>Export Jetspeed database to ${exportDataDir}/j2-data.xml</echo>
+
+        <mkdir dir="${exportDataDir}"/>
+        <java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-E &quot;${exportDataDir}/j2-data.xml&quot; 
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;serializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
+        </java>
+
+        <echo>Export Jetspeed database pages to ${exportDataDir}/pages</echo>
+
+        <mkdir dir="${exportDataDir}/pages"/>
+        <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-E &quot;/&quot;
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;pageSerializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;
+              -psml &quot;${exportDataDir}/pages&quot;" />
+        </java>
+        <condition property="_exportedPages">
+            <or>
+                <available file="${exportDataDir}/pages/folder.metadata" type="file"/>
+                <available file="${exportDataDir}/pages/page.security" type="file"/>
+                <available file="${exportDataDir}/pages/_user" type="dir"/>
+                <available file="${exportDataDir}/pages/__subsite-root" type="dir"/>
+                <available file="${exportDataDir}/pages/system" type="dir"/>
+                <available file="${exportDataDir}/pages/Administrative" type="dir"/>
+            </or>
+        </condition>
+        <antcall target="cleanupExportedPages"/>
+
+        <echo>Export Jetspeed database complete!</echo>
+
+    </target>
+
+    <target name="cleanupExportedPages" unless="_exportedPages">
+        <delete dir="${exportDataDir}/pages"/>
+    </target>
+
+    <target name="importDB" depends="checkDerby" unless="_derby" if="importDataDir">
+
+        <echo>Import Jetspeed database from ${importDataDir}/j2-data.xml</echo>
+
+        <java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-I &quot;${importDataDir}/j2-data.xml&quot; 
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;serializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
+        </java>
+
+        <echo>Import Jetspeed database pages from ${importDataDir}/pages</echo>
+
+        <available file="${importDataDir}/pages" type="dir" property="_importPages"/>
+        <antcall target="importPages"/>
+
+        <echo>Import Jetspeed database complete!</echo>
+
+    </target>
 
-		<echo>Setting up the Jetspeed database for ${db.type}</echo>
+    <target name="importPages" if="_importPages">
+        <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-I &quot;/&quot;
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;pageSerializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;
+              -psml &quot;${importDataDir}/pages&quot;" />
+        </java>
+    </target>
+
+    <target name="checkInput" unless="failSetup">
+        <antcall target="runSetupDB" />
+    </target>
+
+    <target name="checkDerby">
+        <condition property="_derby">
+            <equals arg1="${db.type}" arg2="derby" />
+        </condition>
+    </target>
+
+    <target name="checkImportPsml">
+        <condition property="_doImportPsml">
+            <equals arg1="${dbImportPsml}" arg2="true" />
+        </condition>
+    </target>
+
+    <target name="generateDerbyDB" if="_derby">
+        <delete dir="${basedir}/derby/productiondb" quiet="true" />
+        <echo>Executing file ${basedir}/derby/create-schema.sql</echo>
+
+        <java classname="org.apache.jetspeed.anttasks.ExecuteJavaSQL" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <arg line="driver=&quot;${_jdbc.driver.class}&quot; 
+              url=&quot;${_jdbc.url}&quot;
+              userid=&quot;${_db.username}&quot; 
+              password=&quot;{_db.password}&quot;
+              src=&quot;${basedir}/derby/create-schema.sql&quot; autocommit=true
+              onerror=abort" />
+        </java>
+    </target>
+
+    <target name="generateStandardDB" unless="_derby">
+
+        <echo>Cleaning up possible existing database</echo>
+        <sql driver="${_jdbc.driver.class}" url="${_jdbc.url}" userid="${_db.username}" password="${_db.password}" src="${basedir}/${db.type}/drop-schema.sql" autocommit="true" onerror="continue" print="no" output="setup.log">
+            <classpath>
+                <fileset dir="${basedir}/../lib">
+                    <include name="**/*.jar" />
+                </fileset>
+            </classpath>
+        </sql>
+
+        <echo>Starting database generation</echo>
+        <sql driver="${_jdbc.driver.class}" url="${_jdbc.url}" userid="${_db.username}" password="${_db.password}" src="${basedir}/${db.type}/create-schema.sql">
+            <classpath>
+                <fileset dir="${basedir}/../lib">
+                    <include name="**/*.jar" />
+                </fileset>
+            </classpath>
+        </sql>
+        <echo>Database generation done!</echo>
+
+    </target>
+
+    <target name="copyJetspeedContext">
+        <copy file="resources/${portalName}.xml" tofile="${basedir}/../conf/Catalina/localhost/${portalName}.xml" overwrite="true">
+
+            <!-- note that the $ is escaped here -->
+            <filterset begintoken="$${" endtoken="}">
+                <filter token="org.apache.jetspeed.production.database.user" value="${_db.username}" />
+                <filter token="org.apache.jetspeed.production.database.password" value="${_db.password}" />
+                <filter token="org.apache.jetspeed.production.database.driver" value="${_jdbc.driver.class}" />
+                <filter token="org.apache.jetspeed.production.database.url" value="${_jdbc.url}" />
+            </filterset>
+        </copy>
+    </target>
+
+    <target name="filterSpringFilterKey">
+        <delete quiet="true" file="${jetspeedWebInfDir}/conf/spring-filter-key.properties" />
+
+        <!-- Ant's if/else simulation, _doImportPsml has been set before -->
+        <antcall target="filterSpringFilterKey_db"/>
+        <antcall target="filterSpringFilterKey_file"/>
+    </target>
+
+    <target name="filterSpringFilterKey_db" if="_doImportPsml">
+        <copy file="resources/spring-filter-key.properties" todir="${jetspeedWebInfDir}/conf/">
+            <!-- note that the $ is escaped here -->
+            <filterset begintoken="$${" endtoken="}">
+                <filter token="org.apache.jetspeed.spring.filter.key" value="portal.dbPageManager" />
+            </filterset>
+        </copy>
+    </target>
+
+    <target name="filterSpringFilterKey_file" unless="_doImportPsml">
+        <copy file="resources/spring-filter-key.properties" todir="${jetspeedWebInfDir}/conf/">
+            <!-- note that the $ is escaped here -->
+            <filterset begintoken="$${" endtoken="}">
+                <filter token="org.apache.jetspeed.spring.filter.key" value="portal" />
+            </filterset>
+        </copy>
+    </target>
+
+    <target name="seedDB">
+
+        <echo>Seeding the database</echo>
+
+        <java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-I &quot;${basedir}/resources/j2-seed.xml&quot; 
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;serializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
+        </java>
+
+    </target>
+
+    <target name="dbPsml" if="_doImportPsml">
+
+        <echo>Importing psml into the database</echo>
+
+        <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl" fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-I &quot;/&quot;
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;pageSerializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
+        </java>
 
-		<echo>All existing Jetspeed data is going to be deleted from the database.</echo>
-		<echo>
-		</echo>
-		<echo>Selected database configuration:</echo>
-		<echo>
-		</echo>
-		<echo>database type: ${db.type}</echo>
-		<echo>username: ${_db.username}</echo>
-		<echo>jdbc url: ${_jdbc.url}</echo>
-		<echo>
-		</echo>
-		<echo>Make sure that the appropriate jdbc driver jar for the ${db.type} database is placed in the Tomcat shared/lib folder.</echo>
-		<echo>For using the Derby database, the correct driver jar is available in the lib folder.</echo>
-		<echo>
-		</echo>
-		<echo>Also make sure Tomcat is not running before continuing.</echo>
-		<echo>
-		</echo>
-		<input validargs="y,n" defaultvalue="n" addproperty="do.continue">Are you sure to continue?</input>
-		<condition property="failSetup">
-			<equals arg1="n" arg2="${do.continue}" />
-		</condition>
-
-		<antcall target="checkInput" />
-
-	</target>
-
-	<target name="runSetupDB" depends="checkDerby,checkImportPsml,generateStandardDB,generateDerbyDB,copyJetspeedContext,filterSpringFilterKey,seedDB,dbPsml" />
-
-	<target name="runSetupNoDB" depends="checkImportPsml,copyJetspeedContext,filterSpringFilterKey" />
-
-	<target name="checkInput" unless="failSetup">
-		<antcall target="runSetupDB" />
-	</target>
-
-	<target name="checkDerby">
-		<condition property="_derby">
-			<equals arg1="${db.type}" arg2="derby" />
-		</condition>
-	</target>
-
-	<target name="checkImportPsml">
-		<condition property="_doImportPsml">
-			<equals arg1="${dbImportPsml}" arg2="true" />
-		</condition>
-	</target>
-
-	<target name="generateDerbyDB" if="_derby">
-		<delete dir="${basedir}/derby/productiondb" quiet="true" />
-		<echo>Executing file ${basedir}/derby/create-schema.sql</echo>
-
-		<java classname="org.apache.jetspeed.anttasks.ExecuteJavaSQL" fork="yes">
-			<classpath>
-				<fileset dir="${basedir}/../lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<fileset dir="${jetspeedWebInfDir}/lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<fileset dir="${basedir}/lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<pathelement location="${basedir}/../lib" />
-				<pathelement location="${jetspeedWebInfDir}/classes" />
-			</classpath>
-			<arg line="driver=&quot;${_jdbc.driver.class}&quot; 
-	          url=&quot;${_jdbc.url}&quot;
-	          userid=&quot;${_db.username}&quot; 
-	          password=&quot;{_db.password}&quot;
-	          src=&quot;${basedir}/derby/create-schema.sql&quot; autocommit=true
-	          onerror=abort" />
-		</java>
-	</target>
-
-	<target name="generateStandardDB" unless="_derby">
-		<echo>Cleaning up possible existing database</echo>
-
-		<sql driver="${_jdbc.driver.class}" url="${_jdbc.url}" userid="${_db.username}" password="${_db.password}" src="${basedir}/${db.type}/drop-schema.sql" autocommit="true" onerror="continue" print="no" output="setup.log">
-			<classpath>
-				<fileset dir="${basedir}/../lib">
-					<include name="**/*.jar" />
-				</fileset>
-			</classpath>
-		</sql>
-
-		<echo>Starting database generation</echo>
-		<sql driver="${_jdbc.driver.class}" url="${_jdbc.url}" userid="${_db.username}" password="${_db.password}" src="${basedir}/${db.type}/create-schema.sql">
-			<classpath>
-				<fileset dir="${basedir}/../lib">
-					<include name="**/*.jar" />
-				</fileset>
-			</classpath>
-		</sql>
-		<echo>Database generation done!</echo>
-
-	</target>
-
-	<target name="copyJetspeedContext">
-		<copy file="resources/${portalName}.xml" tofile="${basedir}/../conf/Catalina/localhost/${portalName}.xml" overwrite="true">
-
-			<!-- note that the $ is escaped here -->
-			<filterset begintoken="$${" endtoken="}">
-				<filter token="org.apache.jetspeed.production.database.user" value="${_db.username}" />
-				<filter token="org.apache.jetspeed.production.database.password" value="${_db.password}" />
-				<filter token="org.apache.jetspeed.production.database.driver" value="${_jdbc.driver.class}" />
-				<filter token="org.apache.jetspeed.production.database.url" value="${_jdbc.url}" />
-			</filterset>
-		</copy>
-	</target>
-
-	<target name="filterSpringFilterKey">
-		<delete quiet="true" file="${jetspeedWebInfDir}/conf/spring-filter-key.properties" />
-
-		<!-- Ant's if/else simulation, _doImportPsml has been set before -->
-		<antcall target="filterSpringFilterKey_db"/>
-		<antcall target="filterSpringFilterKey_file"/>
-	</target>
-
-	<target name="filterSpringFilterKey_db" if="_doImportPsml">
-		<copy file="resources/spring-filter-key.properties" todir="${jetspeedWebInfDir}/conf/">
-			<!-- note that the $ is escaped here -->
-			<filterset begintoken="$${" endtoken="}">
-				<filter token="org.apache.jetspeed.spring.filter.key" value="portal.dbPageManager" />
-			</filterset>
-		</copy>
-	</target>
-
-	<target name="filterSpringFilterKey_file" unless="_doImportPsml">
-		<copy file="resources/spring-filter-key.properties" todir="${jetspeedWebInfDir}/conf/">
-			<!-- note that the $ is escaped here -->
-			<filterset begintoken="$${" endtoken="}">
-				<filter token="org.apache.jetspeed.spring.filter.key" value="portal" />
-			</filterset>
-		</copy>
-	</target>
-
-	<target name="seedDB">
-
-		<echo>Seeding the database</echo>
-
-		<java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl" fork="yes">
-			<classpath>
-				<fileset dir="${basedir}/../lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<fileset dir="${jetspeedWebInfDir}/lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<fileset dir="${basedir}/lib">
-					<include name="**/*.jar" />
-				</fileset>
-				<pathelement location="${basedir}/../lib" />
-				<pathelement location="${jetspeedWebInfDir}/classes" />
-			</classpath>
-
-            <sysproperty key="org.apache.jetspeed.database.user" value="${_db.username}"/>
-	        <sysproperty key="org.apache.jetspeed.database.password" value="${_db.password}"/>
-	        <sysproperty key="org.apache.jetspeed.database.url" value="${_jdbc.url}"/>
-	        <sysproperty key="org.apache.jetspeed.database.driver" value="${_jdbc.driver.class}"/>
-            <sysproperty key="org.apache.portals.logdir" value="${org.apache.portals.logdir}"/>
-	        	
-			<arg line="-I &quot;${basedir}/resources/j2-seed.xml&quot; 
-              -a &quot;${basedir}/../webapps/${portalName}&quot;
-      		  -c &quot;serializer&quot;
-      	      -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
-		</java>
-
-	</target>
-
-	<target name="dbPsml" if="_doImportPsml">
-
-	    <echo>Importing psml into the database</echo>
-
-	    <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl" fork="yes">
-	      <classpath>
-			<fileset dir="${basedir}/../lib">
-				<include name="**/*.jar" />
-			</fileset>
-			<fileset dir="${jetspeedWebInfDir}/lib">
-				<include name="**/*.jar" />
-			</fileset>
-			<fileset dir="${basedir}/lib">
-				<include name="**/*.jar" />
-			</fileset>
-			<pathelement location="${basedir}/../lib" />
-			<pathelement location="${jetspeedWebInfDir}/classes" />
-	      </classpath>
-
-          <sysproperty key="org.apache.jetspeed.database.user" value="${_db.username}"/>
-          <sysproperty key="org.apache.jetspeed.database.password" value="${_db.password}"/>
-          <sysproperty key="org.apache.jetspeed.database.url" value="${_jdbc.url}"/>
-          <sysproperty key="org.apache.jetspeed.database.driver" value="${_jdbc.driver.class}"/>
-          <sysproperty key="org.apache.portals.logdir" value="${org.apache.portals.logdir}"/>
-
-	      <arg
-	        line="-I &quot;/&quot;
-	              -a &quot;${basedir}/../webapps/${portalName}&quot;
-	      		  -c &quot;pageSerializer&quot;
-	      	      -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;" />
-	    </java>
-	</target>
+    </target>
 
 </project>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message