Search in sources :

Example 1 with PortalContext

use of javax.portlet.PortalContext in project liferay-faces-bridge-impl by liferay.

the class ResourceHandlerBridgeImpl method isAbleToSetHttpStatusCode.

private boolean isAbleToSetHttpStatusCode(FacesContext facesContext) {
    ExternalContext externalContext = facesContext.getExternalContext();
    PortletRequest portletRequest = (PortletRequest) externalContext.getRequest();
    PortalContext portalContext = portletRequest.getPortalContext();
    String setHttpStatusCodeSupport = portalContext.getProperty(BridgePortalContext.SET_HTTP_STATUS_CODE_SUPPORT);
    return (setHttpStatusCodeSupport != null);
}
Also used : PortletRequest(javax.portlet.PortletRequest) ExternalContext(javax.faces.context.ExternalContext) PortalContext(javax.portlet.PortalContext) BridgePortalContext(com.liferay.faces.bridge.context.BridgePortalContext)

Example 2 with PortalContext

use of javax.portlet.PortalContext in project liferay-faces-bridge-impl by liferay.

the class ExternalContextCompat_2_0_Impl method setResponseBufferSize.

/**
 * @see    ExternalContext#setResponseBufferSize(int)
 * @since  JSF 2.0
 */
@Override
public void setResponseBufferSize(int size) {
    if (portletResponse instanceof ResourceResponse) {
        PortalContext portalContext = portletRequest.getPortalContext();
        String setResponseBufferSizeSupport = portalContext.getProperty(BridgePortalContext.SET_RESOURCE_RESPONSE_BUFFER_SIZE_SUPPORT);
        if (setResponseBufferSizeSupport != null) {
            ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
            resourceResponse.setBufferSize(size);
        }
    } else {
        if (manageIncongruities) {
            incongruityContext.setResponseBufferSize(size);
        } else {
            throw new IllegalStateException();
        }
    }
}
Also used : ResourceResponse(javax.portlet.ResourceResponse) PortalContext(javax.portlet.PortalContext) BridgePortalContext(com.liferay.faces.bridge.context.BridgePortalContext)

Example 3 with PortalContext

use of javax.portlet.PortalContext in project liferay-faces-bridge-impl by liferay.

the class BridgePortalContextAjaxRequestTest method testBridgePortalContextAjaxRequest.

@Test
public void testBridgePortalContextAjaxRequest() {
    boolean markupHeadElementSupport = true;
    boolean ajaxRequest = true;
    PortalContext portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport, ajaxRequest));
    testBridgePortalContextAjaxRequest(portalContextBridgeImpl);
    markupHeadElementSupport = false;
    portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport, ajaxRequest));
    testBridgePortalContextAjaxRequest(portalContextBridgeImpl);
}
Also used : PortalContext(javax.portlet.PortalContext) PortalContextBridgeImpl(com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl) Test(org.junit.Test)

Example 4 with PortalContext

use of javax.portlet.PortalContext in project liferay-faces-bridge-ext by liferay.

the class BridgePortletRequestFactoryLiferayImpl method getHeaderRequest.

@Override
public HeaderRequest getHeaderRequest(HeaderRequest headerRequest, HeaderResponse headerResponse, PortletConfig portletConfig, BridgeConfig bridgeConfig) {
    headerRequest = getWrapped().getHeaderRequest(headerRequest, headerResponse, portletConfig, bridgeConfig);
    PortalContext portalContext = new PortalContextBridgeLiferayImpl(headerRequest);
    return new HeaderRequestBridgeLiferayImpl(headerRequest, headerResponse.getNamespace(), portletConfig, portalContext);
}
Also used : PortalContext(javax.portlet.PortalContext) PortalContextBridgeLiferayImpl(com.liferay.faces.bridge.ext.context.internal.PortalContextBridgeLiferayImpl)

Example 5 with PortalContext

use of javax.portlet.PortalContext in project liferay-faces-bridge-ext by liferay.

the class BridgePortletRequestFactoryLiferayImpl method getEventRequest.

@Override
public EventRequest getEventRequest(EventRequest eventRequest, EventResponse eventResponse, PortletConfig portletConfig, BridgeConfig bridgeConfig) {
    eventRequest = getWrapped().getEventRequest(eventRequest, eventResponse, portletConfig, bridgeConfig);
    PortalContext portalContext = new PortalContextBridgeLiferayImpl(eventRequest);
    return new EventRequestBridgeLiferayImpl(eventRequest, eventResponse.getNamespace(), portletConfig, portalContext);
}
Also used : PortalContext(javax.portlet.PortalContext) PortalContextBridgeLiferayImpl(com.liferay.faces.bridge.ext.context.internal.PortalContextBridgeLiferayImpl)

Aggregations

PortalContext (javax.portlet.PortalContext)13 PortalContextBridgeLiferayImpl (com.liferay.faces.bridge.ext.context.internal.PortalContextBridgeLiferayImpl)5 BridgePortalContext (com.liferay.faces.bridge.context.BridgePortalContext)4 ExternalContext (javax.faces.context.ExternalContext)4 PortletRequest (javax.portlet.PortletRequest)4 UIViewRoot (javax.faces.component.UIViewRoot)3 PortalContextBridgeImpl (com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl)2 Product (com.liferay.faces.util.product.Product)2 ArrayList (java.util.ArrayList)2 FacesContext (javax.faces.context.FacesContext)2 ResponseWriter (javax.faces.context.ResponseWriter)2 PortletContext (javax.portlet.PortletContext)2 Test (org.junit.Test)2 BridgeURI (com.liferay.faces.bridge.internal.BridgeURI)1 BridgeTest (com.liferay.faces.bridge.tck.annotation.BridgeTest)1 AnnotatedExcludedBean (com.liferay.faces.bridge.tck.beans.AnnotatedExcludedBean)1 FacesRequestParameterMap (com.liferay.faces.util.context.map.FacesRequestParameterMap)1 MultiPartFormData (com.liferay.faces.util.context.map.MultiPartFormData)1 ProductFactory (com.liferay.faces.util.product.ProductFactory)1 FacesURLEncoder (com.liferay.faces.util.render.FacesURLEncoder)1