[jboss-svn-commits] JBoss Portal SVN: r5680 - in trunk/identity/src: main/org/jboss/portal/identity2 resources/draft

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 20 09:01:20 EST 2006


Author: bdaw
Date: 2006-11-20 09:01:11 -0500 (Mon, 20 Nov 2006)
New Revision: 5680

Added:
   trunk/identity/src/resources/draft/db-profile.xml
   trunk/identity/src/resources/draft/ldap-profile.xml
   trunk/identity/src/resources/draft/template-domain.hbm.xml
Removed:
   trunk/identity/src/resources/draft/profile.xml
Modified:
   trunk/identity/src/main/org/jboss/portal/identity2/User.java
   trunk/identity/src/resources/draft/identity-config.xml
   trunk/identity/src/resources/draft/standardidentity-config.xml
Log:
- draft of identity configuration files

Modified: trunk/identity/src/main/org/jboss/portal/identity2/User.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/User.java	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/main/org/jboss/portal/identity2/User.java	2006-11-20 14:01:11 UTC (rev 5680)
@@ -60,9 +60,12 @@
    String INFO_USER_LAST_LOGIN_DATE = "portal.user.last-login-date";
    String INFO_USER_REGISTRATION_DATE = "portal.user.registration-date";
 
+   String INFO_USER_ENABLED = "portal.user.enabled";
+   String INFO_USER_EMAIL_REAL = "portal.user.realEmail";
 
 
 
+
    /** The user identifier. */
    Object getId();
 

Copied: trunk/identity/src/resources/draft/db-profile.xml (from rev 5679, trunk/identity/src/resources/draft/profile.xml)
===================================================================
--- trunk/identity/src/resources/draft/profile.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/db-profile.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ 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.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<profile>
+   <!--Database mapping - jbp_user table column mapping-->
+   <property>
+      <attribute-name>user.name.given</attribute-name>
+      <type>java.lang.String</type>
+      <access-mode>read-only</access-mode>
+      <usage>mandatory</usage>
+      <display-name xml:lang="EN">User name</display-name>
+      <description xml:lang="EN">The user name</description>
+      <mapping>
+         <column>
+            <column-name>jbp_givenname</column-name>
+         </column>
+      </mapping>
+   </property>
+   <property>
+      <attribute-name>portal.user.enabled</attribute-name>
+      <type>java.lang.Boolean</type>
+      <access-mode>read-write</access-mode>
+      <usage>optional</usage>
+      <display-name xml:lang="EN">User enabled</display-name>
+      <description xml:lang="EN">User enabled status</description>
+      <mapping>
+         <column>
+            <column-name>jbp_enabled</column-name>
+         </column>
+      </mapping>
+   </property>
+   <property>
+      <attribute-name>user.name.nickName</attribute-name>
+      <type>java.lang.String</type>
+      <access-mode>read-write</access-mode>
+      <usage>optional</usage>
+      <display-name xml:lang="EN">Nick name</display-name>
+      <description xml:lang="EN">The nick name</description>
+      <mapping>
+         <column>
+            <column-name>jbp_nickname</column-name>
+         </column>
+      </mapping>
+   </property>
+   <!--Dynamic database store-->
+   <property>
+      <attribute-name>portal.user.signature</attribute-name>
+      <type>java.lang.String</type>
+      <access-mode>read-write</access-mode>
+      <usage>optional</usage>
+      <display-name xml:lang="EN">Signature</display-name>
+      <description xml:lang="EN">The user signature</description>
+      <mapping>
+         <dynamic-name>portal.user.signature</dynamic-name>
+      </mapping>
+   </property>
+</profile>
\ No newline at end of file

Modified: trunk/identity/src/resources/draft/identity-config.xml
===================================================================
--- trunk/identity/src/resources/draft/identity-config.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/identity-config.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -26,6 +26,7 @@
       <module>
          <!--type used to correctly map in IdentityContext registry-->
          <type>UserModule</type>
+         <implementation>DB</implementation>
 
          <!--name of service and class for creating mbean-->
          <service-name>portal:service=Module,type=User</service-name>
@@ -54,10 +55,23 @@
       <!--similar sections for role, membership and user profile modules-->
       ...
 
+
+      <!--in this case all the settings will be taken from standardidentity-config.xml based on type and implementation-->
+      <module>
+         <!--type used to correctly map in IdentityContext registry-->
+         <type>UserModule</type>
+         <implementation>DB</implementation>
+
+         <!--any setting can be overwritten if needed -->
+      </module>
+
+
+
       <!--example for ldap module...-->
       <module>
          <!--type used to correctly map in IdentityContext registry-->
          <type>RoleModule</type>
