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