Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.core
Class BaseAction  view BaseAction download BaseAction.java

java.lang.Object
  extended byorg.mentawai.core.BaseAction
All Implemented Interfaces:
Action
Direct Known Subclasses:
SingleInstanceBaseAction

public abstract class BaseAction
extends java.lang.Object
implements Action

The abstract base implementation of a Mentawai action. It also privides access to input, output, session context and application context through protected data members.


Field Summary
protected  Context application
           
private static org.mentawai.message.MessageContext FIXED_MSG_CONTEXT
           
protected  Input input
           
protected  java.util.Locale loc
           
private  org.mentawai.message.MessageContext msgContext
           
protected  Output output
           
protected  Context session
           
 
Fields inherited from interface org.mentawai.core.Action
ERROR, SUCCESS
 
Constructor Summary
BaseAction()
          Creates a BaseAction.
 
Method Summary
protected  void addError(int error_id)
          Adds an error to the action with the given number.
protected  void addError(int error_id, org.mentawai.message.MessageContext msgContext)
          Adds an error to the action with the given number and context.
protected  void addError(org.mentawai.message.Message error)
          Adds an error to the action.
protected  void addError(java.lang.String error_id)
          Adds an error to the action with the given number.
protected  void addError(java.lang.String field, int error_id)
          Adds an error to the action with the given number for the given field.
protected  void addError(java.lang.String field, int error_id, org.mentawai.message.MessageContext msgContext)
          Adds an error to the action with the given number and context for the given field.
protected  void addError(java.lang.String field, org.mentawai.message.Message error)
          Adds an error to the action for the given field.
protected  void addError(java.lang.String error_id, org.mentawai.message.MessageContext msgContext)
          Adds an error to the action with the given number and context.
protected  void addError(java.lang.String field, java.lang.String error_id)
          Adds an error to the action with the given number for the given field.
protected  void addError(java.lang.String field, java.lang.String error_id, org.mentawai.message.MessageContext msgContext)
          Adds an error to the action with the given number and context for the given field.
protected  void addMessage(int msg_id)
          Adds a message to the action with the given number.
protected  void addMessage(int msg_id, org.mentawai.message.MessageContext msgContext)
          Adds a message to the action with the given number and context.
protected  void addMessage(org.mentawai.message.Message msg)
          Adds an message to the action.
protected  void addMessage(java.lang.String msg_id)
          Adds a message to the action with the given number.
protected  void addMessage(java.lang.String msg_id, org.mentawai.message.MessageContext msgContext)
          Adds a message to the action with the given number and context.
 Context getApplication()
          Gets this action application context.
private  java.util.List getErrors()
           
private  java.util.Map getFieldErrors()
           
 Input getInput()
          Gets the action input.
 java.util.Locale getLocale()
          Gets the use locale for this action.
private  java.util.List getMessages()
           
 Output getOutput()
          Gets the action output.
 Context getSession()
          Gets this action session context.
 void setApplication(Context context)
          Sets the application context for this action.
 void setInput(Input input)
          Sets the input for this action.
 void setLocale(java.util.Locale loc)
          Sets the user locale for this action.
static void setMessageContext(org.mentawai.message.MessageContext msgContext)
          Sets a fixed message context for all actions derived from BaseAction.
 void setOutput(Output output)
          Sets the output for this action.
 void setSession(Context context)
          Sets the session context for this action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mentawai.core.Action
execute
 

Field Detail

FIXED_MSG_CONTEXT

private static org.mentawai.message.MessageContext FIXED_MSG_CONTEXT

msgContext

private org.mentawai.message.MessageContext msgContext

input

protected Input input

output

protected Output output

session

protected Context session

application

protected Context application

loc

protected java.util.Locale loc
Constructor Detail

BaseAction

public BaseAction()
Creates a BaseAction.

Method Detail

setMessageContext

public static void setMessageContext(org.mentawai.message.MessageContext msgContext)
Sets a fixed message context for all actions derived from BaseAction.

Since:
1.1.2

getMessages

private java.util.List getMessages()

getErrors

private java.util.List getErrors()

getFieldErrors

private java.util.Map getFieldErrors()

addMessage

protected void addMessage(java.lang.String msg_id)
Adds a message to the action with the given number.

Since:
1.1.1

addMessage

protected void addMessage(int msg_id)
Adds a message to the action with the given number.


addError

protected void addError(java.lang.String error_id)
Adds an error to the action with the given number.

Since:
1.1.1

addError

protected void addError(int error_id)
Adds an error to the action with the given number.


addError

protected void addError(java.lang.String field,
                        java.lang.String error_id)
Adds an error to the action with the given number for the given field.

Since:
1.1.1

addError

protected void addError(java.lang.String field,
                        int error_id)
Adds an error to the action with the given number for the given field.


addMessage

protected void addMessage(java.lang.String msg_id,
                          org.mentawai.message.MessageContext msgContext)
Adds a message to the action with the given number and context.

Since:
1.1.1

addMessage

protected void addMessage(int msg_id,
                          org.mentawai.message.MessageContext msgContext)
Adds a message to the action with the given number and context.


addError

protected void addError(java.lang.String error_id,
                        org.mentawai.message.MessageContext msgContext)
Adds an error to the action with the given number and context.

Since:
1.1.1

addError

protected void addError(int error_id,
                        org.mentawai.message.MessageContext msgContext)
Adds an error to the action with the given number and context.


addError

protected void addError(java.lang.String field,
                        java.lang.String error_id,
                        org.mentawai.message.MessageContext msgContext)
Adds an error to the action with the given number and context for the given field.

Since:
1.1.1

addError

protected void addError(java.lang.String field,
                        int error_id,
                        org.mentawai.message.MessageContext msgContext)
Adds an error to the action with the given number and context for the given field.


addMessage

protected void addMessage(org.mentawai.message.Message msg)
Adds an message to the action.


addError

protected void addError(org.mentawai.message.Message error)
Adds an error to the action.


addError

protected void addError(java.lang.String field,
                        org.mentawai.message.Message error)
Adds an error to the action for the given field.

Since:
1.1

setInput

public void setInput(Input input)
Description copied from interface: Action
Sets the input for this action.

Specified by:
setInput in interface Action

setOutput

public void setOutput(Output output)
Description copied from interface: Action
Sets the output for this action.

Specified by:
setOutput in interface Action

setSession

public void setSession(Context context)
Description copied from interface: Action
Sets the session context for this action.

Specified by:
setSession in interface Action

setApplication

public void setApplication(Context context)
Description copied from interface: Action
Sets the application context for this action.

Specified by:
setApplication in interface Action

setLocale

public void setLocale(java.util.Locale loc)
Description copied from interface: Action
Sets the user locale for this action.

Specified by:
setLocale in interface Action

getInput

public Input getInput()
Description copied from interface: Action
Gets the action input.

Specified by:
getInput in interface Action

getOutput

public Output getOutput()
Description copied from interface: Action
Gets the action output.

Specified by:
getOutput in interface Action

getSession

public Context getSession()
Description copied from interface: Action
Gets this action session context.

Specified by:
getSession in interface Action

getApplication

public Context getApplication()
Description copied from interface: Action
Gets this action application context.

Specified by:
getApplication in interface Action

getLocale

public java.util.Locale getLocale()
Description copied from interface: Action
Gets the use locale for this action.

Specified by:
getLocale in interface Action