Customizing Default Landing Page

Customizing Default Landing Page Per User

Default Landing Page is where user is automatically redirected after the successful login into the Webspace server. There is a configuration parameter "default.landing.page.path" which can be set for portal wide landing page for every user. To configure a system wide landing page, configure following parameters in portal-ext.properties.

auth.forward.by.last.path=true
default.landing.page.path=/web/guest/login

The above configuration lands users to "/web/guest/login" page after successful authentication. If the Webspace URL is http://localhost:8080 then the user is redirected to http://localhost:8080/web/guest/login.

Things become interesting when it is required to configure a landing page per user. The webspace server also has a configuration parameter "login.events.post" which can take a comma separated list of Java classes that will be invoked after the successful login by a user. The default Landing Page behavior is actually, part of the post login event.

This document provides with a sample that would allow the Webspace administrator to provision a user with default landing page (this could be potentially a private page of a community) per user. Also, this sample includes a Java class that would be included in the "login.events.post" list. The Java class MyLandingPage would read the custom attribute "landingpage" which would point to a community's private/public page (or any other page).

To Install and Configure

  1. Download the MyLandingPage.java
  2. Build the jar using Netbeans portal pack by selecting Java application project with Webspace libraries. The portal-impl.jar also required which is available under WEB-INF/lib directory of the GlassFish domain's webspace application directory (GF_DIR/domains/domain1/applications/j2ee-modules/webspace/WEB-INF/lib).
  3. Copy the jar file into webspace customs directory <install_root>/var/webspace/war-workspace/customs/webspace/WEB-INF/lib
  4. Add the following line to portal-ext.properties file at <install_root>/var/webspace/war-workspace/customs/webspace/WEB-INF/classes. If portal-ext.properties exist, then append to the file, else create it.
    login.events.post=com.liferay.portal.events.LoginPostAction,com.sample.MyLandingPage
    
  5. Build and install the update webspace.war by running "ant -f synchronize.xml"
  6. Restart the Webspace Server.
  7. Using control panel (as "admin" user) add a text based custom attribute "landingpage" under "Users" option. Grant "View" permission to "Guest".
  8. Edit a user and assign the custom attribute to a community's private page. (for example /group/customer)
  9. Test the Login for user.

In this sample, if the user is not provisioned with "landingpage" attribute then the portal's default landing page becomes applicable.

Labels

webspace webspace Delete
liferay liferay Delete
portal portal Delete
landingpage landingpage Delete
glassfish glassfish Delete
portfolio portfolio Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact