com.liferay.faces.bridge.scope
Class BridgeRequestScopeImpl

java.lang.Object
  extended by com.liferay.faces.bridge.scope.BridgeRequestScopeBaseImpl
      extended by com.liferay.faces.bridge.scope.BridgeRequestScopeCompatImpl
          extended by com.liferay.faces.bridge.scope.BridgeRequestScopeCompat_2_2_Impl
              extended by com.liferay.faces.bridge.scope.BridgeRequestScopeImpl
All Implemented Interfaces:
BridgeRequestScope, Serializable
Direct Known Subclasses:
BridgeRequestScopeLiferayImpl

public class BridgeRequestScopeImpl
extends BridgeRequestScopeCompat_2_2_Impl
implements Serializable

Author:
Neil Griffin
See Also:
Serialized Form

Nested Class Summary
protected  class BridgeRequestScopeImpl.IncongruityAttribute
           
protected  class BridgeRequestScopeImpl.RequestAttribute
           
 
Nested classes/interfaces inherited from class com.liferay.faces.bridge.scope.BridgeRequestScopeCompatImpl
BridgeRequestScopeCompatImpl.FacesContextAttribute
 
Nested classes/interfaces inherited from interface com.liferay.faces.bridge.scope.BridgeRequestScope
BridgeRequestScope.Transport
 
Field Summary
protected static String BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES
           
protected static String EXCLUCED_NAMESPACE_JAVAX_SERVLET
           
protected static String EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE
           
protected static String EXCLUDED_NAMESPACE_JAVAX_FACES
           
protected static String EXCLUDED_NAMESPACE_JAVAX_PORTLET
           
protected static String EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES
           
 
Constructor Summary
BridgeRequestScopeImpl(javax.portlet.PortletConfig portletConfig, javax.portlet.PortletContext portletContext, javax.portlet.PortletRequest portletRequest)
           
 
Method Summary
 Bridge.PortletPhase getBeganInPhase()
          Determines the Bridge#PortletPhase in which the bridge request scope instance was created.
 long getDateCreated()
          Returns the date in which the scope was created, measured in UTC milliseconds from the epoch.
 String getId()
          Returns the unique identifier, which is prefixed with the value passed to BridgeRequestScope.setIdPrefix(String).
 Map<String,Object> getManagedBeanMap()
           
 javax.portlet.PortletMode getPortletMode()
           
protected  Set<String> getPreExistingRequestAttributeNames(javax.portlet.PortletRequest portletRequest)
          According to section 5.1.2 of the JSR 329 spec, the request attributes that exist before the bridge acquires the FacesContext must not be part of the bridge request scope.
 Map<String,String> getPreservedActionParameterMap()
           
 String getPreservedViewStateParam()
           
 Set<String> getRemovedAttributeNames()
          This method returns a mutable set of attribute names that correspond to those that were removed by the BridgeRequestScope.removeExcludedAttributes(RenderRequest) method.
 int hashCode()
          The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.
