Message Boards

How to get full image path from imageId present in image table of lportal ?

Amar Daulatkar, modified 12 Years ago.

How to get full image path from imageId present in image table of lportal ?

New Member Posts: 8 Join Date: 3/30/12 Recent Posts
Hello

I am developing a portlet in which i have to display profile image of different user. So to display that i have following problems
1) How to get imageId of different user ?
2) How to get full image path from imageId ?
3)How to display that image ?
thumbnail
Hitoshi Ozawa, modified 12 Years ago.

RE: How to get full image path from imageId present in image table of lport

Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Just use the User.getPortraitId()

http://docs.liferay.com/portal/6.0/javadocs/com/liferay/portal/model/User.html

Something like this?(I just copy and pasted from Liferay's code)

<portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" var="editUserPortraitURL">
<portlet:param name="struts_action" value="/enterprise_admin/edit_user_portrait" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="p_u_i_d" value="<%= String.valueOf(selUser.getUserId()) %>" />
<portlet:param name="portrait_id" value="<%= String.valueOf(selUser.getPortraitId()) %>" />
</portlet:renderURL>