1 PACKAGE dbms_xdbresource AUTHID CURRENT_USER IS
2
3 --------------------------------------------
4 -- TYPES
5 --
6 --------------------------------------------
7 SUBTYPE xdbrestype IS RAW(13);
8 TYPE XDBResource IS RECORD(id xdbrestype);
9
10 ---------------------------------------------------------------------------
11 -- XDBResource related API
12 ---------------------------------------------------------------------------
13
14 ---------------------------------------------
15 -- FUNCTION - isNull
16 -- Checks if the input res is null.
17 -- PARAMETERS -
18 -- res - input resource
19 -- RETURNS -
20 -- TRUE if the input res is null.
21 ---------------------------------------------
22 FUNCTION isNull(res IN XDBResource) return BOOLEAN;
23
24 ---------------------------------------------
25 -- PROCEDURE - freeResource
26 -- Frees any memory associated with an XDBResource
27 -- PARAMETERS -
28 -- res - The XDBResource to free
29 ---------------------------------------------
30 PROCEDURE freeResource (res IN XDBResource);
31
32 ---------------------------------------------
33 -- FUNCTION - getACL
34 -- Given an XDBResource, returns its ACL as string.
35 -- PARAMETERS -
36 -- res - An XDBResource
37 -- RETURNS -
38 -- The ACL of the XDBResource as VARCHAR2
39 ---------------------------------------------
40 FUNCTION getACL (res IN XDBResource) return VARCHAR2;
41
42 FUNCTION getACLDocFromRes(res IN XDBResource) return sys.xmltype;
43
44 ---------------------------------------------
45 -- FUNCTION - getAuthor
46 -- Given an XDBResource, returns its author.
47 -- PARAMETERS -
48 -- res - An XDBResource
49 -- RETURNS -
50 -- The Author of the XDBResource.
51 ---------------------------------------------
52 FUNCTION getAuthor(res IN XDBResource) return VARCHAR2;
53
54 ---------------------------------------------
55 -- FUNCTION - getCharacterSet
56 -- Given an XDBResource, returns its characterset.
57 -- PARAMETERS -
58 -- res - An XDBResource
59 -- RETURNS -
60 -- The character set of the XDBResource.
61 ---------------------------------------------
62 FUNCTION getCharacterSet(res IN XDBResource) return VARCHAR2;
63
64 ---------------------------------------------
65 -- FUNCTION - getComment
66 -- Given an XDBResource, returns its comment.
67 -- PARAMETERS -
68 -- res - An XDBResource
69 -- RETURNS -
70 -- The Comment of the XDBResource.
71 ---------------------------------------------
72 FUNCTION getComment(res IN XDBResource) return VARCHAR2;
73
74 ---------------------------------------------
75 -- FUNCTION - getContentType
76 -- Given an XDBResource, returns its content-type.
77 -- PARAMETERS -
78 -- res - An XDBResource
79 -- RETURNS -
80 -- The content type of the XDBResource.
81 ---------------------------------------------
82 FUNCTION getContentType(res IN XDBResource) return VARCHAR2;
83
84 ---------------------------------------------
85 -- FUNCTION - getCreationDate
86 -- Given an XDBResource, returns its creation date.
87 -- PARAMETERS -
88 -- res - An XDBResource
89 -- RETURNS -
90 -- The creation date of the XDBResource.
91 ---------------------------------------------
92 FUNCTION getCreationDate(res IN XDBResource) return TIMESTAMP;
93
94 ---------------------------------------------
95 -- FUNCTION - getCreator
96 -- Given an XDBResource, returns its creator.
97 -- PARAMETERS -
98 -- res - An XDBResource
99 -- RETURNS -
100 -- The creator of the XDBResource.
101 ---------------------------------------------
102 FUNCTION getCreator(res IN XDBResource) return VARCHAR2;
103
104 ---------------------------------------------
105 -- FUNCTION - getDisplayName
106 -- Given an XDBResource, returns its display name.
107 -- PARAMETERS -
108 -- res - An XDBResource
109 -- RETURNS -
110 -- The display name of the XDBResource.
111 ---------------------------------------------
112 FUNCTION getDisplayName(res IN XDBResource) return VARCHAR2;
113
114 ---------------------------------------------
115 -- FUNCTION - getLanguage
116 -- Given an XDBResource, returns its language.
117 -- PARAMETERS -
118 -- res - An XDBResource
119 -- RETURNS -
120 -- The language of the XDBResource.
121 ---------------------------------------------
122 FUNCTION getLanguage (res IN XDBResource) return VARCHAR2;
123
124 ---------------------------------------------
125 -- FUNCTION - getLastModifier
126 -- Given an XDBResource, returns its last modifier.
127 -- PARAMETERS -
128 -- res - An XDBResource
129 -- RETURNS -
130 -- The last modifier of the XDBResource.
131 ---------------------------------------------
132 FUNCTION getLastModifier(res IN XDBResource) return VARCHAR2;
133
134 ---------------------------------------------
135 -- FUNCTION - getModificationDate
136 -- Given an XDBResource, returns its modification date.
137 -- PARAMETERS -
138 -- res - An XDBResource
139 -- RETURNS -
140 -- The modification date of the XDBResource.
141 ---------------------------------------------
142 FUNCTION getModificationDate(res IN XDBResource) return TIMESTAMP;
143
144 ---------------------------------------------
145 -- FUNCTION - getOwner
146 -- Given an XDBResource, returns its owner.
147 -- PARAMETERS -
148 -- res - An XDBResource
149 -- RETURNS -
150 -- The owner of the XDBResource.
151 ---------------------------------------------
152 FUNCTION getOwner(res IN XDBResource) return VARCHAR2;
153
154 ---------------------------------------------
155 -- FUNCTION - getRefCount
156 -- Given an XDBResource, returns its reference count.
157 -- PARAMETERS -
158 -- res - An XDBResource
159 -- RETURNS -
160 -- The reference count of the XDBResource.
161 ---------------------------------------------
162 FUNCTION getRefCount (res IN XDBResource) return PLS_INTEGER;
163
164 ---------------------------------------------
165 -- FUNCTION - getVersionId
166 -- Given an XDBResource, returns its version id.
167 -- PARAMETERS -
168 -- res - An XDBResource
169 -- RETURNS -
170 -- The version id of the XDBResource.
171 ---------------------------------------------
172 FUNCTION getVersionId(res IN XDBResource) return PLS_INTEGER;
173
174 ---------------------------------------------
175 -- PROCEDURE - setAuthor
176 -- Sets the author of the given XDBResource to the specified varchar2.
177 -- PARAMETERS -
178 -- res - An XDBResource
179 -- author - The new author
180 --
181 ---------------------------------------------
182 PROCEDURE setAuthor(res IN OUT XDBResource, author IN VARCHAR2);
183
184 ---------------------------------------------
185 -- PROCEDURE - setACL
186 -- Sets the acl of the given XDBResource to the path specified varchar2.
187 -- PARAMETERS -
188 -- res - An XDBResource
189 -- ACLPath - The absolute path of the new acl
190 ---------------------------------------------
191 PROCEDURE setACL(res IN OUT XDBResource, ACLPath IN VARCHAR2);
192
193 ---------------------------------------------
194 -- PROCEDURE - setCharacterSet
195 -- Sets the character set of the given XDBResource to the specified varchar2.
196 -- PARAMETERS -
197 -- res - An XDBResource
198 -- charset - The new charset
199 ---------------------------------------------
200 PROCEDURE setCharacterSet(res IN OUT XDBResource, charSet IN VARCHAR2);
201
202 ---------------------------------------------
203 -- PROCEDURE - setComment
204 -- Sets the comment of the given XDBResource to the specified varchar2.
205 -- PARAMETERS -
206 -- res - An XDBResource
207 -- comment - The new comment
208 ---------------------------------------------
209 PROCEDURE setComment(res IN OUT XDBResource, comment IN VARCHAR2);
210
211 ---------------------------------------------
212 -- PROCEDURE - setContentType
213 -- Sets the content-type of the given XDBResource to the specified varchar2.
214 -- PARAMETERS -
215 -- res - An XDBResource
216 -- conttype - The new content-type
217 ---------------------------------------------
218 PROCEDURE setContentType(res IN OUT XDBResource, conttype IN VARCHAR2);
219
220 ---------------------------------------------
221 -- PROCEDURE - setDisplayName
222 -- Sets the display name of the given XDBResource to the specified varchar2.
223 -- PARAMETERS -
224 -- res - An XDBResource
225 -- name - The new display name
226 ---------------------------------------------
227 PROCEDURE setDisplayName(res IN OUT XDBResource, name IN VARCHAR2);
228
229 ---------------------------------------------
230 -- PROCEDURE - setLanguage
231 -- Sets the language of the given XDBResource to the specified varchar2.
232 -- PARAMETERS -
233 -- res - An XDBResource
234 -- lang - The new language
235 ---------------------------------------------
236 PROCEDURE setLanguage(res IN OUT XDBResource, lang IN VARCHAR2);
237
238 ---------------------------------------------
239 -- PROCEDURE - setOwner
240 -- Sets the owner of the given XDBResource to the specified varchar2.
241 -- PARAMETERS -
242 -- res - An XDBResource
243 -- owner - The new owner
244 ---------------------------------------------
245 PROCEDURE setOwner(res IN OUT XDBResource, owner IN VARCHAR2);
246
247 ---------------------------------------------
248 -- FUNCTION - hasAuthorChanged
249 -- Returns TRUE if the author of the given resource has changed,
250 -- FALSE otherwise.
251 -- PARAMETERS -
252 -- res - An XDBResource
253 -- RETURNS -
254 --
255 ---------------------------------------------
256 FUNCTION hasAuthorChanged(res IN XDBResource) return BOOLEAN;
257
258 ---------------------------------------------
259 -- FUNCTION - hasCharacterSetChanged
260 -- Returns TRUE if the charset of the given resource has changed,
261 -- FALSE otherwise.
262 -- PARAMETERS -
263 -- res - An XDBResource
264 -- RETURNS -
265 -- TRUE if the charset of the given resource has changed,
266 -- FALSE otherwise.
267 ---------------------------------------------
268 FUNCTION hasCharacterSetChanged(res IN XDBResource) return BOOLEAN;
269
270 ---------------------------------------------
271 -- FUNCTION - hasCommentChanged
272 -- Returns TRUE if the comment of the given resource has changed,
273 -- FALSE otherwise.
274 -- PARAMETERS -
275 -- res - An XDBResource
276 -- RETURNS -
277 -- TRUE if the comment of the given resource has changed,
278 -- FALSE otherwise.
279 ---------------------------------------------
280 FUNCTION hasCommentChanged(res IN XDBResource) return BOOLEAN;
281
282 ---------------------------------------------
283 -- FUNCTION - hasContentTypeChanged
284 -- Returns TRUE if the content-type of the given resource has changed,
285 -- FALSE otherwise.
286 -- PARAMETERS -
287 -- res - An XDBResource
288 -- RETURNS -
289 -- TRUE if the content-type of the given resource has changed,
290 -- FALSE otherwise.
291 ---------------------------------------------
292 FUNCTION hasContentTypeChanged(res IN XDBResource) return BOOLEAN;
293
294 ---------------------------------------------
295 -- FUNCTION - hasContentChanged
296 -- Returns TRUE if the contents of the given resource has changed,
297 -- FALSE otherwise.
298 -- PARAMETERS -
299 -- res - An XDBResource
300 -- RETURNS -
301 -- TRUE if the contents of the given resource has changed,
302 -- FALSE otherwise.
303 ---------------------------------------------
304 FUNCTION hasContentChanged(res IN XDBResource) return BOOLEAN;
305
306 ---------------------------------------------
307 -- FUNCTION - hasCreationDateChanged
308 -- Returns TRUE if the creation date of the given resource has changed,
309 -- FALSE otherwise.
310 -- PARAMETERS -
311 -- res - An XDBResource
312 -- RETURNS -
313 -- TRUE if the creation date of the given resource has changed,
314 -- FALSE otherwise.
315 ---------------------------------------------
316 FUNCTION hasCreationDateChanged(res IN XDBResource) return BOOLEAN;
317
318 ---------------------------------------------
319 -- FUNCTION - hasCreatorChanged
320 -- Returns TRUE if the creator of the given resource has changed,
321 -- FALSE otherwise.
322 -- PARAMETERS -
323 -- res - An XDBResource
324 -- RETURNS -
325 -- TRUE if the creator of the given resource has changed,
326 -- FALSE otherwise.
327 ---------------------------------------------
328 FUNCTION hasCreatorChanged(res IN XDBResource) return BOOLEAN;
329
330 ---------------------------------------------
331 -- FUNCTION - hasDisplayName
332 -- Returns TRUE if the display name of the given resource has changed,
333 -- FALSE otherwise.
334 -- PARAMETERS -
335 -- res - An XDBResource
336 -- RETURNS -
337 -- TRUE if the display name of the given resource has changed,
338 -- FALSE otherwise.
339 ---------------------------------------------
340 FUNCTION hasDisplayNameChanged(res IN XDBResource) return BOOLEAN;
341
342 ---------------------------------------------
343 -- FUNCTION - hasLanguageChanged
344 -- Returns TRUE if the language of the given resource has changed,
345 -- FALSE otherwise.
346 -- PARAMETERS -
347 -- res - An XDBResource
348 -- RETURNS -
349 -- TRUE if the language of the given resource has changed,
350 -- FALSE otherwise.
351 ---------------------------------------------
352 FUNCTION hasLanguageChanged(res IN XDBResource) return BOOLEAN;
353
354 ---------------------------------------------
355 -- FUNCTION - hasLastModifierChanged
356 -- Returns TRUE if the last modifier of the given resource has changed,
357 -- FALSE otherwise.
358 -- PARAMETERS -
359 -- res - An XDBResource
360 -- RETURNS -
361 -- TRUE if the last modifier of the given resource has changed,
362 -- FALSE otherwise.
363 ---------------------------------------------
364 FUNCTION hasLastModifierChanged(res IN XDBResource) return BOOLEAN;
365
366 ---------------------------------------------
367 -- FUNCTION - hasModificationDate
368 -- Returns TRUE if the modification date of the given resource has changed,
369 -- FALSE otherwise.
370 -- PARAMETERS -
371 -- res - An XDBResource
372 -- RETURNS -
373 -- TRUE if the modification date of the given resource has changed,
374 -- FALSE otherwise.
375 ---------------------------------------------
376 FUNCTION hasModificationDateChanged(res IN XDBResource) return BOOLEAN;
377
378 ---------------------------------------------
379 -- FUNCTION - hasOwnerChanged
380 -- Returns TRUE if the owner of the given resource has changed,
381 -- FALSE otherwise.
382 -- PARAMETERS -
383 -- res - An XDBResource
384 -- RETURNS -
385 -- TRUE if the owner of the given resource has changed,
386 -- FALSE otherwise.
387 ---------------------------------------------
388 FUNCTION hasOwnerChanged(res IN XDBResource) return BOOLEAN;
389
390 ---------------------------------------------
391 -- FUNCTION - hasRefCountChanged
392 -- Returns TRUE if the reference count of the given resource has changed,
393 -- FALSE otherwise.
394 -- PARAMETERS -
395 -- res - An XDBResource
396 -- RETURNS -
397 -- TRUE if the reference count of the given resource has changed,
398 -- FALSE otherwise.
399 ---------------------------------------------
400 FUNCTION hasRefCountChanged(res IN XDBResource) return BOOLEAN;
401
402 ---------------------------------------------
403 -- FUNCTION - hasVersionId
404 -- Returns TRUE if the version id of the given resource has changed,
405 -- FALSE otherwise.
406 -- PARAMETERS -
407 -- res - An XDBResource
408 -- RETURNS -
409 -- TRUE if the version id of the given resource has changed,
410 -- FALSE otherwise.
411 ---------------------------------------------
412 FUNCTION hasVersionIdChanged(res IN XDBResource) return BOOLEAN;
413
414 ---------------------------------------------
415 -- FUNCTION - hasACLChanged
416 -- Returns TRUE if the ACL of the given resource has changed,
417 -- FALSE otherwise.
418 -- PARAMETERS -
419 -- res - An XDBResource
420 -- RETURNS -
421 -- TRUE if the ACL of the given resource has changed,
422 -- FALSE otherwise.
423 ---------------------------------------------
424 FUNCTION hasACLChanged(res IN XDBResource) return BOOLEAN;
425
426 ---------------------------------------------
427 -- FUNCTION - isFolder
428 -- Checks if the given resource is a folder or not.
429 -- PARAMETERS -
430 -- res - An XDBResource
431 -- RETURNS -
432 -- TRUE if the given resource is a folder,
433 -- FALSE otherwise.
434 ---------------------------------------------
435 FUNCTION isFolder(res IN XDBResource) return BOOLEAN;
436
437 ---------------------------------------------
438 -- FUNCTION - getContentClob
439 -- Returns the contents of the resource as a clob.
440 -- PARAMETERS -
441 -- res - An XDBResource
442 -- RETURNS -
443 -- The contents as CLOB.
444 ---------------------------------------------
445 FUNCTION getContentClob(res IN XDBResource) return CLOB;
446
447 ---------------------------------------------
448 -- FUNCTION - getContentBlob
449 -- Returns the contents of the resource as a blob.
450 -- PARAMETERS -
451 -- res - An XDBResource
452 -- csid - OUT - The character set id of the blob returned.
453 -- RETURNS -
454 -- The contents as BLOB.
455 ---------------------------------------------
456 FUNCTION getContentBlob(res IN XDBResource, csid OUT PLS_INTEGER) return BLOB;
457
458 ---------------------------------------------
459 -- FUNCTION - getContentXML
460 -- Returns the contents of the resource as an XMLType.
461 -- PARAMETERS -
462 -- res - An XDBResource
463 -- RETURNS -
464 -- The contents as XMLType.
465 ---------------------------------------------
466 FUNCTION getContentXML(res IN XDBResource) return SYS.XMLType;
467
468 ---------------------------------------------
469 -- FUNCTION - getContentVarchar2
470 -- Returns the contents of the resource as an Varchar2.
471 -- PARAMETERS -
472 -- res - An XDBResource
473 -- RETURNS -
474 -- The contents as Varchar2.
475 ---------------------------------------------
476 FUNCTION getContentVarchar2(res IN XDBResource) return VARCHAR2;
477
478 ---------------------------------------------
479 -- FUNCTION - getContentRef
480 -- Returns the contents of the resource as a Ref.
481 -- PARAMETERS -
482 -- res - An XDBResource
483 -- RETURNS -
484 -- The contents as an XMLTypeRef.
485 ---------------------------------------------
486 FUNCTION getContentRef(res IN XDBResource) return REF SYS.XMLType;
487
488 ---------------------------------------------
489 -- PROCEDURE - setContent
490 -- Replaces the contents of the given resource with the given clob.
491 -- PARAMETERS -
492 -- res - An XDBResource
493 -- data - The clob
494 ---------------------------------------------
495 PROCEDURE setContent(res IN OUT XDBResource, data IN CLOB);
496
497 ---------------------------------------------
498 -- PROCEDURE -
499 -- Replaces the contents of the given resource with the given blob.
500 -- PARAMETERS -
501 -- res - An XDBResource
502 -- data - The blob
503 -- csid - The character-set id of the blob
504 ---------------------------------------------
505 PROCEDURE setContent(res IN OUT XDBResource, data IN BLOB, csid IN PLS_INTEGER);
506
507 ---------------------------------------------
508 -- PROCEDURE -
509 -- Replaces the contents of the given resource with the given XMLType.
510 -- PARAMETERS -
511 -- res - An XDBResource
512 -- data - The XMLType
513 ---------------------------------------------
514 PROCEDURE setContent(res IN OUT XDBResource, data IN SYS.XMLType);
515
516 ---------------------------------------------
517 -- PROCEDURE -
518 -- Replaces the contents of the given resource with the given string.
519 -- PARAMETERS -
520 -- res - An XDBResource
521 -- data - The input string
522 ---------------------------------------------
523 PROCEDURE setContent(res IN OUT XDBResource, data IN VARCHAR2);
524
525 ---------------------------------------------
526 -- PROCEDURE -
527 -- Replaces the contents of the given resource with the given REF to XMLType.
528 -- PARAMETERS -
529 -- res - An XDBResource
530 -- data - The REF to XMLType
531 ---------------------------------------------
532 PROCEDURE setContent(res IN OUT XDBResource, data IN REF SYS.XMLType,
533 sticky IN BOOLEAN := TRUE);
534
535 ---------------------------------------------
536 -- PROCEDURE -
537 -- Replaces the contents of the given resource with the given BFILE.
538 -- PARAMETERS -
539 -- res - An XDBResource
540 -- data - The input bfile
541 -- csid_bfile - The character set id of the bfile
542 ---------------------------------------------
543 PROCEDURE setContent(res IN OUT XDBResource, data IN BFILE,
544 csid_bfile IN PLS_INTEGER);
545
546 ---------------------------------------------
547 -- PROCEDURE - save
548 -- Updates the resource with any modifications that were done on it.
549 -- PARAMETERS -
550 -- res - An XDBResource
551 ---------------------------------------------
552 PROCEDURE save(res IN XDBResource);
553
554 ---------------------------------------------
555 -- FUNCTION - makeDocument
556 -- Converts the XDBResource to DOMDocument. This can be used in
557 -- XMLDOM APIs. (Please refer to the XMLDOM package).
558 -- PARAMETERS -
559 -- res - An XDBResource
560 -- RETURNS -
561 -- The DOMDocument for this resource.
562 ---------------------------------------------
563 FUNCTION makeDocument(res IN XDBResource) return DBMS_XMLDOM.DOMDocument;
564
565 FUNCTION hasChanged(res IN XDBResource, xpath IN VARCHAR2,
566 bnamespace IN VARCHAR2) return BOOLEAN;
567
568 FUNCTION getCustomMetadata(res IN XDBResource, xpath IN VARCHAR2,
569 namespace IN VARCHAR2) return SYS.XMLType;
570
571 FUNCTION hasCustomMetadataChanged(res IN XDBResource) return BOOLEAN;
572
573 PROCEDURE setCustomMetadata(res IN XDBResource, xpath IN VARCHAR2,
574 namespace IN VARCHAR2, newMetadata IN SYS.XMLType);
575 end dbms_xdbresource;