Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Casey Payne
Retrieving User PK for Expando within Create Account Hook
November 26, 2012 2:15 PM
Answer

Casey Payne

Rank: New Member

Posts: 2

Join Date: November 26, 2012

Recent Posts

Having trouble finding a non-Ext way to do the following: after user clicks to create a new account, I want to query another non-Liferay/customer system to gather a few more details about a user (user will already exist in another system), and store those details in Expando tables. So, I want to programmatically save some values that system determines to Expando.

I'm able to do this with Ext by overriding the CreateAccountAction.addUser() and calling user.getExpandoBridge().setAttribute() after User is created. But, trying to rewrite it as a hook using BaseStrutsPortletAction, I need to be able to determine the User PK after originalStrutsPortletAction.processAction(...) is called in order to either load that User object, or else programmatically call the Expando Util methods which take the User primary key as a parameter.

Am I going about this the wrong way by needing to get access to the User object just-created by originalStrutsPortletAction.processAction(...) ?

Thanks for any hints/help/insight.
David H Nebinger
RE: Retrieving User PK for Expando within Create Account Hook
November 27, 2012 7:09 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8184

Join Date: September 1, 2006

Recent Posts

I would use a ModelListener on the User object. You will be able to insert your lookup to the other system and add necessary custom field values.
Casey Payne
RE: Retrieving User PK for Expando within Create Account Hook
November 27, 2012 1:01 PM
Answer

Casey Payne

Rank: New Member

Posts: 2

Join Date: November 26, 2012

Recent Posts

Great.Thanks for the help.