portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r505014 [1/11] - in /portals/jetspeed-2/trunk: components/serializer/ components/serializer/src/java/org/apache/jetspeed/serializer/ components/serializer/src/java/org/apache/jetspeed/serializer/objects/ etc/ etc/sql/ etc/xsd/ jetspeed-api/...
Date Thu, 08 Feb 2007 19:31:03 GMT
Author: taylor
Date: Thu Feb  8 11:31:01 2007
New Revision: 505014

URL: http://svn.apache.org/viewvc?view=rev&rev=505014
Log:
https://issues.apache.org/jira/browse/JS2-461
Serializer component: secondary snapshot processing for User Preferences (and entities)
see implementation in JetspeedSerializerSecondaryImpl.java
This completes work on the serializer component for 2.1 release
contribution from Hajo Birthelmer

Added:
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerBase.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerSecondaryImpl.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSApplication.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSApplications.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSEntities.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSEntity.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSEntityPreference.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSEntityPreferences.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNVPElements.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPortlet.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSPortlets.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSecondaryData.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSeedData.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/request-context.xml
Modified:
    portals/jetspeed-2/trunk/components/serializer/maven.xml
    portals/jetspeed-2/trunk/components/serializer/pom.xml
    portals/jetspeed-2/trunk/components/serializer/project.xml
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerApplication.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSNameValuePairs.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUser.java
    portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/objects/JSUserAttributes.java
    portals/jetspeed-2/trunk/etc/build-with-DDLUTILS.xml
    portals/jetspeed-2/trunk/etc/build.xml
    portals/jetspeed-2/trunk/etc/pom.xml
    portals/jetspeed-2/trunk/etc/sql/j2-seed.xml
    portals/jetspeed-2/trunk/etc/xsd/j2-seed.xsd
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
    portals/jetspeed-2/trunk/maven-archetypes/portal/build.xml
    portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/archetype-resources/etc/build.xml
    portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/archetype-resources/etc/pom.xml
    portals/jetspeed-2/trunk/maven-plugin/plugin-with-DDLUTILS.jelly
    portals/jetspeed-2/trunk/maven-plugin/plugin.jelly

Modified: portals/jetspeed-2/trunk/components/serializer/maven.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/maven.xml?view=diff&rev=505014&r1=505013&r2=505014
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/maven.xml (original)
+++ portals/jetspeed-2/trunk/components/serializer/maven.xml Thu Feb  8 11:31:01 2007
@@ -1,115 +1,151 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Copyright 2004 The Apache Software Foundation
-    
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define">
-
-    <!-- Target of maven test:single test -->
-    <property name='testcase' value='org.apache.jetspeed.idgenerator.TestIdGenerator' />
-
-    <goal name='copyAssemblies'>
-        <mkdir dir="${maven.build.dir}/assembly/"/>
-        <mkdir dir="${maven.build.dir}/assembly/boot/"/>        
-        <copy todir='${maven.build.dir}/assembly/boot/' file='../../src/webapp/WEB-INF/assembly/boot/datasource.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/capabilities.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/profiler.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-atn.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-atz.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-managers.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-providers.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi-atn.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi-atz.xml'/>
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/transaction.xml'/>        
-        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/prefs.xml'/>                
-    </goal>
-    
-    <goal name='export'>
-        <copy todir='${maven.build.dir}/classes'
-          file="../../etc/log4j/log4j.properties"/>
-        <copy todir='${maven.build.dir}/classes'>
-          <fileset dir="../../etc/db-ojb/"/>
-        </copy>                      
-        <attainGoal name='copyAssemblies'/>
-        <java classname="org.apache.jetspeed.serializer.JetspeedSerializerApplication" fork="yes">
-          <classpath>
-            <path refid="maven.dependency.classpath"/>
-            <pathelement path="${maven.build.dest}"/>
-            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
-          </classpath>
-            <arg line="-E c:/temp/export100.xml -b target/assembly/boot/ -c target/assembly/"/>  
-            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
-            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
-            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
-            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
-        </java>
-    </goal>
-	<preGoal name='export'>
-        <attainGoal name="java:compile" />		
-	</preGoal>				
-    <goal name='import'>
-        <copy todir='${maven.build.dir}/classes'
-          file="../../etc/log4j/log4j.properties"/>
-        <copy todir='${maven.build.dir}/classes'>
-          <fileset dir="../../etc/db-ojb/"/>
-        </copy>                      
-        <attainGoal name='copyAssemblies'/>
-        <java classname="org.apache.jetspeed.serializer.JetspeedSerializerApplication" fork="yes">
-          <classpath>
-            <path refid="maven.dependency.classpath"/>
-            <pathelement path="${maven.build.dest}"/>
-            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
-          </classpath>
-            <arg line="-I c:/temp/export100.xml -b target/assembly/boot/ -c target/assembly/"/>  
-            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
-            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
-            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
-            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
-        </java>
-    </goal>
-	<preGoal name='import'>
-        <attainGoal name="java:compile" />		
-	</preGoal>		   <goal name='test2'>
-        <echo message="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
-    </goal>
-	
-	<goal name='createDB'>
-	        <copy todir='${maven.build.dir}/classes'
-	          file="../../etc/log4j/log4j.properties"/>
-	        <copy todir='${maven.build.dir}/schema'>
-	          <fileset dir="../../etc/schema/"/>
-	        </copy>                      
-	        <java classname="org.apache.jetspeed.serializer.JetspeedDDLApplication" fork="yes">
-	          <classpath>
-	            <path refid="maven.dependency.classpath"/>
-	            <pathelement path="${maven.build.dest}"/>
-	            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
-	          </classpath> 
-	            <arg line="-I target/schema -R"/>  
-	            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
-	            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
-	            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
-	            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
-	        </java>
-	    </goal>
-		<preGoal name='export'>
-	        <attainGoal name="java:compile" />		
-		</preGoal>				
-	    <goal name='test2'>
-	        <echo message="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
-	    </goal>
-		
-	
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2004 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define">
+
+    <!-- Target of maven test:single test -->
+    <property name='testcase' value='org.apache.jetspeed.idgenerator.TestIdGenerator' />
+
+    <goal name='copyAssemblies'>
+        <mkdir dir="${maven.build.dir}/assembly/"/>
+        <mkdir dir="${maven.build.dir}/assembly/boot/"/>        
+        <copy todir='${maven.build.dir}/assembly/boot/' file='../../src/webapp/WEB-INF/assembly/boot/datasource.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/capabilities.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/profiler.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-atn.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-atz.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-managers.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-providers.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi-atn.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/security-spi-atz.xml'/>
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/transaction.xml'/>        
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/registry.xml'/>        
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/prefs.xml'/>                
+        <copy todir='${maven.build.dir}/assembly/' file='../../src/webapp/WEB-INF/assembly/alternate/request-context.xml'/>                
+    </goal>
+    
+	
+	<goal name='exportprefs'>
+	        <copy todir='${maven.build.dir}/classes'
+	          file="../../etc/log4j/log4j.properties"/>
+	        <copy todir='${maven.build.dir}/classes'>
+	          <fileset dir="../../etc/db-ojb/"/>
+	        </copy>                      
+	        <attainGoal name='copyAssemblies'/>
+	    	
+	        <java classname="org.apache.jetspeed.serializer.JetspeedSerializerApplication" fork="yes">
+	          <classpath>
+	            <path refid="maven.dependency.classpath"/>
+	            <pathelement path="${maven.build.dest}"/>
+	            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
+	          </classpath>
+	        	<arg line="-E c:/temp/exportprefs.xml -b target/assembly/boot/ -c target/assembly/ -O PREFS "/>  
+	            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
+	            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+	            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
+	            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
+	        </java>
+	    </goal>
+		<preGoal name='exportprefs'>
+	        <attainGoal name="java:compile" />		
+		</preGoal>				
+	    
+	
+    <goal name='export'>
+    	<!-- Display maven.dependency.classpath in a nice format. -->
+    	    <property
+    	      name="mavenDependencyClasspath"
+    	      refid="maven.dependency.classpath"
+    	    />
+        <copy todir='${maven.build.dir}/classes'
+          file="../../etc/log4j/log4j.properties"/>
+        <copy todir='${maven.build.dir}/classes'>
+          <fileset dir="../../etc/db-ojb/"/>
+        </copy>                      
+        <attainGoal name='copyAssemblies'/>
+    	
+        <java classname="org.apache.jetspeed.serializer.JetspeedSerializerApplication" fork="yes">
+          <classpath>
+            <path refid="maven.dependency.classpath"/>
+            <pathelement path="${maven.build.dest}"/>
+            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
+          </classpath>
+            <arg line="-E c:/temp/export100.xml -b target/assembly/boot/ -c target/assembly/"/>  
+            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
+            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
+            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
+        </java>
+    </goal>
+	<preGoal name='export'>
+        <attainGoal name="java:compile" />		
+	</preGoal>				
+    <goal name='import'>
+        <copy todir='${maven.build.dir}/classes'
+          file="../../etc/log4j/log4j.properties"/>
+        <copy todir='${maven.build.dir}/classes'>
+          <fileset dir="../../etc/db-ojb/"/>
+        </copy>                      
+        <attainGoal name='copyAssemblies'/>
+        <java classname="org.apache.jetspeed.serializer.JetspeedSerializerApplication" fork="yes">
+          <classpath>
+            <path refid="maven.dependency.classpath"/>
+            <pathelement path="${maven.build.dest}"/>
+            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
+          </classpath>
+            <arg line="-I c:/temp/export100.xml -b target/assembly/boot/ -c target/assembly/"/>  
+            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
+            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
+            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
+        </java>
+    </goal>
+	<preGoal name='import'>
+        <attainGoal name="java:compile" />		
+	</preGoal>		   
+	<goal name='test2'>
+        <echo message="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
+    </goal>
+	
+	<goal name='createDB'>
+	        <copy todir='${maven.build.dir}/classes'
+	          file="../../etc/log4j/log4j.properties"/>
+	        <copy todir='${maven.build.dir}/schema'>
+	          <fileset dir="../../etc/schema/"/>
+	        </copy>                      
+	        <java classname="org.apache.jetspeed.serializer.JetspeedDDLApplication" fork="yes">
+	          <classpath>
+	            <path refid="maven.dependency.classpath"/>
+	            <pathelement path="${maven.build.dest}"/>
+	            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>                          
+	          </classpath> 
+	            <arg line="-I target/schema -R"/>  
+	            <sysproperty key="org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
+	            <sysproperty key="org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+	            <sysproperty key="org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
+	            <sysproperty key="org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>            
+	        </java>
+	    </goal>
+		<preGoal name='export'>
+	        <attainGoal name="java:compile" />		
+		</preGoal>				
+	    <goal name='test2'>
+	        <echo message="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
+	    </goal>
+		
+	
+</project>

Modified: portals/jetspeed-2/trunk/components/serializer/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/pom.xml?view=diff&rev=505014&r1=505013&r2=505014
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/pom.xml (original)
+++ portals/jetspeed-2/trunk/components/serializer/pom.xml Thu Feb  8 11:31:01 2007
@@ -1,144 +1,148 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2006 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-  $Id:$
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-    <prerequisites>
-        <maven>2.0.4</maven>
-    </prerequisites>
-
-    <!-- POM Identification -->
-
-    <artifactId>jetspeed-serializer</artifactId>
-    <parent>
-        <groupId>org.apache.portals.jetspeed-2</groupId>
-        <artifactId>components</artifactId>
-        <version>2.1-dev</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <packaging>jar</packaging>
-    <name>Jetspeed-2 Serializer</name>
-    <description>
-        Jetspeed Serializer
-    </description>
-
-    <!-- Dependencies -->
-
-    <dependencies>
-
-        <!-- Build Dependencies -->
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>        
-        <dependency>
-            <groupId>commons-configuration</groupId>
-            <artifactId>commons-configuration</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javolution</groupId>
-            <artifactId>javolution</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>ddlutils</groupId>
-            <artifactId>ddlutils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${pom.groupId}</groupId>
-            <artifactId>jetspeed-rdbms</artifactId>
-        </dependency>
-
-        <!-- Runtime Dependencies -->
-        <dependency>
-            <groupId>xml-apis</groupId>
-            <artifactId>xml-apis</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-          <groupId>${pom.groupId}</groupId>
-          <artifactId>jetspeed-cm</artifactId>
-        </dependency>            
-        <dependency>
-            <groupId>${pom.groupId}</groupId>
-            <artifactId>jetspeed-api</artifactId>
-        </dependency>
-    </dependencies>
-
-    <!-- Build Configuration -->
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>hot-deploy-component</id>
-                        <phase>install</phase>
-                        <configuration>
-                            <tasks>
-                                <ant target="hot-deploy-jar" antfile="build.xml" dir="${basedir}/../../app-servers" inheritall="off">
-                                    <property name="org.apache.jetspeed.deploy.enable"
-                                              value="${org.apache.jetspeed.env.hotdeploy}"/>
-                                    <property name="org.apache.jetspeed.deploy.target"
-                                              value="${org.apache.jetspeed.env.deploy.target}"/>
-                                    <property name="org.apache.jetspeed.server.home"
-                                              value="${org.apache.jetspeed.server.home}"/>
-                                    <property name="org.apache.jetspeed.deploy.groupid"
-                                              value="${pom.groupId}"/>
-                                    <property name="org.apache.jetspeed.deploy.artifactid"
-                                              value="${pom.artifactId}"/>
-                                    <property name="org.apache.jetspeed.deploy.version"
-                                              value="${pom.version}"/>
-                                </ant>
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <!-- Project Information -->
-
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer</developerConnection>
-        <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/serializer/</url>
-    </scm>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2006 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+  $Id:$
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <prerequisites>
+        <maven>2.0.4</maven>
+    </prerequisites>
+
+    <!-- POM Identification -->
+
+    <artifactId>jetspeed-serializer</artifactId>
+    <parent>
+        <groupId>org.apache.portals.jetspeed-2</groupId>
+        <artifactId>components</artifactId>
+        <version>2.1-dev</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <packaging>jar</packaging>
+    <name>Jetspeed-2 Serializer</name>
+    <description>
+        Jetspeed Serializer
+    </description>
+
+    <!-- Dependencies -->
+
+    <dependencies>
+
+        <!-- Build Dependencies -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javolution</groupId>
+            <artifactId>javolution</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ddlutils</groupId>
+            <artifactId>ddlutils</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>jetspeed-rdbms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>jetspeed-registry</artifactId>
+        </dependency>
+
+        <!-- Runtime Dependencies -->
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>${pom.groupId}</groupId>
+          <artifactId>jetspeed-cm</artifactId>
+        </dependency>            
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>jetspeed-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <!-- Build Configuration -->
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>hot-deploy-component</id>
+                        <phase>install</phase>
+                        <configuration>
+                            <tasks>
+                                <ant target="hot-deploy-jar" antfile="build.xml" dir="${basedir}/../../app-servers" inheritall="off">
+                                    <property name="org.apache.jetspeed.deploy.enable"
+                                              value="${org.apache.jetspeed.env.hotdeploy}"/>
+                                    <property name="org.apache.jetspeed.deploy.target"
+                                              value="${org.apache.jetspeed.env.deploy.target}"/>
+                                    <property name="org.apache.jetspeed.server.home"
+                                              value="${org.apache.jetspeed.server.home}"/>
+                                    <property name="org.apache.jetspeed.deploy.groupid"
+                                              value="${pom.groupId}"/>
+                                    <property name="org.apache.jetspeed.deploy.artifactid"
+                                              value="${pom.artifactId}"/>
+                                    <property name="org.apache.jetspeed.deploy.version"
+                                              value="${pom.version}"/>
+                                </ant>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!-- Project Information -->
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer</developerConnection>
+        <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/serializer/</url>
+    </scm>
+
+</project>

Modified: portals/jetspeed-2/trunk/components/serializer/project.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/project.xml?view=diff&rev=505014&r1=505013&r2=505014
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/project.xml (original)
+++ portals/jetspeed-2/trunk/components/serializer/project.xml Thu Feb  8 11:31:01 2007
@@ -1,79 +1,144 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-    $Id: project.xml 355198 2005-12-08 20:44:03Z rogerrut $
--->
-<project>
-<extend>${basedir}/../../core-build.xml</extend>
-  <pomVersion>3</pomVersion>
-  <id>jetspeed-serializer</id>
-  <name>Jetspeed-2 Serializer</name>
-  
-  <package>org.apache.jetspeed</package>
-    <description>Jetspeed Serializer</description>
-  <shortDescription>Serializer</shortDescription>
-
-  <repository>                 
-        <connection>
-            scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer
-        </connection>
-        <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer
-        </developerConnection>
-    <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/serializer/</url>
-  </repository>
-  
-  
-  <dependencies>
-  	<dependency>
-      <id>org.apache.portals.jetspeed-2:jetspeed-commons</id>
-      <version>${jetspeed.version}</version>
-      <properties>
-         <war.bundle>true</war.bundle>
-      </properties>                    
-    </dependency>
-  	<dependency>
-      <id>org.apache.portals.jetspeed-2:jetspeed-cm</id>
-      <version>${jetspeed.version}</version>
-      <properties>
-         <war.bundle>true</war.bundle>
-      </properties>                              
-    </dependency>            
-    <dependency>
-      <id>org.apache.portals.jetspeed-2:jetspeed-api</id>
-      <version>${jetspeed.version}</version>
-      <properties>
-         <war.bundle>true</war.bundle>
-      </properties>                            
-    </dependency>
-    <dependency>
-      <id>org.apache.portals.jetspeed-2:jetspeed-rdbms</id>
-      <version>${jetspeed.version}</version>
-      <properties>
-         <war.bundle>true</war.bundle>
-      </properties>                            
-    </dependency>      
-    <dependency>
-      <id>org.apache.portals.jetspeed-2:jetspeed-capability</id>
-      <version>${jetspeed.version}</version>
-      <properties>
-         <war.bundle>true</war.bundle>
-      </properties>                            
-    </dependency>            
-  </dependencies>
-  
-  
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+    $Id: project.xml 355198 2005-12-08 20:44:03Z rogerrut $
+-->
+<project>
+<extend>${basedir}/../../core-build.xml</extend>
+  <pomVersion>3</pomVersion>
+  <id>jetspeed-serializer</id>
+  <name>Jetspeed-2 Serializer</name>
+  
+  <package>org.apache.jetspeed</package>
+    <description>Jetspeed Serializer</description>
+  <shortDescription>Serializer</shortDescription>
+
+  <repository>                 
+        <connection>
+            scm:svn:http://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer
+        </connection>
+        <developerConnection>
+            scm:svn:https://svn.apache.org/repos/asf/portals/jetspeed-2/trunk/components/serializer
+        </developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/serializer/</url>
+  </repository>
+  
+  
+  <dependencies>
+  	<dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-commons</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                    
+    </dependency>
+  	<dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-cm</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                              
+    </dependency>            
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-api</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-rdbms</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>      
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-capability</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-registry</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+
+  <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-profiler</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-locator</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-security</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-prefs</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+
+
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-portlet-factory</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+
+
+<!--  UNCOMMENT IF RUNNING TEST CASE right from the serilizer directory (e.g. "maven export")  !!!!!
+    <dependency>
+      <id>org.apache.portals.jetspeed-2:jetspeed-portal</id>
+      <version>${jetspeed.version}</version>
+      <properties>
+         <war.bundle>true</war.bundle>
+      </properties>                            
+    </dependency>            
+-->
+
+        
+  </dependencies>
+  
+  
+</project>

