]> err.no Git - sope/blob - sope-appserver/NGObjWeb/WOComponent+JS.m
improved SOPE security exceptions
[sope] / sope-appserver / NGObjWeb / WOComponent+JS.m
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include "common.h"
24 #include <NGObjWeb/NGObjWeb.h>
25
26 /*
27   WOComponent JavaScript object
28
29   Properties
30
31     String      sessionID
32     String      name
33     String      path
34     String      baseURL
35     Object      context
36     Object      session
37     Object      application
38     WOComponent parent
39     bool        hasSession
40     bool        cachingEnabled
41     bool        isEventLoggingEnabled
42     bool        isStateless
43     bool        synchronizesVariablesWithBindings
44   
45   Methods
46
47     reset()    
48     WOComponent     pageWithName(name)
49     WOElement       templateWithName(name)
50     Object          performParentAction(name)
51     bool            canGetValueForBinding(name)
52     bool            canSetValueForBinding(name)
53                     setValueForBinding(value,name)
54     Object          valueForBinding(name)
55     bool            hasBinding(name)
56                     print(string[,...string])
57     ResourceManager getResourceManager()
58 */
59
60 static NSNumber *nYes = nil;
61 static NSNumber *nNo  = nil;
62
63 #define ENSURE_BOOLNUMS {\
64   if (nYes == nil) nYes = [[NSNumber alloc] initWithBool:YES];\
65   if (nNo  == nil) nNo  = [[NSNumber alloc] initWithBool:NO];\
66 }
67
68 @implementation WOComponent(JSKVC)
69
70 #if 1
71 - (void)takeValue:(id)_value forJSPropertyNamed:(NSString *)_key {
72   [self takeValue:_value forKey:_key];
73 }
74 - (id)valueForJSPropertyNamed:(NSString *)_key {
75   return [self valueForKey:_key];
76 }
77 #endif
78
79 @end /* WOComponent(JSKVC) */