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

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

Introduction

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

Prototype

public static HttpServletRequest getHttpServletRequest(PortletRequest portletRequest) 

Source Link

Usage

From source file:com.liferay.marketplace.store.web.internal.portlet.RemoteMVCPortlet.java

License:Open Source License

protected void setBaseRequestParameters(PortletRequest portletRequest, PortletResponse portletResponse,
        OAuthRequest oAuthRequest) {//from  ww w .j a  va  2s  .c  o  m

    HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(portletRequest);

    String clientAuthToken = AuthTokenUtil.getToken(httpServletRequest);

    addOAuthParameter(oAuthRequest, "clientAuthToken", clientAuthToken);

    addOAuthParameter(oAuthRequest, "clientPortletId", getClientPortletId());
    addOAuthParameter(oAuthRequest, "clientURL", PortalUtil.getCurrentCompleteURL(httpServletRequest));
    addOAuthParameter(oAuthRequest, "p_p_id", getServerPortletId());
}

From source file:com.liferay.message.boards.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static MBCategory getCategory(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getCategory(request);
}

From source file:com.liferay.message.boards.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static MBMessage getMessage(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getMessage(request);
}

From source file:com.liferay.message.boards.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static MBMessageDisplay getMessageDisplay(PortletRequest portletRequest) throws PortalException {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getMessageDisplay(request);
}

From source file:com.liferay.message.boards.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static MBMessage getThreadMessage(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getThreadMessage(request);
}

From source file:com.liferay.polls.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static void getQuestion(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getQuestion(request);//from w  ww .  j av  a  2 s.  c  o  m
}

From source file:com.liferay.polls.web.internal.portlet.util.PollsUtil.java

License:Open Source License

public static void saveVote(PortletRequest portletRequest, PortletResponse portletResponse, long questionId) {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);
    HttpServletResponse response = PortalUtil.getHttpServletResponse(portletResponse);

    saveVote(request, response, questionId);
}

From source file:com.liferay.product.navigation.site.administration.internal.display.context.SiteAdministrationPanelCategoryDisplayContext.java

License:Open Source License

public Group getGroup() {
    if (_group != null) {
        return _group;
    }//  w  w w .  j  a v  a 2 s. com

    _group = _groupProvider.getGroup(PortalUtil.getHttpServletRequest(_portletRequest));

    if (_group != null) {
        updateLatentGroup(_group.getGroupId());
    }

    return _group;
}

From source file:com.liferay.product.navigation.site.administration.internal.display.context.SiteAdministrationPanelCategoryDisplayContext.java

License:Open Source License

public boolean isShowSiteSelector() throws PortalException {
    HttpServletRequest request = PortalUtil.getHttpServletRequest(_portletRequest);

    List<Group> mySites = getMySites();
    List<Group> recentSites = _recentGroupManager.getRecentGroups(request);

    if (mySites.isEmpty() && recentSites.isEmpty()) {
        return false;
    }/*from  www . j a  v a2s  . com*/

    return true;
}

From source file:com.liferay.product.navigation.site.administration.internal.display.context.SiteAdministrationPanelCategoryDisplayContext.java

License:Open Source License

protected void updateLatentGroup(long groupId) {
    if (groupId <= 0) {
        return;/*from ww w  .  j ava  2s .  c om*/
    }

    HttpServletRequest request = PortalUtil.getHttpServletRequest(_portletRequest);

    _recentGroupManager.addRecentGroup(request, groupId);

    _groupProvider.setGroup(request, _group);
}