i have liferay 6.2 GA4.. i have a question
i want to use liferay's user portrait change, but i dont want to copy all the code to my portlet...
is there a way to call liferay's portrait update from my portlet? just like in a render URL or something like that... call the edit_user_portrait struts action from liferay's my account portlet, and then let liferay do everything else... update the image, show errors, etc...
using this for example: (this is the code in liferay's my account portlet, to call the pop up that updates the portrait)
<portlet:renderURL var="editUserPortraitURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/users_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()) %>" />
i want something like this, but this is not working... where i tell the portlet name (users admin in this case) where the struts action lives... and let liferay handle the rest..
<liferay-portlet:renderURL portletName="<%=PortletKeys.USERS_ADMIN %>" var="editUserPortraitURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/users_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()) %>" />
for this i imported the <%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet"%>
this code gives me a permissions error:
You do not have the roles required to access this portlet.
but i doesnt send any error in the log.. how can i make this work? what im i missing?
thank you!!
<%=themeDisplay.getPortalURL()%>/group/control_panel/manage?p_p_id=2&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&_2_portrait_id=0&_2_p_u_i_d=<%=themeDisplay.getUserId()%>&_2_struts_action=%2Fmy_account%2Fedit_user_portrait
and it worked for me – Saleem Khan