Uploaded image for project: 'ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)'
  1. ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)
  2. LEP-6816

Wiki note for topic: "Customizing the default page after login"

    Details

    • Type: Technical Support
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: None
    • Fix Version/s: 5.1.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      GF2ur2, jdk1.5.0_15, Liferay ext 5.1.x

      Description

      The following note relates to the Wiki article titled "Customizing the default page after login". My codebase is patched with minor permission checks for presentation concerns. Despite the changes, I expect the following to hold true on a clean co from the v5.1.x branch. I'm providing this information in case anyone else may benefit from it. The Wiki page would not permit comments:

      ------------------------------------------------

      In 5.1.x, portal.properties has:

      login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction

      When using an alternate handler in place of DefaultLandingPageAction, the following Wiki-described reference to THEME_DISPLAY was observed to be null (1):

      req.getAttribute(WebKeys.THEME_DISPLAY)

      The request instance, however, does contain other references such as WebKeys.USER_ID which can be used to return a reference to a User object instance, for example:

      /*

      • Get user id
        */
        java.lang.Long userId = (java.lang.Long)request.getAttribute(WebKeys.USER_ID);

      /*

      • Validate userId then get User
        */

      User user = UserLocalServiceUtil.getUserById(userId.longValue());

      -----------

      The final entry in portal-ext.properties looks like the following:

      login.events.post=com.liferay.portal.events.LoginPostAction,HomeLandingPageAction

      in comparison to the original entry in portal.properties:

      login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction

      To build HomeLandingPageAction, the unpackaged source file was conveniently placed in $EXT_HOME/ext-impl/src

      ------------------------------

      1) A terse debug of the login event showed no assignments for THEME_DISPLAY in the context of the "login.events.post" handler invocation. In the larger/outer context of the login activity, THEME_DISPLAY was set for other handlers. The evaluation was limited for the purpose of achieving a working solution.

        Attachments

          Activity

            People

            Assignee:
            mduan Arcko Duan (Inactive)
            Reporter:
            bvj bvj (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                5.1.2