Example usage for com.liferay.portal.kernel.util PropsKeys DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL

List of usage examples for com.liferay.portal.kernel.util PropsKeys DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL.

Prototype

String DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL

To view the source code for com.liferay.portal.kernel.util PropsKeys DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL.

Click Source Link

Usage

From source file:it.webscience.kpeople.event.login.KpeoplePrivatePageRedirectAction.java

License:Open Source License

protected void doRun(HttpServletRequest request, HttpServletResponse response) throws Exception {

    long companyId = PortalUtil.getCompanyId(request);

    String path = PrefsPropsUtil.getString(companyId,
            PropsKeys.LAYOUT_FRIENDLY_URL_PRIVATE_USER_SERVLET_MAPPING);

    path = path + "/" + PortalUtil.getUser(request).getScreenName();

    path = path + PrefsPropsUtil.getString(companyId, PropsKeys.DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL);

    _log.info(String.format("PrivatePageRedirectAction, path=%s...", path));

    if (_log.isInfoEnabled()) {
        _log.info("Private page path: " + StringPool.EQUAL + path);
    }/*from  w w w. jav a 2  s. com*/

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

        HttpSession session = request.getSession();
        request.setAttribute(WebKeys.LAST_PATH, lastPath);
        session.setAttribute(WebKeys.LAST_PATH, lastPath);
    }
}