org.mmbase.module.gui.html
Class StateManager
java.lang.Object
|
+--org.mmbase.module.gui.html.StateManager
- All Implemented Interfaces:
- CommandHandlerInterface
- public class StateManager
- extends java.lang.Object
- implements CommandHandlerInterface
The StateManager class maintains a list of EditStates for users logged on to MMBase through SCAN.
It provides the states so a user can browse the SCAN editors and edit objects, letting the server remember the change history.
Changes to the state are made either by calling a replace ($MOD) command, or by processing parameters passed to a SCAN page.
State info (such as the current editnode number) can be retrieved using $MOD.
- Version:
- $Id: StateManager.java,v 1.11.2.3 2003/07/04 14:38:27 vpro Exp $
- Author:
- Daniel Ockeloen, Hans Speijer, Pierre van Rooden
|
Constructor Summary |
StateManager(MMBase mmBase)
Initialises the StateManager, by creating a new (empty) map of editstates. |
|
Method Summary |
EditState |
getEditState(java.lang.String user)
Retrieves the EditState for a user, or creates a new one if the user did not yet have an EditState assigned. |
java.util.Vector |
getList(scanpage sp,
StringTagger args,
java.util.StringTokenizer command)
List commands |
java.util.Vector |
getOpenBuilders(EditState state,
StringTagger args)
|
EditState |
getState(java.lang.String user)
Retrieves the EditState for a user, or creates a new one if the user did not yet have an EditState assigned. |
void |
initUserStates()
Loads all previously persistified editstates from the database. |
boolean |
process(scanpage sp,
java.util.StringTokenizer command,
java.util.Hashtable cmds,
java.util.Hashtable vars)
The hook that passes all form related pages to the correct handler |
java.lang.String |
replace(scanpage sp,
java.util.StringTokenizer commands)
Handle a $MOD command. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mmBase
public MMBase mmBase
- Reference to the MMBase module.
StateManager
public StateManager(MMBase mmBase)
- Initialises the StateManager, by creating a new (empty) map of editstates.
- Parameters:
mmBase - reference to the MMBase module
initUserStates
public void initUserStates()
- Loads all previously persistified editstates from the database.
getEditState
public EditState getEditState(java.lang.String user)
- Retrieves the EditState for a user, or creates a new one if the user did not yet have an EditState assigned.
The EditState contains status information for a specific user (which node is being edited, for instance).
EditStates are associated by username. They are kept in memory as long as teh StateManager is.
- Parameters:
user - the user for which to retrieve an EditState object- Returns:
- the EditState objevt associated with this user
replace
public java.lang.String replace(scanpage sp,
java.util.StringTokenizer commands)
- Handle a $MOD command.
This generally replaces the command in the SCAN page with the value returned by the command.
Commands include:
- SETBUILDER-buildername[-joinnode]: Adds a new node of the specified builder type to the user's stack of working objects, and makes it current. If 'joinnode' is specified, the JOINNODE variable is set to this value
- GETBUILDER : lists the type of the current working object.
- DELBUILDER : drop the current working object. If the stack of working objects is not empty, the top object becomes current.
- CLEARBUILDERS : drop all working objects
- ADDRELATION : obsolete
- SETHTMLVALUE-name-value : sets teh value fo teh variable 'name' to 'value'
- GETHTMLVALUE-name : returns the value of the variable 'name'
- SETEDITNODE : ???
- GETEDITNODE : ???
- GETEDITSRCDUTCHNAME : ???
- GETEDITDSTDUTCHNAME : ???
- GETEDITSRCNAME : ???
- GETEDITDSTNAME : ???
- GETEDITSRCNODE : ???
- GETEDITDSTNODE : ???
- GETEDITSRCGUIINDICATOR : ???
- GETEDITDSTGUIINDICATOR : ???
- NEWNODE : ???
- NEWINSNODE-sourcenr-destinationnr-role : Creates a relation object node using the specified parameters and makes it current
- REMOVENODE : ???
- REMOVEEDITOR : ???
- ISCHANGED : ???
- Specified by:
replace in interface CommandHandlerInterface
getList
public java.util.Vector getList(scanpage sp,
StringTagger args,
java.util.StringTokenizer command)
throws ParseException
- List commands
- Specified by:
getList in interface CommandHandlerInterface
process
public boolean process(scanpage sp,
java.util.StringTokenizer command,
java.util.Hashtable cmds,
java.util.Hashtable vars)
- The hook that passes all form related pages to the correct handler
- Specified by:
process in interface CommandHandlerInterface
getOpenBuilders
public java.util.Vector getOpenBuilders(EditState state,
StringTagger args)
getState
public EditState getState(java.lang.String user)
- Retrieves the EditState for a user, or creates a new one if the user did not yet have an EditState assigned.
- Parameters:
user - the user for which to retrieve an EditState object- Returns:
- the EditState objevt associated with this user
MMBase build 1.6.5.20030923