aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/webdav/resources.texi
blob: b9b3869fa893cb3ff7ba3c32474ae44286839a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@node WebDAV Resources
@section Resources

@deftp {GOOPS class} <resource>
Base type for all WebDAV resources.

The base class shouldn't be directly instanciated.

    @defun resource? x
    Is the given object a <resource>, or decendant?
    @end defun
@end deftp

@deftp {GOOPS method} name resource
The name of a resource is the local part of a href.
@end deftp

@deftp {GOOPS method} children resource
All direct children of a resource, as a list.
@end deftp

@defun add-child! parent child [#:overwrite?] [#:collection?=(is-collection? child)]
Adds a resource as a child of another resource.

Before adding the resource to the parents child set,
@code{(setup-new-resource! child parent)} is called. If
@var{collection?} is true, then
@code{(setup-new-collection! child parent)} is also called.

If @var{overwrite?} is present, then the parent will be checked for a
child which already has that name, and take action accordingly.
It will return one of: @code{'replaced} if a resource already existed
with that name, but it has been replaced, @code{'collision}, if the
old one was kept, and @code{'created} if the new resource was added
without collisions.

If @var{overwrite?} is absent then the method always returns @var{'created}.
@end defun

@defun add-resource! resource name content
Creates a new resource with the given name, and make it a child of
@var{self}. Setting its initial content to @var{content}.

Calls @code{add-resource!}, so the same book-keeping procedures are called.
@c TODO Document throw
@c TODO Document return
@end defun

@defun add-collection! resource name
Similar to @code{add-resource!} but the created resource is instead a collection.
@end defun

@deftp {GOOPS method} setup-new-resource! (self <resource>) (parent <resource>)
Book-keeping procedure called by @code{add-resource!} on @emph{all}
added resources.

Base implementation in a no-op.
@end deftp

@deftp {GOOPS method} setup-new-collection! (self <resource>) (parent <resource>)
Book-keeping procedure called by @code{add-resource!} if
@var{collection?} is true.

Base implementation is a no-op.
@end deftp

@deftp {GOOPS method} is-collection? resource
Is the given resource a collection.

The base implementation simply checks if the resource has any children.
@end deftp

@deftp {GOOPS method} content resource
@deftpx {GOOPS method} set-content! resource content
Get and set the content of a given resource. @var{content}s type can
be anything that the given resource type accepts. Overrides of this
procedure should preferably save its contents properly.
@end deftp

@c 

@defun get-property resource xml-tag
@defunx get-live-property resource xml-tag
@defunx get-dead-property resource xml-tag
@end defun


@defun set-property resource xml-el
@defunx set-property! resource xml-el
@defunx set-dead-property resource xml-el
@defunx set-dead-property! resource xml-el
@defunx set-live-property resource xml-el
@defunx set-live-property! resource xml-el
@end defun


@defun remove-property resource xml-tag
@defunx remove-property! resource xml-tag
@defunx remove-dead-property resource xml-tag
@defunx remove-dead-property! resource xml-tag
@defunx remove-live-property resource xml-tag
@defunx remove-live-property! resource xml-tag
@end defun

@c 

@deftp {GOOPS method} copy-resource (resource <resource>) include-children? [name]
Create a new resource which looks as similar as possible to the given
resource. The new resource will have the same (GOOPS) class as the
source, displayname, contentlanguage and all dead properties are
transfered, other live properties are currently not explicitly
transfered (but probably still transfered implicitly).

The new resources name is @var{name} if given, and the name of the
original resource otherwise.

If @var{include-children?} is true then a deep copy is performed,
otherwise no children are copied, and the resulting resource will be a
leaf node.

Content is copied verbatim.

@b{NOTE} currently no helper method is called, which means that extra
resources held by the resource object can't be copied.
For example, FILE can't create a copy (but it also shouldn't do that
here, but rathen when the element is ``mounted'' into the tree).
@end deftp

@c 

@defun lookup-resource root-resource path
@end defun


@defun all-resources-under resource [prefix='()]
Returns the given resource, and all its children in a flat list.

Currently depth first, but that might change.
The root resource is however guaranteed to be first.
@end defun

@c 

@c TODO
           make-live-property
           live-property?
           property-getter

           property-setter-generator
           property-remover-generator

           prepare-update-properties

           live-properties
           dead-properties

           webdav-properties