Example usage for com.liferay.portal.kernel.util PortalUtil getLayoutURL

List of usage examples for com.liferay.portal.kernel.util PortalUtil getLayoutURL

Introduction

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

Prototype

public static String getLayoutURL(ThemeDisplay themeDisplay) throws PortalException 

Source Link

Usage

From source file:com.liferay.faces.portal.context.internal.LiferayPortletHelperImpl.java

License:Open Source License

@Override
public ServiceContext getServiceContext() {

    ServiceContext serviceContext = new ServiceContext();
    ThemeDisplay themeDisplay = getThemeDisplay();
    serviceContext.setCompanyId(themeDisplay.getCompanyId());
    serviceContext.setLanguageId(themeDisplay.getLanguageId());
    serviceContext.setPathMain(PortalUtil.getPathMain());
    serviceContext.setPlid(themeDisplay.getPlid());
    serviceContext.setPortalURL(PortalUtil.getPortalURL(getPortletRequest()));
    serviceContext.setScopeGroupId(themeDisplay.getScopeGroupId());
    serviceContext.setUserId(themeDisplay.getUserId());

    try {//from  ww  w .j  a  v  a2  s .  c om
        serviceContext.setLayoutFullURL(PortalUtil.getLayoutFullURL(themeDisplay));
        serviceContext.setLayoutURL(PortalUtil.getLayoutURL(themeDisplay));
        serviceContext.setUserDisplayURL(themeDisplay.getUser().getDisplayURL(themeDisplay));
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }

    return serviceContext;
}

From source file:com.slemarchand.quick.sign.up.web.portlet.QuickSignUpPortlet.java

License:Open Source License

protected String getSuccessRedirect(ActionRequest actionRequest, ActionResponse actionResponse)
        throws PortalException, SystemException {

    String redirect = getRedirect(actionRequest, actionResponse);

    if (Validator.isNull(redirect)) {
        ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

        redirect = PortalUtil.getLayoutURL(themeDisplay);
    }//from w w  w  .ja v  a 2s. c om

    return redirect;
}