PATH |
WOContext
Inherits from: Object
Implements: Cloneable
Package: com.webobjects.appserver
Class Description
A WOContext object lets you access objects and information that define the context of a transaction. In a typical request-response loop (a transaction), several objects have a hand in what is going on: the WOApplication and WOSession objects, the page involved in the request or response (a WOComponent object), the page's subcomponents (also WOComponents), plus the dynamic elements on the page. The WOContext object passed as an argument in the takeValuesFromRequest, invokeAction, and appendToResponse messages allows access to these objects. A context is identified by the context ID, which appears in the URL after the session ID and page name. Each context ID is an integer that the session increments each time a new context is created.
WOContext objects provide other information and services related to the current transaction. From them you can get the entire URL currently in effect as well as portions of that URL, such as the element ID, the context ID, and the URL up to and including the session ID.
A WOContext object plays a further role behind the scenes. For the benefit of a page's dynamic elements, it keeps track of the current component, that is, the WOComponent associated with the current element in the request-handling cycle. The current component can be the WOComponent that represents one of the page's subcomponents or the page itself. By reference to the current component (accessed through WOContext's component method), a dynamic element can exchange values associatively between itself and the WOComponent that contains it.
Method Types
Constructors WOContext Creating new object instances contextWithRequest Obtaining attributes component contextID elementID hasSession isInForm page request response session session setInForm Manipulating element ID appendElementIDComponent appendZeroElementIDComponent deleteAllElementIDComponents deleteLastElementIDComponent incrementLastElementIDComponent Generating URLs directActionURLForActionNamed completeURLWithRequestHandlerKey componentActionURL urlWithRequestHandlerKey
Constructors
WOContext
public WOContext(WORequest aRequest)
Static Methods
contextWithRequest
public static WOContext contextWithRequest(WORequest aRequest)
Instance Methods
appendElementIDComponent
public void appendElementIDComponent(String aString)
See Also: deleteAllElementIDComponents, deleteLastElementIDComponent, incrementLastElementIDComponent
appendZeroElementIDComponent
public void appendZeroElementIDComponent()
See Also: deleteAllElementIDComponents, deleteLastElementIDComponent, incrementLastElementIDComponent
clone
public Object clone()
completeURLWithRequestHandlerKey
public String completeURLWithRequestHandlerKey( String requestHandlerKey, String aRequestHandlerPath, String aQueryString, boolean isSecure, int somePort)
true
, this method uses "https" instead of "http." If somePort is 0 (zero), this method uses the default port.
See Also: urlWithRequestHandlerKey
component
public WOComponent component()
See Also: WOComponent class, page, request, response, session
componentActionURL
public String componentActionURL()
contextID
public String contextID()
deleteAllElementIDComponents
public void deleteAllElementIDComponents()
See Also: appendElementIDComponent, appendZeroElementIDComponent, incrementLastElementIDComponent
deleteLastElementIDComponent
public void deleteLastElementIDComponent()
See Also: appendElementIDComponent, appendZeroElementIDComponent, incrementLastElementIDComponent
directActionURLForActionNamed
public String directActionURLForActionNamed( String anActionName, NSDictionary aQueryDict)
See Also: WODirectAction class specification
elementID
public String elementID()
hasSession
public boolean hasSession()
See Also: session
incrementLastElementIDComponent
public void incrementLastElementIDComponent()
See Also: appendElementIDComponent, appendZeroElementIDComponent, deleteAllElementIDComponents, deleteLastElementIDComponent
isInForm
public boolean isInForm()
true
when in the context of a WOForm.
See Also: setInForm
page
public WOComponent page()
See Also: component, request, response, session
request
public WORequest request()
See Also: component, page, response, session
response
public WOResponse response()
See Also: component, page, response, session
senderID
public String senderID()
null
, as it always is on the first request of a session.
See Also: request , uri (WORequest)
session
public WOSession session()
See Also: component, page, request, response, WOSession class
setInForm
public void setInForm(boolean flag)
See Also: isInForm
toString
public String toString()
urlWithRequestHandlerKey
public String urlWithRequestHandlerKey( String requestHandlerKey, String aRequestHandlerPath, String aQueryString)
See Also: completeURLWithRequestHandlerKey
© 2001 Apple Computer, Inc. (Last Published April 15, 2001)