Author: julien(a)jboss.com
Date: 2007-06-20 17:23:37 -0400 (Wed, 20 Jun 2007)
New Revision: 7489
Modified:
trunk/core/src/main/org/jboss/portal/core/ui/portlet/user/UserPortlet.java
Log:
allow user to nillate his theme property to revert to portal theme
Modified: trunk/core/src/main/org/jboss/portal/core/ui/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/ui/portlet/user/UserPortlet.java 2007-06-20
21:13:29 UTC (rev 7488)
+++ trunk/core/src/main/org/jboss/portal/core/ui/portlet/user/UserPortlet.java 2007-06-20
21:23:37 UTC (rev 7489)
@@ -871,7 +871,7 @@
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\"" : "");
+ ctx.put("VIEWREALEMAIL", (getProperty(user,
User.INFO_USER_VIEW_EMAIL_VIEW_REAL)).equals("true") ?
"checked=\"checked\"" : "");
ctx.put("HOMEPAGE", (String)getProperty(user,User.INFO_USER_HOMEPAGE));
ctx.put("ICQ", (String)getProperty(user,User.INFO_USER_IM_ICQ));
ctx.put("AIM", (String)getProperty(user,User.INFO_USER_IM_AIM));
@@ -1029,7 +1029,24 @@
log.error("Cannot convert locale format", e);
}
- putNonEmptyProperty(user, User.INFO_USER_THEME, theme);
+ // It means we want to erase the current theme choice and use the default
provided by the site
+ if (theme != null && theme.length() == 0)
+ {
+ try
+ {
+ userProfileModule.setProperty(user, User.INFO_USER_THEME, null);
+ }
+ catch (IdentityException e)
+ {
+ log.error("Cannot update theme property", e);
+ }
+ }
+ else
+ {
+ putNonEmptyProperty(user, User.INFO_USER_THEME, theme);
+ }
+
+ //
putNonEmptyProperty(user, User.INFO_USER_HOMEPAGE, homepage);
putNonEmptyProperty(user, User.INFO_USER_SECURITY_QUESTION, question);
putNonEmptyProperty(user, User.INFO_USER_SECURITY_ANSWER, answer);
@@ -1374,8 +1391,6 @@
private void putNonEmptyProperty(User user, String key, Object value)
{
-
-
if (value != null)
{
if (value instanceof String && !(((String)value).trim().length() != 0)
)
Show replies by date