WOContext
Inherits from: NSObject
Conforms to: NSObject
(NSObject)
Declared in: WebObjects/WOContext.h
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:inContext:, invokeActionForRequest:inContext:, and appendToResponse:inContext: 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.
Adopted Protocols
NSCopying- copy - copyWithZone:
Method Types
- Creating new object instances
- + contextWithRequest:
- - init
- - initWithRequest:
- Obtaining attributes
- - component
- - contextID
- - elementID
- - hasSession
- - isInForm
- - page
- - request
- - response
- - session
- - session
- - setInForm:
- Manipulating element ID
- - appendElementIDComponent:
- - appendZeroElementIDComponent
- - deleteAllElementIDComponents
- - deleteLastElementIDComponent
- - incrementLastElementIDComponent
- Generating URLs
- - directActionURLForActionNamed:queryDictionary:
- - completeURLWithRequestHandlerKey:path:queryString:isSecure:port:
- - componentActionURL
- - urlWithRequestHandlerKey:path:queryString:
Class Methods
contextWithRequest:
+ (WOContext *)contextWithRequest:(WORequest
*)aRequest
Instance Methods
appendElementIDComponent:
- (void)appendElementIDComponent:(NSString
*)aString
See Also: - deleteAllElementIDComponents, - deleteLastElementIDComponent, - incrementLastElementIDComponent
appendZeroElementIDComponent
- (void)appendZeroElementIDComponent
See Also: - deleteAllElementIDComponents, - deleteLastElementIDComponent, - incrementLastElementIDComponent
completeURLWithRequestHandlerKey:path:queryString:isSecure:port:
- (NSString *)completeURLWithRequestHandlerKey:(NSString
*)requestHandlerKey
path:(NSString *)aRequestHandlerPath
queryString:(NSString *)aQueryString
isSecure:(BOOL)isSecure
port:(int)somePort
See Also: - urlWithRequestHandlerKey:path:queryString:
component
- (WOComponent *)component
See Also: WOComponent class, - page, - request, - response, - session
componentActionURL
- (NSString *)componentActionURL
contextID
- (NSString *)contextID
deleteAllElementIDComponents
- (void)deleteAllElementIDComponents
See Also: - appendElementIDComponent:, - appendZeroElementIDComponent, - incrementLastElementIDComponent
deleteLastElementIDComponent
- (void)deleteLastElementIDComponent
See Also: - appendElementIDComponent:, - appendZeroElementIDComponent, - incrementLastElementIDComponent
directActionURLForActionNamed:queryDictionary:
- (NSString *)directActionURLForActionNamed:(NSString
*)anActionName
queryDictionary:(NSDictionary
*)aQueryDict
See Also: WODirectAction class specification
elementID
- (NSString *)elementID
hasSession
- (BOOL)hasSession
See Also: - session
incrementLastElementIDComponent
- (void)incrementLastElementIDComponent
See Also: - appendElementIDComponent:, - appendZeroElementIDComponent, - deleteAllElementIDComponents, - deleteLastElementIDComponent
init
- (id)init
initWithRequest:
- (id)initWithRequest:(WORequest
*)aRequest
isInForm
- (BOOL)isInForm
See Also: setInForm:
page
- (WOComponent *)page
See Also: - component, - request, - response, - session
request
- (WORequest *)request
See Also: - component, - page, - response, - session
response
- (WOResponse *)response
See Also: - component, - page, - response, - session
senderID
- (NSString *)senderID
See Also: - initWithRequest:, - request , - uri (WORequest)
session
- (WOSession *)session
See Also: - component, - page, - request, - response, WOSession class
setInForm:
- (void)setInForm:(BOOL)flag
See Also: isInForm
urlWithRequestHandlerKey:path:queryString:
- (NSString *)urlWithRequestHandlerKey:(NSString
*)requestHandlerKey
path:(NSString *)aRequestHandlerPath
queryString:(NSString *)aQueryString
See Also: - completeURLWithRequestHandlerKey:path:queryString:isSecure:port: