icon

Custom Landing Page Hook

icon
Tejas Kanani
Data Modeling & Business Logic
Description
After a user logs into Liferay, it is a common requirement to be able to redirect them to a different page based on their Organization or Site membership. This hook allows you to specify the desired redirection behavior using a properties file setting. Based on the properties file, it will redirect the user to their private page, public page, their default site's public/private homepage, or their default organization's public/private homepage. Simply install the hook and specify the property by overriding the following settings in your hook's portal.properties:

##
## Set override.default.landing.page.path to true if you want this property be override
## by CustomLandingPage path. If this is not provided by default it will take its value
## as true. And if this is set to false, CustomLandingPage hook will redirect to this page
## only. It needs to be true in case of Custom Landing page to work.
##
override.default.landing.page.path=true

##
## Set this property as per your needs for landing page after user log in. It could be from one of
## the value from below options
## 1. userPrivatePage
## 2. userPublicPage
## 3. sitePublicPage
## 4. sitePrivatePage
## 5. organizationPublicPage
## 6. organizationPrivatePage
## 7. role
## 8. userGroup
##
## For sitePublicPage, sitePrivatePage, organizationPublicPage, organizationPrivatePage option we
## can provide specific landing page friendly URL in custom attribute.
## example,
## For site/organization PublicPage, we can provide landing page in site custom attribute with key "landingPagePublic"
## landingPagePublic = /myHome , where /myHome is frienlyURL of a public page exist in particular site/organization site
## For site/organization PrivatePage, we can provide landing page in site custom attribute with key "landingPrivatePublic"
## landingPagePublic = /myPrivateHome , where /myPrivateHome is frienlyURL of a private page exist in particular site/organization site
## For role & userGroup, we can provide landing page complete relative URL in role OR userGroup's custom attribute with key "landingPage"
## landingPage = /web/mysite/home
##
## For more details,
## https://github.com/opensourceforlife/CustomLandingPage-Hook
##
custom.landing.page.type={userPrivatePage/userPublicPage/sitePublicPage/sitePrivatePage/organizationPublicPage/organizationPrivatePage/role/userGroup}

For defining,
1) Site/Organization's Public page
- Create custom attribute of type "TextField" with key "landingPagePublic" and define value as desired page's friendlyURL. i.e. /welcome
2) Site/Organization's Private page
- Create custom attribute of type "TextField" with key "landingPagePrivate" and define value as desired page's friendlyURL. i.e. /myhome
3) Role/UserGroup
- Create custom attribute of type "TextField" with key "landingPage" and define value as desired page's complete page URL. i.e. /web/mysite/myhome

- Glassfish with PACL issue
There is an open PACL/Glassfish issue which is currently under investigation (https://issues.liferay.com/browse/LPS-39137) .
Until it will get fixed below is the workaround for glassfish users.
1. Start Glassfish with security manager
2. Make sure portal.security.manager.strategy is set to "liferay" in poral-ext.properties

For complete release history visit -
https://github.com/opensourceforlife/CustomLandingPage-Hook /releases

For any issue/query/help/feedback,
Reach out to me @ admin{at}opensourceforlife.com
Liferay is trademark of Liferay, Inc., Liferay International Limited and/or Liferay Affiliate, registered in the United States and/or other countries.
License
    All prices displayed are in USD. For pricing specific to your country/currency, please follow the installation instructions below for accessing and purchasing this app through your Control Panel.
    Release Summary and Release Notes
    Version Change Log Supported Framework Versions Date Added
    1.2.2 - Added provision to define custom landing page for specific Role & User Group in Liferay 6.2 - For role & userGroup, provide landing page complete relative URL in role OR userGroup's custom attribute with key "landingPage" i.e. landingPage = /web/mysite/home
    Liferay Portal 6.2 CE GA1+
    Liferay Portal 6.2 EE GA1+
    2014-03-10
    1.2.1 Added Liferay 6.2 CE & Liferay 6.2 EE Compatibility
    Liferay Portal 6.2 CE GA1+
    Liferay Portal 6.2 EE GA1+
    2014-01-08
    1.2 Minor bug fixes and code improvement
    Liferay Portal 6.1 CE GA2
    Liferay Portal 6.1 EE GA2
    Liferay Portal 6.1 CE GA3+
    Liferay Portal 6.1 EE GA3+
    2013-12-02
    1.1 New option added by which any "specific" page within a Site/Organization can be made a landing page for that Site/Organization instead of their default page(home page). For this flexibility, we just need to define page friendlyURL via custom attribute of Site/Organization. For defining, 1) Site/Organization's Public page - Create custom attribute of type "TextField" with key "landingPagePublic" and define value as desired page's friendlyURL. i.e. /welcome 2) Site/Organization's Private page - Create custom attribute of type "TextField" with key "landingPagePrivate" and define value as desired page's friendlyURL. i.e. /myhome For more details visit the documentation/description of app from provided details above.
    Liferay Portal 6.1 CE GA2
    Liferay Portal 6.1 EE GA2
    Liferay Portal 6.1 CE GA3+
    Liferay Portal 6.1 EE GA3+
    2013-10-18
    1.0
    Liferay Portal 6.1 CE GA2+
    Liferay Portal 6.1 EE GA2+
    2013-03-04
    DEVELOPER
    Tejas Kanani
    Published Date
    Version
    1.2.2
    Supported Versions
    6.2, 6.1
    Edition
    EE, CE
    Price
    Free
    SHARE LINK

    Installation Instructions

    This is a Legacy App that is no longer available in the new App Marketplace. You are able to acquire it from your installed DXP or CE instance and install it by following the instructions below.

    Acquiring this App through the legacy Liferay Portal Store

    1. Review app documentation for any specific installation instructions.
    2. Login to your Liferay Portal instance with administrative permissions.
    3. Navigate to the Control Panel, Marketplace (or Apps for 7.3 and prior), then Store.
    4. If needed, login to your Liferay.com account by choosing Sign In.
    5. Search for the app name in the Search dialog.
    6. Once the app is found, click on the app in the search results.
    7. On the app details page, choose to acquire the app by selecting the Free, Buy, or Trial button.
    8. Follow the instructions on the screen to complete the acquisition.

    Installing this App through legacy Liferay Portal Purchased Apps

    1. After acquiring the app, login to your Liferay Portal instance with administrative permissions.
    2. Navigate to the Control Panel, Marketplace (or Apps for 7.3 and prior), then Purchased.
    3. If needed, login to your Liferay.com account by choosing Sign In.
    4. Click the Install button to install your app on your Liferay Portal instance.

    See the legacy App Marketplace help documentation for more information.