org.mmbase.applications.editwizard
Class WizardCommand

java.lang.Object
  extended by org.mmbase.applications.editwizard.WizardCommand
All Implemented Interfaces:
Serializable

public class WizardCommand
extends Object
implements Serializable

The wizardcommands are used to store information received from the clients about commands. Eg.: add-item, delete commands are stored here.

Since:
MMBase-1.6
Version:
$Id: WizardCommand.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Kars Veling, Pierre van Rooden
See Also:
Serialized Form
Javadoc:

Field Summary
static short ADD_ITEM
           
static short CANCEL
           
static short COMMIT
           
static short DELETE_ITEM
           
static short GOTO_FORM
           
static short MOVE_DOWN
           
static short MOVE_UP
           
static short SAVE
           
static short START_WIZARD
           
static short UNKNOWN_COMMAND
           
static short UPDATE_ITEM
           
 
Constructor Summary
WizardCommand(String acommand, String avalue)
          Creates a wizard command object with the given command and value.
 
Method Summary
 String getDid()
          Returns the 'did' (data id) parameter of the parsed command.
 String getFid()
          Returns the 'fid' (field id) parameter of the parsed command.
 String getParameter(int i)
          Returns the parameter with the indicated index of the parsed command.
 int getType()
          Returns the type of the parsed command.
 String getValue()
          Returns the value passed to the parsed command.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_COMMAND

public static final short UNKNOWN_COMMAND
See Also:
Constant Field Values

ADD_ITEM

public static final short ADD_ITEM
See Also:
Constant Field Values

CANCEL

public static final short CANCEL
See Also:
Constant Field Values

COMMIT

public static final short COMMIT
See Also:
Constant Field Values

DELETE_ITEM

public static final short DELETE_ITEM
See Also:
Constant Field Values

GOTO_FORM

public static final short GOTO_FORM
See Also:
Constant Field Values

MOVE_DOWN

public static final short MOVE_DOWN
See Also:
Constant Field Values

MOVE_UP

public static final short MOVE_UP
See Also:
Constant Field Values

SAVE

public static final short SAVE
See Also:
Constant Field Values

START_WIZARD

public static final short START_WIZARD
See Also:
Constant Field Values

UPDATE_ITEM

public static final short UPDATE_ITEM
See Also:
Constant Field Values
Constructor Detail

WizardCommand

public WizardCommand(String acommand,
                     String avalue)
Creates a wizard command object with the given command and value. The command parsed should be of the format: cmd/type/fid/did/otherdid/ 'type' is the command itself (i.e. 'add-item'), fid, did, and otherdid are possible parameters to the command.

Parameters:
acommand - The full command
avalue - The value of the command
To Do:
should use StringTokenizer here
Method Detail

getType

public int getType()
Returns the type of the parsed command.

Returns:
one of the WizardCommand constants, or UNKNOWN_COMMAND if the type cannot be determined

getValue

public String getValue()
Returns the value passed to the parsed command.

Returns:
the value as a string

getParameter

public String getParameter(int i)
Returns the parameter with the indicated index of the parsed command.

Returns:
teh parameter as string, or an empty string if it doesn't exist.

getFid

public String getFid()
Returns the 'fid' (field id) parameter of the parsed command. This is always the parameter with index 0

Returns:
the fid as string, or an empty string if it doesn't exist.

getDid

public String getDid()
Returns the 'did' (data id) parameter of the parsed command. This is always the parameter with index 1

Returns:
the did as string, or an empty string if it doesn't exist.

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null