Fórum

Community Specific Landing Page?

thumbnail
L P Bharat, modificado 11 Anos atrás.

Community Specific Landing Page?

Junior Member Postagens: 39 Data de Entrada: 20/08/08 Postagens Recentes
Hi All,

I am using Liferay 6.0 sp2. and I have the following requirement.

1) I have more than one community in my portal say comm1, comm2 etc.
2) Each community has its own public and private pages.
3) Each community has its own "Login" page (public page) on which login portlet is added.
a) comm1 >> Login
b) comm2 >> Login
I want users to land to private pages of comm1 if they are logging in from comm1 >> login
and to private page of comm2 if they are logging in from comm2 >> login

Does Liferay has this functionality out of the box or it needs customization?
If customization is needed then how to achieve this functionality?

Regards
L P
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: Community Specific Landing Page?

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
You have to implement com.liferay.portal.events.MyLandingPageAction through hook.

1. liferay-hook.xml:

<portal-properties>portal.properties</portal-properties>


2. portal.properties

login.events.post = com.liferay.portal.events.MyLandingPageAction


3. Get the Site(community) name by passing userId and redirect to site URL.

Here is the working example.
thumbnail
L P Bharat, modificado 11 Anos atrás.

RE: Community Specific Landing Page?

Junior Member Postagens: 39 Data de Entrada: 20/08/08 Postagens Recentes
Hi Gnaniyar ,

Thanks for the quick reply.
But the link suggested by you is taking the user to the first available community (site) in his site list.
if ((userSites != null) && !userSites.isEmpty()) {
String siteFriendlyURL = userSites.get(0).getFriendlyURL();
sitePath = language + "/web" + siteFriendlyURL;
}


Irrespective of the community from which the user is logging in (comm1 or comm2) it will always take the user to the fist available community in the list.
Furthermore I tried to get current community in login post action using theme display but it (theme display) seems to be null in post action.

Please correct me If I miss something.

Regards,
L P
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: Community Specific Landing Page?

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
You have to findout the user's site and check if users belongs to particular community then redirect.

If you want to get all the users from that site passing groupId (siteId):

UserLocalServiceUtil.getGroupUserIds(groupId)


You can get all the Sites (Groups) from the user object which returns List of Sites:

user.getGroups()