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
24 #include <NGObjWeb/NGObjWeb.h>
27 WOSession JavaScript object
32 String domainForIDCookies
33 Date expirationDateForIDCookies
34 bool isDistributionEnabled
39 bool storesIDsInCookies
44 WOComponent restorePageForContextID(ctxid)
46 savePageInPermanentCache(page)
48 print(string [,..string])
51 static NSNumber *nYes = nil;
52 static NSNumber *nNo = nil;
54 @implementation WOSession(JSFunctions)
56 - (id)_jsfunc_restorePageForContextID:(NSArray *)_args {
57 return [self restorePageForContextID:[[_args objectAtIndex:0] stringValue]];
59 - (id)_jsfunc_savePage:(NSArray *)_args {
60 [self savePage:[_args objectAtIndex:0]];
63 - (id)_jsfunc_savePageInPermanentCache:(NSArray *)_args {
64 [self savePageInPermanentCache:[_args objectAtIndex:0]];
67 - (id)_jsfunc_terminate:(NSArray *)_args {
72 - (id)_jsfunc_print:(NSArray *)_args {
79 ms = [NSMutableString stringWithCapacity:128];
81 e = [_args objectEnumerator];
82 while ((o = [e nextObject])) {
85 if (!isFirst) [ms appendString:@" "];
92 [self logWithFormat:@"%@", ms];
99 @implementation WOSession(JSProperties)
102 if (nYes == nil) nYes = [[NSNumber alloc] initWithBool:YES];
103 if (nNo == nil) nNo = [[NSNumber alloc] initWithBool:NO];
106 - (id)_jsprop_sessionID {
107 return [self sessionID];
109 - (id)_jsprop_domainForIDCookies {
110 return [self domainForIDCookies];
112 - (id)_jsprop_expirationDateForIDCookies {
113 return [self expirationDateForIDCookies];
116 - (id)_jsprop_isDistributionEnabled:(id)_value {
117 [self setDistributionEnabled:[_value boolValue]];
120 - (id)_jsprop_isDistributionEnabled {
121 return [self isDistributionEnabled] ? nYes : nNo;
124 - (id)_jsprop_isTerminating {
125 return [self isTerminating] ? nYes : nNo;
128 - (id)_jsprop_languages:(id)_value {
129 [self setLanguages:_value];
132 - (id)_jsprop_languages {
133 return [self languages];
136 - (id)_jsprop_statistics {
137 return [self statistics];
140 - (id)_jsprop_timeOut:(id)_value {
141 [self setTimeOut:[_value doubleValue]];
144 - (id)_jsprop_timeOut {
145 return [NSNumber numberWithDouble:[self timeOut]];
148 - (id)_jsprop_storesIDsInCookies:(id)_value {
149 [self setStoresIDsInCookies:[_value boolValue]];
152 - (id)_jsprop_storesIDsInCookies {
153 return [self storesIDsInCookies] ? nYes : nNo;
156 - (id)_jsprop_storesIDsInURLs:(id)_value {
157 [self setStoresIDsInURLs:[_value boolValue]];
160 - (id)_jsprop_storesIDsInURLs {
161 return [self storesIDsInURLs] ? nYes : nNo;
164 @end /* WOSession(JSProperties) */