com.sdm.quasar.client.jsf.application.dialog
Class MyFacesStateManager

java.lang.Object
  extended byJspStateManagerImpl
      extended bycom.sdm.quasar.client.jsf.application.dialog.MyFacesStateManager

public class MyFacesStateManager
extends JspStateManagerImpl

This class takes care of creating, storing and restoring views (javax.faces.component.UIViewRoot) of dialog instances. It utilizes the dialogs' instance-id to store different view-states for equal view-files (jsp/faces). This is necessary because otherwise all dialog instances (Java objects) would use the same view being stored by the default JSF com.sdm.quasar.client.comp.dlgstate.StateManager as it doesn't know anything about dialog-instances. This class directly extends org.apache.myfaces.application.jsp.JspStateManagerImpl, which is the actual state-manager implementation which is provided by Apache MyFaces. Copyright (c) 2005 software design & management AG All rights reserved. This file is made available under the terms of the license agreement that accompanies this distribution. $Revision:$, last modified $Date: $ by $Author: $

Author:
Carsten Lucke
See Also:
Serialized Form

Field Summary
protected  StateManager _base
          The standard ViewHandler
 
Constructor Summary
MyFacesStateManager(StateManager orig)
          Constructor.
 
Method Summary
protected static java.lang.String getTaggedViewId()
          Returns the view-identifier.
 UIViewRoot restoreView(FacesContext context, java.lang.String viewId, java.lang.String renderKitId)
          Writes the state for the view.
 SerializedView saveSerializedView(FacesContext context)
          Serializes the date of the faces-context's current view.
 void writeState(FacesContext context, SerializedView state)
          Writes the state for the view.
 void writeStateAsUrlParams(FacesContext facesContext, SerializedView serializedView)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_base

protected StateManager _base
The standard ViewHandler

Constructor Detail

MyFacesStateManager

public MyFacesStateManager(StateManager orig)
Constructor.

Parameters:
orig - the standard ViewHandler
Method Detail

writeState

public void writeState(FacesContext context,
                       SerializedView state)
                throws java.io.IOException
Writes the state for the view. Utilizes the dialoginstance-id to enable multiton behaviour for the view-state.

Parameters:
context -
state -
Throws:
java.io.IOException
See Also:
javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)

writeStateAsUrlParams

public void writeStateAsUrlParams(FacesContext facesContext,
                                  SerializedView serializedView)
                           throws java.io.IOException
Throws:
java.io.IOException

restoreView

public UIViewRoot restoreView(FacesContext context,
                              java.lang.String viewId,
                              java.lang.String renderKitId)
Writes the state for the view. Utilizes the dialoginstance-id to enable multiton behaviour for the view-state.

Parameters:
context -
viewId -
renderKitId -
See Also:
javax.faces.application.StateManager#restoreView(javax.faces.context.FacesContext, java.lang.String, java.lang.String)

saveSerializedView

public SerializedView saveSerializedView(FacesContext context)
                                  throws java.lang.IllegalStateException
Serializes the date of the faces-context's current view. Utilizes the dialoginstance-id to enable multiton behaviour for the view-state.

Parameters:
context -
Throws:
java.lang.IllegalStateException
See Also:
javax.faces.application.StateManager#saveSerializedView(javax.faces.context.FacesContext)

getTaggedViewId

protected static java.lang.String getTaggedViewId()
Returns the view-identifier. It's the string-representation of the current dialog's instance-id.

Returns:
the view-identifier