2 Copyright (C) 2002-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 __OFS_OFSFolder_H__
23 #define __OFS_OFSFolder_H__
25 #include <SoOFS/OFSBaseObject.h>
30 OFSFolder's map to filesystem directories and are "collections" of other
31 OFS objects. OFSFolder's can also store custom properties in a special file
34 How collections are loaded
35 ==========================
36 When an OFSFolder is loaded, it doesn't instantiate any of it child objects
37 (since this would result in a cascade sucking in all the filesystem below.
38 As long as OFSFolder isn't sent -allObjects, it isn't fully loaded, instead
39 the objects are stored in the children hash and loaded on demand when the key
42 How child objects are instantiated
43 ==================================
44 An OFSFolder also acts as a factory for it's children since it needs to
45 unarchive them into memory. That is, it's the task of the folder to select
46 an appropriate class for the in-memory representation of a childresource.
50 The folder can manage the owner of the children and manages it's own
51 owner. The own owner is stored in the SoOwner field of the propertylist
52 and the children in the SoChildOwners field (which has to be a dictionary).
55 @class NSArray, NSDictionary, NSMutableDictionary, NSString, NSEnumerator;
56 @class WOResourceManager;
58 @class OFSFactoryContext, OFSFactoryRegistry;
60 @interface OFSFolder : OFSBaseObject
64 NSMutableDictionary *children;
70 BOOL checkedVersionSpecials:1;
73 WOResourceManager *resourceManager;
76 /* mimic a dictionary */
79 - (NSArray *)allValues;
80 - (BOOL)hasKey:(NSString *)_key;
81 - (id)objectForKey:(NSString *)_key;
82 - (NSEnumerator *)keyEnumerator;
83 - (NSEnumerator *)objectEnumerator;
85 - (BOOL)isValidKey:(NSString *)_key;
91 - (NSString *)storagePathForChildKey:(NSString *)_name;
93 - (id)restorationFactoryForContext:(OFSFactoryContext *)_ctx;
94 - (id)creationFactoryForContext:(OFSFactoryContext *)_ctx;
96 - (NSException *)reload;
100 - (NSString *)defaultMethodNameInContext:(id)_ctx;
102 - (id)GETAction:(id)_ctx;
103 - (id)PUTAction:(id)_ctx;
104 - (id)MKCOLAction:(id)_ctx;
105 - (id)DELETEAction:(id)_ctx;
109 - (NSString *)ownerInContext:(id)_ctx;
110 - (NSString *)ownerOfChild:(id)_child inContext:(id)_ctx;
114 - (WOResourceManager *)resourceManagerInContext:(id)_ctx;
118 - (OFSFactoryRegistry *)factoryRegistry;
119 - (id)restorationFactoryForContext:(OFSFactoryContext *)_ctx;
120 - (id)creationFactoryForContext:(OFSFactoryContext *)_ctx;
124 #endif /* __OFS_OFSFolder_H__ */