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_WOSession_H__
23 #define __NGObjWeb_WOSession_H__
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSLock.h>
27 #import <Foundation/NSDate.h>
28 #include <NGObjWeb/NGObjWebDecls.h>
30 @class NSString, NSArray, NSRecursiveLock, NSMutableDictionary, NSDate;
31 @class WOContext, WOApplication;
32 @class WORequest, WOResponse, WOContext, WOComponent;
34 struct WOSessionCacheEntry;
36 NGObjWeb_EXPORT NSString *WOSessionDidTimeOutNotification;
37 NGObjWeb_EXPORT NSString *WOSessionDidRestoreNotification;
38 NGObjWeb_EXPORT NSString *WOSessionDidCreateNotification;
39 NGObjWeb_EXPORT NSString *WOSessionDidTerminateNotification;
41 @interface WOSession : NSObject < NSLocking >
44 NSArray *wosLanguages;
46 NSRecursiveLock *wosLock;
47 NSString *wosSessionId;
48 NSMutableDictionary *wosVariables; // session variables
49 NSTimeInterval wosTimeOut;
50 id wosDefaultEditingContext;
52 BOOL storesIDsInURLs:1;
53 BOOL storesIDsInCookies:1;
59 struct WOSessionCacheEntry *entries;
64 struct WOSessionCacheEntry *entries;
69 @protected // transients (non-retained)
70 WOApplication *application;
76 - (NSString *)sessionID;
77 - (void)setStoresIDsInURLs:(BOOL)_flag;
78 - (BOOL)storesIDsInURLs;
79 - (void)setStoresIDsInCookies:(BOOL)_flag;
80 - (BOOL)storesIDsInCookies;
81 - (NSString *)domainForIDCookies;
82 - (NSDate *)expirationDateForIDCookies;
84 - (void)setDistributionEnabled:(BOOL)_flag;
85 - (BOOL)isDistributionEnabled;
87 - (void)setTimeOut:(NSTimeInterval)_timeout;
88 - (NSTimeInterval)timeOut;
90 - (BOOL)isTerminating;
92 - (WOContext *)context;
96 - (id)defaultEditingContext;
100 - (void)setLanguages:(NSArray *)_langs;
101 - (NSArray *)languages;
110 - (id)restorePageForContextID:(NSString *)_idx;
111 - (void)savePage:(WOComponent *)_page;
112 - (void)savePageInPermanentCache:(WOComponent *)_page; // new in WO4
116 - (void)takeValuesFromRequest:(WORequest *)_request inContext:(WOContext *)_ctx;
117 - (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx;
118 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx;
126 /* session variables */
128 - (void)setObject:(id)_obj forKey:(NSString *)_key;
129 - (id)objectForKey:(NSString *)_key;
130 - (void)removeObjectForKey:(NSString *)_key;
134 - (NSArray *)statistics;
138 @interface WOSession(DeprecatedMethodsInWO4)
140 - (id)application; // use [WOApplication application] instead
144 @interface WOSession(PrivateMethods)
145 - (void)_awakeWithContext:(WOContext *)_ctx;
146 - (void)_sleepWithContext:(WOContext *)_ctx;
149 @interface WOSession(NSCoding) < NSCoding >
152 @interface WOSession(Logging)
154 - (void)logWithFormat:(NSString *)_format, ...;
155 - (void)debugWithFormat:(NSString *)_format, ...; // new in WO4
159 #endif /* __NGObjWeb_WOSession_H__ */