Modified: portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerApplication.java?view=diff&rev=505014&r1=505013&r2=505014
==============================================================================
--- portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerApplication.java (original)
+++ portals/jetspeed-2/trunk/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerApplication.java Thu Feb  8 11:31:01 2007
@@ -1,481 +1,514 @@
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.jetspeed.serializer;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.jetspeed.components.jndi.SpringJNDIStarter;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-/**
- * Jetspeed Serializer Application
- * 
- * invoke with mandatory 
- * <p>-E filename or -I filename to denote the export or the import file</p>
- * <p>-I filename | directory, if a directory will process all XML files of pattern "*seed.xml"</p>
- * 
- * invoke with (optional) parameters as
- * <p>-p propertyFilename : overwrite the default filename defined in System.getProperty JetSpeed.Serializer.Configuration</p> 
- * <p>-a ApplicationPath : overwrite the default ./ or ApplicationPath property in properties file)</p>
- * <p>-b bootPath : directory to Spring boot files,   overwrite the default assembly/boot/ or bootPath  property in properties file)</p>  
- * <p>-c configPath : directory to Spring config files,   overwrite the default assembly/ or configPath property in properties file)</p>
- * 
- * <p>-o optionstring : overwrite defrault "ALL,REPLACE"</p>
- * <p>optionstring: 
- *      ALL - extract/import all 
- *      USER - extract/import users
- *      USERPREFS - extract/import user preferences (for export requires USER)
- *      CAPABILITIES - extract/import capabilities
- *      PROFILE = extract/import profile settings (for export requires USER) 
- *      NOOVERWRITE = don't overwrite existing file (for export)
- *      BACKUP = backup before process
- * </p>
- * <p>
- * -dc driverClass, for example com.mysql.jdbc.Driver
- * </p>
- * <p>
- * -ds url, ruls according to the driver used, URL needs to point to the correct
- * database
- * </p>
- * <p>
- * -du user, user with create/drop etc. rights on the database
- * </p>
- * <p>
- * -dp password
- * </p>
- * 
- * <p>
- * -l log4j-level, ERROR (default), WARN, INFO 
- * </p>
- * 
- * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
- * @version $Id: $
- */
-public class JetspeedSerializerApplication
-{
-    public static final String JNDI_DS_NAME = "jetspeed";    
-    
-    public static void main(String[] args)
-    {
-        String propertyFileName = null;
-        
-        String fileName = null; // XML filename - mandatory on command line        
-        String applicationPath = null; // configuration.getProperties("applicationPath");
-        String bootConfigFiles = null; // configuration.getProperties("bootConfigFiles");
-        String configFiles = null; // configuration.getProperties("configFiles");
-
-        String name = null;
-        
-        String options = null;
-        
-        PropertiesConfiguration configuration = null;
-        
-        String defaultIndent = null;
-
-    	String driverClass = null; // jdbc driver
-    	String url = null; // jdbc url to database
-    	String user = null; // user
-    	String password = null; // password
-
-        String logLevel = null;
-        
-        boolean doImport = false;
-        boolean doExport = false;
- 
-        if (args == null)
-            throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
-
-        
-        // Parse all the command-line arguments
-        for (int n = 0; n < args.length; n++)
-        {
-            if (args[n].equals("-p"))
-                propertyFileName = args[++n];
-            else if (args[n].equals("-a"))
-                applicationPath = args[++n];
-            else if (args[n].equals("-b"))
-                bootConfigFiles = args[++n];
-            else if (args[n].equals("-c"))
-                configFiles = args[++n];
-            else if (args[n].equals("-E"))
-            {
-                doExport = true;
-                fileName = args[++n];
-            } 
-            else if (args[n].equals("-I"))
-            {
-                doImport = true;
-                fileName = args[++n];
-            } 
-            else if (args[n].equals("-N"))
-            {
-                name = args[++n];
-            }
-            else if (args[n].equals("-l"))
-                logLevel = args[++n];
-            else if (args[n].equals("-O"))
-                options = args[++n];
-            else if (args[n].equals("-dc"))
-                driverClass = args[++n];
-            else if (args[n].equals("-ds"))
-                url = args[++n];
-            else if (args[n].equals("-du"))
-            {
-                if (((n + 1) >= args.length) || args[n + 1].startsWith("-d"))
-                {
-                    user = "";
-                } else
-                {
-                    user = args[++n];
-                }
-            } 
-            else if (args[n].equals("-dp"))
-            {
-                if (((n + 1) >= args.length) || args[n + 1].startsWith("-d"))
-                {
-                    password = "";
-                } else
-                {
-                    password = args[++n];
-                }
-            } 
-            else
-            {
-                throw new IllegalArgumentException("Unknown argument: "
-                        + args[n]);
-            }
-        }
-        
-        /** The only required argument is the filename for either export or import*/
-        if ((!doImport) && (!doExport))
-          throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
-
-        /** But not both*/
-        if ((doImport) && (doExport))
-            throw new IllegalArgumentException("Only one - either import or export - can be requested");
-
-        if (name == null) name = fileName;
-        
-        /** get system property definition */
-        if (propertyFileName == null)
-            propertyFileName = System.getProperty(
-                "org.apache.jetspeed.xml.importer.configuration",
-                null);
- 
-        if (propertyFileName != null)
-        {    
-            try
-            {
-                configuration = new PropertiesConfiguration(propertyFileName);
-            }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-                System.exit(1);
-            }
-            if (configuration != null)
-            {
-                /** only read what was not defined on the command line */
-            
-                if (applicationPath == null) 
-                    applicationPath = configuration.getString("applicationPath");
-                if (bootConfigFiles == null)  
-                    bootConfigFiles = configuration.getString("bootConfigFiles");
-                if (configFiles == null) 
-                    configFiles = configuration.getString("configFiles");
-                if (options == null) 
-                    options = configuration.getString("options");
-                if (defaultIndent == null) 
-                    defaultIndent = configuration.getString("defaultIndent");
-
-        		if (driverClass == null)
-    				driverClass = configuration.getString("driverClass");
-    			if (url == null)
-    				url = configuration.getString("url");
-    			if (user == null)
-    				user = configuration.getString("user");
-    			if (password == null)
-    				password = configuration.getString("password");
-    			if (logLevel == null)
-    				logLevel = configuration.getString("loglevel");
-    				
-    	
-            }
-        }
-
-        // if we still miss some settings, use hardoced defaults
-        if (applicationPath == null) 
-            applicationPath = "./";
-        if (bootConfigFiles == null) 
-            bootConfigFiles = "assembly/boot/";
-        if (configFiles == null) 
-            configFiles = "assembly/";
-		if (logLevel == null) 
-            logLevel = "ERROR";
-      
-
-        bootConfigFiles = bootConfigFiles + "*.xml";
-        configFiles = configFiles + "*.xml";
-     
-        // ok - we are ready to rumble....
-        
-        /** create the instruction map */
-        
-        Map settings = null;
-        if (options != null)
-        {
-            settings = new HashMap();
-            settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.FALSE);
-            settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.FALSE);
-            settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.FALSE);
-            settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.FALSE);
-            settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
-            settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);            
-            String[] optionSet = getTokens(options);
-            
-            
-            for (int i = 0; i < optionSet.length; i++)
-            {
-                String o = optionSet[i];
-                if (o.equalsIgnoreCase("all"))
-                {
-                    settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.TRUE);
-                    settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.TRUE);
-                    settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.TRUE);
-                    settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.TRUE);
-                }
-                else
-                if (o.equalsIgnoreCase("user"))
-                    settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.TRUE);
-                else 
-                    if (o.equalsIgnoreCase("USERPREFS"))
-                        settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.TRUE);
-                    else 
-                        if (o.equalsIgnoreCase("CAPABILITIES"))
-                            settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.TRUE);
-                        else 
-                            if (o.equalsIgnoreCase("PROFILE"))
-                                settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.TRUE);
-                            else 
-                                if (o.equalsIgnoreCase("NOOVERWRITE"))
-                                    settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.FALSE);
-                                else 
-                                    if (o.equalsIgnoreCase("BACKUP"))
-                                        settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.TRUE);
-                
-            }
-        }
-        JetspeedSerializer serializer = null;
-
-		if (driverClass == null)
-			driverClass = System.getProperty(
-					"org.apache.jetspeed.database.driverClass",
-					"com.mysql.jdbc.Driver");
-		if (url == null)
-			url = System.getProperty("org.apache.jetspeed.database.url",
-					"jdbc:mysql://localhost/j2test");
-		if (user == null)
-			user = System.getProperty("org.apache.jetspeed.database.user",
-					"user");
-		if (password == null)
-			password = System.getProperty(
-					"org.apache.jetspeed.database.password", "password");
-
-		if (driverClass == null)
-			throw new IllegalArgumentException(
-					"Can't proceed without a valid driver");
-		if (url == null)
-			throw new IllegalArgumentException(
-					"Can't proceed without a valid url to the target database");
-		if (user == null)
-			throw new IllegalArgumentException(
-					"Can't proceed without a valid database user");
-
-        
-        
-        HashMap context = new HashMap();
- 
-		context.put(SpringJNDIStarter.DATASOURCE_DRIVER, driverClass);
-		context.put(SpringJNDIStarter.DATASOURCE_URL, url);
-		context.put(SpringJNDIStarter.DATASOURCE_USERNAME, user);
-		context.put(SpringJNDIStarter.DATASOURCE_PASSWORD, password);
-        
-		Logger  logger = Logger.getLogger("org.springframework");
-		Level level = logger.getLevel();
-		if (logLevel.equalsIgnoreCase("INFO"))
-			logger.setLevel(Level.INFO);
-		else
-			if (logLevel.equalsIgnoreCase("WARN"))
-				logger.setLevel(Level.WARN);
-			else
-				logger.setLevel(Level.ERROR);
-				
-
-        SpringJNDIStarter starter = new SpringJNDIStarter(context,applicationPath,getTokens(bootConfigFiles),getTokens(configFiles));
-        
-        System.out.println("starter framework created " + starter);
-        
-        
-        try
-        {
-            starter.setUp();
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-            System.exit(1);
-        }
-        System.out.println("starter framework established " + starter);
-        String[] importList = null;
-
-        if (doImport)
-        	importList = parseFiles(fileName);
-    	
-        if ((doImport) && (importList != null) && (importList.length > 0))
-        {
-			for (int i = 0; i < importList.length; i++)
-			{
-				try
-			    {
-			        System.out.println("processing import  " + importList[i]);
-			        serializer = new JetspeedSerializerImpl(starter.getComponentManager());
-			        serializer.importData(importList[i], settings);
-			        System.out.println("processing import  " + importList[i] + " done");
-			        
-			    } 
-			    catch (Exception e)
-			    {
-			        System.err.println("Failed to process XML import for " + importList[i] + ":" + e);
-			        e.printStackTrace();
-			    }
-			    finally
-			    {
-			        if (serializer != null)
-			            serializer.closeUp();
-			    }
-			 }
-        }
-        if (doExport)
-        {
-        	try
-	        {
-	            serializer = new JetspeedSerializerImpl(starter.getComponentManager());
-	                serializer.exportData(name, fileName, settings);
-	        } 
-	        catch (Exception e)
-	        {
-	            System.err.println("Failed to process XML export of " + fileName + ": " + e);
-	            e.printStackTrace();
-	        }
-	        finally
-	        {
-	            if (serializer != null)
-	                serializer.closeUp();
-	        }
-
-        }
-        try
-        {
-           starter.tearDown();
-           logger.setLevel(level);;
-        }
-        catch (Exception e1)
-        {
-            System.out.println("starter framework teardown caused exception "  + e1.getLocalizedMessage());
-            e1.printStackTrace();
-            
-        }            
-        System.out.println("DONE performing " + (doExport?"export":"import")+ " with " + fileName);
-    }
-    
-        
-       
-	/**
-	 * process provided filename or directory name
-	 * 
-	 * @return one or more files to be processed
-	 */
-	static private String[] parseFiles(String schemaDirectory)
-	{
-		String[] fileList = null;
-		try
-		{
-			File dir = new File(schemaDirectory);
-			if (!(dir.exists()))
-            {
-				return fileList;
-            }
-			if (!(dir.isDirectory()))
-			{
-				fileList = new String[1];
-				fileList[0] = schemaDirectory;
-				return fileList;
-			}
-			// 	Handling a directory
-			File[] files = dir.listFiles(
-				    new FilenameFilter() {
-				        public boolean accept(File dir, String name) 
-				        			{String n = name.toLowerCase();
-	   								return n.endsWith("seed.xml");
-				        }
-				    });
-			if (files == null)
-				return fileList;
-
-			fileList = new String[files.length];
-			for (int i = 0; i < files.length; i++)
-            {
-				fileList[i] = files[i].getAbsolutePath();
-            }
-			return fileList;
-		} 
-        catch (Exception e)
-		{
-			e.printStackTrace(); 
-			throw new IllegalArgumentException(
-					"Processing the schema-directory " + schemaDirectory
-							+ " caused exception "
-							+ e.getLocalizedMessage());
-		}
-
-		
-	}
-
-    
-        private static  String[] getTokens(String _line)
-        {
-            if ((_line == null) || (_line.length() == 0))
-                return null;
-            
-            StringTokenizer st = new StringTokenizer(_line, ",");
-            ArrayList list = new ArrayList();
-
-            while (st.hasMoreTokens())
-                list.add(st.nextToken());
-            String[] s = new String[list.size()];
-            for (int i=0; i<list.size(); i++)
-                s[i] = (String)list.get(i);
-            return s;
-        }
-
-        
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.serializer;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.jetspeed.components.jndi.SpringJNDIStarter;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+/**
+ * Jetspeed Serializer Application
+ * 
+ * invoke with mandatory 
+ * <p>-E filename or -I filename to denote the export or the import file</p>
+ * <p>-I filename | directory, if a directory will process all XML files of pattern "*seed.xml"</p>
+ * 
+ * invoke with (optional) parameters as
+ * <p>-p propertyFilename : overwrite the default filename defined in System.getProperty JetSpeed.Serializer.Configuration</p> 
+ * <p>-a ApplicationPath : overwrite the default ./ or ApplicationPath property in properties file)</p>
+ * <p>-b bootPath : directory to Spring boot files,   overwrite the default assembly/boot/ or bootPath  property in properties file)</p>  
+ * <p>-c configPath : directory to Spring config files,   overwrite the default assembly/ or configPath property in properties file)</p>
+ * 
+ * <p>-O optionstring : overwrite defrault "ALL,REPLACE"</p>
+ * <p>optionstring: 
+ *      ALL - extract/import all (with exception of PREFERENCES)
+ *      USER - extract/import users
+ *      CAPABILITIES - extract/import capabilities
+ *      PROFILE = extract/import profile settings (for export requires USER) 
+ *      PREFS = extract/import  portlet preferences (ignored if any of the above is set)
+ *      
+ *      NOOVERWRITE = don't overwrite existing file (for export)
+ *      BACKUP = backup before process
+ * </p>
+ * <p>
+ * -dc driverClass, for example com.mysql.jdbc.Driver
+ * </p>
+ * <p>
+ * -ds url, ruls according to the driver used, URL needs to point to the correct
+ * database
+ * </p>
+ * <p>
+ * -du user, user with create/drop etc. rights on the database
+ * </p>
+ * <p>
+ * -dp password
+ * </p>
+ * 
+ * <p>
+ * -l log4j-level, ERROR (default), WARN, INFO 
+ * </p>
+ * 
+ * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
+ * @version $Id: $
+ */
+public class JetspeedSerializerApplication
+{
+    public static final String JNDI_DS_NAME = "jetspeed";    
+    
+    public static void main(String[] args)
+    {
+        String propertyFileName = null;
+        
+        String fileName = null; // XML filename - mandatory on command line        
+        String applicationPath = null; // configuration.getProperties("applicationPath");
+        String bootConfigFiles = null; // configuration.getProperties("bootConfigFiles");
+        String configFiles = null; // configuration.getProperties("configFiles");
+
+        String name = null;
+        
+        String options = null;
+        
+        PropertiesConfiguration configuration = null;
+        
+        String defaultIndent = null;
+
+    	String driverClass = null; // jdbc driver
+    	String url = null; // jdbc url to database
+    	String user = null; // user
+    	String password = null; // password
+
+        String logLevel = null;
+        
+        boolean doImport = false;
+        boolean doExport = false;
+ 
+        if (args == null)
+            throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
+
+        
+        // Parse all the command-line arguments
+        for (int n = 0; n < args.length; n++)
+        {
+            if (args[n].equals("-p"))
+                propertyFileName = args[++n];
+            else if (args[n].equals("-a"))
+                applicationPath = args[++n];
+            else if (args[n].equals("-b"))
+                bootConfigFiles = args[++n];
+            else if (args[n].equals("-c"))
+                configFiles = args[++n];
+            else if (args[n].equals("-E"))
+            {
+                doExport = true;
+                fileName = args[++n];
+            } 
+            else if (args[n].equals("-I"))
+            {
+                doImport = true;
+                fileName = args[++n];
+            } 
+            else if (args[n].equals("-N"))
+            {
+                name = args[++n];
+            }
+            else if (args[n].equals("-l"))
+                logLevel = args[++n];
+            else if (args[n].equals("-O"))
+                options = args[++n];
+            else if (args[n].equals("-dc"))
+                driverClass = args[++n];
+            else if (args[n].equals("-ds"))
+                url = args[++n];
+            else if (args[n].equals("-du"))
+            {
+                if (((n + 1) >= args.length) || args[n + 1].startsWith("-d"))
+                {
+                    user = "";
+                } else
+                {
+                    user = args[++n];
+                }
+            } 
+            else if (args[n].equals("-dp"))
+            {
+                if (((n + 1) >= args.length) || args[n + 1].startsWith("-d"))
+                {
+                    password = "";
+                } else
+                {
+                    password = args[++n];
+                }
+            } 
+            else
+            {
+                throw new IllegalArgumentException("Unknown argument: "
+                        + args[n]);
+            }
+        }
+        
+        /** The only required argument is the filename for either export or import*/
+        if ((!doImport) && (!doExport))
+          throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
+
+        /** But not both*/
+        if ((doImport) && (doExport))
+            throw new IllegalArgumentException("Only one - either import or export - can be requested");
+
+        if (name == null) name = fileName;
+        
+        /** get system property definition */
+        if (propertyFileName == null)
+            propertyFileName = System.getProperty(
+                "org.apache.jetspeed.xml.importer.configuration",
+                null);
+ 
+        if (propertyFileName != null)
+        {    
+            try
+            {
+                configuration = new PropertiesConfiguration(propertyFileName);
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+                System.exit(1);
+            }
+            if (configuration != null)
+            {
+                /** only read what was not defined on the command line */
+            
+                if (applicationPath == null) 
+                    applicationPath = configuration.getString("applicationPath");
+                if (bootConfigFiles == null)  
+                    bootConfigFiles = configuration.getString("bootConfigFiles");
+                if (configFiles == null) 
+                    configFiles = configuration.getString("configFiles");
+                if (options == null) 
+                    options = configuration.getString("options");
+                if (defaultIndent == null) 
+                    defaultIndent = configuration.getString("defaultIndent");
+
+        		if (driverClass == null)
+    				driverClass = configuration.getString("driverClass");
+    			if (url == null)
+    				url = configuration.getString("url");
+    			if (user == null)
+    				user = configuration.getString("user");
+    			if (password == null)
+    				password = configuration.getString("password");
+    			if (logLevel == null)
+    				logLevel = configuration.getString("loglevel");
+    				
+    	
+            }
+        }
+
+        // if we still miss some settings, use hardoced defaults
+        if (applicationPath == null) 
+            applicationPath = "./";
+        if (bootConfigFiles == null) 
+            bootConfigFiles = "assembly/boot/";
+        if (configFiles == null) 
+            configFiles = "assembly/";
+		if (logLevel == null) 
+            logLevel = "ERROR";
+      
+
+        bootConfigFiles = bootConfigFiles + "*.xml";
+        configFiles = configFiles + "*.xml";
+     
+        // ok - we are ready to rumble....
+        
+        /** create the instruction map */
+        
+        Map settings = null;
+        int processHelper = 1; // default process SEED
+        if (options != null)
+        {
+            settings = new HashMap();
+            settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.FALSE);
+            settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.FALSE);
+            settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.FALSE);
+            settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.FALSE);
+            settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
+            settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);            
+            String[] optionSet = getTokens(options);
+            
+            processHelper = 0;
+            
+            for (int i = 0; i < optionSet.length; i++)
+            {
+                String o = optionSet[i];
+                if (o.equalsIgnoreCase("all"))
+                {
+                    settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.TRUE);
+                    settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.TRUE);
+                    settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.TRUE);
+                    settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.FALSE);
+                    processHelper = 1;
+                }
+                else
+                if (o.equalsIgnoreCase("user"))
+                {
+                    settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.TRUE);
+                    processHelper = 1;
+                }
+                else 
+                    if (o.equalsIgnoreCase("PREFS"))
+                    {
+                        settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.TRUE);
+                		processHelper = 2;
+                    }
+                    else 
+                        if (o.equalsIgnoreCase("CAPABILITIES"))
+                        {
+                            settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.TRUE);
+                            processHelper = 1;
+                        }
+                        else 
+                            if (o.equalsIgnoreCase("PROFILE"))
+                            {
+                                settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.TRUE);
+                                processHelper = 1;
+                            }
+                            else 
+                                if (o.equalsIgnoreCase("NOOVERWRITE"))
+                                    settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.FALSE);
+                                else 
+                                    if (o.equalsIgnoreCase("BACKUP"))
+                                        settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.TRUE);
+                
+            }
+            
+        }
+        JetspeedSerializer serializer = null;
+
+		if (driverClass == null)
+			driverClass = System.getProperty(
+					"org.apache.jetspeed.database.driverClass",
+					"com.mysql.jdbc.Driver");
+		if (url == null)
+			url = System.getProperty("org.apache.jetspeed.database.url",
+					"jdbc:mysql://localhost/j2test");
+		if (user == null)
+			user = System.getProperty("org.apache.jetspeed.database.user",
+					"user");
+		if (password == null)
+			password = System.getProperty(
+					"org.apache.jetspeed.database.password", "password");
+
+		if (driverClass == null)
+			throw new IllegalArgumentException(
+					"Can't proceed without a valid driver");
+		if (url == null)
+			throw new IllegalArgumentException(
+					"Can't proceed without a valid url to the target database");
+		if (user == null)
+			throw new IllegalArgumentException(
+					"Can't proceed without a valid database user");
+
+        
+        
+        HashMap context = new HashMap();
+ 
+		context.put(SpringJNDIStarter.DATASOURCE_DRIVER, driverClass);
+		context.put(SpringJNDIStarter.DATASOURCE_URL, url);
+		context.put(SpringJNDIStarter.DATASOURCE_USERNAME, user);
+		context.put(SpringJNDIStarter.DATASOURCE_PASSWORD, password);
+        
+		Logger  logger = Logger.getLogger("org.springframework");
+		Level level = logger.getLevel();
+		if (logLevel.equalsIgnoreCase("INFO"))
+			logger.setLevel(Level.INFO);
+		else
+			if (logLevel.equalsIgnoreCase("WARN"))
+				logger.setLevel(Level.WARN);
+			else
+				logger.setLevel(Level.ERROR);
+				
+/**
+ * set the application root
+ */
+		System.setProperty("applicationRoot",applicationPath);
+		System.setProperty("portal.name","jetspped");
+        SpringJNDIStarter starter = new SpringJNDIStarter(context,applicationPath,getTokens(bootConfigFiles),getTokens(configFiles));
+        
+        System.out.println("starter framework created " + starter);
+        
+        
+        try
+        {
+            starter.setUp();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            System.exit(1);
+        }
+        System.out.println("starter framework established " + starter);
+        String[] importList = null;
+
+        if (doImport)
+        	importList = parseFiles(fileName);
+    	
+        if ((doImport) && (importList != null) && (importList.length > 0))
+        {
+			for (int i = 0; i < importList.length; i++)
+			{
+				try
+			    {
+			        System.out.println("processing import  " + importList[i]);
+			        if (processHelper == 2)
+			        {
+			        	serializer = new JetspeedSerializerSecondaryImpl(starter.getComponentManager());
+			        }
+			        else
+			        	serializer = new JetspeedSerializerImpl(starter.getComponentManager());
+			        serializer.importData(importList[i], settings);
+			        System.out.println("processing import  " + importList[i] + " done");
+			        
+			    } 
+			    catch (Exception e)
+			    {
+			        System.err.println("Failed to process XML import for " + importList[i] + ":" + e);
+			        e.printStackTrace();
+			    }
+			    finally
+			    {
+			        if (serializer != null)
+			            serializer.closeUp();
+			    }
+			 }
+        }
+        if (doExport)
+        {
+        	try
+	        {
+		        System.out.println("processing export to  " + fileName);
+		        if (processHelper == 2)
+		        {
+		        	serializer = new JetspeedSerializerSecondaryImpl(starter.getComponentManager());
+		        }
+		        else
+		        	serializer = new JetspeedSerializerImpl(starter.getComponentManager());
+
+		        serializer.exportData(name, fileName, settings);
+	        } 
+	        catch (Exception e)
+	        {
+	            System.err.println("Failed to process XML export of " + fileName + ": " + e);
+	            e.printStackTrace();
+	        }
+	        finally
+	        {
+	            if (serializer != null)
+	                serializer.closeUp();
+ 	        }
+
+        }
+        try
+        {
+           starter.tearDown();
+           logger.setLevel(level);;
+        }
+        catch (Exception e1)
+        {
+            System.out.println("starter framework teardown caused exception "  + e1.getLocalizedMessage());
+            e1.printStackTrace();
+            
+        }            
+        System.out.println("DONE performing " + (doExport?"export":"import")+ " with " + fileName);
+    }
+    
+        
+       
+	/**
+	 * process provided filename or directory name
+	 * 
+	 * @return one or more files to be processed
+	 */
+	static private String[] parseFiles(String schemaDirectory)
+	{
+		String[] fileList = null;
+		try
+		{
+			File dir = new File(schemaDirectory);
+			if (!(dir.exists()))
+            {
+				return fileList;
+            }
+			if (!(dir.isDirectory()))
+			{
+				fileList = new String[1];
+				fileList[0] = schemaDirectory;
+				return fileList;
+			}
+			// 	Handling a directory
+			File[] files = dir.listFiles(
+				    new FilenameFilter() {
+				        public boolean accept(File dir, String name) 
+				        			{String n = name.toLowerCase();
+	   								return n.endsWith("seed.xml");
+				        }
+				    });
+			if (files == null)
+				return fileList;
+
+			fileList = new String[files.length];
+			for (int i = 0; i < files.length; i++)
+            {
+				fileList[i] = files[i].getAbsolutePath();
+            }
+			return fileList;
+		} 
+        catch (Exception e)
+		{
+			e.printStackTrace(); 
+			throw new IllegalArgumentException(
+					"Processing the schema-directory " + schemaDirectory
+							+ " caused exception "
+							+ e.getLocalizedMessage());
+		}
+
+		
+	}
+
+    
+        private static  String[] getTokens(String _line)
+        {
+            if ((_line == null) || (_line.length() == 0))
+                return null;
+            
+            StringTokenizer st = new StringTokenizer(_line, ",");
+            ArrayList list = new ArrayList();
+
+            while (st.hasMoreTokens())
+                list.add(st.nextToken());
+            String[] s = new String[list.size()];
+            for (int i=0; i<list.size(); i++)
+                s[i] = (String)list.get(i);
+            return s;
+        }
+
+        
 }



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