org.activemath.webapp.dict
Class DictionaryState

java.lang.Object
  extended by org.activemath.webapp.dict.DictionaryState
All Implemented Interfaces:
Serializable, Cloneable

public class DictionaryState
extends Object
implements Cloneable, Serializable

Represents all the states of an interaction with the ActiveMath search tool, and is responsible for its storage.

See Also:
Serialized Form

Field Summary
protected static Category log
          The logger for this class
 
Constructor Summary
DictionaryState()
           
 
Method Summary
 void clearItemView()
           
 void clearSearchResult()
          Assigns a missing search-result which shows to further requests that no search-result is to be displayed.
 Object clone()
           
 String getAccepted4Langs()
           
 AMQueryPack getAmQuery()
           
 String getCurrentFocusInput()
           
static DictionaryState getDictionaryState(int dictNum, int stepNum, HttpSession session, User user)
           
static Iterator getDictionaryStatesIterator(HttpSession session, User user, int dictNum)
           
 int getDictNum()
           
 DictUserMessage getDictUserMessage()
           
 ItemView getItemView()
           
 String getLastAction()
           
static int getLastDictNum(HttpSession session)
           
static int getLastStepNum(int dictNum, HttpSession session)
           
 String getLinkToHere()
           
 boolean getMinItemAndLastScroll()
           
 ItemView getOrMakeItemView()
           
 SearchPolicy getPolicy()
           
 AMAbstractQuery getQuery(String name)
           
 int getScrollX()
           
 int getScrollY()
           
 String getSearchMode()
           
 SearchResultCursor getSearchResult()
          Provides the registered search-result of null if none is defined.
 String getShortSummary()
           
 boolean getShouldDoSearch()
           
 int getStepNum()
           
 String getStringQ()
           
 String getStringQOrEmpty()
           
 boolean hasDictUserMessage()
           
 boolean hasItemView()
           
static void pushDictionaryState(int dictNum, int stepNum, HttpSession session, User user, DictionaryState state)
          Inserts the indicated dictionary state in the collection of states after the indicated location then updates the state's dictNum and stepNum}.
 SearchResultCursor restartSearchResult()
          Initializes and assigns a copy of the searchResult bean so that it can be further modified.
 void seedDefaultsFromSession(AppSession appSession)
           
 void setAccepted4Langs(String langs)
           
 void setCurrentFocusInput(String currentFocusInput)
           
 void setDictNum(int dictNum)
           
 void setDictUserMessage(String message)
           
 void setDictUserMessage(String message, String relevance)
           
 void setLastAction(String lastAction)
           
 void setMinItemAndLastScroll(boolean minItemAndLastScroll)
           
 void setScrollX(int scrollX)
           
 void setScrollY(int scrollY)
           
 void setSearchMode(String searchMode)
           
 void setStepNum(int stepNum)
           
 void setStringQ(String stringQ)
           
 SearchResultCursor startSearchResult()
          Initializes and assigns a blank search-result.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Category log
The logger for this class

Constructor Detail

DictionaryState

public DictionaryState()
Method Detail

getDictionaryState

public static DictionaryState getDictionaryState(int dictNum,
                                                 int stepNum,
                                                 HttpSession session,
                                                 User user)

getLastDictNum

public static int getLastDictNum(HttpSession session)

getLastStepNum

public static int getLastStepNum(int dictNum,
                                 HttpSession session)

pushDictionaryState

public static void pushDictionaryState(int dictNum,
                                       int stepNum,
                                       HttpSession session,
                                       User user,
                                       DictionaryState state)
Inserts the indicated dictionary state in the collection of states after the indicated location then updates the state's dictNum and stepNum}.

Parameters:
dictNum - the dictionary number to be edited.
stepNum -
session -
state -

getDictionaryStatesIterator

public static Iterator getDictionaryStatesIterator(HttpSession session,
                                                   User user,
                                                   int dictNum)

getSearchMode

public String getSearchMode()

setSearchMode

public void setSearchMode(String searchMode)

getLastAction

public String getLastAction()

setLastAction

public void setLastAction(String lastAction)

getStringQ

public String getStringQ()

getStringQOrEmpty

public String getStringQOrEmpty()

setStringQ

public void setStringQ(String stringQ)

getShortSummary

public String getShortSummary()

clearItemView

public void clearItemView()

hasItemView

public boolean hasItemView()

getOrMakeItemView

public ItemView getOrMakeItemView()

getItemView

public ItemView getItemView()

setDictUserMessage

public void setDictUserMessage(String message)

setDictUserMessage

public void setDictUserMessage(String message,
                               String relevance)

getDictUserMessage

public DictUserMessage getDictUserMessage()

hasDictUserMessage

public boolean hasDictUserMessage()

setScrollX

public void setScrollX(int scrollX)

getScrollX

public int getScrollX()

setScrollY

public void setScrollY(int scrollY)

getScrollY

public int getScrollY()

getMinItemAndLastScroll

public boolean getMinItemAndLastScroll()

setMinItemAndLastScroll

public void setMinItemAndLastScroll(boolean minItemAndLastScroll)

clone

public Object clone()
Overrides:
clone in class Object

getLinkToHere

public String getLinkToHere()

getAccepted4Langs

public String getAccepted4Langs()

setAccepted4Langs

public void setAccepted4Langs(String langs)

getAmQuery

public AMQueryPack getAmQuery()

getPolicy

public SearchPolicy getPolicy()

seedDefaultsFromSession

public void seedDefaultsFromSession(AppSession appSession)

getQuery

public AMAbstractQuery getQuery(String name)

getCurrentFocusInput

public String getCurrentFocusInput()

setCurrentFocusInput

public void setCurrentFocusInput(String currentFocusInput)

getDictNum

public int getDictNum()

setDictNum

public void setDictNum(int dictNum)

getStepNum

public int getStepNum()

setStepNum

public void setStepNum(int stepNum)

getSearchResult

public SearchResultCursor getSearchResult()
Provides the registered search-result of null if none is defined.

Returns:
the registered one, a null values means there's no result to show.

clearSearchResult

public void clearSearchResult()
Assigns a missing search-result which shows to further requests that no search-result is to be displayed.


startSearchResult

public SearchResultCursor startSearchResult()
Initializes and assigns a blank search-result.

Returns:
the prepared search-result, ready to be populated.

restartSearchResult

public SearchResultCursor restartSearchResult()
Initializes and assigns a copy of the searchResult bean so that it can be further modified.

Returns:
the copied search-result, without hit as per SearchResultCursor.clone()

getShouldDoSearch

public boolean getShouldDoSearch()