org.apache.commons.scaffold.util
Interface BizResponse

All Known Implementing Classes:
BizResponseImpl

public interface BizResponse

Convenient wrapper for the result of a business process.

The result property returns any object generated by the process that is to be returned to the presentation tier. The messages property is a list of any confirmation messages to be displayed by the presentation tier. These may be keys into a resource bundle, or literal text, depending on whether the application is localized. The dispatchPath property returns any special advice regarding the next step in the workflow. Null indicates the nominal "success" path should be followed. The data property is any actual data returned from storage. This may be a single record or a collection of records (see isSingleForm()).

Version:
$Revision: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
Author:
Ted Husted, Synthis Corporation, Nationwide Insurance Company

Method Summary
 void addMessage(Message message)
          Add a message to the list.
 void addMessage(Message message, String property)
          Add a message to the list.
 Object getData()
          Return the data object.
 String getDispatch()
          The dispatch property can be used to re-route control to an non-default location, either as a system path or via a logical name (e.g ActionForward).
 Messages getMessages()
          Return the messages list.
 String getName()
          Return the attribute name for the result object.
 String getScope()
          Return the scope under which to store this result object.
 boolean isAggregate()
          Return whether the result of this ProcessResult is a collection of contains other ProcessResult objects to be handled individually.
 boolean isData()
          Return whether data object has been set.
 boolean isDispatch()
          Return whether dispatch advice has been set.
 boolean isDispatchPath()
          Return whether dispatch advice is suppose to be a true path or a logical name (e.g.
 boolean isExposed()
          Return the exposed state.
 boolean isMessages()
          Return whether there are any messages queued.
 boolean isSingleForm()
          Return the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.
 void setAggregate(boolean aggregate)
          Assign a new container state.
 void setData(Object data)
          Assign a new data object.
 void setDispatch(String dispatch)
          Field to store dispatch property.
 void setDispatchPath(boolean dispatchPath)
          Indicates whether dispatch advice (if any) is suppose to be a path or a logical name (e.g.
 void setExposed(boolean exposed)
          Indicates whether the result should be exposed to the rest of the application through a context.
 void setName(String name)
          Set the attribute name for this result object.
 void setScope(String scope)
          Set the scope under which to store this result object.
 void setSingleForm(boolean singleForm)
          Set the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.
 

Method Detail

getName

String getName()
Return the attribute name for the result object.

Typically, this will be set by the caller but is provided in case a special name must be used or a way is needed to distingish between result objects.

Returns:
the name

setName

void setName(String name)
Set the attribute name for this result object.

Parameters:
name - The new name

getScope

String getScope()
Return the scope under which to store this result object.

Returns:
the scope

setScope

void setScope(String scope)
Set the scope under which to store this result object.

Parameters:
scope - The new scope

isSingleForm

boolean isSingleForm()
Return the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.


setSingleForm

void setSingleForm(boolean singleForm)
Set the single-form state: list of 0 or more records=FALSE, exactly one record=TRUE.

Parameters:
Set - to true for single form.

isExposed

boolean isExposed()
Return the exposed state.

Returns:
True if the result should be exposed

setExposed

void setExposed(boolean exposed)
Indicates whether the result should be exposed to the rest of the application through a context.

Parameters:
multiple - The new exposed

getData

Object getData()
Return the data object.


setData

void setData(Object data)
Assign a new data object.

Parameters:
data - The new data object

isData

boolean isData()
Return whether data object has been set.


isAggregate

boolean isAggregate()
Return whether the result of this ProcessResult is a collection of contains other ProcessResult objects to be handled individually. This allows processes to be combined on the business tier and returned to controller as a single operation.


setAggregate

void setAggregate(boolean aggregate)
Assign a new container state.

Parameters:
aggregate - Set to true for aggregate result

getMessages

Messages getMessages()
Return the messages list.


isMessages

boolean isMessages()
Return whether there are any messages queued.


addMessage

void addMessage(Message message,
                String property)
Add a message to the list. Instantiate messages if it does not already exist.


addMessage

void addMessage(Message message)
Add a message to the list. Instantiate messages if it does not already exist.


getDispatch

String getDispatch()
The dispatch property can be used to re-route control to an non-default location, either as a system path or via a logical name (e.g ActionForward).

See Also:
setDispatchPath()

setDispatch

void setDispatch(String dispatch)
Field to store dispatch property.


isDispatch

boolean isDispatch()
Return whether dispatch advice has been set.


isDispatchPath

boolean isDispatchPath()
Return whether dispatch advice is suppose to be a true path or a logical name (e.g. ActionForward)


setDispatchPath

void setDispatchPath(boolean dispatchPath)
Indicates whether dispatch advice (if any) is suppose to be a path or a logical name (e.g. ActionForward).

Parameters:
dispatchPath - The new dispatch advice


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.