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.trash.web.internal.display.context.TrashContainerModelDisplayContext.java

License:Open Source License

public TrashContainerModelDisplayContext(LiferayPortletRequest liferayPortletRequest,
        LiferayPortletResponse liferayPortletResponse) {

    _liferayPortletRequest = liferayPortletRequest;
    _liferayPortletResponse = liferayPortletResponse;

    _request = PortalUtil.getHttpServletRequest(liferayPortletRequest);
}

From source file:com.liferay.user.groups.admin.web.internal.portlet.action.ActionUtil.java

License:Open Source License

public static UserGroup getUserGroup(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getUserGroup(request);
}

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

License:Open Source License

public static void getAddress(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getAddress(request);/*from  w  ww  .  j ava2  s  . c om*/
}

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

License:Open Source License

public static void getEmailAddress(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getEmailAddress(request);/*ww w .  j a v a 2s .com*/
}

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

License:Open Source License

public static Organization getOrganization(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    return getOrganization(request);
}

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

License:Open Source License

public static void getOrgLabor(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getOrgLabor(request);/* ww  w .ja  va2  s .c  o m*/
}

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

License:Open Source License

public static void getPhone(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getPhone(request);//from  w w w  .j  a  v  a2  s  .  c o m
}

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

License:Open Source License

public static void getWebsite(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    getWebsite(request);/*w w w.jav a2s  .c  o  m*/
}

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

License:Open Source License

public static WikiNode getNode(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    long nodeId = ParamUtil.getLong(portletRequest, "nodeId");
    String nodeName = ParamUtil.getString(portletRequest, "nodeName");

    WikiNode node = null;/*from  w  ww. j  a va2  s .  co m*/

    try {
        if (nodeId > 0) {
            node = WikiNodeServiceUtil.getNode(nodeId);
        } else if (Validator.isNotNull(nodeName)) {
            node = WikiNodeServiceUtil.getNode(themeDisplay.getScopeGroupId(), nodeName);
        } else {
            throw new NoSuchNodeException();
        }
    } catch (NoSuchNodeException nsne) {
        node = ActionUtil.getFirstVisibleNode(portletRequest);
    }

    return node;
}

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

License:Open Source License

public static WikiPage getPage(PortletRequest portletRequest) throws Exception {

    HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

    long nodeId = ParamUtil.getLong(request, "nodeId");
    String title = ParamUtil.getString(request, "title");
    double version = ParamUtil.getDouble(request, "version");

    WikiNode node = null;/* w w w .ja  v a2s .c o  m*/

    try {
        if (nodeId > 0) {
            node = WikiNodeServiceUtil.getNode(nodeId);
        }
    } catch (NoSuchNodeException nsne) {
    }

    if (node == null) {
        node = (WikiNode) request.getAttribute(WikiWebKeys.WIKI_NODE);

        if (node != null) {
            nodeId = node.getNodeId();
        }
    }

    WikiWebComponentProvider wikiWebComponentProvider = WikiWebComponentProvider.getWikiWebComponentProvider();

    WikiGroupServiceConfiguration wikiGroupServiceConfiguration = wikiWebComponentProvider
            .getWikiGroupServiceConfiguration();

    if (Validator.isNull(title)) {
        title = wikiGroupServiceConfiguration.frontPageName();
    }

    try {
        return WikiPageServiceUtil.getPage(nodeId, title, version);
    } catch (NoSuchPageException nspe) {
        if (title.equals(wikiGroupServiceConfiguration.frontPageName()) && (version == 0)) {

            return getFirstVisiblePage(nodeId, portletRequest);
        } else {
            throw nspe;
        }
    }
}