org.apache.myfaces.trinidad.model
Class ProcessMenuModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.apache.myfaces.trinidad.model.CollectionModel
          extended by org.apache.myfaces.trinidad.model.TreeModel
              extended by org.apache.myfaces.trinidad.model.MenuModel
                  extended by org.apache.myfaces.trinidad.model.BaseMenuModel
                      extended by org.apache.myfaces.trinidad.model.ViewIdPropertyMenuModel
                          extended by org.apache.myfaces.trinidad.model.ProcessMenuModel
All Implemented Interfaces:
Iterable, LocalRowKeyIndex, RowKeyIndex, TreeLocalRowKeyIndex

public class ProcessMenuModel
extends ViewIdPropertyMenuModel

There are two common scenarios for processes, "Plus One" and "Max Visited" which are explained below.

A node in a process should be readOnly if that step of the process is not reachable from the current step. The isReadOnly() method can be used to bind the node's readOnly attribute.

A node in a process should be immediate if the values in the current step don't need to be validated. The isImmediate() method can be used to bind the node's immediate attribute.

See Also:
ProcessUtils

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
 
Constructor Summary
ProcessMenuModel()
          No-arg constructor for use with managed-beans.
ProcessMenuModel(Object instance, String viewIdProperty)
          The "Plus One" behavior will be used with this constructor.
ProcessMenuModel(Object instance, String viewIdProperty, String maxPathKey)
           
 
Method Summary
 void clearMaxPath()
          to clear the max visited path out of the session
 String getMaxPathKey()
           
 boolean isImmediate()
           A node in a process should be immediate if the values in the current step don't need to be validated.
 boolean isReadOnly()
           A node in a process should be readOnly if that step of the process is not reachable from the current step.
 boolean isVisited()
          For the Max Visited case, a stop is considered visited if - a stop is before the max visited stop - or is the max visited stop For the Plus One case, a stop is considered visited if, - it's before the current or, - is the current stop itself
 void setMaxPathKey(String maxPathKey)
           
 
Methods inherited from class org.apache.myfaces.trinidad.model.ViewIdPropertyMenuModel
addViewId, getCurrentViewId, getFocusRowKey, getViewIdProperty, setViewIdProperty, setWrappedData
 
Methods inherited from class org.apache.myfaces.trinidad.model.BaseMenuModel
enterContainer, exitContainer, getContainerRowKey, getRowCount, getRowData, getRowIndex, getRowKey, getWrappedData, isContainer, isRowAvailable, setRowIndex, setRowKey
 
Methods inherited from class org.apache.myfaces.trinidad.model.TreeModel
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, getAllAncestorContainerRowKeys, getContainerRowKey, getDepth, getDepth, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainerEmpty
 
Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel
addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, getSortCriteria, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, removeRowKeyChangeListener, setSortCriteria
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, iterator, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessMenuModel

public ProcessMenuModel()
No-arg constructor for use with managed-beans. Must call the ViewIdPropertyMenuModel.setViewIdProperty(java.lang.String) and ViewIdPropertyMenuModel.setWrappedData(java.lang.Object) methods after constructing this instance.


ProcessMenuModel

public ProcessMenuModel(Object instance,
                        String viewIdProperty)
                 throws IntrospectionException
The "Plus One" behavior will be used with this constructor.

Parameters:
instance - a treeModel. This object will be passed to ModelUtils.toTreeModel(java.lang.Object)
viewIdProperty - the property to use to retrieve a viewId from a node in the tree
Throws:
IntrospectionException

ProcessMenuModel

public ProcessMenuModel(Object instance,
                        String viewIdProperty,
                        String maxPathKey)
                 throws IntrospectionException
Parameters:
instance - a treeModel. This object will be passed to ModelUtils.toTreeModel(java.lang.Object)
viewIdProperty - the property to use to retrieve a viewId from a node in the tree
maxPathKey - if the "Max Visited" behavior is desired, this is the key that will be used to get and set the maxPath value on the session and request. For the "Plus One" behavior pass in null.
Throws:
IntrospectionException
Method Detail

isImmediate

public boolean isImmediate()

A node in a process should be immediate if the values in the current step don't need to be validated. This method can be used to bind the node's immediate attribute. If a user will have to return to the current page then immediate can be set to true. For example in a "Plus One" process, if the user is on step 5 and goes back to step 2, the user will have to come back to step 5 again, so the fields on page 5 don't need to be validated when going back to steps 1,2,3,4, but should be validated when going to step 6.


isReadOnly

public boolean isReadOnly()

A node in a process should be readOnly if that step of the process is not reachable from the current step. This method can be used to bind the node's readOnly attribute.


isVisited

public boolean isVisited()
For the Max Visited case, a stop is considered visited if - a stop is before the max visited stop - or is the max visited stop For the Plus One case, a stop is considered visited if, - it's before the current or, - is the current stop itself


clearMaxPath

public void clearMaxPath()
to clear the max visited path out of the session


setMaxPathKey

public void setMaxPathKey(String maxPathKey)

getMaxPathKey

public String getMaxPathKey()


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.