2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
22 #ifndef __SoObjects_SoObject_H__
23 #define __SoObjects_SoObject_H__
25 #import <Foundation/NSObject.h>
28 This mostly defines a new KVC interface on NSObject. The major difference
29 to KVC is, that KVC calls method keys while SoObjectLookup returns an
31 It also introduces a new "class" hierachy used for "web" methods and classes
32 that basically mirrors the Python object system (where ivars and methods are
36 @class NSString, NSException, NSClassDescription, NSArray;
37 @class SoClass, SoClassSecurityInfo;
39 @interface NSObject(SoObject)
45 + (SoClassSecurityInfo *)soClassSecurityInfo;
46 - (NSClassDescription *)soClassDescription;
50 - (BOOL)hasName:(NSString *)_key inContext:(id)_ctx;
51 - (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag;
52 - (NSException *)validateName:(NSString *)_key inContext:(id)_ctx;
58 - (id)callOnObject:(id)_client inContext:(id)_ctx;
59 - (NSString *)defaultMethodNameInContext:(id)_ctx;
60 - (id)lookupDefaultMethod;
62 /* binding (returns self by default [unbound objects]) */
64 - (id)bindToObject:(id)_object inContext:(id)_ctx;
68 - (NSString *)ownerInContext:(id)_ctx;
69 - (id)authenticatorInContext:(id)_ctx;
74 - (void)detachFromContainer;
75 - (NSString *)nameInContainer;
76 - (NSArray *)objectContainmentStack;
77 - (NSArray *)pathArrayToSoObject;
78 - (NSArray *)reversedPathArrayToSoObject;
80 - (NSString *)baseURLInContext:(id)_ctx;
81 - (NSString *)rootURLInContext:(id)_ctx;
85 @interface NSObject(SoObjectLookup)
87 /* your object can override this methods to use specialized lookup */
89 - (id)traverseKey:(NSString *)_key inContext:(id)_ctx;
91 /* traversal implementation */
93 - (id)handleValidationError:(NSException *)_error
94 duringTraveralOfKey:(NSString *)_key
96 - (id)traverseKey:(NSString *)_name
98 error:(NSException **)_error
99 acquire:(BOOL)_acquire;
101 - (id)traversePathArray:(NSArray *)traversalPath
103 error:(NSException **)_error
104 acquire:(BOOL)_acquire;
107 The following is a convenience method, it creates a context for
108 traversal and returns the error as the result - the right thing
109 for all "custom" lookups.
111 - (id)traversePath:(id)_tp acquire:(BOOL)_acquire;
112 - (id)traversePathArray:(NSArray *)_tp acquire:(BOOL)_acquire;
116 #endif /* __SoObjects_SoObject_H__ */