Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Gouse Basha
Login Action Overide
2. April 2013 00:12
Antwort

Gouse Basha

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 30. November 2012

Neue Beiträge

Hi All,

I am overriding LoginPostAction through hook portlet. In liferay-hook.xml I wrote this code,

<hook>
<event>
<event-class>com.events.SampleLoginPostAction</event-class>
<event-type>login.events.post</event-type>
</event>

</hook>

In SampleLoginPostAction, run method,
I am not able to get any themedisplay, current groupId, only i am getting current user object through httpservletrequest,. If want to know which community user is logged in the server.

Suggestions are most welcome.
Jitendra Rajput
RE: Login Action Overide
2. April 2013 00:22
Antwort

Jitendra Rajput

Rang: Liferay Master

Nachrichten: 647

Eintrittsdatum: 7. Januar 2011

Neue Beiträge

Not clear with your question but you can get user object using below way.
1String userId = request.getRemoteUser();


Once you have userId you can get User object using User Services.
Gouse Basha
RE: Login Action Overide
2. April 2013 01:55
Antwort

Gouse Basha

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 30. November 2012

Neue Beiträge

Hi Jitendra,

I am getting user object with values but themedisplay and scopegroupId is not getting in httpservlet request after login. I need current community Id in servlet run method
Jitendra Rajput
RE: Login Action Overide
2. April 2013 02:14
Antwort

Jitendra Rajput

Rang: Liferay Master

Nachrichten: 647

Eintrittsdatum: 7. Januar 2011

Neue Beiträge

Did you tried with PortalUtil.getScopeGroupId(httpRequest) ?
Parikshit Sharma
RE: Login Action Overide
2. April 2013 03:27
Antwort

Parikshit Sharma

Rang: New Member

Nachrichten: 21

Eintrittsdatum: 16. Januar 2013

Neue Beiträge

Probably it will return the default groupIId instead of community groupId.
mohammad azaruddin
RE: Login Action Overide
2. April 2013 05:13
Antwort

mohammad azaruddin

Rang: Expert

Nachrichten: 420

Eintrittsdatum: 17. September 2012

Neue Beiträge

Hi
Try this-may be helpfull to you link
And we can pass object between our portlet and hook class.refer thislink
ugandhar @
RE: Login Action Overide
2. April 2013 05:16
Antwort

ugandhar @

Rang: Junior Member

Nachrichten: 25

Eintrittsdatum: 21. November 2011

Neue Beiträge

Hi Gouse,

you can get themedisplay and group like below.

ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
themeDisplay.getLayout().getGroupId();
Gouse Basha
RE: Login Action Overide
9. April 2013 00:01
Antwort

Gouse Basha

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 30. November 2012

Neue Beiträge

Yes, I tried "PortalUtil.getScopeGroupId(httpRequest)" but returns 0, please provide some other options