Foros de discusión

profile

Sanket Gosavi, modificado hace 12 años.

profile

Junior Member Mensajes: 35 Fecha de incorporación: 24/12/11 Mensajes recientes
I want to show profile picture of the user............Help..
thumbnail
Emilio José Lamas Fraga, modificado hace 12 años.

RE: profile

Junior Member Mensajes: 57 Fecha de incorporación: 29/11/11 Mensajes recientes
Hi Sanket,

You can get either the portrait id and the portrait URL of the user from the User class:


user.getPortraitURL(themeDisplay);
user.getPortraitId();


hope it helps

Regards
Sanket Gosavi, modificado hace 12 años.

RE: profile

Junior Member Mensajes: 35 Fecha de incorporación: 24/12/11 Mensajes recientes
There is no user.getPortraitURL(themeDisplay);
thumbnail
Juhi Kumari, modificado hace 12 años.

RE: profile

Expert Mensajes: 347 Fecha de incorporación: 12/12/11 Mensajes recientes
Hi Sanket,

To display profile image use this code in your jsp.
<% User user = UserLocalServiceUtil.getUserById(themeDisplay.getUserId); %>
<img src="<%= themeDisplay.getPathImage() %>/user_portrait?img_id=<%= user.getPortraitId() %>">


Regards
Juhi
thumbnail
Emilio José Lamas Fraga, modificado hace 12 años.

RE: profile

Junior Member Mensajes: 57 Fecha de incorporación: 29/11/11 Mensajes recientes
Hi again,
I'm using Liferay CE 6.1 and in this version, user.getPortraitURL(themeDisplay) exists. It is used at the dockbar for example, in the view.jsp file.
ronnie orvakanti, modificado hace 11 años.

RE: profile

Junior Member Mensajes: 27 Fecha de incorporación: 27/02/12 Mensajes recientes
Juhi Kumari:
Hi Sanket,

To display profile image use this code in your jsp.
&lt;% User user = UserLocalServiceUtil.getUserById(themeDisplay.getUserId); %&gt;
<img src="<%= themeDisplay.getPathImage() %>/user_portrait?img_id=<%= user.getPortraitId() %>">


Regards
Juhi


Hi Juhi,
How do i get the "themeDisplay" in jsp?

Thanks
thumbnail
Amit Doshi, modificado hace 11 años.

RE: profile

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Hi ronnie,


How do i get the "themeDisplay" in jsp?


Using below code, you can get themeDisplay object

<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<liferay-theme:defineObjects />

Thanks & REgards,
Amit Doshi
ronnie orvakanti, modificado hace 11 años.

RE: profile

Junior Member Mensajes: 27 Fecha de incorporación: 27/02/12 Mensajes recientes
Thx Amit,
Could you plz share a sample jsp where the themeDisplay and the profile picture are retrieved? Coz i seem to be missing a lot of other stuff such a jsp would need.
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: profile

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
As Emilio replied, check the dockbar portlet:
liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\webapps\ROOT\html\portlet\dockbar\view.jsp
thumbnail
Amit Doshi, modificado hace 11 años.

RE: profile

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Hi Ronnie,

After Getting User Object

Please check below code.


<img id="userImg" src="<%= themeDisplay.getPathImage() +&quot;/user_&quot; + (user.isMale() ? &quot;male&quot; : &quot;female&quot;) + &quot;_portrait?img_id=&quot; + user.getPortraitId()+&quot;&amp;t=&quot; + ImageServletTokenUtil.getToken(user.getPortraitId())%>" alt="User Image">	  


Hope it helps.

Thanks & Regards,
Amit Doshi
ronnie orvakanti, modificado hace 11 años.

RE: profile

Junior Member Mensajes: 27 Fecha de incorporación: 27/02/12 Mensajes recientes
Amit Doshi:
Hi Ronnie,

After Getting User Object

Please check below code.


<img id="userImg" src="<%= themeDisplay.getPathImage() +&quot;/user_&quot; + (user.isMale() ? &quot;male&quot; : &quot;female&quot;) + &quot;_portrait?img_id=&quot; + user.getPortraitId()+&quot;&amp;t=&quot; + ImageServletTokenUtil.getToken(user.getPortraitId())%>" alt="User Image">	  


Hope it helps.

Thanks & Regards,
Amit Doshi



Hi Amit,
I retrieve a user from Liferay DB based on his emailID or screenName. After that, i retrieve his list of buddies. Now for these buddies, i need to retrieve theer profile pictures as well. If im not wrong, the themeDisplay object is unique for each user, right? So how do i retrieve a themeDisplay object unique to that user (in the buddyList) and then retrieve his profile picture? You had mentioned that i could retrieve the themDisplay by the code below:
&lt;%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %&gt;
<liferay-theme:defineobjects />


But i don't see any user specific themeDisplay here?
thumbnail
Amit Doshi, modificado hace 11 años.

RE: profile

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Ronnie :-


Hi Juhi,
How do i get the "themeDisplay" in jsp?

Thanks


As you have asked this in your post, so I posted the answer for that.

And check in my code it is for getting the image path, I used themedisplay object.


I retrieve a user from Liferay DB based on his emailID or screenName. After that, i retrieve his list of buddies. Now for these buddies, i need to retrieve theer profile pictures as well. If im not wrong, the themeDisplay object is unique for each user, right? So how do i retrieve a themeDisplay object unique to that user (in the buddyList) and then retrieve his profile picture? You had mentioned that i could retrieve the themDisplay by the code below:


you have already retrieved list of buddies.In order to retrieve the images for all the budies. Then iterate the list of buddy and get the user object one by one in the for loop and put my code inside it. It will work.
ronnie orvakanti, modificado hace 11 años.

RE: profile

Junior Member Mensajes: 27 Fecha de incorporación: 27/02/12 Mensajes recientes
By your code, you mean this????:

&lt;%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %&gt;
<liferay-theme:defineobjects />
<img id="userImg" src="<%= themeDisplay.getPathImage() +&quot;/user_&quot; + (user.isMale() ? &quot;male&quot; : &quot;female&quot;) + &quot;_portrait?img_id=&quot; + user.getPortraitId()+&quot;&amp;t=&quot; + ImageServletTokenUtil.getToken(user.getPortraitId())%>" alt="User Image">      


Inside a java class?????
thumbnail
Amit Doshi, modificado hace 11 años.

RE: profile

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Pass the buddy list object from java to jsp page and then with the help of tag library or using simple for each loop iterate it
ronnie orvakanti, modificado hace 11 años.

RE: profile

Junior Member Mensajes: 27 Fecha de incorporación: 27/02/12 Mensajes recientes
Thx Amit emoticon