Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Lambert Mickael
Live Users in a personnal portlet
December 7, 2012 2:02 AM
Answer

Lambert Mickael

Rank: Junior Member

Posts: 58

Join Date: December 29, 2011

Recent Posts

Hello,

I created a portlet I developed myself. I wish I could view in this portlet, the list of connected users.

For this, I created my own class LiveUsers (which contains the exact same code that the classe LiveUsers in portal-impl.jar), but unfortunately, when I try to retrieve the user function LiveUsers.getSessionUsers (CompanyID), it returns to me an empty list.

So I noticed that there must be a trigger or something like that when a user logs in. The class LiveUsersMessageListener and more specifically with the function doCommandSignIn (JsonObject JsonObject) must be use somewhere.

So I added this to my package (with, again, the exact source code of Liferay).

Unfortunately, I do not know how to make the system takes this class as the trigger. Or that the system triggers the function doCommandSignIn (JsonObject JsonObject).

Can you help me please? I'm lost ...

Thank you in advance to all of you!
Jan Geißler
RE: Live Users in a personnal portlet
December 7, 2012 2:35 AM
Answer

Jan Geißler

Rank: Expert

Posts: 358

Join Date: July 5, 2011

Recent Posts

You need to have to set this to true to enable tracking via Live Users.

live.users.enabled=false

in your portal properties. But be aware that there is a bug which will prevent LIferay from doing redirects after Login of a user. So if you have a custom postLoginAction, this will not work any more.

Regards
Jan
Lambert Mickael
RE: Live Users in a personnal portlet
December 7, 2012 2:47 AM
Answer

Lambert Mickael

Rank: Junior Member

Posts: 58

Join Date: December 29, 2011

Recent Posts

Yes, I know, i already put live.users.enabled at true.

But my problem is that it's in a portlet that i have created. And we can't access to the class LiveUsers, so i created myself