-
1. Re: user attributes in PortletRequest not set
trong.tran Oct 15, 2010 1:10 AM (in response to j.harm)you have read PLT.21, so you could also read the "PLT.21.3 Important Note on User Information"
There are some discussion related to this :
- http://community.jboss.org/message/543978
- http://community.jboss.org/message/535181
I hope it could help you
-
2. Re: user attributes in PortletRequest not set
j.harm Oct 15, 2010 10:16 AM (in response to trong.tran)Of course, I read PLT.21.3, too. As far as I know up to now there is no Java standard to access user information. Therefore, the recommendation of the PortletSpec should be supported by GateIn (q.v. https://jira.jboss.org/browse/GTNPC-36).
As workaround I followed the example of UIUserInfoPortlet.java:
{code:java}
public User getUser() {
ConversationState state = ConversationState.getCurrent();
return (User)state.getAttribute(CacheUserProfileFilter.USER_PROFILE);
}
{code}
-
3. Re: user attributes in PortletRequest not set
trong.tran Oct 15, 2010 12:33 PM (in response to j.harm)1 of 1 people found this helpfulYes, i agree with you
I think the workaround that you are following is a good way for now and it's acceptable in GateIn
-
4. Re: user attributes in PortletRequest not set
claprun Oct 18, 2010 5:46 AM (in response to j.harm)Hi Joerg,
This is actually a problem in GateIn itself, not in the portlet container. I took the liberty of moving your issue over to GTNPORTAL instead as this is where it should be fixed. Thanks a lot for your involvement with GateIn!
-
5. Re: user attributes in PortletRequest not set
j.harm Oct 18, 2010 5:51 AM (in response to claprun)Hi Chris,
thank you for moving the issue to the right place (https://jira.jboss.org/browse/GTNPORTAL-1567).
Kind regards,
Joerg
-
6. Re: user attributes in PortletRequest not set
ndkhoiits Oct 19, 2010 1:17 AM (in response to j.harm)Hi Joerg
Please re-check your problem, i think we're mistaking 'user profile' and 'account info' concept. In gatein, we had user profile attributes as same as PLT spec, and account info including of User name, first name, last name, email, password. And you're confusing firstname, lastname with user.name.given and user.name.family in PLT specs, so you couldn't get them from your portlet. You must fill given name and family name of user in User profile for your requirement instead of
Anyway, we should also clarify whether use 'first name', 'last name' and 'email' in account info or not
-
7. Re: user attributes in PortletRequest not set
j.harm Oct 19, 2010 4:57 PM (in response to ndkhoiits)Hi Khoi,
you are right! There are two different classes (org.exoplatform.services.organization.User for the account info and org.exoplatform.services.organization.UserProfile for the user profile). But the two classes intersect somewhat. "first name", "given name", "forename", and "Christian name" describe the same real world concept (as do "last name", "family name", "second name", and "surname"). Is there any reason to manage the same information in two places (and to force the user to type the same twice)?
Kind regards,
Joerg
-
8. Re: user attributes in PortletRequest not set
hngmduyi Nov 2, 2010 10:29 PM (in response to j.harm)oh thank you very much
-
9. Re: user attributes in PortletRequest not set
j.harm Jan 28, 2011 6:11 PM (in response to ndkhoiits)The user profile can be used to store additional attributes beside those defined in PortletRequest.P3PUserInfos. Unfortunately, these attributes are not accessible the PLT way because the class org.exoplatform.portal.webui.application.ExoUserContext restricts the attributes that from P3PUserInfos. PLT.21 does not say that the recommended attribute list is exclusive. It just says that attributes not declared in the deployment descriptor of the portlet application should not be exposed to the portlets. The filter in ExoUserContext seems to be unnecessary.
Kind regards,
Joerg