]> err.no Git - sope/blob - sope-appserver/NGObjWeb/WebDAV/README
Add libxml2-dev to libsope-xml4.7-dev deps
[sope] / sope-appserver / NGObjWeb / WebDAV / README
1 NGObjWeb WebDAV Implementation for SoObjects
2 ============================================
3
4 This subproject contains a WebDAV implementation for SOPE which is based on top
5 of the SoObjectRequestHandler.
6
7 The central point where processing starts once the request is received by the
8 handler, is the
9
10   SoObjectWebDAVDispatcher
11
12 class. This class knows about the various WebDAV HTTP methods and takes
13 appropriate actions by calling specified methods on either the SoObject which
14 is targetted by the URL or on one of the maintenance objects. Eg WebDAV 
15 locking and notification is handled by the
16
17   SoDAVLockManager
18   SoSubscriptionManager
19
20 classes, so the targetted object itself doesn't need to concern itself about
21 that.
22
23 Once a WebDAV action has been performed, the
24
25   SoWebDAVRenderer
26
27 class is used to turn the result value of the HTTP method in a suitable WebDAV
28 XML representation. To support non basic XML properties there is also a helper
29 class
30
31   SoWebDAVValue
32
33
34 PROPFIND/SEARCH Queries
35 =======================
36
37 The payload of both, WebDAV PROPFIND and SEARCH methods are represented as a
38 regular EOControl EOFetchSpecification. The fetchspec is annotated with various
39 hints to add additional WebDAV information. This includes the required depth
40 of the query as well as the properties being requested.
41
42 In case a SEARCH query is decoded, a regular EOQualifier/EOSortOrdering is
43 used for representing that query.
44
45 To perform a query, the layer will call:
46
47   - (id)performWebDAVQuery:(EOFetchSpecification *)_fetchSpecification
48     inContext:(WOContext *)_context;
49
50 on the target object.
51
52 Note that there are default implementations for queries based on KVC
53 (see below)
54
55
56 A special feature is that an object can make the WebDAV layer "remap" the 
57 public WebDAV property names to internal names, for example KVC keys. To do so
58 the object needs to implement
59
60   - (NSDictionary *)davAttributeMapInContext:(WOContext *)_context;
61
62 For example this can be used to map the "davDisplayName" to the "title" of a
63 given object.
64
65
66 Default Query Implementation
67 ============================
68
69 The default implementation is done in the NSObject(SoDAVQuery) category which
70 requires an NSObject conforming to the "So" model of doing things. A query is
71 initiated by
72
73   - (id)performWebDAVQuery:(EOFetchSpecification *)_fetchSpecification
74     inContext:(WOContext *)_context;
75
76 The method then splits the operation based on the depth into one of those
77 methods for 'self'(0) or 'deep'(infinity) queries:
78
79   - (id)davQueryOnSelf:(EOFetchSpecification *)_fs inContext:(WOContext *)_ctx;
80   - (id)performWebDAVDeepQuery:((EOFetchSpecification *)_fs 
81     inContext:(WOContext *)_ctx;
82
83 For 'flat'(1) queries it uses a datasource to fetch the content and the
84 -davQueryOnSelf:inContext: method to retrieve info on the object itself
85 (required by WebDAV, but buggy in some implementations, eg WebFolders). The
86 datasource is determined by
87
88   - (EODataSource *)contentDataSourceInContext:(WOContext *)_context;
89
90 Per default this returns the SoObjectDataSource which performs KVC / EOControl
91 based filtering and sorting.
92
93 Besides those standard queries, the default implementations also deals with
94 bulk queries as generated by either BPROPFIND or by the _range_ URI hack for
95 ZideLook. Those will call
96
97   - (id)performWebDAVBulkQuery:(EOFetchSpecification *)_fetchSpec
98     inContext:(WOContext *)_context;
99
100 Its discouraged to use bulk queries, since they are non-standard.
101
102
103 In case no specific property names are requested (<allprop/> or a propfind
104 without a body), the toolkit is going to query the available property set
105 using:
106
107   - (NSArray *)defaultWebDAVPropertyNamesInContext:(WOContext *)_context;
108   TODO: check for soClass slots
109
110 Note that this is just the set used for allprop queries, you can still support
111 more properties than that (not sure whether that would be valid WebDAV though).
112
113
114
115 Special Features
116 ================
117
118 The dispatcher supports various Exchange WebDAV enhancements, eg bulk queries
119 like BPROPFIND.
120
121 Further it supports so called "ZideStore range" queries which are treated
122 similiar to BPROPFIND and catches URLs starting with _range.
123
124
125 TODO
126 ====
127
128 REPORT
129 - find a good way to represent arbitary reports
130
131 extended ops: ACL, CHECKOUT etc
132
133 - check for default property names (allprop) in SoClass slots
134
135 - add support for DAV:supportedlock property
136
137 - add support for property level 404 status
138   - currently we just deliver empty tags or none (if the brief header is set)
139
140 - add Apache2 like typing namespaces on DAV:creationdate and 
141   DAV:getlastmodified
142
143 Notes
144 =====
145
146 DASL:
147   ---snip---
148   <?xml version="1.0" encoding="utf-8" ?>
149   <D:searchrequest xmlns:D="DAV:">
150     <D:basicsearch>
151       <D:select><D:allprop/></D:select>
152       <D:from>
153         <D:scope>
154           <D:href>/evo/dav/helge/Private.plist/</D:href>
155           <D:depth>infinity</D:depth>
156         </D:scope>
157       </D:from>
158       <D:where>
159         <D:eq>
160           <D:prop><D:sn/></D:prop>
161           <D:literal>Mueller</D:literal>
162         </D:eq>
163       </D:where>
164     </D:basicsearch>
165   </D:searchrequest>
166   ---snap---
167   SQL-search queries use
168     <D:searchrequest><D:sql>
169   instead of
170     <D:searchrequest><D:basicsearch>