+         <implementation>LDAP</implementation>
 
          <!--name of service and class for creating mbean-->
          <service-name>portal:service=Module,type=Role</service-name>
@@ -73,10 +87,39 @@
          </config>
       </module>
 
+      <module>
+         <!--type used to correctly map in IdentityContext registry-->
+         <type>UserProfileModule</type>
+         <implementation>LDAP</implementation>
+
+         <!--name of service and class for creating mbean-->
+         <service-name>portal:service=Module,type=Role</service-name>
+         <class>org.jboss.portal.identity.ldap.LDAPRoleModuleImp</class>
+         <jndi-name>java:/portal/RoleModule</jndi-name>
+
+         <!--set of options that are passed to a class constructor-->
+         <config>
+            <option>
+               <name>LDAPConnectionJNDIName</name>
+               <value>java:/portal/UserSessionFactory</value>
+            </option>
+            <!--Hibernate mappings for db level store (dynamic properties not mapped as ldap attributes)-->
+            <option>
+               <name>SessionFactoryJNDIName</name>
+               <value>java:/portal/PropertyStoreSessionFactory</value>
+            </option>
+            <option>
+               <name>profileMappings</name>
+               <value>ldap-profile.xml</value>
+            </option>
+         </config>
+      </module>
+
       <!--For ldap configuration this is needed additionally to use ldap connection...-->
       <module>
          <!--type used to correctly map in IdentityContext registry-->
          <type>LDAPConnectionContext</type>
+         <implementation>CUSTOM</implementation>
 
          <!--name of service and class for creating mbean-->
          <service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
@@ -165,6 +208,7 @@
             <value>top</value>
             <value>uidObject</value>
             <value>person</value>
+            <value>inetUser</value>
          </option>
          <!--Schema requires those to have initial value-->
          <option>

Added: trunk/identity/src/resources/draft/ldap-profile.xml
===================================================================
--- trunk/identity/src/resources/draft/ldap-profile.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/ldap-profile.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ 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.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<profile>
+   <!--LDAP-->
+   <property>
+      <attribute-name>portal.user.realEmail</attribute-name>
+      <type>java.lang.String</type>
+      <access-mode>read-write</access-mode>
+      <usage>optional</usage>
+      <display-name xml:lang="EN">Real Email</display-name>
+      <description xml:lang="EN">The real email</description>
+      <mapping>
+         <attribute>
+            <attribute-name>mail</attribute-name>
+         </attribute>
+      </mapping>
+   </property>
+   <!--Dynamic database store-->
+   <property>
+      <attribute-name>portal.user.signature</attribute-name>
+      <type>java.lang.String</type>
+      <access-mode>read-write</access-mode>
+      <usage>optional</usage>
+      <display-name xml:lang="EN">Signature</display-name>
+      <description xml:lang="EN">The user signature</description>
+      <mapping>
+         <dynamic-name>portal.user.signature</dynamic-name>
+      </mapping>
+   </property>
+</profile>
\ No newline at end of file

Deleted: trunk/identity/src/resources/draft/profile.xml
===================================================================
--- trunk/identity/src/resources/draft/profile.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/profile.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  ~ 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.                  ~
-  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
- 
\ No newline at end of file

Modified: trunk/identity/src/resources/draft/standardidentity-config.xml
===================================================================
--- trunk/identity/src/resources/draft/standardidentity-config.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/standardidentity-config.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -20,4 +20,86 @@
   ~ 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.                  ~
