2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __NGObjWeb_WOSession_H__
24 #define __NGObjWeb_WOSession_H__
26 #import <Foundation/NSObject.h>
27 #import <Foundation/NSLock.h>
28 #import <Foundation/NSDate.h>
29 #include <NGObjWeb/NGObjWebDecls.h>
31 @class NSString, NSArray, NSRecursiveLock, NSMutableDictionary, NSDate;
32 @class WOContext, WOApplication;
33 @class WORequest, WOResponse, WOContext, WOComponent;
35 struct WOSessionCacheEntry;
37 NGObjWeb_EXPORT NSString *WOSessionDidTimeOutNotification;
38 NGObjWeb_EXPORT NSString *WOSessionDidRestoreNotification;
39 NGObjWeb_EXPORT NSString *WOSessionDidCreateNotification;
40 NGObjWeb_EXPORT NSString *WOSessionDidTerminateNotification;
42 @interface WOSession : NSObject < NSLocking >
45 NSArray *wosLanguages;
47 NSRecursiveLock *wosLock;
48 NSString *wosSessionId;
49 NSMutableDictionary *wosVariables; // session variables
50 NSTimeInterval wosTimeOut;
51 id wosDefaultEditingContext;
53 BOOL storesIDsInURLs:1;
54 BOOL storesIDsInCookies:1;
60 struct WOSessionCacheEntry *entries;
65 struct WOSessionCacheEntry *entries;
70 @protected // transients (non-retained)
71 WOApplication *application;
77 - (NSString *)sessionID;
78 - (void)setStoresIDsInURLs:(BOOL)_flag;
79 - (BOOL)storesIDsInURLs;
80 - (void)setStoresIDsInCookies:(BOOL)_flag;
81 - (BOOL)storesIDsInCookies;
82 - (NSString *)domainForIDCookies;
83 - (NSDate *)expirationDateForIDCookies;
85 - (void)setDistributionEnabled:(BOOL)_flag;
86 - (BOOL)isDistributionEnabled;
88 - (void)setTimeOut:(NSTimeInterval)_timeout;
89 - (NSTimeInterval)timeOut;
91 - (BOOL)isTerminating;
93 - (WOContext *)context;
97 - (id)defaultEditingContext;
101 - (void)setLanguages:(NSArray *)_langs;
102 - (NSArray *)languages;
111 - (id)restorePageForContextID:(NSString *)_idx;
112 - (void)savePage:(WOComponent *)_page;
113 - (void)savePageInPermanentCache:(WOComponent *)_page; // new in WO4
117 - (void)takeValuesFromRequest:(WORequest *)_request inContext:(WOContext *)_ctx;
118 - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx;
119 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx;
127 /* session variables */
129 - (void)setObject:(id)_obj forKey:(NSString *)_key;
130 - (id)objectForKey:(NSString *)_key;
131 - (void)removeObjectForKey:(NSString *)_key;
135 - (NSArray *)statistics;
139 @interface WOSession(DeprecatedMethodsInWO4)
141 - (id)application; // use [WOApplication application] instead
145 @interface WOSession(PrivateMethods)
146 - (void)_awakeWithContext:(WOContext *)_ctx;
147 - (void)_sleepWithContext:(WOContext *)_ctx;
150 @interface WOSession(NSCoding) < NSCoding >
153 @interface WOSession(Logging)
155 - (void)logWithFormat:(NSString *)_format, ...;
156 - (void)debugWithFormat:(NSString *)_format, ...; // new in WO4
160 #endif /* __NGObjWeb_WOSession_H__ */