net.wotonomy.web
Class WODirectAction

java.lang.Object
  extended by net.wotonomy.web.WODirectAction

public class WODirectAction
extends java.lang.Object

A pure java implementation of WODirectAction. This class provides a number of services to subclasses, including access to the query parameters, the request, the session, and logging and debugging facilities. A new instance of the class is created and then destroyed for every request-response cycle.

Subclass this to implement direct actions for your application. Subclasses would typically override the constructor to initialize state based on the request, and then provide additional methods that would be invoked based on the value at the end of the URI.

Example: "http://www/MyApp.woa/MyActions/search" would call the method named "searchAction" on the DirectAction subclass named "MyActions". If the subclass name is omitted, a subclass named "DirectAction" is assumed to exist within the application.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $

Constructor Summary
WODirectAction(WORequest aRequest)
          Request constructor.
 
Method Summary
static void debugString(java.lang.String aString)
          Writes a message to the standard error stream if debugging is activated.
 WOActionResults defaultAction()
          Returns the response from the component named "Main".
 WOSession existingSession()
          Returns the existing session, or null if no session exists.
static void logString(java.lang.String aString)
          Writes a message to the standard error stream.
 WOComponent pageWithName(java.lang.String aString)
          Returns the named WOComponent.
 WOActionResults performActionNamed(java.lang.String anAction)
          Appends "Action" to the specified string and tries to invoke method with that name and no arguments.
 WORequest request()
          Returns the WORequest object for the current request.
 WOSession session()
          Returns the existing session if it exists.
 void takeFormValueArraysForKeyArray(net.wotonomy.foundation.NSArray anArray)
          Assigns the arrays of form values for the specified keys to properties on this object with matching names whose type is NSArray or is convertable from a Collection.
 void takeFormValuesForKeyArray(net.wotonomy.foundation.NSArray anArray)
          Assigns the form values for the specified keys to properties on this object with matching names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WODirectAction

public WODirectAction(WORequest aRequest)
Request constructor. This is the constructor used to create an action in response to a user request. Override to perform any necessary initialization in your subclass.

Method Detail

defaultAction

public WOActionResults defaultAction()
Returns the response from the component named "Main".


request

public WORequest request()
Returns the WORequest object for the current request.


existingSession

public WOSession existingSession()
Returns the existing session, or null if no session exists.


session

public WOSession session()
Returns the existing session if it exists. If no session exists, returns a newly created session. Note that if the user client does not support session ids/cookies, this will create a new session with each request.


pageWithName

public WOComponent pageWithName(java.lang.String aString)
Returns the named WOComponent.


performActionNamed

public WOActionResults performActionNamed(java.lang.String anAction)
Appends "Action" to the specified string and tries to invoke method with that name and no arguments. Returns null if the method does not exist. If anAction is null, "defaultAction" will be assumed.


takeFormValueArraysForKeyArray

public void takeFormValueArraysForKeyArray(net.wotonomy.foundation.NSArray anArray)
Assigns the arrays of form values for the specified keys to properties on this object with matching names whose type is NSArray or is convertable from a Collection.


takeFormValuesForKeyArray

public void takeFormValuesForKeyArray(net.wotonomy.foundation.NSArray anArray)
Assigns the form values for the specified keys to properties on this object with matching names.


logString

public static void logString(java.lang.String aString)
Writes a message to the standard error stream.


debugString

public static void debugString(java.lang.String aString)
Writes a message to the standard error stream if debugging is activated.



Copyright © 2006 null. All Rights Reserved.