Proposal for 3.0 API: Deprecate constant Bridge.PORTLET_LIFECYCLE_PHASE and refactor BridgeUtil methods accordingly -------------------------------------------------------------------------------------------------------------------
Key: PORTLETBRIDGE-205 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-205 Project: MyFaces Portlet Bridge Issue Type: New Feature Components: General Affects Versions: 3.0.0 Reporter: Neil Griffin Assignee: Michael Freedman Proposal is to do this in Bridge.java: /** @deprecated replaced by {@link Bridge#BRIDGE_CONTEXT_ATTRIBUTE} and {@link BridgeContext#getPortletLifecyclePhase()} */ @Deprecated public static final String PORTLET_LIFECYCLE_PHASE = "javax.portlet.faces.phase"; And to refactor BridgeUtil.getPortletRequestPhase() to something like this: public static Bridge.PortletPhase getPortletRequestPhase() { Bridge.PortletPhase portletRequestPhase = null; FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); Map<String, Object> requestMap = externalContext.getRequestMap(); BridgeContext bridgeContext = (BridgeContext) requestMap.get(Bridge.BRIDGE_CONTEXT_ATTRIBUTE); if (bridgeContext != null) { portletRequestPhase = bridgeContext.getPortletRequestPhase(); } return portletRequestPhase; } And refactor BridgeUtil.isPortletRequest() to something like this: public static boolean isPortletRequest() { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); Map<String, Object> requestMap = externalContext.getRequestMap(); BridgeContext bridgeContext = (BridgeContext) requestMap.get(Bridge.BRIDGE_CONTEXT_ATTRIBUTE); return (bridgeContext != null); } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira