com.endeca.portal.data
Class AbstractMDEXStateManager

java.lang.Object
  extended by com.endeca.portal.data.AbstractMDEXStateManager
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultMDEXStateManager

public abstract class AbstractMDEXStateManager
extends java.lang.Object
implements java.io.Serializable

An abstract base class for managing MDEXState changes.

Author:
wfleming
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
AbstractMDEXStateManager()
          default constructor
 
Method Summary
protected  void addEventTrigger(javax.portlet.PortletRequest request, MDEXState ds)
          Use this method to make sure an appropriate change event will be triggered for an altered MDEXState
abstract  QueryState handleStateMerge(javax.portlet.PortletRequest request, MDEXState mdexState)
          Handle query-time determination of the query a portlet should fire before the portlet requests execution
 void handleStateReset(javax.portlet.PortletRequest request, MDEXState mdexState)
          Handle resetting of the query state to its initial state
abstract  void handleStateUpdate(javax.portlet.PortletRequest request, MDEXState mdexState, QueryState newQueryState)
          Encapsulate data source update logic.
protected  void processRefinementsToAdd(java.util.List<QueryFunction> functionsToAdd, QueryState queryState)
          This method handles refinement additions for V6 -- specifically, it decides a new refinement is a descendant of an existing one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

AbstractMDEXStateManager

public AbstractMDEXStateManager()
default constructor

Method Detail

handleStateUpdate

public abstract void handleStateUpdate(javax.portlet.PortletRequest request,
                                       MDEXState mdexState,
                                       QueryState newQueryState)
                                throws QueryStateException
Encapsulate data source update logic. This method will be called any time a DataSource's QueryState is updated.

Parameters:
request -
mdexState -
newQueryState -
Throws:
QueryStateException

handleStateMerge

public abstract QueryState handleStateMerge(javax.portlet.PortletRequest request,
                                            MDEXState mdexState)
                                     throws QueryStateException
Handle query-time determination of the query a portlet should fire before the portlet requests execution

Parameters:
request -
mdexState -
Returns:
the portlet-visible QueryState as determined by the request and mdexState
Throws:
QueryStateException

handleStateReset

public void handleStateReset(javax.portlet.PortletRequest request,
                             MDEXState mdexState)
                      throws QueryStateException
Handle resetting of the query state to its initial state

Parameters:
request - the PortletRequest
mdexState - the current datasource state
Throws:
QueryStateException - on error

processRefinementsToAdd

protected void processRefinementsToAdd(java.util.List<QueryFunction> functionsToAdd,
                                       QueryState queryState)
                                throws QueryStateException
This method handles refinement additions for V6 -- specifically, it decides a new refinement is a descendant of an existing one. If so, and it is not multi select, the existing refinement filter is removed and replaced (in order) by the new one. If the dimension is multi select, or if it is not a descendant of an existing refinement, the filter just gets added to the end.

Parameters:
functionsToAdd -
queryState -
Throws:
QueryStateException

addEventTrigger

protected void addEventTrigger(javax.portlet.PortletRequest request,
                               MDEXState ds)
Use this method to make sure an appropriate change event will be triggered for an altered MDEXState

Parameters:
request - The current request object
ds - The MDEXState that has changed and needs an event triggered