[jboss-svn-commits] JBL Code SVN: r11302 - in labs/jbosslabs/branches/identity_integration/trunk/portal-extensions: binaries/maven-repo-addons and 17 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Apr 24 11:02:13 EDT 2007


Author: sohil.shah at jboss.com
Date: 2007-04-24 11:02:13 -0400 (Tue, 24 Apr 2007)
New Revision: 11302

Added:
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/cactus-1.7.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/junit-3.8.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/maven.xml.off
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.properties.off
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.xml.off
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/readme.txt
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/cactus.properties
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/aspectjrt-1.2.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/cactus-1.7.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-httpclient-2.0.2.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-logging-1.0.4.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/httpunit-1.6.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junit-3.8.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junitperf-1.9.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/nekohtml-0.9.1.jar
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeRoleBean.java
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeUserBean.java
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/SyncNukesUsersTestCase.java
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/Tools.java
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeRoleBean.hbm.xml
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeUserBean.hbm.xml
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/nukes.cfg.xml
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/jboss-web.xml
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/tld/
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/tld/forge.tld
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/web.xml
Modified:
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-admin/src/java/org/jboss/website/user/util/UsernameAndPasswordLoginModule.java
   labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/maven.xml
Log:
integrated a data migration tool from Nukes to JBoss.org Identity system

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/cactus-1.7.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/cactus-1.7.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/junit-3.8.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/binaries/maven-repo-addons/cactus/jars/junit-3.8.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-admin/src/java/org/jboss/website/user/util/UsernameAndPasswordLoginModule.java
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-admin/src/java/org/jboss/website/user/util/UsernameAndPasswordLoginModule.java	2007-04-24 14:50:12 UTC (rev 11301)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-admin/src/java/org/jboss/website/user/util/UsernameAndPasswordLoginModule.java	2007-04-24 15:02:13 UTC (rev 11302)
@@ -265,15 +265,33 @@
 
             // grab the roles associated with this user
             Collection roles = identity.getRoles(this.provider);
+            boolean hasAdmin = false;
+            boolean hasUser = false;
             if (roles != null)
             {
                for (Iterator itr = roles.iterator(); itr.hasNext();)
                {
-                  Principal role = this.createIdentity((String) itr.next());
+                  String roleName = (String) itr.next();
+                  Principal role = this.createIdentity(roleName);
                   groups[0].addMember(role);
+                  
+                  if(roleName.equalsIgnoreCase("Admin"))
+                  {
+                     hasAdmin = true;
+                  }
+                  else if(roleName.equalsIgnoreCase("User"))
+                  {
+                     hasUser = true;
+                  }
                }
             }
-
+            
+            //if neither admin or user role is found...force adding regular user role
+            if(!hasAdmin && !hasUser)
+            {
+               Principal role = this.createIdentity("User");
+               groups[0].addMember(role);
+            }
          }
 
          return groups;

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/maven.xml.off
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/maven.xml.off	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/maven.xml.off	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,38 @@
+<!-- 
+  JBoss, the OpenSource J2EE webOS
+  Distributable under LGPL license.
+  See terms of license at gnu.org. 
+ -->
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
+	<!-- Default war-project goals -->
+
+	<goal name="all">		
+		<attainGoal name="clean"/>
+		<attainGoal name="build"/>
+		<attainGoal name="deploy"/>
+	</goal>
+	
+	<goal name="clean">
+		<ant:delete dir="${maven.build.dir}"/>
+		<ant:delete dir="${maven.build.dest}"/>
+	</goal>
+
+	<goal name="build">	
+		<attainGoal name="prj-war-build" />
+	</goal>
+    
+	<goal name="deploy">	
+	    <attainGoal name="prj-war-deploy"/>	
+	    <ant:unzip src="${local.deploy.dir}/jbwebsite-user-migration-1.0.sar" 
+		dest="${local.deploy.dir}/temp" overwrite="true"/>   	     	  
+   	    <ant:delete file="${local.deploy.dir}/jbwebsite-user-migration-1.0.sar"/>   	    
+  	    <ant:copy todir="${local.deploy.dir}/temp">
+			<ant:fileset dir="src/etc/lib">
+				<ant:filename name="*.jar" />
+			</ant:fileset>			
+		</ant:copy>	    
+		<ant:zip basedir="${local.deploy.dir}/temp" 
+		destfile="${local.deploy.dir}/jbwebsite-user-migration-1.0.sar"/>
+		<ant:delete dir="${local.deploy.dir}/temp"/>			    			
+	</goal>	
+</project>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.properties.off
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.properties.off	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.properties.off	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,2 @@
+maven.repo.remote=http://repository.atlassian.com,http://repo1.maven.org/maven,http://dist.codehaus.org/
+maven.war.src=${basedir}/src/web

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.xml.off
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.xml.off	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/project.xml.off	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!-- 
+  JBoss, the OpenSource J2EE webOS
+  Distributable under LGPL license.
+  See terms of license at gnu.org. 
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../common.xml</extend>
+    <id>jbwebsite-user-migration</id>
+    <name>user-migration</name>
+    <currentVersion>1.0</currentVersion>
+    <organization>
+        <name>Sohil Shah</name>
+        <url>http://www.jboss.org</url>
+    </organization>
+    <description></description>
+    
+    <dependencies>
+    
+    <!--  application dependencies -->        
+    <dependency>
+	    <groupId>jbosswebsite</groupId>
+	    <artifactId>jbosswebsite-common</artifactId>
+	    <version>1.0</version>
+	</dependency>
+	<dependency>
+	    	<groupId>jbosswebsite</groupId>
+	    	<artifactId>jbwebsite-security</artifactId>
+	    	<version>1.0</version>
+		</dependency>
+	
+	<dependency>
+	    <groupId>jbosswebsite</groupId>
+	    <artifactId>jbwebsite-user-admin</artifactId>
+	    <version>1.0</version>	    
+	</dependency>
+	
+	<!--  jboss-sso framework -->
+	<dependency>
+                <groupId>jboss-sso</groupId>
+                <artifactId>jboss-identity-management</artifactId>
+                <version>1.0</version>                
+                <jar>jboss-identity-management.jar</jar>
+    </dependency>    
+    <dependency>
+                <groupId>jboss-sso</groupId>
+                <artifactId>jboss-sso-common</artifactId>
+                <version>1.0</version>                
+                <jar>jboss-security-common.jar</jar>
+    </dependency>            
+    
+    <!--  infrastructure dependencies -->
+    <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>hibernate3</artifactId>
+            <version>1.0</version>
+            <jar>hibernate3.jar</jar>
+    </dependency>
+    <dependency>
+        <groupId>jboss</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.0</version>
+        <jar>log4j.jar</jar>
+    </dependency>
+    <!--  plug in the cactus dependencies -->
+    <dependency>
+            <groupId>cactus</groupId>
+            <artifactId>cactus</artifactId>
+            <version>1.7.1</version>
+            <jar>cactus-1.7.1.jar</jar>
+    </dependency>
+    <dependency>
+            <groupId>cactus</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <jar>junit-3.8.1.jar</jar>
+    </dependency>  	    	     		
+   </dependencies>
+</project>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/readme.txt
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/readme.txt	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/readme.txt	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,17 @@
+This is the migration tool that can be used to migrate Nukes (JBoss.com) users over to the JBoss.org Identity System running on LDAP
+
+Instructions are:
+
+1) rename maven.xml.off/project.properties.off/project.xml.off to maven.xml/project.properties/project.xml respectively
+
+2) do a maven all at the /portal-extensions level
+
+3) This will deploy the migration tool on the server
+
+4) To launch the tool, run the SyncNukesUserTestCase and this will sync up the data
+
+5) The resulting data will add new data to portal database, and produces a nukes.ldif file.
+
+6) Do a slapadd -l nukes.ldif to add the data into the OpenLDAP repository.
+
+7) Restart the server
\ No newline at end of file

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/cactus.properties
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/cactus.properties	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/cactus.properties	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,7 @@
+#jbwebsite testing
+cactus.contextURL=http://localhost/migrate
+#cactus.contextURL=http://169.254.25.129/jbwebsite-test
+#acl testing
+#cactus.contextURL=http://localhost:8080/jboss-acl-test
+#sso testing
+#cactus.contextURL=http://localhost:8080/test
\ No newline at end of file

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/aspectjrt-1.2.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/aspectjrt-1.2.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/cactus-1.7.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/cactus-1.7.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-httpclient-2.0.2.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-httpclient-2.0.2.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/httpunit-1.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/httpunit-1.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junit-3.8.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junitperf-1.9.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/junitperf-1.9.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/nekohtml-0.9.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/etc/lib/nekohtml-0.9.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeRoleBean.java
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeRoleBean.java	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeRoleBean.java	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,89 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.website.user.migration;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Jul 24, 2006
+ *
+ */
+public class NukeRoleBean implements Serializable 
+{
+    private long id = 0;
+    private String name = null;
+    private Collection users = null;
+    
+    
+    
+    public String getName() 
+    {
+        return name;
+    }
+
+
+
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+    
+    
+
+
+
+    public long getId() {
+        return id;
+    }
+
+
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+
+
+    /**
+     * 
+     *
+     */
+    public NukeRoleBean()
+    {
+        
+    }
+
+
+
+    public Collection getUsers() {
+        return users;
+    }
+
+
+
+    public void setUsers(Collection users) {
+        this.users = users;
+    }
+}

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeUserBean.java
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeUserBean.java	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/NukeUserBean.java	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,641 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.website.user.migration;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.jboss.website.utils.Util;
+
+/**
+ * 
+ * @author Sohil Shah - sohil.shah at jboss.com - Jul 19, 2006
+ *
+ */
+public class NukeUserBean implements Serializable
+{
+    private long id = 0;
+    private String userName = null;
+    private Date regDate = null;
+    private Date prevLastVisit = null;
+    private Date lastVisit = null;
+    private Date memberPlusDate = null;
+    private Integer commentMax = 0;
+    private Integer userLang = 0;
+    private Integer thold = 0;
+    private Integer newsletter = 0;
+    private Integer enabled = 0;
+    private Integer salesContact = 0;
+    private Integer supportContact = 0;
+    private Integer uorder = 0;
+    private Integer userViewEmail = 0;
+    private Integer noScore = 0;
+    private Integer timezoneOffset = 0;
+    private String answer = null;
+    private String bio = null;
+    private String question = null;
+    private String umode = null;
+    private String usingSince = null;
+    private String companySize = null;
+    private String userOcc = null;
+    private String userFrom = null;
+    private String street = null;
+    private String userIcq = null;
+    private String userInterest = null;
+    private String userAim = null;
+    private String firstHear = null;
+    private String zip = null;
+    private String interestInJboss = null;
+    private String role = null;
+    private String userType = null;
+    private String userYim = null;
+    private String userMsnm = null;
+    private String url = null;
+    private String userSig = null;
+    private String theme = null;
+    private String userAvatar = null;
+    private String phone = null;
+    private String state = null;
+    private String pass = null;
+    private String hardware = null;
+    private String os = null;
+    private String title = null;
+    private String fname = null;
+    private String lname = null;
+    private String name = null;
+    private String femail = null;
+    private String email = null;
+    private String city = null;
+    private String country = null;
+    private String cname = null;
+    
+    
+    
+    
+    
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+    
+    
+
+    public Date getRegDate() {
+        if(regDate == null)
+        {
+            return new Date();
+        }
+        return regDate;
+    }
+
+    public void setRegDate(Date regDate) {
+        this.regDate = regDate;
+    }
+    
+    
+
+    public Date getLastVisit() {
+        return lastVisit;
+    }
+
+    public void setLastVisit(Date lastVisit) {
+        this.lastVisit = lastVisit;
+    }
+
+    public Date getMemberPlusDate() {
+        return memberPlusDate;
+    }
+
+    public void setMemberPlusDate(Date memberPlusDate) {
+        this.memberPlusDate = memberPlusDate;
+    }
+
+    public Date getPrevLastVisit() {
+        return prevLastVisit;
+    }
+
+    public void setPrevLastVisit(Date prevLastVisit) {
+        this.prevLastVisit = prevLastVisit;
+    }
+
+    /**
+     * 
+     *
+     */
+    public NukeUserBean()
+    {
+        
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public Integer getCommentMax() {
+        if(this.commentMax==null)
+        {
+            this.commentMax = new Integer(0);
+        }
+        return commentMax;
+    }
+
+    public void setCommentMax(Integer commentMax) {
+        this.commentMax = commentMax;
+    }
+
+    public Integer getEnabled() {
+        if(this.enabled==null)
+        {
+            this.enabled = new Integer(0);
+        }
+        return enabled;
+    }
+
+    public void setEnabled(Integer enabled) {
+        this.enabled = enabled;
+    }
+
+    public Integer getNewsletter() {
+        if(this.newsletter==null)
+        {
+            this.newsletter = new Integer(0);
+        }
+        return newsletter;
+    }
+
+    public void setNewsletter(Integer newsletter) {
+        this.newsletter = newsletter;
+    }
+
+    public Integer getNoScore() {
+        if(this.noScore==null)
+        {
+            this.noScore = new Integer(0);
+        }
+        return noScore;
+    }
+
+    public void setNoScore(Integer noScore) {
+        this.noScore = noScore;
+    }
+
+    public Integer getSalesContact() {
+        if(this.salesContact==null)
+        {
+            this.salesContact = new Integer(0);
+        }
+        return salesContact;
+    }
+
+    public void setSalesContact(Integer salesContact) {
+        this.salesContact = salesContact;
+    }
+
+    public Integer getSupportContact() {
+        if(this.supportContact==null)
+        {
+            this.supportContact = new Integer(0);
+        }
+        return supportContact;
+    }
+
+    public void setSupportContact(Integer supportContact) {
+        this.supportContact = supportContact;
+    }
+
+    public Integer getThold() {
+        if(this.thold==null)
+        {
+            this.thold = new Integer(0);
+        }
+        return thold;
+    }
+
+    public void setThold(Integer thold) {
+        this.thold = thold;
+    }
+
+    public Integer getTimezoneOffset() {
+        if(this.timezoneOffset==null)
+        {
+            this.timezoneOffset = new Integer(0);
+        }
+        return timezoneOffset;
+    }
+
+    public void setTimezoneOffset(Integer timezoneOffset) {
+        this.timezoneOffset = timezoneOffset;
+    }
+
+    public Integer getUorder() {
+        if(this.uorder==null)
+        {
+            this.uorder = new Integer(0);
+        }
+        return uorder;
+    }
+
+    public void setUorder(Integer uorder) {
+        this.uorder = uorder;
+    }
+
+    public Integer getUserLang() {
+        if(this.userLang==null)
+        {
+            this.userLang = new Integer(0);
+        }
+        return userLang;
+    }
+
+    public void setUserLang(Integer userLang) {
+        this.userLang = userLang;
+    }
+
+    public Integer getUserViewEmail() {
+        if(this.userViewEmail==null)
+        {
+            this.userViewEmail = new Integer(0);
+        }
+        return userViewEmail;
+    }
+
+    public void setUserViewEmail(Integer userViewEmail) {
+        this.userViewEmail = userViewEmail;
+    }
+
+    public String getAnswer() {
+        if(Util.isEmpty(answer))
+        {
+            return "missing";
+        }
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public String getBio() {
+        return bio;
+    }
+
+    public void setBio(String bio) {
+        this.bio = bio;
+    }
+
+    public String getCompanySize() {
+        return companySize;
+    }
+
+    public void setCompanySize(String companySize) {
+        this.companySize = companySize;
+    }
+
+    public String getQuestion() {
+        if(Util.isEmpty(question))
+        {
+            return "missing";
+        }
+        return question;
+    }
+
+    public void setQuestion(String question) {
+        this.question = question;
+    }
+
+    public String getStreet() {
+        if(Util.isEmpty(street))
+        {
+            return "missing";
+        }
+        return street;
+    }
+
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+    public String getUmode() {
+        return umode;
+    }
+
+    public void setUmode(String umode) {
+        this.umode = umode;
+    }
+
+    public String getUserFrom() {
+        return userFrom;
+    }
+
+    public void setUserFrom(String userFrom) {
+        this.userFrom = userFrom;
+    }
+
+    public String getUserOcc() {
+        return userOcc;
+    }
+
+    public void setUserOcc(String userOcc) {
+        this.userOcc = userOcc;
+    }
+
+    public String getUsingSince() {
+        return usingSince;
+    }
+
+    public void setUsingSince(String usingSince) {
+        this.usingSince = usingSince;
+    }
+
+    public String getFirstHear() {
+        return firstHear;
+    }
+
+    public void setFirstHear(String firstHear) {
+        this.firstHear = firstHear;
+    }
+
+    public String getInterestInJboss() {
+        return interestInJboss;
+    }
+
+    public void setInterestInJboss(String interestInJboss) {
+        this.interestInJboss = interestInJboss;
+    }
+
+    public String getRole() {
+        if(Util.isEmpty(role))
+        {
+            return "other";
+        }
+        return role;
+    }
+
+    public void setRole(String role) {
+        this.role = role;
+    }
+
+    public String getUserAim() {
+        return userAim;
+    }
+
+    public void setUserAim(String userAim) {
+        this.userAim = userAim;
+    }
+
+    public String getUserIcq() {
+        return userIcq;
+    }
+
+    public void setUserIcq(String userIcq) {
+        this.userIcq = userIcq;
+    }
+
+    public String getUserInterest() {
+        return userInterest;
+    }
+
+    public void setUserInterest(String userInterest) {
+        this.userInterest = userInterest;
+    }
+
+    public String getUserMsnm() {
+        return userMsnm;
+    }
+
+    public void setUserMsnm(String userMsnm) {
+        this.userMsnm = userMsnm;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public String getUserYim() {
+        return userYim;
+    }
+
+    public void setUserYim(String userYim) {
+        this.userYim = userYim;
+    }
+
+    public String getZip() {
+        if(Util.isEmpty(zip))
+        {
+            return "missing";
+        }
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getHardware() {
+        return hardware;
+    }
+
+    public void setHardware(String hardware) {
+        this.hardware = hardware;
+    }
+
+    public String getOs() {
+        return os;
+    }
+
+    public void setOs(String os) {
+        this.os = os;
+    }
+
+    public String getPass() {
+        return pass;
+    }
+
+    public void setPass(String pass) {
+        this.pass = pass;
+    }
+
+    public String getPhone() {
+        if(Util.isEmpty(phone))
+        {
+            return "missing";
+        }
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getState() {
+        if(Util.isEmpty(state))
+        {
+            return "missing";
+        }
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getTheme() {
+        return theme;
+    }
+
+    public void setTheme(String theme) {
+        this.theme = theme;
+    }
+
+    public String getTitle() {
+        if(Util.isEmpty(title))
+        {
+            return "missing";
+        }
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUserAvatar() {
+        return userAvatar;
+    }
+
+    public void setUserAvatar(String userAvatar) {
+        this.userAvatar = userAvatar;
+    }
+
+    public String getUserSig() {
+        return userSig;
+    }
+
+    public void setUserSig(String userSig) {
+        this.userSig = userSig;
+    }
+
+    public String getCity() {
+        if(Util.isEmpty(city))
+        {
+            return "missing";
+        }
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getCname() {
+        if(Util.isEmpty(cname))
+        {
+            return "missing";
+        }
+        return cname;
+    }
+
+    public void setCname(String cname) {
+        this.cname = cname;
+    }
+
+    public String getCountry() {
+        if(Util.isEmpty(country))
+        {
+            return "USA";
+        }
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getFemail() {
+        return femail;
+    }
+
+    public void setFemail(String femail) {
+        this.femail = femail;
+    }
+
+    public String getFname() {
+        if(Util.isEmpty(fname))
+        {
+            return "missing";
+        }
+        return fname;
+    }
+
+    public void setFname(String fname) {
+        this.fname = fname;
+    }
+
+    public String getLname() {
+        if(Util.isEmpty(lname))
+        {
+            return "missing";
+        }
+        return lname;
+    }
+
+    public void setLname(String lname) {
+        this.lname = lname;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    
+}

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/SyncNukesUsersTestCase.java
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/SyncNukesUsersTestCase.java	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/SyncNukesUsersTestCase.java	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,618 @@
+/*****************************************
+ *                                       *                                         *
+ *   Distributable under LGPL license.   *
+ *   See terms of license at gnu.org.    *
+ *                                       *
+ *****************************************/
+package org.jboss.website.user.migration;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.text.SimpleDateFormat;
+import java.text.MessageFormat;
+import java.io.OutputStream;
+
+
+import org.apache.log4j.Logger;
+import org.apache.cactus.ServletTestCase;
+
+
+import org.hibernate.*;
+
+import org.jboss.website.security.JBossIdentity;
+import org.jboss.website.user.bo.UserBean;
+import org.jboss.website.user.bo.ProfileBean;
+import org.jboss.security.idm.Address;
+import org.jboss.security.idm.Role;
+import org.jboss.website.utils.Util;
+
+/**
+ * users to test
+ * 
+ * cn=chrisi
+ * cn=kristofn
+ * cn=oudenaar
+ * cn=jgilje
+ * cn=njipp
+ * cn=nbk27hi
+ * 
+ * 
+ * 
+ * 
+ */
+
+/**
+ * @author Sohil Shah - sohil.shah at jboss.com
+ *
+ */
+public class SyncNukesUsersTestCase extends ServletTestCase 
+{
+    private static Logger log = Logger.getLogger(SyncNukesUsersTestCase.class);
+        
+    private FileOutputStream ldifos = null;
+    private Collection usersAdded = new ArrayList();
+    
+    /**
+     * 
+     */
+    public void setUp() throws Exception
+    { 
+        File file = new File("/migration/nukes.ldif");
+        file.createNewFile();
+        this.ldifos = new FileOutputStream(file,false); //overwrite mode
+    }
+             
+    /**
+     * 
+     */
+    protected void tearDown() throws Exception 
+    {        
+        if(this.ldifos!=null)
+        {
+            this.ldifos.flush();
+            this.ldifos.close();
+        }
+    }
+
+
+
+
+    /**
+     * 
+     */
+    public void testStartSync() throws Exception
+    {
+       System.out.println("User Migration tool successfully called.........");
+        //initialize the ldif file
+        this.initLDIF(this.ldifos);
+        
+        this.performUserSync();
+        
+        this.performRoleSync();
+    }
+    
+    //------user sync-------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @throws Exception
+     */
+    private void performUserSync() throws Exception
+    {
+        StringBuffer buffer = new StringBuffer();
+        SimpleDateFormat format = new SimpleDateFormat();
+        Session session = null;
+        try
+        {
+            log.info("Starting synchronization from NukesUsers to PortalUsers...."); 
+            long start = System.currentTimeMillis();
+            
+            //testing the Hibernate setup to look into the Nukes database
+            session = Tools.getOpenSession();        
+            session.beginTransaction();
+            
+            //read a NukeUserBean            
+            Query query = session.createQuery("from NukeUserBean as u");
+            
+            int counter = 1;            
+            for(Iterator itr=query.iterate();itr.hasNext();)
+            {                
+                /*if(counter == 20)
+                {
+                    break;
+                }*/
+                
+                NukeUserBean user = (NukeUserBean)itr.next();
+                            
+                log.info("Synchronizing........"+user.getUserName()+" ("+counter+++")");
+                
+                /*Transaction userReadTx = org.jboss.website.hibernate.Tools.getOpenSession().beginTransaction(); 
+                try
+                {
+                    if(UserBean.readByUserName(user.getUserName().trim())!=null)
+                    {
+                        //the user already exists....no need to migrate
+                        continue;
+                    }
+                }
+                catch(Exception e)
+                {
+                    buffer.append("-----------------------------\n");
+                    buffer.append("User="+user.getUserName()+"\n");
+                    buffer.append("RegisteredOn="+format.format(user.getRegDate())+"\n");
+                    buffer.append("Exception="+e.toString()+"\n");
+                    buffer.append("-----------------------------\n");
+                    continue;
+                }
+                finally
+                {
+                    if(userReadTx != null)
+                    {
+                        userReadTx.rollback();
+                    }
+                }*/
+                if(this.usersAdded.contains(user.getUserName().trim()))
+                {
+                    //the user already exists....no need to migrate
+                    continue;
+                }
+                
+                if( 
+                        Util.isEmpty(user.getUserName()) ||
+                        user.getUserName().contains("--") ||
+                        user.getUserName().contains(",")  ||                        
+                        user.getUserName().contains("=") ||                        
+                        user.getUserName().contains("&#") ||
+                        user.getUserName().contains("#") ||
+                        user.getUserName().contains(";") ||
+                        user.getUserName().contains("+") ||
+                        user.getUserName().startsWith("-") ||
+                        user.getUserName().endsWith("-")
+                )
+                {
+                    buffer.append("-----------------------------\n");
+                    buffer.append("User="+user.getUserName()+"\n");
+                    buffer.append("RegisteredOn="+format.format(user.getRegDate())+"\n");
+                    buffer.append("Exception=Illegal UserName.....This account will not be synched\n");
+                    buffer.append("-----------------------------\n");
+                    continue;
+                }
+                
+                
+                //now for testing purpose setup this user into the new Portal system
+                UserBean portalUser = new UserBean();
+                ProfileBean profile = new ProfileBean();
+                JBossIdentity identity = new JBossIdentity();
+                
+                portalUser.setIdentity(identity);
+                portalUser.setProfile(profile);
+                
+                
+                //setup the portalUser
+                portalUser.setUserName(user.getUserName().trim());
+                portalUser.setForceResetEnabled(true);
+                portalUser.setOldNukesPass(user.getPass());
+                
+                
+                //setup the identity
+                identity.setUserName(user.getUserName().trim());
+                identity.setPassword(user.getPass().getBytes());
+                identity.setEmail(user.getEmail().trim());
+                if(user.getEnabled()>0)
+                {
+                    identity.setActive(true);
+                }
+                else
+                {
+                    identity.setActive(false);
+                }
+                
+                
+                identity.setFullName(user.getFname().trim()+" "+user.getLname().trim());
+                identity.setRegistrationDate(user.getRegDate());
+                identity.setSecretQuestion(user.getQuestion().trim());
+                identity.setSecretAnswer(user.getAnswer().trim());
+                
+                //other emails
+                //identity.addEmail(user.getFemail());
+                
+                //phone numbers
+                //if(user.getPhone()!=null && user.getPhone().trim().length()>0 && 
+                //   ( user.getPhone().startsWith("+")|| Character.isDigit(user.getPhone().charAt(0)) )
+                //)
+                //{
+                //    identity.addPhoneNumber(user.getPhone());
+                //}
+                
+                
+                //company
+                Address companyAddress = new Address();
+                identity.setCompanyAddress(companyAddress);
+                companyAddress.setStreet(user.getStreet().trim());
+                companyAddress.setCity(user.getCity().trim());
+                companyAddress.setState(user.getState().trim());                
+                companyAddress.setPostalCode(user.getZip().trim());
+                companyAddress.setCountry(user.getCountry().trim());
+                
+                                
+                identity.setCompanyRole(user.getRole().trim());
+                identity.setCompanyName(user.getCname().trim());
+                identity.setCompanyTitle(user.getTitle().trim());
+                
+                
+                //setup the profile
+                profile.setCompanySize(user.getCompanySize());
+                profile.setCompanyType(user.getUserType());
+                profile.setInterestType(user.getInterestInJboss());
+                if(user.getNewsletter()>0)
+                {
+                    profile.setNewsLetter(true);
+                }
+                else
+                {
+                    profile.setNewsLetter(false);
+                }
+                if(user.getSalesContact()>0)
+                {
+                    profile.setSalesContact(true);
+                }
+                else
+                {
+                    profile.setSalesContact(false);
+                }
+                if(user.getSupportContact()>0)
+                {
+                    profile.setSupportContact(true);
+                }
+                else
+                {
+                    profile.setSupportContact(false);
+                }
+                
+                //perform the user add operation
+                Transaction tx = org.jboss.website.hibernate.Tools.getOpenSession().beginTransaction();
+                boolean success = false;
+                try
+                {
+                    this.register(portalUser);
+                    success = true;
+                }
+                catch(Exception e)
+                {
+                    success = false;
+                    //log this error
+                    buffer.append("-----------------------------\n");
+                    buffer.append("User="+user.getUserName()+"\n");
+                    buffer.append("RegisteredOn="+format.format(user.getRegDate())+"\n");
+                    buffer.append("Exception="+e.toString()+"\n");
+                    buffer.append("-----------------------------\n");
+                }
+                finally
+                {
+                    if(success)
+                    {
+                        tx.commit();
+                        this.usersAdded.add(identity.getUserName().trim());
+                    }
+                    else
+                    {
+                        tx.rollback();
+                    }
+                }                               
+            }                                                
+            log.info("Synchronization from NukesUsers to PortalUsers successfully finished....");
+            long stop = System.currentTimeMillis();
+            long duration = stop - start;
+            log.info("Sync finished in..."+duration+"ms");
+        }
+        catch(Exception e)
+        {
+            e.printStackTrace();
+            throw e;
+        }
+        finally
+        {
+            Tools.closeSession(session);            
+            //log
+            //spit it out to a log file
+            File file = new File("/migration/synctoolusers.log");
+            file.createNewFile();
+            FileOutputStream fos = new FileOutputStream(file,false); //truncates if an older file exists
+            fos.write(buffer.toString().getBytes());
+            fos.close();
+        }
+    }
+    
+    /**
+     * 
+     *
+     */
+    private void register(UserBean user)
+    {
+        boolean success = false;        
+        try
+        {                                                        
+            //save the user to the database, this saves the user to the portal database,
+            user.save();
+            
+            //add this user to the core portal data....without this the portal will break,
+            //this should be fixed in 2.4
+            //UserModule userModule = JBossPortalUtil.getUserModule();
+            //userModule.createUser(user.getUserName(),null,null);
+                                                                                            
+            //tag success, so that the profile can be created in the JBoss Corp Identity system
+            success = true;                     
+        }        
+        catch(Exception e)
+        {
+            log.error(this,e);
+            throw new RuntimeException(e);
+        }
+        finally
+        {
+            if(success)
+            {
+                try{this.saveLDIF(user,this.ldifos);}catch(Exception e){throw new RuntimeException(e);}
+            }
+        }                
+    }
+    
+    /**
+     * 
+     * @param user
+     * @param os
+     * @throws Exception
+     */
+    private void saveLDIF(UserBean user,OutputStream os) throws Exception
+    {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-DD");
+        StringBuffer template = new StringBuffer();
+        template.append("dn: cn={0},ou=jbosssso,dc=jboss,dc=com\n");
+        template.append("cn: {1}\n");
+        template.append("sn: {2}\n");
+        template.append("o: {3}\n");        
+        template.append("objectClass: jbossIdentity\n");
+        template.append("secretQuestion: {4}\n");
+        template.append("secretAnswer: {5}\n");        
+        template.append("registrationDate: {6}\n");
+        template.append("employeeType: {7}\n");
+        template.append("title: {8}\n");
+        template.append("givenName: {9}\n");
+        template.append("displayName: {10}\n");
+        template.append("userPassword: {11}\n");
+        
+        //multivalue telephoneNumber
+        template.append("telephoneNumber: missing\n");                
+        
+        //multivalue mail
+        Collection allEmails = new ArrayList();
+        allEmails.add(user.getIdentity().getEmail());
+        allEmails.addAll(user.getIdentity().getOtherEmails());
+        if(!Util.isEmpty(allEmails))
+        {
+            int count = 0;
+            for(Iterator itr=allEmails.iterator();itr.hasNext();)
+            {
+                if(count == 0)
+                {
+                    template.append("mail: primary="+itr.next()+"\n");
+                }
+                else
+                {
+                    template.append("mail: "+itr.next()+"\n");
+                }
+                count++;
+            }
+        }
+        else
+        {
+            template.append("mail: null\n");
+        }
+        
+        //multivalue postalAddress
+        if(!Util.isEmpty(user.getIdentity().getCompanyAddress().getStreet()))
+        {
+            template.append("postalAddress: street="+user.getIdentity().getCompanyAddress().getStreet()+"\n");
+        }
+        else
+        {
+            template.append("postalAddress: street=null\n");
+        }
+        if(!Util.isEmpty(user.getIdentity().getCompanyAddress().getCity()))
+        {
+            template.append("postalAddress: city="+user.getIdentity().getCompanyAddress().getCity()+"\n");
+        }
+        else
+        {
+            template.append("postalAddress: city=null\n");
+        }
+        if(!Util.isEmpty(user.getIdentity().getCompanyAddress().getState()))
+        {
+            template.append("postalAddress: state="+user.getIdentity().getCompanyAddress().getState()+"\n");
+        }
+        else
+        {
+            template.append("postalAddress: state=null\n");
+        }
+        if(!Util.isEmpty(user.getIdentity().getCompanyAddress().getPostalCode()))
+        {
+            template.append("postalAddress: postalCode="+user.getIdentity().getCompanyAddress().getPostalCode()+"\n");
+        }
+        else
+        {
+            template.append("postalAddress: postalCode=null\n");
+        }
+        if(!Util.isEmpty(user.getIdentity().getCompanyAddress().getCountry()))
+        {
+            template.append("postalAddress: country="+user.getIdentity().getCompanyAddress().getCountry()+"\n");
+        }
+        else
+        {
+            template.append("postalAddress: country=null\n");
+        }
+        
+        template.append("\n");
+        
+        String userObject = MessageFormat.format(template.toString(),
+        new Object[]{
+            user.getIdentity().getUserName(),
+            user.getIdentity().getUserName(),
+            user.getIdentity().isActive(),
+            !Util.isEmpty(user.getIdentity().getCompanyName())?user.getIdentity().getCompanyName():"null",
+            !Util.isEmpty(user.getIdentity().getSecretQuestion())?user.getIdentity().getSecretQuestion():"null",
+            !Util.isEmpty(user.getIdentity().getSecretAnswer())?user.getIdentity().getSecretAnswer():"null",
+            user.getIdentity().getRegistrationDate()!=null?simpleDateFormat.format(user.getIdentity().getRegistrationDate()):simpleDateFormat.format(new Date()),
+            !Util.isEmpty(user.getIdentity().getCompanyRole())?user.getIdentity().getCompanyRole():"null",
+            !Util.isEmpty(user.getIdentity().getCompanyTitle())?user.getIdentity().getCompanyTitle():"null",
+            !Util.isEmpty(user.getIdentity().getFullName())?user.getIdentity().getFullName():"null",
+            !Util.isEmpty(user.getIdentity().getFullName())?user.getIdentity().getFullName():"null",
+            new String(user.getIdentity().getPassword())
+        }
+        );
+        
+        os.write(userObject.getBytes());
+        os.flush();
+    }
+    //----------role sync------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     */
+    private void performRoleSync() throws Exception
+    {
+        log.info("Starting synchronization from NukesRoles to PortalRoles....");
+        
+        //add the defaultRoles
+        this.createDefaultRoles(this.ldifos);
+        
+        //testing the Hibernate setup to look into the Nukes database
+        Session session = Tools.getCurrentSession();
+        
+        session.beginTransaction();
+        
+        //read a NukeRoleBean
+        Query query = session.createQuery("from NukeRoleBean as u");        
+        
+        int counter = 1;
+        for(Iterator itr=query.iterate();itr.hasNext();)
+        {
+            NukeRoleBean role = (NukeRoleBean)itr.next();
+            Role portalRole = new Role();
+            
+            //skip the specified roles
+            if(
+                    role.getName().equalsIgnoreCase("users") ||
+                    role.getName().equalsIgnoreCase("admins") ||
+                    role.getName().equalsIgnoreCase("jboss-html") ||
+                    role.getName().equalsIgnoreCase("jboss-blog") ||
+                    role.getName().equalsIgnoreCase("jbosside") ||
+                    role.getName().equalsIgnoreCase("nukes") ||
+                    role.getName().equalsIgnoreCase("memberplus")
+            )
+            {
+                continue;
+            }
+                                    
+            System.out.println("Synchronizing........"+role.getName()+" ("+counter+")");
+            portalRole.setName("jboss.com_"+role.getName().toLowerCase());
+            
+            for(Iterator userItr=role.getUsers().iterator();userItr.hasNext();)
+            {
+                NukeUserBean user = (NukeUserBean)userItr.next();
+                System.out.println("User="+user.getId()+","+user.getUserName());
+                portalRole.getIdentities().add(user.getUserName());
+            }                        
+            
+            
+            //now persist the portalRole into the LDAP repo
+            this.saveLDIF(portalRole,this.ldifos);
+            
+            counter++;
+        }                
+        log.info("Synchronization from NukesRoles to PortalRoles successfully finished....");
+    }  
+    
+    /**
+     * 
+     * @param role
+     * @param os
+     */
+    private void saveLDIF(Role role,OutputStream os) throws Exception
+    {
+        StringBuffer buffer = new StringBuffer();
+        
+        buffer.append("dn: cn="+role.getName()+",ou=role,dc=jboss,dc=com\n");
+        buffer.append("cn: "+role.getName()+"\n");
+        buffer.append("objectClass: groupOfUniqueNames\n");
+        if(!Util.isEmpty(role.getIdentities()))
+        {
+            for(Iterator itr=role.getIdentities().iterator();itr.hasNext();)
+            {
+                String identity = (String)itr.next();
+                buffer.append("uniqueMember: cn="+identity+"\n");
+            }
+        }
+        else
+        {
+            buffer.append("uniqueMember: cn=null\n");
+        }
+        buffer.append("\n");
+        
+        os.write(buffer.toString().getBytes());
+        os.flush();
+    }
+    
+    /**
+     * 
+     * @param os
+     * @throws Exception
+     */
+    private void createDefaultRoles(OutputStream os) throws Exception
+    {
+        StringBuffer buffer = new StringBuffer();
+        
+        buffer.append("dn: cn=Admin,ou=role,dc=jboss,dc=com\n");
+        buffer.append("cn: Admin\n");
+        buffer.append("uniqueMember: cn=admin\n");
+        buffer.append("objectClass: groupOfUniqueNames\n");
+        buffer.append("\n");
+        
+        buffer.append("dn: cn=User,ou=role,dc=jboss,dc=com\n");
+        buffer.append("cn: User\n");
+        buffer.append("uniqueMember: cn=null\n");
+        buffer.append("objectClass: groupOfUniqueNames\n");
+        buffer.append("\n");
+        
+        os.write(buffer.toString().getBytes());
+        os.flush();
+    }
+    //-------------------------------------------------------------------------------------------------------------------------------------------------
+    /**
+     * 
+     * @throws Exception
+     */
+    private void initLDIF(OutputStream os) throws Exception
+    {
+        StringBuffer buffer = new StringBuffer();
+        
+        buffer.append("dn: dc=jboss,dc=com\n");
+        buffer.append("dc: jboss\n");
+        buffer.append("objectClass: dcObject\n");
+        buffer.append("objectClass: organizationalUnit\n");
+        buffer.append("ou: JBoss Dot Com\n");
+        buffer.append("\n");
+        buffer.append("dn: ou=role,dc=jboss,dc=com\n");
+        buffer.append("ou: role\n");
+        buffer.append("objectClass: organizationalUnit\n");
+        buffer.append("\n");
+        buffer.append("dn: ou=jbosssso,dc=jboss,dc=com\n");
+        buffer.append("ou: jbosssso\n");
+        buffer.append("objectClass: organizationalUnit\n");
+        buffer.append("\n");
+        
+        os.write(buffer.toString().getBytes());
+        os.flush();
+    }
+}

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/Tools.java
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/Tools.java	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/java/org/jboss/website/user/migration/Tools.java	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,98 @@
+package org.jboss.website.user.migration;
+
+
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+
+public class Tools 
+{
+	private static final Logger log = Logger.getLogger(Tools.class);
+	
+	//hibernate configuration relation information
+	private static SessionFactory sessionFactory = null;
+	private static Configuration cfg = null;
+	private static boolean autoClose = false;
+	
+	static
+	{
+		//load the SessionFactory
+		try
+		{
+			Tools.cfg = new Configuration();
+			Tools.cfg.configure("/nukes.cfg.xml");
+			String autoCloseProperty = Tools.cfg.getProperty("hibernate.transaction.auto_close_session");
+			Tools.autoClose = Boolean.parseBoolean(autoCloseProperty);
+		}
+		catch(Exception e)
+		{
+			Tools.cfg = null;
+			Tools.sessionFactory = null;			
+			Tools.log.error("Tools",e);
+		}
+	}
+	
+    /**
+     * 
+     *
+     */
+	public static void init()
+	{
+		try
+		{
+			//just to initialize the session factory
+			Tools.sessionFactory = (SessionFactory)new InitialContext().lookup("java:jbwebsite/NukesSessionFactory");
+		}
+		catch(Exception e)
+		{
+			Tools.sessionFactory = Tools.cfg.buildSessionFactory();
+		}		
+	}
+    
+    //---------------------------------------------------------------------------------------------------------------------------------------------------
+	
+    /**
+     * 
+     * @return
+     */
+	public static Session getCurrentSession()
+	{
+        if(Tools.sessionFactory==null)
+        {
+            Tools.init();
+        }
+		Session session = Tools.sessionFactory.getCurrentSession();
+		return session;
+	}
+	
+    /**
+     * 
+     * @return
+     */
+	public static Session getOpenSession()
+	{
+        if(Tools.sessionFactory==null)
+        {
+            Tools.init();
+        }
+		Session session = Tools.sessionFactory.openSession();
+		return session;
+	}
+	
+	/**
+     * 
+     * @param session
+	 */	
+	public static void closeSession(Session session)
+	{
+		if(session!=null && !Tools.autoClose)
+		{			
+			session.close();
+		}
+	}	
+}

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeRoleBean.hbm.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeRoleBean.hbm.xml	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeRoleBean.hbm.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.website.user.migration.NukeRoleBean"
+        table="nuke_groups"
+        lazy="true"
+    >
+        <!--  id -->
+        <id
+            name="id"
+            column="pn_gid"
+            type="long"
+        >
+            <generator class="native"/>
+        </id>
+        
+        <!--  associations -->
+        <set name="users"
+              table="nuke_group_membership"
+              lazy="true"           
+        >
+        	<key column="pn_gid"/>
+        	<many-to-many class="org.jboss.website.user.migration.NukeUserBean" column="pn_uid" not-found="ignore"/>
+        </set>
+        
+        <!--  map the properties -->                
+        <!--  strings -->
+        <property
+            name="name"
+            column="pn_name"
+            type="string"
+        />        
+    </class>
+</hibernate-mapping>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeUserBean.hbm.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeUserBean.hbm.xml	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/NukeUserBean.hbm.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.website.user.migration.NukeUserBean"
+        table="nuke_users"
+        lazy="true"
+    >
+        <!--  id -->
+        <id
+            name="id"
+            column="pn_uid"
+            type="long"
+        >
+            <generator class="native"/>
+        </id>
+        
+        <!--  map the properties -->        
+        <property
+            name="regDate"
+            column="pn_user_regdate"
+            type="timestamp"
+            lazy="true"
+        />
+        <property
+            name="prevLastVisit"
+            column="pn_prev_last_visit"
+            type="timestamp"
+            lazy="true"
+        />
+        <property
+            name="lastVisit"
+            column="pn_last_visit"
+            type="timestamp"
+            lazy="true"
+        />
+        <property
+            name="memberPlusDate"
+            column="pn_memberplusdate"
+            type="timestamp"
+            lazy="true"
+        />        
+        
+        <!--  integers -->
+        <property
+            name="commentMax"
+            column="pn_commentmax"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="userLang"
+            column="pn_user_lang"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="thold"
+            column="pn_thold"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="newsletter"
+            column="pn_newsletter"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="enabled"
+            column="pn_enabled"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="salesContact"
+            column="pn_salescontact"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="supportContact"
+            column="pn_supportcontact"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="uorder"
+            column="pn_uorder"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="userViewEmail"
+            column="pn_user_viewemail"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="noScore"
+            column="pn_noscore"
+            type="integer"
+            lazy="true"
+        />
+        <property
+            name="timezoneOffset"
+            column="pn_timezone_offset"
+            type="integer"
+            lazy="true"
+        />
+        
+        <!--  strings -->
+        <property
+            name="userName"
+            column="pn_uname"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="answer"
+            column="pn_answer"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="bio"
+            column="pn_bio"
+            type="string"
+            lazy="true"
+        />       
+        <property
+            name="question"
+            column="pn_question"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="umode"
+            column="pn_umode"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="usingSince"
+            column="pn_usingsince"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="companySize"
+            column="pn_companysize"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userOcc"
+            column="pn_user_occ"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userFrom"
+            column="pn_user_from"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="street"
+            column="pn_street"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userIcq"
+            column="pn_user_icq"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userInterest"
+            column="pn_user_intrest"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userAim"
+            column="pn_user_aim"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="firstHear"
+            column="pn_firsthear"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="zip"
+            column="pn_zip"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="interestInJboss"
+            column="pn_interestinjboss"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="role"
+            column="pn_role"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userType"
+            column="pn_usertype"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userYim"
+            column="pn_user_yim"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userMsnm"
+            column="pn_user_msnm"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="url"
+            column="pn_url"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userSig"
+            column="pn_user_sig"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="theme"
+            column="pn_theme"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="userAvatar"
+            column="pn_user_avatar"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="phone"
+            column="pn_phone"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="state"
+            column="pn_state"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="pass"
+            column="pn_pass"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="hardware"
+            column="pn_hardware"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="os"
+            column="pn_os"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="title"
+            column="pn_title"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="fname"
+            column="pn_fname"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="lname"
+            column="pn_lname"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="name"
+            column="pn_name"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="femail"
+            column="pn_femail"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="email"
+            column="pn_email"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="city"
+            column="pn_city"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="country"
+            column="pn_country"
+            type="string"
+            lazy="true"
+        />
+        <property
+            name="cname"
+            column="pn_cname"
+            type="string"
+            lazy="true"
+        />
+    </class>
+
+</hibernate-mapping>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/nukes.cfg.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/nukes.cfg.xml	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/classes/nukes.cfg.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+    "-//Hibernate/Hibernate Configuration DTD//EN"
+    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+   <session-factory name="java:jbwebsite/NukesSessionFactory">
+         
+      <!--  properties when deployed in J2EE app server) -->     
+      <!--property name="connection.datasource">java:PortalDS</property>      
+      <property name="show_sql">true</property>      
+      <property name="hibernate.transaction.flush_before_completion">true</property>
+      <property name="hibernate.transaction.auto_close_session">true</property>
+      <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+      <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property-->
+            
+      <!--  properties for testing stuff locally -->        
+      <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+      <property name="connection.url">jdbc:mysql://localhost:3306/nukes3?autoReconnectForPools=true&amp;maintainTimeStats=false&amp;cacheResultSetMetaData=true&amp;zeroDateTimeBehavior=convertToNull</property>
+      <property name="connection.username">nukes3</property>
+      <property name="connection.password">nukes3</property>  
+      <property name="hibernate.current_session_context_class">thread</property>      
+      <property name="show_sql">true</property>
+      <property name="cache.use_second_level_cache">false</property>
+      <property name="cache.use_query_cache">false</property>
+      <property name="hibernate.cglib.use_reflection_optimizer">false</property>
+                 
+      
+      <!--  caching properties -->
+      <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+      
+      <!--  set the dialect for MySQLInnoDB -->
+      <!-- Force the dialect instead of using autodetection -->
+      <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+                        
+      <!-- Mapping files -->  
+      <mapping resource="NukeUserBean.hbm.xml"/>    
+      <mapping resource="NukeRoleBean.hbm.xml"/>      
+   </session-factory>
+</hibernate-configuration>
\ No newline at end of file

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/jboss-web.xml	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/jboss-web.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ JBoss, a division of Red Hat                                              ~
+  ~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+  ~ contributors as indicated by the @authors tag. See the                    ~
+  ~ copyright.txt in the distribution for a full listing of                   ~
+  ~ individual contributors.                                                  ~
+  ~                                                                           ~
+  ~ This is free software; you can redistribute it and/or modify it           ~
+  ~ under the terms of the GNU Lesser General Public License as               ~
+  ~ published by the Free Software Foundation; either version 2.1 of          ~
+  ~ the License, or (at your option) any later version.                       ~
+  ~                                                                           ~
+  ~ This software is distributed in the hope that it will be useful,          ~
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+  ~ Lesser General Public License for more details.                           ~
+  ~                                                                           ~
+  ~ You should have received a copy of the GNU Lesser General Public          ~
+  ~ License along with this software; if not, write to the Free               ~
+  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+   <context-root>migrate</context-root>   
+</jboss-web>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/tld/forge.tld
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/tld/forge.tld	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/tld/forge.tld	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,181 @@
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
+  version="2.0">
+  <!-- 
+  JBoss, the OpenSource J2EE webOS
+  Distributable under LGPL license.
+  See terms of license at gnu.org. 
+ -->
+   <tlib-version>1.1</tlib-version>
+   <jsp-version>2.0</jsp-version>
+   <shortname>forge</shortname>
+   <info>Forge tags</info>
+   
+   <tag>
+      <name>pageURL</name>
+      <tagclass>org.jboss.forge.common.taglib.PageURLTag</tagclass>
+      <attribute>
+         <name>page</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+         <name>form</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+		<name>tagmeButton</name>
+		<tagclass>org.jboss.forge.common.taglib.TagMeTag</tagclass>
+		<attribute>
+	         <name>div</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+      	</attribute>
+      	<attribute>
+	         <name>service</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+	    </attribute>
+      	<attribute>
+	         <name>user</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+	    </attribute>
+      	<attribute>
+	         <name>path</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+	    </attribute>
+	    <attribute>
+	         <name>id</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+	    </attribute>
+	    <attribute>
+	         <name>website</name>
+	         <required>true</required>
+	         <rtexprvalue>true</rtexprvalue>
+	    </attribute>
+   </tag>
+   
+   <tag>
+      <name>param</name>
+      <tagclass>org.jboss.forge.common.taglib.ParamTag</tagclass>
+      <attribute>
+         <name>name</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+         <name>value</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>wikiURL</name>
+      <tagclass>org.jboss.forge.common.taglib.WikiURLTag</tagclass>
+      <attribute>
+         <name>page</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>freezoneURL</name>
+      <tagclass>org.jboss.forge.common.taglib.FreezoneURLTag</tagclass>
+      <attribute>
+         <name>page</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>projectURL</name>
+      <tagclass>org.jboss.forge.common.taglib.ProjectURLTag</tagclass>
+      <attribute>
+         <name>project</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+         <name>page</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+         <name>form</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   
+   <tag>
+      <name>selectedProject</name>
+      <tagclass>org.jboss.forge.common.taglib.SelectedProjectTag</tagclass>
+   </tag>
+   
+   <tag>
+      <name>imagePath</name>
+      <tagclass>org.jboss.forge.common.taglib.ImagePathTag</tagclass>
+      <attribute>
+         <name>src</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+         <name>project</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>attrValue</name>
+      <tagclass>org.jboss.forge.common.taglib.AttrValueTag</tagclass>
+      <attribute>
+         <name>name</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+   <tag>
+      <name>attrIf</name>
+      <tagclass>org.jboss.forge.common.taglib.AttrIfTag</tagclass>
+      <attribute>
+         <name>name</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+    <tag>
+      <name>ifEmpty</name>
+      <tagclass>org.jboss.forge.common.taglib.IfEmptyTag</tagclass>
+      <attribute>
+         <name>value</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+    <tag>
+      <name>ifNotEmpty</name>
+      <tagclass>org.jboss.forge.common.taglib.IfNotEmptyTag</tagclass>
+      <attribute>
+         <name>value</name>
+         <required>true</required>
+         <rtexprvalue>true</rtexprvalue>
+      </attribute>
+   </tag>
+   
+</taglib>

Added: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/web.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/jbwebsite-user-migration/src/web/WEB-INF/web.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+
+<web-app>
+
+    <filter>
+        <filter-name>FilterRedirector</filter-name>
+        <filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>FilterRedirector</filter-name>
+        <url-pattern>/FilterRedirector</url-pattern>
+    </filter-mapping>
+
+    <servlet>
+        <servlet-name>ServletRedirector</servlet-name>
+        <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
+    </servlet>
+
+    <servlet>
+        <servlet-name>JspRedirector</servlet-name>
+        <jsp-file>/jspRedirector.jsp</jsp-file>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>ServletRedirector</servlet-name>
+        <url-pattern>/ServletRedirector</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>JspRedirector</servlet-name>
+        <url-pattern>/JspRedirector</url-pattern>
+    </servlet-mapping>
+
+</web-app>
\ No newline at end of file

Modified: labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/maven.xml
===================================================================
--- labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/maven.xml	2007-04-24 14:50:12 UTC (rev 11301)
+++ labs/jbosslabs/branches/identity_integration/trunk/portal-extensions/maven.xml	2007-04-24 15:02:13 UTC (rev 11302)
@@ -170,6 +170,15 @@
 				<ant:include name="*.jar" />
 			</ant:fileset>			    
 		</ant:copy>
+		
+		<maven:reactor includes="jbwebsite-user-admin/project.xml" excludes="" basedir="." 
+			banner="Making jbwebsite-user-admin for the repo" 
+			goals="clean,build" ignoreFailures="false" />
+		<ant:copy todir="${maven.repo.local}/jbosswebsite/jars">
+			<ant:fileset dir="jbwebsite-user-admin/target">
+				<ant:include name="*.jar" />
+			</ant:fileset>			    
+		</ant:copy>
 	</goal>
 
 	<!-- Default project install goal - empty -->




More information about the jboss-svn-commits mailing list