Foren
Link to a users public page
Felipe Sere, geändert vor 13 Jahren.
Link to a users public page
Junior Member Beiträge: 87 Beitrittsdatum: 27.01.10 Neueste Beiträge
Hi everyone,
I am working on a customized user directory.
I'd like to know if there is an elegant way to get a URL to a users public page if it is available?
I did check some weird stuff out but it did not work. Here is my JSP where I want to add the URL/Link:
Cheers,
Felipe
I am working on a customized user directory.
I'd like to know if there is an elegant way to get a URL to a users public page if it is available?
I did check some weird stuff out but it did not work. Here is my JSP where I want to add the URL/Link:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@include file="init.jsp" %>
<%
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
User benutzer = (User) row.getObject();
%>
<liferay-ui:icon-menu>
<liferay-ui:icon image="edit" message="Mail" url="<%=" mailto:" + benutzer.getdisplayemailaddress() %>"/>
<%-- <liferay-ui:icon image="edit" message="Home" url="<URL GOES HERE> " --%>
</liferay-ui:icon></liferay-ui:icon></liferay-ui:icon-menu>
Cheers,
Felipe
Peter Shin, geändert vor 13 Jahren.
RE: Link to a users public page
Regular Member Beiträge: 121 Beitrittsdatum: 24.09.07 Neueste Beiträge
There are some extra helper methods defined in UserImpl.java.
benutzer.getDisplayURL(themeDisplay)
Felipe Sere, geändert vor 13 Jahren.
RE: Link to a users public page
Junior Member Beiträge: 87 Beitrittsdatum: 27.01.10 Neueste Beiträge
I had seen that method, but it actually needing a parameter (worse, one I dont understand) confused me.
How would I go about to get a ThemeDisplay Object from inside a normal Java class? And what does that thing actually do?
Felipe
How would I go about to get a ThemeDisplay Object from inside a normal Java class? And what does that thing actually do?
Felipe
Felipe Sere, geändert vor 13 Jahren.
RE: Link to a users public page
Junior Member Beiträge: 87 Beitrittsdatum: 27.01.10 Neueste Beiträge
I have one more question:
How can I check if the user has a public page at all?
How can I check if the user has a public page at all?
Peter Shin, geändert vor 13 Jahren.
RE: Link to a users public page
Regular Member Beiträge: 121 Beitrittsdatum: 24.09.07 Neueste Beiträge
From the portletRequest, you can get it like this
There's also another helper method to generate a user url
And to check if a user has any public pages
ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
There's also another helper method to generate a user url
user.getDisplayURL(String portalURL, String mainPath)
And to check if a user has any public pages
int count = user.getGroup().getPublicLayoutsPageCount();