protected  boolean isExcludedRequestAttributeByAnnotation(Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByConfig(String attributeName, Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByInstance(String attributeName, Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByNamespace(String attributeName)
           
protected  boolean isExcludedRequestAttributeByPreExisting(String attributeName)
           
 boolean isFacesLifecycleExecuted()
          Returns the flag indicating whether or not the Faces Lifecycle was executed.
protected  boolean isNamespaceMatch(String attributeName, String namespace)
           
 boolean isNavigationOccurred()
          Returns the flag indicating whether or not a navigation-rule fired.
 boolean isPortletModeChanged()
          Returns a flag indicating whether or not the PortletMode has changed.
 boolean isRedirectOccurred()
          Returns a flag indicating whether or not a was encountered in a navigation-rule.
 void removeExcludedAttributes(javax.portlet.RenderRequest renderRequest)
          Unlike Pluto, Liferay will preserve/copy request attributes that were originally set on an ActionRequest into the RenderRequest.
 void restoreState(javax.faces.context.FacesContext facesContext)
          This method restores the scoped data that was preserved by the call to BridgeRequestScope.saveState(FacesContext) method as required by section 5.1.2 of the Bridge Spec.
 void saveState(javax.faces.context.FacesContext facesContext)
          Saves the state of the FacesContext as required by section 5.1.2 of the JSR 329 spec.
 void setFacesLifecycleExecuted(boolean facesLifecycleExecuted)
          Sets the flag indicating whether or not the Faces lifecycle was executed.
 void setIdPrefix(String idPrefix)
          Sets the prefix of the unique identifier returned by BridgeRequestScope.getId().
 void setNavigationOccurred(boolean navigationOccurred)
          Sets the flag indicating whether or not a navigation-rule fired.
 void setPortletMode(javax.portlet.PortletMode portletMode)
           
 void setPortletModeChanged(boolean portletModeChanged)
          Sets a flag indicating whether or not the PortletMode has changed.
 void setRedirectOccurred(boolean redirect)
          Sets a flag indicating whether or not a was encountered in a navigation-rule.
 String toString()
          The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.
 
Methods inherited from class com.liferay.faces.bridge.scope.BridgeRequestScopeCompat_2_2_Impl
restoreClientWindow, saveClientWindow
 
Methods inherited from class com.liferay.faces.bridge.scope.BridgeRequestScopeCompatImpl
restoreFlashState, restoreJSF2FacesContextAttributes, saveFlashState, saveJSF2FacesContextAttributes
 
Methods inherited from class com.liferay.faces.bridge.scope.BridgeRequestScopeBaseImpl
getAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES

protected static final String BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_FACES

protected static final String EXCLUDED_NAMESPACE_JAVAX_FACES
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_PORTLET

protected static final String EXCLUDED_NAMESPACE_JAVAX_PORTLET
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES

protected static final String EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES
See Also:
Constant Field Values

EXCLUCED_NAMESPACE_JAVAX_SERVLET

protected static final String EXCLUCED_NAMESPACE_JAVAX_SERVLET
See Also:
Constant Field Values

EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE

protected static final String EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE
See Also:
Constant Field Values
Constructor Detail

BridgeRequestScopeImpl

public BridgeRequestScopeImpl(javax.portlet.PortletConfig portletConfig,
                              javax.portlet.PortletContext portletContext,
                              javax.portlet.PortletRequest portletRequest)
Method Detail

hashCode

public int hashCode()
The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.

Overrides:
hashCode in class Object

removeExcludedAttributes

public void removeExcludedAttributes(javax.portlet.RenderRequest renderRequest)
Unlike Pluto, Liferay will preserve/copy request attributes that were originally set on an ActionRequest into the RenderRequest. However, the Bridge Spec assumes that they will not be preserved. Therefore is necessary to remove these request attributes when running under Liferay.

Specified by:
removeExcludedAttributes in interface BridgeRequestScope

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext)
Description copied from interface: BridgeRequestScope
This method restores the scoped data that was preserved by the call to BridgeRequestScope.saveState(FacesContext) method as required by section 5.1.2 of the Bridge Spec. This method is designed to be called during the EVENT_PHASE and RENDER_PHASE of the portlet lifecycle.

Specified by:
restoreState in interface BridgeRequestScope
Parameters:
facesContext - The current FacesContext.

saveState

public void saveState(javax.faces.context.FacesContext facesContext)
Saves the state of the FacesContext as required by section 5.1.2 of the JSR 329 spec. This method is designed to be called during the ACTION_PHASE of the portlet lifecycle.

Specified by:
saveState in interface BridgeRequestScope
Parameters:
facesContext - The current faces context.

toString

public String toString()
The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.

Overrides:
toString in class Object

getBeganInPhase

public Bridge.PortletPhase getBeganInPhase()
Description copied from interface: BridgeRequestScope
Determines the Bridge#PortletPhase in which the bridge request scope instance was created.

Specified by:
getBeganInPhase in interface BridgeRequestScope
Returns:
The Bridge#PortletPhase in which the bridge request scope instance was created.

isFacesLifecycleExecuted

public boolean isFacesLifecycleExecuted()
Description copied from interface: BridgeRequestScope
Returns the flag indicating whether or not the Faces Lifecycle was executed.

Specified by:
isFacesLifecycleExecuted in interface BridgeRequestScope
Returns:
true if the Faces Lifecycle was executed, otherwise false.

isNavigationOccurred

public boolean isNavigationOccurred()
Description copied from interface: BridgeRequestScope
Returns the flag indicating whether or not a navigation-rule fired.

Specified by:
isNavigationOccurred in interface BridgeRequestScope
Returns:
true indicates that a navigation-rule fired, otherwise false.

isPortletModeChanged

public boolean isPortletModeChanged()
Description copied from interface: BridgeRequestScope
Returns a flag indicating whether or not the PortletMode has changed.

Specified by:
isPortletModeChanged in interface BridgeRequestScope
Returns:
true if the portlet mode has changed, otherwise false

isRedirectOccurred

public boolean isRedirectOccurred()
Description copied from interface: BridgeRequestScope
Returns a flag indicating whether or not a was encountered in a navigation-rule.

Specified by:
isRedirectOccurred in interface BridgeRequestScope
Returns:
true indicates that was encountered in a navigation-rule, otherwise false.

getDateCreated

public long getDateCreated()
Description copied from interface: BridgeRequestScope
Returns the date in which the scope was created, measured in UTC milliseconds from the epoch.

Specified by:
getDateCreated in interface BridgeRequestScope

isExcludedRequestAttributeByInstance

protected boolean isExcludedRequestAttributeByInstance(String attributeName,
                                                       Object attributeValue)

isExcludedRequestAttributeByNamespace

protected boolean isExcludedRequestAttributeByNamespace(String attributeName)

setFacesLifecycleExecuted

public void setFacesLifecycleExecuted(boolean facesLifecycleExecuted)
Description copied from interface: BridgeRequestScope
Sets the flag indicating whether or not the Faces lifecycle was executed.

Specified by:
setFacesLifecycleExecuted in interface BridgeRequestScope
Parameters:
facesLifecycleExecuted - true indicates that the Faces lifecycle was executed, otherwise false.

isExcludedRequestAttributeByConfig

protected boolean isExcludedRequestAttributeByConfig(String attributeName,
                                                     Object attributeValue)

isExcludedRequestAttributeByPreExisting

protected boolean isExcludedRequestAttributeByPreExisting(String attributeName)

isNamespaceMatch

protected boolean isNamespaceMatch(String attributeName,
                                   String namespace)

getId

public String getId()
Description copied from interface: BridgeRequestScope
Returns the unique identifier, which is prefixed with the value passed to BridgeRequestScope.setIdPrefix(String).

Specified by:
getId in interface BridgeRequestScope

setIdPrefix

public void setIdPrefix(String idPrefix)
Description copied from interface: BridgeRequestScope
Sets the prefix of the unique identifier returned by BridgeRequestScope.getId().

Specified by:
setIdPrefix in interface BridgeRequestScope

getManagedBeanMap

public Map<String,Object> getManagedBeanMap()

isExcludedRequestAttributeByAnnotation

protected boolean isExcludedRequestAttributeByAnnotation(Object attributeValue)

setNavigationOccurred

public void setNavigationOccurred(boolean navigationOccurred)
Description copied from interface: BridgeRequestScope
Sets the flag indicating whether or not a navigation-rule fired.

Specified by:
setNavigationOccurred in interface BridgeRequestScope
Parameters:
navigationOccurred - true indicates that a navigation-rule fired, otherwise false.

getPortletMode

public javax.portlet.PortletMode getPortletMode()
Specified by:
getPortletMode in interface BridgeRequestScope

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
Specified by:
setPortletMode in interface BridgeRequestScope

setPortletModeChanged

public void setPortletModeChanged(boolean portletModeChanged)
Description copied from interface: BridgeRequestScope
Sets a flag indicating whether or not the PortletMode has changed. If true then request attributes will not be preserved when the BridgeRequestScope.saveState(FacesContext) method is called.

Specified by:
setPortletModeChanged in interface BridgeRequestScope

getPreExistingRequestAttributeNames

protected Set<String> getPreExistingRequestAttributeNames(javax.portlet.PortletRequest portletRequest)
According to section 5.1.2 of the JSR 329 spec, the request attributes that exist before the bridge acquires the FacesContext must not be part of the bridge request scope. Having noted that, we have to save-off a list of names of these pre-existing request attributes, so that we know to NOT restore them.


getPreservedActionParameterMap

public Map<String,String> getPreservedActionParameterMap()
Specified by:
getPreservedActionParameterMap in interface BridgeRequestScope

getPreservedViewStateParam

public String getPreservedViewStateParam()
Specified by:
getPreservedViewStateParam in interface BridgeRequestScope

setRedirectOccurred

public void setRedirectOccurred(boolean redirect)
Description copied from interface: BridgeRequestScope
Sets a flag indicating whether or not a was encountered in a navigation-rule.

Specified by:
setRedirectOccurred in interface BridgeRequestScope
Parameters:
redirect - true indicates that a was encountered in a navigation-rule, otherwise false.

getRemovedAttributeNames

public Set<String> getRemovedAttributeNames()
Description copied from interface: BridgeRequestScope
This method returns a mutable set of attribute names that correspond to those that were removed by the BridgeRequestScope.removeExcludedAttributes(RenderRequest) method. Since the return value is mutable, callers of this method have an opportunity to add names to the set when necessary.

Specified by:
getRemovedAttributeNames in interface BridgeRequestScope
Returns:
The set of removed attribute names.


Copyright © 2014 Liferay, Inc.. All Rights Reserved.