]> err.no Git - sope/blob - sope-appserver/SoOFS/OFSBaseObject.h
added strict OSX bundle dependencies
[sope] / sope-appserver / SoOFS / OFSBaseObject.h
1 /*
2   Copyright (C) 2002-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #ifndef __OFS_OFSBaseObject_H__
23 #define __OFS_OFSBaseObject_H__
24
25 #import <Foundation/NSObject.h>
26 #include <NGExtensions/NGFileManager.h>
27
28 /*
29   OFSBaseObject
30   
31   This is the base class for OFS objects. Every OFS object has at least
32   - a name
33   - a container (not retained !)
34   - a filemanager
35   - a storage path (relative to the filemanager)
36   
37   Note that filemanager and storage path should in no case be made available
38   to the web for security reasons !
39   
40   The name is tracked in the child since it is required of URL construction
41   (to know the URI name the child was found with).
42 */
43
44 @class NSString, NSException, NSClassDescription;
45 @class EOGlobalID;
46 @class WOContext;
47 @class SoClass;
48 @class OFSFactoryContext;
49
50 @interface OFSBaseObject : NSObject
51 {
52   id<NSObject,NGFileManager> fileManager;
53   NSString *storagePath;
54   SoClass  *soClass;
55   NSString *name;
56   id       container;
57 }
58
59 /* accessors */
60
61 - (id<NSObject,NGFileManager>)fileManager;
62 - (NSString *)storagePath;
63 - (EOGlobalID *)globalID;
64
65 - (BOOL)isCollection;
66 - (BOOL)hasChildren;
67 - (BOOL)doesExist;
68
69 /* containment */
70
71 - (id)container;
72 - (NSString *)nameInContainer;
73 - (void)setContainer:(id)_container andName:(NSString *)_name;
74 - (NSException *)takeStorageInfoFromContext:(OFSFactoryContext *)_ctx;
75
76 /* operations */
77
78 - (void)detachFromContainer;
79 - (BOOL)isAttachedToContainer;
80
81 - (id)DELETEAction:(id)_ctx;
82
83 /* instantiation */
84
85 - (id)awakeFromFetchInContext:(OFSFactoryContext *)_ctx;
86 - (id)awakeFromInsertionInContext:(OFSFactoryContext *)_ctx;
87
88 /* WebDAV */
89
90 - (NSString *)davDisplayName; // returns NSFileSubject or -name
91
92 /* key validations */
93
94 - (NSException *)validateForDelete;
95 - (NSException *)validateForInsert;
96 - (NSException *)validateForUpdate;
97 - (NSException *)validateForSave;
98
99 /* security */
100
101 - (NSString *)ownerInContext:(id)_ctx;
102 - (id)authenticatorInContext:(id)_ctx;
103
104 /* version control */
105
106 - (BOOL)isCvsControlled;
107 - (BOOL)isSvnControlled;
108
109 @end
110
111 #endif /* __OFS_OFSBaseObject_H__ */