Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Amar Daulatkar
How to obtain the user id of visited user profile ?
April 3, 2012 9:30 PM
Answer

Amar Daulatkar

Rank: New Member

Posts: 8

Join Date: March 30, 2012

Recent Posts

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 ?
April 3, 2012 11:22 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1693

Join Date: November 5, 2008

Recent Posts

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 ?
April 3, 2012 11:28 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

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 ?
April 4, 2012 12:35 PM
Answer

Amar Daulatkar

Rank: New Member

Posts: 8

Join Date: March 30, 2012

Recent Posts

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

chirag @ India

Rank: Regular Member

Posts: 129

Join Date: December 20, 2011

Recent Posts

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 ?
April 15, 2013 10:22 PM
Answer

chirag @ India

Rank: Regular Member

Posts: 129

Join Date: December 20, 2011

Recent Posts

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.