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 __WebDAV_SoObject_SoDAV_H__
23 #define __WebDAV_SoObject_SoDAV_H__
25 #import <Foundation/NSObject.h>
30 This informal protocol contains methods that can be implemented by
31 SoObject's supporting WebDAV authoring. For most methods a default
32 implementation is provided.
35 @class NSString, NSDate, NSEnumerator, NSException, NSDictionary, NSArray;
36 @class EOFetchSpecification, EOGlobalID, EODataSource;
37 @class SoDAVLockManager;
39 @interface NSObject(SoObjectSoDAV)
42 This method is invoked on SoObjects if a WebDAV PROPFIND or SEARCH
45 - (id)performWebDAVQuery:(EOFetchSpecification *)_fs inContext:(id)_ctx;
46 - (id)performWebDAVBulkQuery:(EOFetchSpecification *)_fs inContext:(id)_ctx;
47 - (NSEnumerator *)davChildKeysInContext:(id)_ctx;
48 - (EODataSource *)contentDataSourceInContext:(id)_ctx;
49 - (id)davQueryOnSelf:(EOFetchSpecification *)_fs inContext:(id)_ctx;
51 - (NSArray *)defaultWebDAVPropertyNamesInContext:(id)_ctx;
54 Editing the object properties (PROPPATCH)
56 - (NSException *)davSetProperties:(NSDictionary *)_setProps
57 removePropertiesNamed:(NSArray *)_delProps
59 - (id)davCreateObject:(NSString *)_name
60 properties:(NSDictionary *)_props
62 - (NSException *)davCreateCollection:(NSString *)_name inContext:(id)_ctx;
64 - (NSException *)davMoveToTargetObject:(id)_target newName:(NSString *)_name
66 - (NSException *)davCopyToTargetObject:(id)_target newName:(NSString *)_name
70 Use the attribute map to map WebDAV propery names to KVC keys for the
71 object. If the object returns a map, the SoObjectWebDAVDispatcher will
72 properly justify the EOFetchSpecification for queries.
74 - (id)davAttributeMapInContext:(id)_ctx;
75 + (id)defaultWebDAVAttributeMap;
78 WebDAV supports locking/unlocking of resources, you can override the
79 default locking mechanism used by implementing this method.
81 - (SoDAVLockManager *)davLockManagerInContext:(id)_ctx;
84 /* some DAV properties are mapped to some keys by default */
86 - (BOOL)davIsCollection; // tries -isCollection and NSFileType, otherwise NO
87 - (BOOL)davIsFolder; // same as -davIsCollection
88 - (BOOL)davHasSubFolders; // same as -davIsFolder
89 - (BOOL)davIsHidden; // returns NO
90 - (BOOL)davIsExecutable; // returns NO
92 - (id)davUid; // tries -globalID, otherwise same as -davURL
94 - (id)davURL; // tries -baseURLInContext:, -baseURL otherwise nil
95 - (id)davContentLength; // tries NSFileSize, -contentLength, otherwise 0
96 - (NSString *)davContentType;
98 - (NSDate *)davLastModified; // tries NSFileModificationDate, otherwise now
99 // tries NSFileCreationDate, NSFileModificationDate, otherwise nil
100 - (NSDate *)davCreationDate;
102 // tries -displayName, NSFileSubject,NSFileName,NSFilePath, -path otherwise nil
103 - (NSString *)davDisplayName;
104 - (NSString *)davResourceType; // uses -davIsCollection
106 // uses -davIsCollection (urn:content-class:folder or urn:content-class:item)
107 - (NSString *)davContentClass;
110 - (BOOL)davDenySubFolders;
111 - (unsigned int)davChildCount;
112 - (unsigned int)davObjectCount;
113 - (unsigned int)davVisibleCount;
117 #endif /* __WebDAV_SoObject_SoDAV_H__ */