zimbra_wsdl 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +70 -0
- data/Rakefile +10 -0
- data/doc/ZPL.txt +492 -0
- data/doc/soap-admin.txt +2507 -0
- data/doc/soap-calendar.txt +1357 -0
- data/doc/soap-context-extension.txt +58 -0
- data/doc/soap-im.txt +570 -0
- data/doc/soap-mobile.txt +136 -0
- data/doc/soap-right.txt +806 -0
- data/doc/soap-waitset.txt +347 -0
- data/doc/soap-wiki.txt +290 -0
- data/doc/soap.txt +3554 -0
- data/examples/savon.rb +27 -0
- data/examples/zimbra_authentication_example.rb +3 -0
- data/lib/zimbra.wsdl +1144 -0
- data/lib/zimbra_wsdl/version.rb +3 -0
- data/lib/zimbra_wsdl.rb +19 -0
- data/spec/minitest_helper.rb +8 -0
- data/spec/zimbra_wsdl_spec.rb +11 -0
- data/zimbra_wsdl.gemspec +19 -0
- metadata +87 -0
@@ -0,0 +1,347 @@
|
|
1
|
+
WaitSet: scalable mechanism for listening for changes to one or more accounts
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
Non-admin versions in the 'zimbraMail' Namespace:
|
5
|
+
-------------------------------------------------
|
6
|
+
<CreateWaitSetRequest>
|
7
|
+
<CreateWaitSetResponse>
|
8
|
+
<WaitSetRequest>
|
9
|
+
<WaitSetResponse>
|
10
|
+
<DestroyWaitSet>
|
11
|
+
<DestroyWaitSetResponse>
|
12
|
+
|
13
|
+
|
14
|
+
Admin versions in the 'zimbraAdmin' Namespace:
|
15
|
+
-------------------------------------------------
|
16
|
+
<AdminCreateWaitSetRequest>
|
17
|
+
<AdminCreateWaitSetResponse>
|
18
|
+
<AdminWaitSetRequest>
|
19
|
+
<AdminWaitSetResponse>
|
20
|
+
<AdminDestroyWaitSet>
|
21
|
+
<AdminDestroyWaitSetResponse>
|
22
|
+
<QueryWaitSetRequest>
|
23
|
+
<QueryWaitSetResponse>
|
24
|
+
|
25
|
+
note that the admin versions of the APIs are identical in any way,
|
26
|
+
except that they can be used to wait on non-owner accounts and can be
|
27
|
+
used to wait on "all accounts".
|
28
|
+
|
29
|
+
|
30
|
+
*************************************
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
INTEREST_TYPES: comma-separated list. Currently:
|
35
|
+
c: contacts
|
36
|
+
m: msgs (and subclasses)
|
37
|
+
a: appointments
|
38
|
+
all: all types (equiv to "c,m,a")
|
39
|
+
|
40
|
+
|
41
|
+
*************************************
|
42
|
+
CreateWaitSet/AdminCreateWaitSet: must be called once to initialize
|
43
|
+
the WaitSet and to set its "default interest types"
|
44
|
+
|
45
|
+
- Non-Admin requests may only specify their own account ID.
|
46
|
+
|
47
|
+
- Non-Admin accounts are restricted to a max of 5 (default,
|
48
|
+
overridable via LocalConfig) WaitSets. Creating more than the max
|
49
|
+
will cause the least-recently-used WaitSet to be destroyed
|
50
|
+
|
51
|
+
- If "allAccounts" is set, then all mailboxes on the system will be
|
52
|
+
listened to, including any mailboxes which are created on the system
|
53
|
+
while the WaitSet is in existence. Additionally:
|
54
|
+
-- <add>, <remove> and <update> tags are IGNORED
|
55
|
+
-- The requesting authtoken must be an admin token
|
56
|
+
|
57
|
+
- AllAccounts WaitSets are *semi-persistent*, that is, even if the
|
58
|
+
server restarts, it is OK to call <WaitSetRequest> passing in your
|
59
|
+
previous sequence number. The server will attempt to resynchronize
|
60
|
+
the waitset using the sequence number you provide (the server's
|
61
|
+
ability to do this is limited by the RedoLogs that are available)
|
62
|
+
================
|
63
|
+
<[Admin]CreateWaitSetRequest defTypes="DEFAULT INTEREST_TYPES" [allAccounts=1]>
|
64
|
+
[ <add>
|
65
|
+
[<a id="ACCTID" [token="lastKnownSyncToken"] [types="if_not_default"]/>]+
|
66
|
+
</add> ]
|
67
|
+
</[Admin]CreateWaitSetRequest>
|
68
|
+
|
69
|
+
<[Admin]CreateWaitSetResponse waitSet="setId" defTypes="types" seq="0">
|
70
|
+
[ <error id="AccountId" t="ERROR_CODE"/>]*
|
71
|
+
</[Admin]CreateWaitSetResponse>
|
72
|
+
|
73
|
+
|
74
|
+
ERROR_CODEs:
|
75
|
+
// RUNTIME errors:
|
76
|
+
MAILBOX_DELETED: the mailbox has been deleted, it is no longer in the waitset
|
77
|
+
|
78
|
+
// ADD errors:
|
79
|
+
ALREADY_IN_SET_DURING_ADD: the account was not added, it was already there
|
80
|
+
ERROR_LOADING_MAILBOX: exception while trying to fetch the mailbox, not added
|
81
|
+
MAINTENANCE_MODE: mailbox currently in Maintenance Mode. Try to add it again later.
|
82
|
+
NO_SUCH_ACCOUNT: unknown account, not added
|
83
|
+
WRONG_HOST_FOR_ACCOUNT: that account's mailbox is on another host. Add it there.
|
84
|
+
|
85
|
+
// REMOVE/UPDATE errors
|
86
|
+
NOT_IN_SET_DURING_REMOVE
|
87
|
+
NOT_IN_SET_DURING_UPDATE
|
88
|
+
|
89
|
+
|
90
|
+
***IMPORTANT: Note that the seq number is **NOT** guaranteed to be an
|
91
|
+
integer. Clients MUST treat this value as an opaque string.***
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
************************************
|
97
|
+
WaitSetRequest/AdminWaitSetRequest: optionally modifies the wait set
|
98
|
+
and checks for any notifications. If block=1 and there are no
|
99
|
+
notificatins, then this API will BLOCK until there is data.
|
100
|
+
|
101
|
+
Client should always set 'seq' to be the highest known value it has
|
102
|
+
received from the server. The server will use this information to
|
103
|
+
retransmit lost data.
|
104
|
+
|
105
|
+
If the client sends a last known sync token then the notification is
|
106
|
+
calculated by comparing the accounts current token with the client's
|
107
|
+
last known.
|
108
|
+
|
109
|
+
If the client does not send a last known sync token, then notification
|
110
|
+
is based on change since last Wait (or change since <add> if this
|
111
|
+
is the first time Wait has been called with the account)
|
112
|
+
|
113
|
+
The client may specifiy a custom timeout-length for their request if
|
114
|
+
they know something about the particular underlying network. The
|
115
|
+
server may or may not honor this request (depending on server
|
116
|
+
configured max/min values). The server will allow a wider range of
|
117
|
+
requested timeouts from admin auth tokens. See LocalConfig values:
|
118
|
+
zimbra_waitset_default_request_timeout,
|
119
|
+
zimbra_waitset_min_request_timeout,
|
120
|
+
zimbra_waitset_max_request_timeout,
|
121
|
+
zimbra_admin_waitset_default_request_timeout,
|
122
|
+
zimbra_admin_waitset_min_request_timeout, and
|
123
|
+
zimbra_admin_waitset_max_request_timeout
|
124
|
+
|
125
|
+
|
126
|
+
================
|
127
|
+
<[Admin]WaitSetRequest waitSet="setId" defTypes="DEFAULT INTEREST TYPES"
|
128
|
+
seq="highestSeqKnown" [block="1"] [timeout="timeout"]>
|
129
|
+
[ <add>
|
130
|
+
[<a id="ACCTID" [token="lastKnownSyncToken"] [types]/>]+
|
131
|
+
</add> ]
|
132
|
+
[ <update>
|
133
|
+
[<a id="ACCTID" [token="lastKnownSyncToken"] [types]/>]+
|
134
|
+
</update> ]
|
135
|
+
[ <remove>
|
136
|
+
[<a id="ACCTID"/>]+
|
137
|
+
</remove> ]
|
138
|
+
</[Admin]WaitSetRequest>
|
139
|
+
|
140
|
+
<[Admin]WaitSetResponse waitSet="setId" [seq="seqNo" OR canceled="1"]>
|
141
|
+
[ <n id="ACCTID"/>]*
|
142
|
+
[ <error id="AccountId" t="ERROR_CODE"/>]*
|
143
|
+
</[Admin]WaitSetResponse>
|
144
|
+
|
145
|
+
If the specified wait set does not exist, the server will throw an
|
146
|
+
admin.NO_SUCH_WAITSET exception.
|
147
|
+
|
148
|
+
NOTE: an empty response to a blocking request *is* possible: it would
|
149
|
+
happen if the server timed-out the waiting. The server does this
|
150
|
+
occasionally just so that requests don't get "stuck". The client
|
151
|
+
should re-submit the original request if this happens.
|
152
|
+
|
153
|
+
If a second WaitMultiple request arrives at the server while one is
|
154
|
+
already waiting, the first request will be immediately completed and
|
155
|
+
will return with the "canceled" flag set.
|
156
|
+
|
157
|
+
ERROR_CODEs:
|
158
|
+
// RUNTIME errors:
|
159
|
+
MAILBOX_DELETED: the mailbox has been deleted, it is no longer in the waitset
|
160
|
+
|
161
|
+
// ADD errors:
|
162
|
+
ALREADY_IN_SET_DURING_ADD: the account was not added, it was already there
|
163
|
+
ERROR_LOADING_MAILBOX: exception while trying to fetch the mailbox, not added
|
164
|
+
MAINTENANCE_MODE: mailbox currently in Maintenance Mode. Try to add it again later.
|
165
|
+
NO_SUCH_ACCOUNT: unknown account, not added
|
166
|
+
WRONG_HOST_FOR_ACCOUNT: that account's mailbox is on another host. Add it there.
|
167
|
+
|
168
|
+
// REMOVE/UPDATE errors
|
169
|
+
NOT_IN_SET_DURING_REMOVE
|
170
|
+
NOT_IN_SET_DURING_UPDATE
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
*************************************
|
176
|
+
DestroyWaitSet/AdminDestroyWaitSet: Use this to close out the wait
|
177
|
+
set. Note that the server will automatically time out a wait set if
|
178
|
+
there is no reference to it for (default of) 20 minutes.
|
179
|
+
*************************************
|
180
|
+
<[Admin]DestroyWaitSetRequest waitSet="setId"/>
|
181
|
+
|
182
|
+
<[Admin]DestroyWaitSetResponse waitSet="setId"/>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
**********************************************************************
|
188
|
+
There are three basic use cases for WaitSets:
|
189
|
+
**********************************************************************
|
190
|
+
1) wait on a single account:
|
191
|
+
<CreateWaitSetRequest defTypes="TYPES"/>
|
192
|
+
<add>
|
193
|
+
<a id="ACCTID"/>
|
194
|
+
</add>
|
195
|
+
</CreateWaitSetRequest>
|
196
|
+
|
197
|
+
<WaitSetsRequest waitSet="id" seq="seqno">
|
198
|
+
<update>
|
199
|
+
<a id="ACCTID" token="lastKnownSyncToken"/>
|
200
|
+
</update>
|
201
|
+
</WaitSetRequest>
|
202
|
+
|
203
|
+
<DestroyWaitSetRequest waitSet="id"/>
|
204
|
+
|
205
|
+
|
206
|
+
2) Wait on many accounts (admin-only -- Remember to use the
|
207
|
+
zimbraAdmin namespace):
|
208
|
+
<AdminCreateWaitSetRequest defTypes="TYPES"/>
|
209
|
+
<add>
|
210
|
+
<a id="ACCTID" [token="lastKnownSyncToken"]/>
|
211
|
+
<a id="ACCTID" [token="lastKnownSyncToken"]/>
|
212
|
+
</add>
|
213
|
+
</AdminCreateWaitSetRequest>
|
214
|
+
|
215
|
+
<AdminWaitSetRequest defTypes="TYPES" waitSet="id" seq="seqno">
|
216
|
+
<update>
|
217
|
+
<a id="ACCTID" [token="lastKnownSyncToken"]/>
|
218
|
+
</update>
|
219
|
+
<remove>
|
220
|
+
<a id="ACCTID"/>
|
221
|
+
</update>
|
222
|
+
<add>
|
223
|
+
<a id="ACCTID" [token="lastKnownSyncToken"]/>
|
224
|
+
</update>
|
225
|
+
</AdminWaitSetRequest>
|
226
|
+
|
227
|
+
<AdminDestroyWaitSetRequest waitSet="id"/>
|
228
|
+
|
229
|
+
|
230
|
+
3) Wait on ALL accounts (admin-only):
|
231
|
+
<AdminCreateWaitSetRequest defTypes="TYPES" allAccounts="1"/>
|
232
|
+
|
233
|
+
<AdminWaitSetRequest waitSet="id" seq="seqno" defTypes="TYPES"/>
|
234
|
+
...
|
235
|
+
// SERVER RESTARTS!
|
236
|
+
...
|
237
|
+
<AdminWaitSetRequest waitSet="id" seq="seqno" defTypes="TYPES"/> // server will re-sync using RedoLogs
|
238
|
+
|
239
|
+
<AdminDestroyWaitSetRequest waitSet="id"/>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
**********************************************************************
|
245
|
+
A Detailed Example:
|
246
|
+
**********************************************************************
|
247
|
+
<AdminCreateWaitSetRequest defTypes="c">
|
248
|
+
<add>
|
249
|
+
<a id="a1"/>
|
250
|
+
</add>
|
251
|
+
</AdminCreateWaitSetRequest>
|
252
|
+
<!-- a1 receives a contact update -->
|
253
|
+
<AdminCreateWaitSetResponse waitSet="foo" defTypes="c" seq="0"/>
|
254
|
+
|
255
|
+
<!--client syncs to a1 state AFTER added to WaitSet (not using sync token) -->
|
256
|
+
<!-- a3 receives a contact update (token goes to 100)-->
|
257
|
+
<!--client syncs to a3 BEFORE adding to WaitSet (client has token 100) -->
|
258
|
+
|
259
|
+
<AdminWaitSetRequest waitSet="foo" seq="0" block="1">
|
260
|
+
<add>
|
261
|
+
<a id="a3" token="100"/>
|
262
|
+
</add>
|
263
|
+
</AdminWaitSetRequest>
|
264
|
+
<!-- Will return *immediately* b/c a1 has changed since the <add> -->
|
265
|
+
<AdminWaitSetResponse waitSet="foo" seq="1">
|
266
|
+
<n id="a1"/>
|
267
|
+
</AdminWaitSetResponse>
|
268
|
+
|
269
|
+
<!-- At this point, client *must* sync with a1, even though the a1 update might have
|
270
|
+
happened before we synched with a1 there is no way to know. a3 is not notified
|
271
|
+
and does not have to sync, because it is using sync tokens. -->
|
272
|
+
|
273
|
+
<AdminWaitSetRequest waitSet="foo" seq="1" block="1">
|
274
|
+
<add>
|
275
|
+
<a id="a2"/>
|
276
|
+
</add>
|
277
|
+
</AdminWaitSetRequest>
|
278
|
+
<!-- the client must sync with a2 state AFTER setting a2 wait, however because
|
279
|
+
block="1" the wait will not return until some account has new data: therefore
|
280
|
+
the client MUST sync a2 using another thread here. The client cannot sync
|
281
|
+
before doing the <add> because of race conditions. If the client is not
|
282
|
+
multi-threaded, then it should issue the <add> as block="0" in this case -->
|
283
|
+
<!-- ...BLOCKS until... -->
|
284
|
+
<!-- a3 receives a contact update (sync token goes to 107) -->
|
285
|
+
<AdminWaitSetResponse waitSet="foo" seq="2">
|
286
|
+
<n id="a3"/>
|
287
|
+
</AdminWaitSetResponse>
|
288
|
+
|
289
|
+
<!-- client syncs to a3 -->
|
290
|
+
|
291
|
+
<AdminWaitSetRequest waitSet="foo" seq="2" block="1">
|
292
|
+
<update>
|
293
|
+
<a id="a3" token="107"/>
|
294
|
+
</update>
|
295
|
+
</AdminWaitSetRequest>
|
296
|
+
|
297
|
+
<!-- Client is up to date, server blocks until there is new data
|
298
|
+
on a1,a2 or a3 -->
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
*************************************
|
303
|
+
QueryWaitSet
|
304
|
+
This API dumps the internal state of all active waitsets. It is
|
305
|
+
intended for debugging use only and should not be used for
|
306
|
+
production uses. This API is not guaranteed to be stable between
|
307
|
+
releases in any way and might be removed without warning.
|
308
|
+
*************************************
|
309
|
+
|
310
|
+
<QueryWaitSetRequest waitset="WAITSETID">
|
311
|
+
|
312
|
+
<QueryWaitSetResponse>
|
313
|
+
|
314
|
+
SomeAccountsWaitSet:
|
315
|
+
----------------------
|
316
|
+
<QueryWaitSetResponse id="WAITSETID"
|
317
|
+
defTypes="DEFAULT_TYPES"
|
318
|
+
owner="WAITSET_OWNER_ACCOUNT_ID"
|
319
|
+
ld="LAST_ACCESS_DATE"
|
320
|
+
cbSeqNo="SEQNO_OF_CB"
|
321
|
+
currentSeqNo="CURRENT_SEQUENCE_NUMBER">
|
322
|
+
[<ready accounts="comma-separated list of account IDs"/>]?
|
323
|
+
[<session types="TYPES" account="ACCOUNT_ID">
|
324
|
+
[
|
325
|
+
<WaitSetSession interestMask="BITMASK" highestChangeId="MBOX_CHANGE_ID"
|
326
|
+
lastAccessTime="LAST_ACCESS_TIME"
|
327
|
+
creationTime="CREATION_TIME"/>
|
328
|
+
]?
|
329
|
+
</session>]*
|
330
|
+
</QueryWaitSetResponse>
|
331
|
+
|
332
|
+
|
333
|
+
AllAccountsWaitSet:
|
334
|
+
-------------------
|
335
|
+
<QueryWaitSetResponse id="WAITSETID"
|
336
|
+
defTypes="DEFAULT_TYPES"
|
337
|
+
owner="WAITSET_OWNER_ACCOUNT_ID"
|
338
|
+
ld="LAST_ACCESS_DATE"
|
339
|
+
nextSeqNo="NEXT_SEQNO"
|
340
|
+
cbSeqNo="CB_SEQNO"
|
341
|
+
currentSeqNo="CURRENT_SEQNO"
|
342
|
+
>
|
343
|
+
[<buffered>
|
344
|
+
[<commit aid="ACCOUNT_ID" cid="COMMIT_ID"/>]* // only during WS creation before first WaitSetRequest
|
345
|
+
]?
|
346
|
+
[<ready accounts="comma-separated list of account IDs"/>]?
|
347
|
+
</QueryWaitSetResponse>
|
data/doc/soap-wiki.txt
ADDED
@@ -0,0 +1,290 @@
|
|
1
|
+
//
|
2
|
+
// Notebook feature and WikiItem are deprecated as of 7.0.0. Briefcase
|
3
|
+
// feature and Document items are still supported and they can be used
|
4
|
+
// instead of Notebook.
|
5
|
+
//
|
6
|
+
// This set of API can be used to access private Notes, or public Wiki pages.
|
7
|
+
//
|
8
|
+
// Private Notes get stored in the mailbox of the requestor. The access to
|
9
|
+
// the private Notes will be determined by ACL of the folder the Notes are stored.
|
10
|
+
// By default Notes are accesible to the account holder only, thus private.
|
11
|
+
//
|
12
|
+
// Public Wiki pages are stored in a central location allocated to ZCS at the
|
13
|
+
// installation time. The access to the Wiki pages also follow the ACL on the
|
14
|
+
// folder the pages are stored.
|
15
|
+
//
|
16
|
+
// There are two types of public Wiki storage. There is a public wiki store,
|
17
|
+
// and there are optional per-domain wiki store. The public wiki store
|
18
|
+
// is open to all authenticated and unauthenticated users. The per-domain wiki
|
19
|
+
// store has rwid access granted to the domain users only.
|
20
|
+
//
|
21
|
+
|
22
|
+
|
23
|
+
// Create / Update
|
24
|
+
//
|
25
|
+
// A Document represents a file. A file can be created by uploading to FileUploadServlet.
|
26
|
+
// Or it can refer to an attachment of an existing message.
|
27
|
+
//
|
28
|
+
// Both Wiki and Documents are versioned. The server maintains the metadata
|
29
|
+
// of each version, such as by who and when the version was edited, and the
|
30
|
+
// fragment of each version.
|
31
|
+
//
|
32
|
+
// When updating an existing Document or Wiki, the client must supply the id
|
33
|
+
// of Document or Wiki, and the last known version of the document in
|
34
|
+
// 'ver' attribute. This is used to prevent blindly overwriting
|
35
|
+
// someone else's change made between the update. The update
|
36
|
+
// will succeed only when the last known version supplied by the client matches
|
37
|
+
// the current version of the item identified by item-id.
|
38
|
+
//
|
39
|
+
// Saving a new document, as opposed to adding a revision of existing document, should leave
|
40
|
+
// the id and ver fields empty in the request. Then the server checks and see if the named
|
41
|
+
// document already exists, if so returns an error.
|
42
|
+
//
|
43
|
+
// The request should contain either <upload> element or <msg> element, but not both.
|
44
|
+
// When <upload> is used, the document should be first uploaded to FileUploadServlet, and
|
45
|
+
// then use the upload-id from the FileUploadResponse.
|
46
|
+
// When <m> is used, the document is retrieved from an existing message in the mailbox,
|
47
|
+
// identified by the msg-id and part-id.
|
48
|
+
// The content of the document can be inlined in <content/> element.
|
49
|
+
// The content can come from another document / revision specified in <doc/> sub element.
|
50
|
+
<SaveDocumentRequest>
|
51
|
+
<doc [id="{item-id}" ver="{last-known-version}"] [name="{file-name}"] [ct="{content-type}"] [l="{folder-id}"] [desc="{description}"] [descEnabled="true|false"]>
|
52
|
+
[<upload id="{upload-id}"/>]
|
53
|
+
[<m id="{msg-id}" part="{part-id}"/>]
|
54
|
+
[<content>{inlined-document-content-string}</content>]
|
55
|
+
[<doc id="{item-id}" ver="{version-to-restore-to}"/>]
|
56
|
+
</doc>
|
57
|
+
</SaveDocumentRequest>
|
58
|
+
|
59
|
+
<SaveDocumentResponse>
|
60
|
+
<doc id="{item-id}" ver="{version}" name="{item-name}"/>
|
61
|
+
</SaveDocumentResponse>
|
62
|
+
|
63
|
+
//
|
64
|
+
// Example
|
65
|
+
//
|
66
|
+
// - Saving a new document
|
67
|
+
//
|
68
|
+
// REQUEST:
|
69
|
+
//
|
70
|
+
//<SaveDocumentRequest xmlns:ns0="urn:zimbraMail">
|
71
|
+
// <doc>
|
72
|
+
// <upload id="18baa043-394f-42ae-be8a-110b279cb696:cc2f2fdf-7957-4412-aa83-6433662ce5d0"/>
|
73
|
+
// </doc>
|
74
|
+
//</SaveDocumentRequest>
|
75
|
+
//
|
76
|
+
// RESPONSE:
|
77
|
+
//
|
78
|
+
//<SaveDocumentResponse xmlns:ns0="urn:zimbraMail">
|
79
|
+
// <doc ver="1" id="574" rest="http://localhost:7070/home/user1/Notebook/PICT0370.JPG"/>
|
80
|
+
//</SaveDocumentResponse>
|
81
|
+
//
|
82
|
+
//
|
83
|
+
// - Updating an existing document
|
84
|
+
//
|
85
|
+
// REQUEST:
|
86
|
+
//
|
87
|
+
//<SaveDocumentRequest xmlns:ns0="urn:zimbraMail">
|
88
|
+
// <doc ver="1" id="574" desc="rev 2.0">
|
89
|
+
// <upload id="18baa043-394f-42ae-be8a-110b279cb696:fcb572ce-2a81-4ad3-b55b-cb998c47b416"/>
|
90
|
+
// </doc>
|
91
|
+
//</SaveDocumentRequest>
|
92
|
+
//
|
93
|
+
// RESPONSE:
|
94
|
+
//
|
95
|
+
//<SaveDocumentResponse xmlns:ns0="urn:zimbraMail">
|
96
|
+
// <doc ver="2" id="574" rest="http://localhost:7070/home/user1/Notebook/PICT0370.JPG"/>
|
97
|
+
//</SaveDocumentResponse>
|
98
|
+
//
|
99
|
+
//
|
100
|
+
// A Wiki is a versioned HTML document.
|
101
|
+
// folder-id argument is valid when the new wiki document is being created,
|
102
|
+
// otherwise it's ignored, and the subsequent revision is stored in the same folder.
|
103
|
+
//
|
104
|
+
// When updating an existing Wiki page, both id and ver attributes must
|
105
|
+
// exist. 'id' attribute should contain the item id. 'ver' attribute should
|
106
|
+
// contain the last known version of the page. This is used for checking collision.
|
107
|
+
// If the version in the server does not match the supplied last known version,
|
108
|
+
// the server will throw an exception, indicating a collision happened
|
109
|
+
// while the page was being edited.
|
110
|
+
<SaveWikiRequest>
|
111
|
+
<w name="{wikiword}" [id="{item-id}" ver="{last-known-version}"] [l="{folder-id}"]> ... contents ... </w>
|
112
|
+
</SaveWikiRequest>
|
113
|
+
|
114
|
+
<SaveWikiResponse>
|
115
|
+
<w id="{item-id}" ver="{version}"/>
|
116
|
+
</SaveWikiResponse>
|
117
|
+
|
118
|
+
//
|
119
|
+
// Examples
|
120
|
+
//
|
121
|
+
// - Saving a new page
|
122
|
+
//
|
123
|
+
// REQUEST:
|
124
|
+
//
|
125
|
+
//<SaveWikiRequest xmlns:ns0="urn:zimbraMail">
|
126
|
+
// <w l="12" name="mypage">this is a test</w>
|
127
|
+
//</SaveWikiRequest>
|
128
|
+
//
|
129
|
+
// RESPONSE:
|
130
|
+
//
|
131
|
+
//<SaveWikiResponse xmlns:ns0="urn:zimbraMail">
|
132
|
+
// <w ver="1" id="575"/>
|
133
|
+
//</SaveWikiResponse>
|
134
|
+
//
|
135
|
+
// - Updating an existing page
|
136
|
+
//
|
137
|
+
// REQUEST:
|
138
|
+
//
|
139
|
+
//<SaveWikiRequest xmlns:ns0="urn:zimbraMail">
|
140
|
+
// <w l="12" ver="1" name="mypage" id="575">this is a second revision</w>
|
141
|
+
//</SaveWikiRequest>
|
142
|
+
//
|
143
|
+
|
144
|
+
// RESPONSE:
|
145
|
+
//<SaveWikiResponse xmlns:ns0="urn:zimbraMail">
|
146
|
+
// <w ver="2" id="575"/>
|
147
|
+
//</SaveWikiResponse>
|
148
|
+
//
|
149
|
+
//
|
150
|
+
// Search
|
151
|
+
// Documents and Wiki documents can be indexed.
|
152
|
+
// Use the existing Search API with "types" set to "wiki" or "document".
|
153
|
+
//
|
154
|
+
|
155
|
+
// Get
|
156
|
+
// through the rest URL:
|
157
|
+
// http://server/zimbra/user/[~]{account-name}/?id={item-id}
|
158
|
+
//
|
159
|
+
// through the SOAP API:
|
160
|
+
// the list of wiki words are managed by the server.
|
161
|
+
|
162
|
+
//
|
163
|
+
// GetWiki
|
164
|
+
// returns the latest version if version is omitted from the request.
|
165
|
+
// if count attribute is present it will return the N revision history of the metadata and fragment,
|
166
|
+
// without body, where N <= count.
|
167
|
+
//
|
168
|
+
// if the attribute tr is set to 1, the server will traverse up the directory tree, then search the
|
169
|
+
// central wiki account until the named Wiki item is found. it's useful when requesting the template
|
170
|
+
// items.
|
171
|
+
//
|
172
|
+
// GetWiki can be invoked with either 'name' or 'id' attribute. 'name' corresponds to
|
173
|
+
// the title of the Wiki page, and 'id' corresponds to the zimbraId of the item.
|
174
|
+
// Wiki name is unique only within the folder. Thus when using 'name' attribute
|
175
|
+
// to retrieve a Wiki page, the folder must be specified in 'l' attribute.
|
176
|
+
//
|
177
|
+
<GetWikiRequest>
|
178
|
+
<w [name="{word}"|id="{message-id}"] [ver="{version}"] [count="{num}"] [l="{folder}"] [tr="1|0"]/>
|
179
|
+
</GetWikiRequest>
|
180
|
+
|
181
|
+
<GetWikiResponse>
|
182
|
+
[<w name="{word}" ver="{version}" cr="{creator}" id="{message-id}" s="{size}" d="{created-date}" md="{modified-date}" l="{folder}" [f="{flags}"] [t="{tags}"]>
|
183
|
+
<fr>... fragment ...</fr>
|
184
|
+
<body>... contents ...</body>
|
185
|
+
</w>]+
|
186
|
+
</GetWikiResponse>
|
187
|
+
|
188
|
+
//
|
189
|
+
// WikiAction
|
190
|
+
// See ItemAction and MsgAction API for the usage.
|
191
|
+
//
|
192
|
+
<WikiActionRequest>
|
193
|
+
<!-- action can be preceeded by a "!" to negate it" -->
|
194
|
+
<action id="{list}" op="delete|read|flag|tag|move|update|spam|template|rename" [tag="..."] [l="{folder}"] [t="..."] [name="{newName}"]/>
|
195
|
+
</WikiActionRequest>
|
196
|
+
|
197
|
+
<WikiActionResponse>
|
198
|
+
<action id="{list}" op="delete|read|flag|tag|move|update|spam|template|rename"/>
|
199
|
+
</WikiActionResponse>
|
200
|
+
|
201
|
+
//
|
202
|
+
// Template management
|
203
|
+
//
|
204
|
+
// use WikiAction with op="template"
|
205
|
+
//
|
206
|
+
// <WikiActionRequest>
|
207
|
+
// <action op="template" id="{wiki-item or folder id}" t="dir|template|styles|header|footer|sidebar|index">
|
208
|
+
// {url to the template}
|
209
|
+
// </action>
|
210
|
+
// <WikiActionRequest>
|
211
|
+
//
|
212
|
+
// e.g.
|
213
|
+
//
|
214
|
+
// <WikiActionRequest>
|
215
|
+
// <action op="template" id="103" t="dir">
|
216
|
+
// //wiki/Templates/Powerpoint
|
217
|
+
// </action>
|
218
|
+
// <WikiActionRequest>
|
219
|
+
|
220
|
+
|
221
|
+
//
|
222
|
+
// DiffDocument
|
223
|
+
//
|
224
|
+
// performs line by line diff of two revisions of a Document or WikiItem,
|
225
|
+
// then returns a list of <chunk/> containing the result. Sections of text
|
226
|
+
// that are identical to both versions are indicated with disp="common".
|
227
|
+
// For each conflict the chunk will show disp="first", disp="second" or both.
|
228
|
+
//
|
229
|
+
//
|
230
|
+
// v3:
|
231
|
+
// line 1<br>
|
232
|
+
// line 2<br>
|
233
|
+
// line 3<br>
|
234
|
+
// line 4<br>
|
235
|
+
// line 5<br>
|
236
|
+
// <br>
|
237
|
+
//
|
238
|
+
// v4:
|
239
|
+
// line 1<br>
|
240
|
+
// line 2<br>
|
241
|
+
// line 3.6<br>
|
242
|
+
// line 4<br>
|
243
|
+
// line 5<br>
|
244
|
+
// <br>
|
245
|
+
//
|
246
|
+
// REQUEST:
|
247
|
+
// -------------
|
248
|
+
// <DiffDocumentRequest xmlns:ns0="urn:zimbraMail">
|
249
|
+
// <doc v1="3" v2="4" id="641"/>
|
250
|
+
// </DiffDocumentRequest>
|
251
|
+
//
|
252
|
+
// RESPONSE:
|
253
|
+
// --------------
|
254
|
+
// <DiffDocumentResponse xmlns:ns0="urn:zimbraMail">
|
255
|
+
// <chunk disp="common">line 1<br>
|
256
|
+
// line 2<br></chunk>
|
257
|
+
// <chunk disp="first">line 3<br></chunk>
|
258
|
+
// <chunk disp="second">line 3.6<br></chunk>
|
259
|
+
// <chunk disp="common">line 4<br>
|
260
|
+
// line 5<br>
|
261
|
+
// <br></chunk>
|
262
|
+
// </DiffDocumentResponse>
|
263
|
+
//
|
264
|
+
|
265
|
+
<DiffDocumentRequest>
|
266
|
+
<doc id="{item-id}" v1="{version}" v2="{version}"/>
|
267
|
+
</DiffDocumentRequest>
|
268
|
+
|
269
|
+
<DiffDocumentResponse>
|
270
|
+
<chunk disp="common|first|second"> ... text ... </chunk>+
|
271
|
+
</DiffDocumentResponse>
|
272
|
+
|
273
|
+
|
274
|
+
//
|
275
|
+
// ListDocumentRevisions
|
276
|
+
//
|
277
|
+
// returns {num} number of revisions starting from {version} of the requested
|
278
|
+
// document. {num} defaults to 1. {version} defaults to the current version.
|
279
|
+
//
|
280
|
+
<ListDocumentRevisionsRequest>
|
281
|
+
<doc id="{item-id}" [ver="{version}"] [count="{num}"]/>
|
282
|
+
</ListDocumentRevisionsRequest>
|
283
|
+
|
284
|
+
<ListDocumentRevisionsResponse>
|
285
|
+
[<doc name="{name}" ver="{version}" cr="{creator}" id="{message-id}" s="{size}" d="{created-date}" md="{modified-date}" l="{folder}" [f="{flags}"] [t="{tags}"] [loid="{lock-owner-account-id}"] [loe="{lock-owner-email}"] [desc="{optional-description}] [descEnabled="true|false"]>
|
286
|
+
<fr>... fragment ...</fr>
|
287
|
+
</doc>]+
|
288
|
+
</ListDocumentRevisionsResponse>
|
289
|
+
|
290
|
+
|