Example usage for com.liferay.portal.util PropsValues DEFAULT_LANDING_PAGE_PATH

List of usage examples for com.liferay.portal.util PropsValues DEFAULT_LANDING_PAGE_PATH

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues DEFAULT_LANDING_PAGE_PATH.

Prototype

String DEFAULT_LANDING_PAGE_PATH

To view the source code for com.liferay.portal.util PropsValues DEFAULT_LANDING_PAGE_PATH.

Click Source Link

Usage

From source file:com.ext.portal.events.CustomDefaultLandingPageAction.java

License:Open Source License

public void run(HttpServletRequest request, HttpServletResponse response) {
    _log.info("***********Inside CustomDefaultLandingPageAction****************");
    String path = PropsValues.DEFAULT_LANDING_PAGE_PATH;

    if (_log.isInfoEnabled()) {
        _log.info(PropsKeys.DEFAULT_LANDING_PAGE_PATH + StringPool.EQUAL + path);
    }//  w  ww  .j  a va  2  s  .  co  m

    HttpSession session = request.getSession();

    if (Validator.isNotNull(path)) {
        LastPath lastPath = new LastPath(StringPool.BLANK, path, new HashMap<String, String[]>());

        session.setAttribute(WebKeys.LAST_PATH, lastPath);
    }

    // The commented code shows how you can programmaticaly set the user's
    // landing page. You can modify this class to utilize a custom algorithm
    // for forwarding a user to his landing page. See the references to this
    // class in portal.properties.

    Map<String, String[]> params = new HashMap<String, String[]>();

    params.put("p_l_id", new String[] { "1806" });

    LastPath lastPath = new LastPath("/c", "/portal/layout", params);
    _log.info("************lastPath=" + lastPath + "*************");
    session.setAttribute(WebKeys.LAST_PATH, lastPath);
}