-  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
\ No newline at end of file
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+  <identity-configuration>
+   <modules>
+      <module>
+         <!--type used to correctly map in IdentityContext registry-->
+         <type>UserModule</type>
+         <implementation>DB</implementation>
+
+         <!--name of service and class for creating mbean-->
+         <service-name>portal:service=Module,type=User</service-name>
+         <class>org.jboss.portal.identity.db.DBUserModuleImp</class>
+         <jndi-name>java:/portal/UserModule</jndi-name>
+
+         <!--set of options that are passed to a class constructor-->
+         <config>
+            <option>
+               <name>SessionFactoryJNDIName</name>
+               <value>java:/portal/UserSessionFactory</value>
+            </option>
+            <option>
+               <name>HibernateConfigLocation</name>
+               <value>conf/hibernate/user/hibernate.cfg.xml</value>
+            </option>
+            <option>
+               <name>HibernateSetupLocation</name>
+               <value>conf/hibernate/user/setup.txt</value>
+            </option>
+            <!--other set of options needed by the module...-->
+         </config>
+      </module>
+
+      ...
+      <!--similar sections for role, membership and user profile modules-->
+      ...
+
+      <!--example for ldap module...-->
+      <module>
+         <!--type used to correctly map in IdentityContext registry-->
+         <type>RoleModule</type>
+         <implementation>LDAP</implementation>
+
+         <!--name of service and class for creating mbean-->
+         <service-name>portal:service=Module,type=Role</service-name>
+         <class>org.jboss.portal.identity.ldap.LDAPRoleModuleImp</class>
+         <jndi-name>java:/portal/RoleModule</jndi-name>
+
+         <!--set of options that are passed to a class constructor-->
+         <config>
+            <option>
+               <name>LDAPConnectionJNDIName</name>
+               <value>java:/portal/UserSessionFactory</value>
+            </option>
+         </config>
+      </module>
+
+      <module>
+         <!--type used to correctly map in IdentityContext registry-->
+         <type>UserProfileModule</type>
+         <implementation>LDAP</implementation>
+
+         <!--name of service and class for creating mbean-->
+         <service-name>portal:service=Module,type=Role</service-name>
+         <class>org.jboss.portal.identity.ldap.LDAPRoleModuleImp</class>
+         <jndi-name>java:/portal/RoleModule</jndi-name>
+
+         <!--set of options that are passed to a class constructor-->
+         <config>
+            <option>
+               <name>LDAPConnectionJNDIName</name>
+               <value>java:/portal/UserSessionFactory</value>
+            </option>
+            <option>
+               <name>SessionFactoryJNDIName</name>
+               <value>java:/portal/PropertyStoreSessionFactory</value>
+            </option>
+            <option>
+               <name>profileMappings</name>
+               <value>ldap-profile.xml</value>
+            </option>
+         </config>
+      </module>
+   </modules>
+</identity-configuration>
\ No newline at end of file

Added: trunk/identity/src/resources/draft/template-domain.hbm.xml
===================================================================
--- trunk/identity/src/resources/draft/template-domain.hbm.xml	2006-11-20 11:53:13 UTC (rev 5679)
+++ trunk/identity/src/resources/draft/template-domain.hbm.xml	2006-11-20 14:01:11 UTC (rev 5680)
@@ -0,0 +1,123 @@
+<?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.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!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.portal.identity.db.UserImpl"
+      table="jbp_users">
+      <cache usage="@portal.hibernate.cache.usage@"/>
+       <id
+          name="key"
+          column="jbp_uid"
+          type="java.lang.Long">
+          <generator class="native">
+             <param name="sequence">user_seq</param>
+          </generator>
+       </id>
+      <property
+         name="userName"
+         column="jbp_uname"
+         type="java.lang.String"
+         update="false"
+         insert="true"
+         unique="true"/>
+       <map
+          name="dynamic"
+          table="jbp_user_prop"
+          lazy="false"
+          sort="unsorted"
+          cascade="all">
+          <cache usage="@portal.hibernate.cache.usage@"/>
+          <key column="jbp_uid"/>
+          <index
+             column="jbp_name"
+             type="java.lang.String"/>
+          <element
+             column="jbp_value"
+             type="java.lang.String"
+             not-null="false"
+             unique="false"/>
+       </map>
+       <!--Here goes mappings generated from profile configuration-->
+       %CONFIG_GENERATED_MAPPINGS%
+       <set
+          name="roles"
+          table="jbp_role_membership"
+          lazy="false"
+          inverse="false"
+          cascade="none"
+          sort="unsorted">
+          <cache usage="@portal.hibernate.cache.usage@"/>
+          <key column="jbp_uid"/>
+          <many-to-many
+             class="org.jboss.portal.identity.db.RoleImpl"
+             column="jbp_rid"
+             outer-join="true"/>
+       </set>
+   </class>
+   <class
+      name="org.jboss.portal.identity.db.RoleImpl"
+      table="jbp_roles">
+      <cache usage="@portal.hibernate.cache.usage@"/>
+      <id
+         name="key"
+         column="jbp_rid"
+         type="java.lang.Long">
+         <generator class="native">
+            <param name="sequence">user_seq</param>
+         </generator>
+      </id>
+      <property
+         name="name"
+         column="jbp_name"
+         type="java.lang.String"
+         update="false"
+         insert="true"
+         unique="true"/>
+      <property
+         name="displayName"
+         column="jbp_displayname"
+         type="java.lang.String"
+         update="true"
+         insert="true"
+         unique="true"/>
+      <set
+         name="users"
+         table="jbp_role_membership"
+         lazy="true"
+         inverse="true"
+         cascade="none"
+         sort="unsorted">
+         <cache usage="@portal.hibernate.cache.usage@"/>
+         <key column="jbp_rid"/>
+         <many-to-many
+            class="org.jboss.portal.identity.db.UserImpl"
+            column="jbp_uid"
+            outer-join="false"/>
+      </set>
+   </class>
+</hibernate-mapping>
\ No newline at end of file




More information about the jboss-svn-commits mailing list