Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Amar Daulatkar
How to obtain the user id of visited user profile ?
3. April 2012 21:30
Antwort

Amar Daulatkar

Rang: New Member

Nachrichten: 8

Eintrittsdatum: 30. März 2012

Neue Beiträge

Hello
I am using Liferay portal 6.0.1. Tell me how to find/get the user id of Richard Editor after going to his public page if i login as Bruno Admin.
Sandeep Nair
RE: How to obtain the user id of visited user profile ?
3. April 2012 23:22
Antwort

Sandeep Nair

Rang: Liferay Legend

Nachrichten: 1732

Eintrittsdatum: 5. November 2008

Neue Beiträge

you can try
1
2Group group = themeDisplay.getLayout().getGroup();
3long userId = 0;
4if(group.isUser()){
5   userId = group.getClassPK();
6}
Dhrutika Vyas
RE: How to obtain the user id of visited user profile ?
3. April 2012 23:28
Antwort

Dhrutika Vyas

Rang: Expert

Nachrichten: 438

Eintrittsdatum: 9. Februar 2009

Neue Beiträge

Hi ,

You can get it by using below method:
<%
User user2 = null;

if (group.isUser()) {
user2 = UserLocalServiceUtil.getUserById(group.getClassPK());
}

%>
user1:::<%= themeDisplay.getUser().getFullName()%>
user2::<%= user2.getFullName() %>

Here user2 will return you username of Richard Editor.

Regards,
Dhrutika
Amar Daulatkar
RE: How to obtain the user id of visited user profile ?
4. April 2012 12:35
Antwort

Amar Daulatkar

Rang: New Member

Nachrichten: 8

Eintrittsdatum: 30. März 2012

Neue Beiträge

Thanks. It's working.
chirag @ India
RE: How to obtain the user id of visited user profile ?
15. April 2013 00:47
Antwort

chirag @ India

Rang: Regular Member

Nachrichten: 129

Eintrittsdatum: 20. Dezember 2011

Neue Beiträge

Hello Dhrutika

How to obtain the user id of visited user profile in velocity template ?

Help me
chirag @ India
RE: How to obtain the user id of visited user profile ?
15. April 2013 22:22
Antwort

chirag @ India

Rang: Regular Member

Nachrichten: 129

Eintrittsdatum: 20. Dezember 2011

Neue Beiträge

chirag @ India:
Hello Dhrutika

How to obtain the user id of visited user profile in velocity template ?

Help me



I got Solution and look at this link post.