Author: bdaw
Date: 2006-12-19 09:46:18 -0500 (Tue, 19 Dec 2006)
New Revision: 5901
Added:
trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml
trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
Removed:
trunk/core/src/resources/portal-core-sar/conf/identity-config.xml
trunk/core/src/resources/portal-core-sar/conf/profile-config.xml
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
Log:
- fixed some user profile issues
- moved configuration files
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2006-12-19
14:30:14 UTC (rev 5900)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2006-12-19
14:46:18 UTC (rev 5901)
@@ -28,6 +28,7 @@
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.p3p.P3PConstants;
import org.jboss.portal.core.aspects.controller.node.Navigation;
import org.jboss.portal.core.modules.MailModule;
import org.jboss.portal.core.portlet.PortletHelper;
@@ -696,7 +697,7 @@
try
{
user = userModule.createUser(uname, pass1);
- setProperty(user,User.INFO_USER_EMAIL_REAL, realEmail);
+ setProperty(user, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL,
realEmail);
//user.setFakeEmail(fakeEmail);
setProperty(user,User.INFO_USER_EMAIL_FAKE, fakeEmail);
@@ -719,7 +720,7 @@
Locale locale = req.getLocale();
ResourceBundle bundle = getResourceBundle(locale);
String subject =
bundle.getString("REGISTER_CONFIRMATIONEMAIL");
- mailModule.send(from, (String)getProperty(user,User.INFO_USER_EMAIL_REAL),
subject, emailText);
+ mailModule.send(from,
(String)getProperty(user,P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL), subject,
emailText);
}
/*
@@ -773,9 +774,9 @@
private void fillContextWithUserProfile(User user, DelegateContext ctx)
{
- ctx.put("GIVENNAME", (String)getProperty(user,
User.INFO_USER_NAME_GIVEN));
- ctx.put("FAMILYNAME", (String)getProperty(user,
User.INFO_USER_NAME_FAMILY));
- ctx.put("REALEMAIL", (String)getProperty(user,
User.INFO_USER_EMAIL_REAL));
+ ctx.put("GIVENNAME", (String)getProperty(user,
P3PConstants.INFO_USER_NAME_GIVEN));
+ ctx.put("FAMILYNAME", (String)getProperty(user,
P3PConstants.INFO_USER_NAME_FAMILY));
+ ctx.put("REALEMAIL", (String)getProperty(user,
P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL));
ctx.put("FAKEEMAIL", (String)getProperty(user,
User.INFO_USER_EMAIL_FAKE));
ctx.put("THEME", (String)getProperty(user, User.INFO_USER_THEME));
ctx.put("VIEWREALEMAIL", ((String)getProperty(user,
User.INFO_USER_VIEW_EMAIL_VIEW_REAL)).equals("true") ?
"checked=\"checked\"" : "");
@@ -886,17 +887,17 @@
//
if (givenName.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_NAME_GIVEN, givenName);
+ setProperty(user, P3PConstants.INFO_USER_NAME_GIVEN, givenName);
}
if (familyName.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_NAME_FAMILY, familyName);
+ setProperty(user, P3PConstants.INFO_USER_NAME_FAMILY, familyName);
}
if (realEmail.trim().length() != 0)
{
- setProperty(user, User.INFO_USER_EMAIL_REAL, realEmail);
+ setProperty(user, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL,
realEmail);
}
if (fakeEmail.trim().length() != 0)
@@ -1104,7 +1105,7 @@
try
{
- givenName = (String)userProfileModule.getProperty(user,
User.INFO_USER_NAME_GIVEN);
+ givenName = (String)userProfileModule.getProperty(user,
P3PConstants.INFO_USER_NAME_GIVEN);
}
catch (IdentityException e)
{
@@ -1127,7 +1128,7 @@
try
{
- familyName = (String)userProfileModule.getProperty(user,
User.INFO_USER_NAME_FAMILY);
+ familyName = (String)userProfileModule.getProperty(user,
P3PConstants.INFO_USER_NAME_FAMILY);
}
catch (IdentityException e)
{
@@ -1153,8 +1154,8 @@
try
{
- givenName = (String)userProfileModule.getProperty(user,
User.INFO_USER_NAME_GIVEN);
- familyName = (String)userProfileModule.getProperty(user,
User.INFO_USER_NAME_FAMILY);
+ givenName = (String)userProfileModule.getProperty(user,
P3PConstants.INFO_USER_NAME_GIVEN);
+ familyName = (String)userProfileModule.getProperty(user,
P3PConstants.INFO_USER_NAME_FAMILY);
}
catch (IdentityException e)
{
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-19
14:30:14 UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-19
14:46:18 UTC (rev 5901)
@@ -494,34 +494,11 @@
<!--<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>-->
<attribute
name="JndiName">java:/portal/IdentityServiceController</attribute>
<attribute name="RegisterMBeans">true</attribute>
- <attribute
name="ConfigFile">conf/identity-config.xml</attribute>
+ <attribute
name="ConfigFile">conf/identity/identity-config.xml</attribute>
<attribute
name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
</mbean>
-
- <!-- Modules -->
- <!--<mbean
- code="org.jboss.portal.identity.db.DBUserModuleImpl"
- name="portal:service=Module,type=User"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute
name="JNDIName">java:/portal/UserModule</attribute>
- <attribute
name="SessionFactoryJNDIName">java:/portal/UserSessionFactory</attribute>
- </mbean>
<mbean
- code="org.jboss.portal.identity.db.DBRoleModuleImpl"
- name="portal:service=Module,type=Role"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate</depends>
- <attribute
name="JNDIName">java:/portal/RoleModule</attribute>
- <attribute
name="SessionFactoryJNDIName">java:/portal/UserSessionFactory</attribute>
- </mbean>
--->
- <mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
xmbean-dd=""
Copied: trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml (from
rev 5895, trunk/core/src/resources/portal-core-sar/conf/identity-config.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-18 19:14:55
UTC (rev 5895)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/identity-config.xml 2006-12-19
14:46:18 UTC (rev 5901)
@@ -0,0 +1,68 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE identity-configuration PUBLIC
+ "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
+
+<identity-configuration>
+ <datasources/>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>User</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Role</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>Membership</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfile</type>
+ <implementation>DELEGATING</implementation>
+ <config>
+ <option>
+ <name>profileConfigFile</name>
+ <value>conf/identity/profile-config.xml</value>
+ </option>
+ </config>
+ </module>
+ <module>
+ <type>DBDelegateUserProfile</type>
+ <implementation>DB</implementation>
+ <config/>
+ </module>
+ </modules>
+ <options/>
+</identity-configuration>
\ No newline at end of file
Copied: trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml (from
rev 5895, trunk/core/src/resources/portal-core-sar/conf/profile-config.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-18 19:14:55
UTC (rev 5895)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2006-12-19
14:46:18 UTC (rev 5901)
@@ -0,0 +1,398 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+ <!--<!DOCTYPE profile PUBLIC
+ "-//JBoss Portal//DTD JBoss User Profile Configuration 1.0//EN"
+ "http://www.jboss.org/portal/dtd/profile-config_1_0.dtd">-->
+
+<profile>
+ <!--Database mapping - jbp_user table column mapping-->
+ <property>
+ <name>user.name.nickName</name>
+ <type>java.lang.String</type>
+ <access-mode>read-only</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Name</display-name>
+ <description xml:lang="en">The user name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_uname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.name.given</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Given Name</display-name>
+ <description xml:lang="en">The user given name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_givenname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.name.family</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Family name</display-name>
+ <description xml:lang="en">The user family
name</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_familyname</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>user.business-info.online.email</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Email</display-name>
+ <description xml:lang="en">The user real email</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_realemail</value>
+ </database>
+ <ldap>
+ <value>mail</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.email.fake</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Fake email</display-name>
+ <description xml:lang="en">The user fake email</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_fakeemail</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.registration-date</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Registration date</display-name>
+ <description xml:lang="en">Registration date of
user</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_regdate</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.email.view-real</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">View real email</display-name>
+ <description xml:lang="en">Is user real email displayed in
public</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_viewrealemail</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.enabled</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>mandatory</usage>
+ <display-name xml:lang="en">Enabled</display-name>
+ <description xml:lang="en">User enabled state</description>
+ <mapping>
+ <database>
+ <type>column</type>
+ <value>jbp_enabled</value>
+ </database>
+ </mapping>
+ </property>
+
+ <!--Dynamic database store-->
+ <property>
+ <name>portal.user.location</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Location</display-name>
+ <description xml:lang="en">The user location</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.location</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.occupation</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Occupation</display-name>
+ <description xml:lang="en">The user occupation</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.occupation</value>
+ </database>
+ <ldap>
+ <value>title</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.extra</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Extra info</display-name>
+ <description xml:lang="en">Extra informtion about
user</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.extra</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.signature</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>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.signature</value>
+ </database>
+ <ldap>
+ <value>personalSignature</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.interests</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Interests</display-name>
+ <description xml:lang="en">The user interests</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.interests</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.locale</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Locale</display-name>
+ <description xml:lang="en">The user locale</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.locale</value>
+ </database>
+ <ldap>
+ <value>localityName</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.icq</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">ICQ</display-name>
+ <description xml:lang="en">The user ICQ id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.icq</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.aim</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">AIM</display-name>
+ <description xml:lang="en">The user AIM id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.aim</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.msnm</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">MSN</display-name>
+ <description xml:lang="en">The user MSN id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.msnm</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.yim</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">YIM</display-name>
+ <description xml:lang="en">The user YIM id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.yim</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.im.skype</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Skype</display-name>
+ <description xml:lang="en">The user skype id</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.im.skype</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.homepage</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Homepage</display-name>
+ <description xml:lang="en">The user homepage</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.homepage</value>
+ </database>
+ <ldap>
+ <value>seeAlso</value>
+ </ldap>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.time-zone-offset</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Timezone</display-name>
+ <description xml:lang="en">Timezone in users
location</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.time-zone-offset</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.theme</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Theme</display-name>
+ <description xml:lang="en">Portlat theme that user is
using</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.theme</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.security.question</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Password Question</display-name>
+ <description xml:lang="en">Portal password recovery
question</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.security.question</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.security.answer</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Password Answer</display-name>
+ <description xml:lang="en">Portal password recovery
answer</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.security.answer</value>
+ </database>
+ </mapping>
+ </property>
+ <property>
+ <name>portal.user.last-login-date</name>
+ <type>java.lang.String</type>
+ <access-mode>read-write</access-mode>
+ <usage>optional</usage>
+ <display-name xml:lang="en">Last login</display-name>
+ <description xml:lang="en">The date of users last
login</description>
+ <mapping>
+ <database>
+ <type>dynamic</type>
+ <value>portal.user.last-login-date</value>
+ </database>
+ </mapping>
+ </property>
+</profile>
\ No newline at end of file
Deleted: trunk/core/src/resources/portal-core-sar/conf/identity-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-19 14:30:14
UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/conf/identity-config.xml 2006-12-19 14:46:18
UTC (rev 5901)
@@ -1,68 +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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
- <!--<!DOCTYPE identity-configuration PUBLIC
- "-//JBoss Portal//DTD JBoss Identity Configuration 1.0//EN"
- "http://www.jboss.org/portal/dtd/identity-config_1_0.dtd">-->
-
-<identity-configuration>
- <datasources/>
- <modules>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>User</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Role</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>Membership</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- <module>
- <!--type used to correctly map in IdentityContext registry-->
- <type>UserProfile</type>
- <implementation>DELEGATING</implementation>
- <config>
- <option>
- <name>profileConfigFile</name>
- <value>conf/profile-config.xml</value>
- </option>
- </config>
- </module>
- <module>
- <type>DBDelegateUserProfile</type>
- <implementation>DB</implementation>
- <config/>
- </module>
- </modules>
- <options/>
-</identity-configuration>
\ No newline at end of file
Deleted: trunk/core/src/resources/portal-core-sar/conf/profile-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-19 14:30:14
UTC (rev 5900)
+++ trunk/core/src/resources/portal-core-sar/conf/profile-config.xml 2006-12-19 14:46:18
UTC (rev 5901)
@@ -1,384 +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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
- <!--<!DOCTYPE profile PUBLIC
- "-//JBoss Portal//DTD JBoss User Profile Configuration 1.0//EN"
- "http://www.jboss.org/portal/dtd/profile-config_1_0.dtd">-->
-
-<profile>
- <!--Database mapping - jbp_user table column mapping-->
- <property>
- <name>portal.user.name.given</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Name</display-name>
- <description xml:lang="en">The user name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_username</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.name.family</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Family name</display-name>
- <description xml:lang="en">The user family
name</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_familyname</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.real</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Email</display-name>
- <description xml:lang="en">The user real email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_realemail</value>
- </database>
- <ldap>
- <value>mail</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.fake</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Fake email</display-name>
- <description xml:lang="en">The user fake email</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_fakeemail</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.registration-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Registration date</display-name>
- <description xml:lang="en">Registration date of
user</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_regdate</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.email.view-real</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">View real email</display-name>
- <description xml:lang="en">Is user real email displayed in
public</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_viewrealemail</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.enabled</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>mandatory</usage>
- <display-name xml:lang="en">Enabled</display-name>
- <description xml:lang="en">User enabled state</description>
- <mapping>
- <database>
- <type>column</type>
- <value>jbp_enabled</value>
- </database>
- </mapping>
- </property>
-
- <!--Dynamic database store-->
- <property>
- <name>portal.user.location</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Location</display-name>
- <description xml:lang="en">The user location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.location</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.occupation</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Occupation</display-name>
- <description xml:lang="en">The user occupation</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.occupation</value>
- </database>
- <ldap>
- <value>title</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.extra</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Extra info</display-name>
- <description xml:lang="en">Extra informtion about
user</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.extra</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.signature</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>
- <database>
- <type>dynamic</type>
- <value>portal.user.signature</value>
- </database>
- <ldap>
- <value>personalSignature</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.interests</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Interests</display-name>
- <description xml:lang="en">The user interests</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.interests</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.locale</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Locale</display-name>
- <description xml:lang="en">The user locale</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.locale</value>
- </database>
- <ldap>
- <value>localityName</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.icq</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">ICQ</display-name>
- <description xml:lang="en">The user ICQ id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.icq</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.aim</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">AIM</display-name>
- <description xml:lang="en">The user AIM id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.aim</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.msnm</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">MSN</display-name>
- <description xml:lang="en">The user MSN id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.msnm</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.yim</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">YIM</display-name>
- <description xml:lang="en">The user YIM id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.yim</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.im.skype</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Skype</display-name>
- <description xml:lang="en">The user skype id</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.im.skype</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.homepage</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Homepage</display-name>
- <description xml:lang="en">The user homepage</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.homepage</value>
- </database>
- <ldap>
- <value>seeAlso</value>
- </ldap>
- </mapping>
- </property>
- <property>
- <name>portal.user.time-zone-offset</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Timezone</display-name>
- <description xml:lang="en">Timezone in users
location</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.time-zone-offset</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.theme</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Theme</display-name>
- <description xml:lang="en">Portlat theme that user is
using</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.theme</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.security.question</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Password Question</display-name>
- <description xml:lang="en">Portal password recovery
question</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.security.question</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.security.answer</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Password Answer</display-name>
- <description xml:lang="en">Portal password recovery
answer</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.security.answer</value>
- </database>
- </mapping>
- </property>
- <property>
- <name>portal.user.last-login-date</name>
- <type>java.lang.String</type>
- <access-mode>read-write</access-mode>
- <usage>optional</usage>
- <display-name xml:lang="en">Last login</display-name>
- <description xml:lang="en">The date of users last
login</description>
- <mapping>
- <database>
- <type>dynamic</type>
- <value>portal.user.last-login-date</value>
- </database>
- </mapping>
- </property>
-</profile>
\ No newline at end of file
Modified:
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2006-12-19
14:30:14 UTC (rev 5900)
+++
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2006-12-19
14:46:18 UTC (rev 5901)
@@ -77,7 +77,7 @@
PropertyInfo property = getProfileInfo().getPropertyInfo(propertyName);
if (property == null)
{
- throw new IdentityException("Such property name is not
supported");
+ throw new IdentityException("Such property name is not supported: "
+ propertyName);
}
else if (property.isMappedLDAP() && isLDAPSupported() && user
instanceof LDAPUserImpl)
{
@@ -87,7 +87,19 @@
else if (property.isMappedDB())
{
log.debug("Delegating to DB module");
- return getDBModule().getProperty(user, propertyName);
+ Object o = getDBModule().getProperty(user, propertyName);
+
+
+ //if property is column it may be some Object - just convert to String for
now
+ if(o != null && !(o instanceof String))
+ {
+ return o.toString();
+ }
+ else
+ {
+ return o;
+ }
+
}
throw new IdentityException("Cannot process property - incorrect profile or
module configuration");
}
@@ -105,7 +117,7 @@
PropertyInfo property = getProfileInfo().getPropertyInfo(name);
if (property == null)
{
- throw new IdentityException("Such property name is not
supported");
+ throw new IdentityException("Such property name is not supported: "
+ name);
}
else if (property.isMappedLDAP() && isLDAPSupported() && user
instanceof LDAPUserImpl)
{
@@ -118,17 +130,18 @@
log.debug("Delegating to DB module");
- Object val = null;
+ Object val = propertyValue.toString();
//if property is dynamic convert value to String first
- if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
- {
- val = propertyValue.toString();
- }
- else
- {
- val = propertyValue;
- }
+//
if(property.getMappingDBType().equals(PropertyInfo.MAPPING_DB_TYPE_DYNAMIC))
+// {
+// val = propertyValue.toString();
+// }
+// else
+// {
+// val = propertyValue;
+// }
+
getDBModule().setProperty(user, name, val);
return;
}
@@ -140,6 +153,7 @@
}
}
+ //TODO: wrong coded - should merge properties from LDAP AND DB
public Map getProperties(User user) throws IdentityException,
IllegalArgumentException
{
if (log.isDebugEnabled()) log.debug("getProperties");//: " + name +
"/" + propertyValue)