nl.pbemengine.engine.ng.base.webserver
Class Action

java.lang.Object
  extended by nl.pbemengine.engine.ng.base.webserver.Action
Direct Known Subclasses:
PrivilegedAction

public abstract class Action
extends java.lang.Object

HTML webpage interface, represents a web page in abstract sense - any dynamic content for a webpage is generated by the implementing class, based on the GET or POST variables.

Author:
Jeroen Steenbeeke

Constructor Summary
Action()
           
 
Method Summary
 ActionCallback getCallback()
          Get the action callback for this action
 PageContext getContext()
          Get this actions PageContext
 java.util.Map<java.lang.String,java.lang.String> getNewCookies()
          Return a mapping of new cookies (if any cookie already exists, it will be overriden)
 java.util.Map getReturnData()
          Data passed to the template, or any chained actions.
abstract  java.lang.String processRequest()
          Processes a HTTP request with the specified context
 void setCallback(ActionCallback callback)
          Sets the callback object for this action
 void setContext(PageContext context)
          Set this actions PageContext
protected  void setNewCookie(java.lang.String key, java.lang.String value)
          Adds a new cookie to the list of new cookies
protected  void setValue(java.lang.String key, java.lang.Object value)
          Adds a new value to the return data of this action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Method Detail

getCallback

public ActionCallback getCallback()
Get the action callback for this action

Returns:
The ActionCallback object

setCallback

public void setCallback(ActionCallback callback)
Sets the callback object for this action

Parameters:
callback - The callback object

getReturnData

public java.util.Map getReturnData()
Data passed to the template, or any chained actions. This will be included in the PageContext of the next Action. An action returning direct data must put it somewhere in this array

Returns:
A Map containing data

getNewCookies

public java.util.Map<java.lang.String,java.lang.String> getNewCookies()
Return a mapping of new cookies (if any cookie already exists, it will be overriden)

Returns:
A Map of cookies

getContext

public PageContext getContext()
Get this actions PageContext

Returns:
The PageContext of this action

setContext

public void setContext(PageContext context)
Set this actions PageContext

Parameters:
context - This actions new context

setNewCookie

protected void setNewCookie(java.lang.String key,
                            java.lang.String value)
Adds a new cookie to the list of new cookies

Parameters:
key - The name of the cookie
value - The value of the cookie

setValue

protected void setValue(java.lang.String key,
                        java.lang.Object value)
Adds a new value to the return data of this action

Parameters:
key - The name of the data item
value - The data item

processRequest

public abstract java.lang.String processRequest()
Processes a HTTP request with the specified context

Returns:
A String code indicating the type of result to be sent


Copyright © 2008. All Rights Reserved.