@Override public String getProperty(String name) { return wrapped.getProperty(name); }
/** * Reads a portal property from the portal context of the Vaadin request. * * @param name * a string with the name of the portal property to get * @return a string with the value of the property, or <code>null</code> if * the property is not defined */ public String getPortalProperty(String name) { return getRequest().getPortalContext().getProperty(name); }
protected String getMarkupHeadElementSupported() { return wrappedPortalContext.getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT); }
protected String getMarkupHeadElementSupported() { return wrappedPortalContext.getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT); }
@Override public String getProperty(String name) { if (BridgePortalContext.ADD_ELEMENT_TO_HEAD_SUPPORT.equals(name) || BridgePortalContext.ADD_SCRIPT_RESOURCE_TO_HEAD_SUPPORT.equals(name) || BridgePortalContext.ADD_SCRIPT_TEXT_TO_HEAD_SUPPORT.equals(name) || BridgePortalContext.ADD_STYLE_SHEET_RESOURCE_TO_HEAD_SUPPORT.equals(name) || BridgePortalContext.ADD_STYLE_SHEET_TEXT_TO_HEAD_SUPPORT.equals(name)) { return addToHeadSupport; } else if (BridgePortalContext.CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT.equals(name)) { return "true"; } else if (BridgePortalContext.STRICT_NAMESPACED_PARAMETERS_SUPPORT.equals(name)) { return namespacedParametersRequired; } else if (BridgePortalContext.POST_REDIRECT_GET_SUPPORT.equals(name)) { // Liferay Portal does not implement the POST-REDIRECT-GET design pattern. Rather, the ACTION_PHASE and // RENDER_PHASE are both part of a single HTTP POST request. return null; } else if (BridgePortalContext.SET_HTTP_STATUS_CODE_SUPPORT.equals(name)) { return "true"; } else { return wrappedPortalContext.getProperty(name); } }
public ResponseWriterBridgeCompat_2_0_Impl(ResponseWriter wrappedResponseWriter) { BridgeContext bridgeContext = BridgeContext.getCurrentInstance(); PortletRequest portletRequest = bridgeContext.getPortletRequest(); PortalContext portalContext = portletRequest.getPortalContext(); String namespacedParametersSupport = portalContext.getProperty( BridgePortalContext.STRICT_NAMESPACED_PARAMETERS_SUPPORT); this.namespacedParameters = (namespacedParametersSupport != null) && JSF_RUNTIME_SUPPORTS_NAMESPACING_VIEWSTATE; }
@Override protected boolean isAbleToSetHttpStatusCode(FacesContext facesContext) { BridgeContext bridgeContext = BridgeContext.getCurrentInstance(); PortletRequest portletRequest = bridgeContext.getPortletRequest(); PortalContext portalContext = portletRequest.getPortalContext(); String setHttpStatusCodeSupport = portalContext.getProperty(BridgePortalContext.SET_HTTP_STATUS_CODE_SUPPORT); return (setHttpStatusCodeSupport != null); }
@Override protected boolean isAbleToSetHttpStatusCode(FacesContext facesContext) { BridgeContext bridgeContext = BridgeContext.getCurrentInstance(); PortletRequest portletRequest = bridgeContext.getPortletRequest(); PortalContext portalContext = portletRequest.getPortalContext(); String setHttpStatusCodeSupport = portalContext.getProperty(BridgePortalContext.SET_HTTP_STATUS_CODE_SUPPORT); return (setHttpStatusCodeSupport != null); }
public ResponseWriterBridgeCompat_2_0_Impl(ResponseWriter wrappedResponseWriter) { BridgeContext bridgeContext = BridgeContext.getCurrentInstance(); PortletRequest portletRequest = bridgeContext.getPortletRequest(); PortalContext portalContext = portletRequest.getPortalContext(); String namespacedParametersSupport = portalContext.getProperty( BridgePortalContext.STRICT_NAMESPACED_PARAMETERS_SUPPORT); this.namespacedParameters = (namespacedParametersSupport != null) && JSF_RUNTIME_SUPPORTS_NAMESPACING_VIEWSTATE; }
/** * @see {@link 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(); } } }
/** * @see {@link 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(); } } }
@Override public String getProperty(String name) { if (ADD_SCRIPT_RESOURCE_TO_HEAD_SUPPORT.equals(name)) { return getAddScriptResourceToHead(); } else if (ADD_SCRIPT_TEXT_TO_HEAD_SUPPORT.equals(name)) { return getAddScriptTextToHead(); } else if (ADD_STYLE_SHEET_RESOURCE_TO_HEAD_SUPPORT.equals(name)) { return getAddStyleSheetResourceToHead(); } else if (CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT.equals(name)) { return getCreateRenderUrlDuringActionPhase(); } else if (STRICT_NAMESPACED_PARAMETERS_SUPPORT.equals(name)) { return getNamespacedParametersRequired(); } else if (POST_REDIRECT_GET_SUPPORT.equals(name)) { return getPostRedirectGetSupported(); } else if (SET_HTTP_STATUS_CODE_SUPPORT.equals(name)) { return getSetHttpStatusCode(); } else if (SET_RESOURCE_RESPONSE_BUFFER_SIZE_SUPPORT.equals(name)) { return getSetResourceResponseBufferSize(); } else { return wrappedPortalContext.getProperty(name); } }
@Override public String getProperty(String name) { if (ADD_SCRIPT_RESOURCE_TO_HEAD_SUPPORT.equals(name)) { return getAddScriptResourceToHead(); } else if (ADD_SCRIPT_TEXT_TO_HEAD_SUPPORT.equals(name)) { return getAddScriptTextToHead(); } else if (ADD_STYLE_SHEET_RESOURCE_TO_HEAD_SUPPORT.equals(name)) { return getAddStyleSheetResourceToHead(); } else if (CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT.equals(name)) { return getCreateRenderUrlDuringActionPhase(); } else if (STRICT_NAMESPACED_PARAMETERS_SUPPORT.equals(name)) { return getNamespacedParametersRequired(); } else if (POST_REDIRECT_GET_SUPPORT.equals(name)) { return getPostRedirectGetSupported(); } else if (SET_HTTP_STATUS_CODE_SUPPORT.equals(name)) { return getSetHttpStatusCode(); } else if (SET_RESOURCE_RESPONSE_BUFFER_SIZE_SUPPORT.equals(name)) { return getSetResourceResponseBufferSize(); } else { return wrappedPortalContext.getProperty(name); } }
@Override protected void initBridgeRequestScope(PortletRequest portletRequest, PortletResponse portletResponse, PortletPhase portletPhase) { super.initBridgeRequestScope(portletRequest, portletResponse, portletPhase); // If the portlet container does not support the POST-REDIRECT-GET design pattern, then the ACTION_PHASE and // RENDER_PHASE are both part of a single HTTP POST request. In such cases, the excluded request attributes must // be pro-actively removed here in the RENDER_PHASE (providing that the bridge request scope was created in the // ACTION_PHASE). Note that this must take place prior to the FacesContext getting constructed. This is because // the FacesContextFactory delegation chain might consult a request attribute that is supposed to be excluded. // This is indeed the case with Apache Trinidad {@link // org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.CacheRenderKit} constructor, which // consults a request attribute named "org.apache.myfaces.trinidad.util.RequestStateMap" that must first be // excluded. PortalContext portalContext = portletRequest.getPortalContext(); String postRedirectGetSupport = portalContext.getProperty(BridgePortalContext.POST_REDIRECT_GET_SUPPORT); if ((postRedirectGetSupport == null) && (bridgeRequestScope.getBeganInPhase() == Bridge.PortletPhase.ACTION_PHASE)) { bridgeRequestScope.removeExcludedAttributes(renderRequest); } }
@Override protected void initBridgeRequestScope(PortletRequest portletRequest, PortletResponse portletResponse, PortletPhase portletPhase) { super.initBridgeRequestScope(portletRequest, portletResponse, portletPhase); // If the portlet container does not support the POST-REDIRECT-GET design pattern, then the ACTION_PHASE and // RENDER_PHASE are both part of a single HTTP POST request. In such cases, the excluded request attributes must // be pro-actively removed here in the RENDER_PHASE (providing that the bridge request scope was created in the // ACTION_PHASE). Note that this must take place prior to the FacesContext getting constructed. This is because // the FacesContextFactory delegation chain might consult a request attribute that is supposed to be excluded. // This is indeed the case with Apache Trinidad {@link // org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.CacheRenderKit} constructor, which // consults a request attribute named "org.apache.myfaces.trinidad.util.RequestStateMap" that must first be // excluded. PortalContext portalContext = portletRequest.getPortalContext(); String postRedirectGetSupport = portalContext.getProperty(BridgePortalContext.POST_REDIRECT_GET_SUPPORT); if ((postRedirectGetSupport == null) && (bridgeRequestScope.getBeganInPhase() == Bridge.PortletPhase.ACTION_PHASE)) { bridgeRequestScope.removeExcludedAttributes(renderRequest); } }
String addScriptResourceToHeadSupport = portalContext.getProperty( BridgePortalContext.ADD_SCRIPT_RESOURCE_TO_HEAD_SUPPORT); boolean portletContainerAbleToAddScriptResourceToHead = (addScriptResourceToHeadSupport != null);
String addScriptResourceToHeadSupport = portalContext.getProperty( BridgePortalContext.ADD_SCRIPT_RESOURCE_TO_HEAD_SUPPORT); boolean portletContainerAbleToAddScriptResourceToHead = (addScriptResourceToHeadSupport != null);
String createRenderUrlDuringActionPhaseSupport = portalContext.getProperty( BridgePortalContext.CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT);
String createRenderUrlDuringActionPhaseSupport = portalContext.getProperty( BridgePortalContext.CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT);