PATH |
Inherits from: Object
Implements: Cloneable
Package: com.webobjects.appserver
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.
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
public WOContext(WORequest aRequest)
public static WOContext contextWithRequest(WORequest aRequest)
public void appendElementIDComponent(String aString)
See Also: deleteAllElementIDComponents, deleteLastElementIDComponent, incrementLastElementIDComponent
public void appendZeroElementIDComponent()
See Also: deleteAllElementIDComponents, deleteLastElementIDComponent, incrementLastElementIDComponent
public Object clone()
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
public WOComponent component()
See Also: WOComponent class, page, request, response, session
public String componentActionURL()
public String contextID()
public void deleteAllElementIDComponents()
See Also: appendElementIDComponent, appendZeroElementIDComponent, incrementLastElementIDComponent
public void deleteLastElementIDComponent()
See Also: appendElementIDComponent, appendZeroElementIDComponent, incrementLastElementIDComponent
public String directActionURLForActionNamed( String anActionName, NSDictionary aQueryDict)
See Also: WODirectAction class specification
public String elementID()
public boolean hasSession()
See Also: session
public void incrementLastElementIDComponent()
See Also: appendElementIDComponent, appendZeroElementIDComponent, deleteAllElementIDComponents, deleteLastElementIDComponent
public boolean isInForm()
true
when in the context of a WOForm.
See Also: setInForm
public WOComponent page()
See Also: component, request, response, session
public WORequest request()
See Also: component, page, response, session
public WOResponse response()
See Also: component, page, response, session
public String senderID()
null
, as it always is on the first request of a session.
See Also: request , uri (WORequest)
public WOSession session()
See Also: component, page, request, response, WOSession class
public void setInForm(boolean flag)
See Also: isInForm
public String toString()
public String urlWithRequestHandlerKey( String requestHandlerKey, String aRequestHandlerPath, String aQueryString)
See Also: completeURLWithRequestHandlerKey
© 2001 Apple Computer, Inc. (Last Published April 15, 2001)