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

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

Introduction

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

Prototype

String LAYOUT_FRIENDLY_URL_PRIVATE_USER_SERVLET_MAPPING

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

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  ww .  j a  v a 2s .co  m

    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);
    }
}