2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGObjWeb_WOContext_H__
23 #define __NGObjWeb_WOContext_H__
25 #import <Foundation/NSObject.h>
26 #include <NGObjWeb/WOPageGenerationContext.h>
27 #include <NGObjWeb/WOElementTrackingContext.h>
32 The WOContext is the central object for processing a single HTTP
33 transaction. It manages request, response, the session, the current
34 element id for component actions, the active component etc.
37 @class NSString, NSMutableDictionary, NSMutableArray, NSMutableSet;
38 @class NSArray, NSDictionary, NSURL;
39 @class WOApplication, WOSession, WOComponent, WORequest, WOResponse;
42 #define NGObjWeb_MAX_COMPONENT_NESTING_DEPTH 50
44 @interface WOContext : NSObject < WOPageGenerationContext >
47 WOApplication *application; // non-retained
51 NSMutableDictionary *variables;
54 NSMutableSet *awakeComponents; // components that were woken up
61 WOElementID *elementID;
62 WOElementID *reqElementID;
63 NSString *urlPrefix; /* cached URL prefix */
66 id componentStack[NGObjWeb_MAX_COMPONENT_NESTING_DEPTH];
67 id contentStack[NGObjWeb_MAX_COMPONENT_NESTING_DEPTH];
68 signed char componentStackCount;
76 /* tracking component actions */
77 BOOL savePageRequired;
81 NSMutableArray *traversalStack;
82 NSString *soRequestType; // WebDAV, XML-RPC, METHOD
86 id objectPermissionCache;
89 #if WITH_DEALLOC_OBSERVERS
92 unsigned short deallocObserverCount;
93 unsigned short deallocObserverCapacity;
97 + (id)contextWithRequest:(WORequest *)_request;
98 - (id)initWithRequest:(WORequest *)_request;
105 - (NSURL *)applicationURL;
106 - (NSURL *)serverURL;
107 - (NSURL *)urlForKey:(NSString *)_key;
111 - (void)setObject:(id)_obj forKey:(NSString *)_key;
112 - (id)objectForKey:(NSString *)_key;
113 - (void)removeObjectForKey:(NSString *)_key;
114 - (void)takeValue:(id)_value forKey:(NSString *)_key;
115 - (id)valueForKey:(NSString *)_key;
119 @interface WOContext(ElementIDs) < WOElementTrackingContext >
122 @interface WOContext(URLs)
124 - (NSString *)componentActionURL;
126 - (NSString *)directActionURLForActionNamed:(NSString *)_actionName
127 queryDictionary:(NSDictionary *)_queryDict;
129 - (NSString *)urlWithRequestHandlerKey:(NSString *)_key
130 path:(NSString *)_path
131 queryString:(NSString *)_query;
132 - (NSString *)completeURLWithRequestHandlerKey:(NSString *)_key
133 path:(NSString *)_path
134 queryString:(NSString *)_query
135 isSecure:(BOOL)_isSecure
138 - (NSString *)senderID; // new in WO4
140 - (NSString *)queryStringFromDictionary:(NSDictionary *)_queryDict;
144 @interface WOContext(PrivateMethods)
146 - (void)setRequestSenderID:(NSString *)_rqsid;
147 - (BOOL)savePageRequired;
151 @interface WOContext(DeprecatedMethodsInWO4)
153 - (id)application; // use WOApplication:+application
155 - (void)setDistributionEnabled:(BOOL)_flag; // use methods in
156 - (BOOL)isDistributionEnabled; // WOSession instead
158 - (NSString *)url; // use componentActionURL methods
159 - (NSString *)urlSessionPrefix; // use componentActionURL methods
163 @interface WOContext(SOPEAdditions)
165 /* languages for resource lookup (non-WO) */
167 - (NSArray *)resourceLookupLanguages;
171 #endif /* __NGObjWeb_WOContext_H__ */