portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r391124 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java etc/import/export.properties etc/import/import.properties maven.xml
Date Mon, 03 Apr 2006 19:34:34 GMT
Author: taylor
Date: Mon Apr  3 12:34:32 2006
New Revision: 391124

URL: http://svn.apache.org/viewcvs?rev=391124&view=rev
Log:
PSML export feature (DB -> file system)

Added:
    portals/jetspeed-2/trunk/etc/import/export.properties
Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
    portals/jetspeed-2/trunk/etc/import/import.properties
    portals/jetspeed-2/trunk/maven.xml

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java?rev=391124&r1=391123&r2=391124&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/PageImporter.java
Mon Apr  3 12:34:32 2006
@@ -78,9 +78,11 @@
             boolean overwriteFolders = configuration.getBoolean("overwrite.folders", true);
             boolean overwritePages = configuration.getBoolean("overwrite.pages", true);
             boolean fullImport = configuration.getBoolean("full.import", true);
+            String sourcePageManager = configuration.getString("source.page.manager", "castorPageManager");
+            String destPageManager = configuration.getString("dest.page.manager", "dbPageManager");
             
-            PageManager srcManager = (PageManager)ctx.getBean("castorPageManager");
-            PageManager dstManager = (PageManager)ctx.getBean("dbPageManager");
+            PageManager srcManager = (PageManager)ctx.getBean(sourcePageManager);
+            PageManager dstManager = (PageManager)ctx.getBean(destPageManager);
             PageImporter importer = new PageImporter(srcManager, dstManager, rootFolder,
overwriteFolders, overwritePages);
             if (fullImport)
             {

Added: portals/jetspeed-2/trunk/etc/import/export.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/import/export.properties?rev=391124&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/etc/import/export.properties (added)
+++ portals/jetspeed-2/trunk/etc/import/export.properties Mon Apr  3 12:34:32 2006
@@ -0,0 +1,17 @@
+# comma-separated list of boot assemblies for Spring
+boot.assemblies =  repository-datasource-spring.xml
+# comma-separated list of assemblies for Spring
+assemblies = import-page-manager.xml, transaction.xml, interceptors.xml
+# root folder to start importing from
+root.folder = /
+# overwrite folders flag, set to true to replace existing folders
+overwrite.folders = true
+# overwrite pages flag, set to true to replace existing pages 
+overwrite.pages = true
+# if this flag is true, will also try to export page.security 
+full.import = true
+# source page manager Spring component name
+source.page.manager = dbPageManager
+# destination page manager Spring component name
+dest.page.manager = castorPageManager
+

Modified: portals/jetspeed-2/trunk/etc/import/import.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/import/import.properties?rev=391124&r1=391123&r2=391124&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/import/import.properties (original)
+++ portals/jetspeed-2/trunk/etc/import/import.properties Mon Apr  3 12:34:32 2006
@@ -2,11 +2,15 @@
 boot.assemblies =  repository-datasource-spring.xml
 # comma-separated list of assemblies for Spring
 assemblies = import-page-manager.xml, transaction.xml, interceptors.xml
-# root folder to start importing from
+# root folder to start exporting from
 root.folder = /
 # overwrite folders flag, set to true to replace existing folders
 overwrite.folders = true
 # overwrite pages flag, set to true to replace existing pages 
 overwrite.pages = true
 # if this flag is true, will also try to import page.security 
-full.import = true
\ No newline at end of file
+full.import = true
+# source page manager Spring component name
+source.page.manager = castorPageManager
+# destination page manager Spring component name
+dest.page.manager = dbPageManager

Modified: portals/jetspeed-2/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven.xml?rev=391124&r1=391123&r2=391124&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven.xml (original)
+++ portals/jetspeed-2/trunk/maven.xml Mon Apr  3 12:34:32 2006
@@ -297,7 +297,45 @@
                        value="./src/webapp/WEB-INF/pages"/>
         </java>
     </goal>
-    
+
+    <goal name='export'>
+        <filterset id="dbSet" begintoken="$" endtoken="}">
+          <filter token="{org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+          <filter token="{org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
     
+          <filter token="{org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
           
+          <filter token="{org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>
           
+        </filterset>            
+        <copy file="./etc/import/assembly/repository-datasource-spring.xml"
+              tofile="${maven.build.dir}/classes/repository-datasource-spring.xml"
+              overwrite="true"
+              failonerror="true">
+          <filterset refid="dbSet"/>
+        </copy>                
+        <copy todir='${maven.build.dir}/classes'
+          file="./etc/log4j/log4j.properties"/>
+        <copy todir='${maven.build.dir}/classes'>
+          <fileset dir="./etc/db-ojb/"/>
+        </copy>              
+        <copy todir="${maven.build.dir}/classes"
+              file="./etc/import/assembly/import-page-manager.xml"/>
+        <copy todir="${maven.build.dir}/classes"
+              file="./src/webapp/WEB-INF/assembly/transaction.xml"/>
+        <copy todir="${maven.build.dir}/classes"
+              file="./src/webapp/WEB-INF/assembly/alternate/interceptors.xml"/>      
 
+        <mkdir dir="./target/export/psml"></mkdir>
+        <java classname="org.apache.jetspeed.page.PageImporter" fork="yes">
+          <classpath>
+            <path refid="maven.dependency.classpath"/>
+            <pathelement path="${maven.build.dest}"/>
+            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
           
+          </classpath>
+          <sysproperty key="org.apache.jetspeed.page.import.configuration" 
+                       value="./etc/import/export.properties"/>       
+          <sysproperty key="org.apache.jetspeed.page.import.pages"
+                       value="./target/export/psml"/>
+        </java>
+    </goal>
+        
     <goal name='pages'>
 	<copy todir="${org.apache.jetspeed.deploy.war.dir}/jetspeed/WEB-INF/pages/">
         <fileset dir="./src/webapp/WEB-INF/pages/"/>        



---------------------------------------------------------------------
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