| Oracle® Database PL/SQL Packages and Types Reference 11g Release 2 (11.2) Part Number E16760-05  | 
  | 
  | 
PDF · Mobi · ePub | 
The DBMS_XDBRESOURCE package provides the interface to operate on the resource's metadata and contents.
See Also:
Oracle XML DB Developer's Guide for examples of "UsingDBMS_XDBRESOURCE"This chapter contains the following topics:
The DBMS_XDBRESOURCE package provides routines to get and set the resource's metadata and contents. To take advantage of the DOM traversal facility, provided in DBMS_XMLDOM package, an XDBResource instance could be converted to a DOMDocument type by using DBMS_XDBRESOURCE.MAKEDOCUMENT routine.
Table 166-1 DBMS_XDBRESOURCE Package Subprograms
| Subprogram | Description | 
|---|---|
| 
 Frees any memory associated with an XDBResource  | 
|
| 
 Given an XDBResource, returns its ACL as string  | 
|
| 
 Returns the ACL Document for the given resource as   | 
|
| 
 Given an XDBResource, returns its author  | 
|
| 
 Given an XDBResource, returns its character set  | 
|
| 
 Given an XDBResource, returns its comment  | 
|
| 
 Returns the contents of the resource as a   | 
|
| 
 Returns the contents of the resource as a   | 
|
| 
 Returns the contents of the resource as an   | 
|
| 
 Given an XDBResource, returns its content-type  | 
|
| 
 Returns the contents of the resource as XML  | 
|
| 
 Returns the contents of the resource as a string  | 
|
| 
 Given an XDBResource, returns its creation date  | 
|
| 
 Given an XDBResource, returns its creator  | 
|
| 
 Returns the requested custom metadata given the xpath and namespace to the metadata  | 
|
| 
 Given an XDBResource, returns its display name  | 
|
| 
 Given an XDBResource, returns its language  | 
|
| 
 Given an XDBResource, returns its last modifier  | 
|
| 
 Given an XDBResource, returns its modification date  | 
|
| 
 Given an XDBResource, returns its owner.  | 
|
| 
 Given an XDBResource, returns its reference count  | 
|
| 
 Given an XDBResource, returns its version ID.  | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Returns   | 
|
| 
 Converts the XDBResource to a DOMDocument which can be operated on using the XMLDOM interface  | 
|
| 
 Updates the resource with any modifications  | 
|
| 
 Sets the ACL of the given XDBResource to the path specified  | 
|
| 
 Sets the author of the given XDBResource to the specified string  | 
|
| 
 Sets the character set of the given XDBResource to a specified character set  | 
|
| 
 Sets a comment associated with the given XDBResource  | 
|
| 
 Replaces the contents of the given resource with the given   | 
|
| 
 Sets the content-type of the given XDBResource  | 
|
| 
 Sets the custom metadata specified by the XPath and namespace to new data  | 
|
| 
 Sets the display name of the given XDBResource  | 
|
| 
 Sets the language of the given XDBResource  | 
|
| 
 Sets the owner of the given XDBResource  | 
This procedure frees any memory associated with an XDBResource.
DBMS_XDBRESEROUCE.FREERESOURCE ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its ACL as string.
DBMS_XDBRESEROUCE.GETACL ( res IN XDBResource) RETURN VARCHAR2;
This function returns the ACL Document for the given resource as XMLType.
DBMS_XDBRESEROUCE.GETACLDOCFROMRES ( res IN XDBResource) RETURN SYS.XMLTYPE;
Given an XDBResource, this function returns its author.
DBMS_XDBRESEROUCE.GETAUTHOR ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its characterset.
DBMS_XDBRESEROUCE.GETCHARACTERSET ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its comment.
DBMS_XDBRESEROUCE.GETCOMMENT ( res IN XDBResource) RETURN VARCHAR2;
This function returns the contents of the resource as a BLOB.
DBMS_XDBRESEROUCE.GETCONTENTBLOB ( res IN XDBResource, csid OUT PLS_INTEGER) RETURN BLOB;
Table 166-8 GETCONTENTBLOB Function Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 Character set ID of the   | 
This function returns the contents of the resource as a CLOB.
DBMS_XDBRESEROUCE.GETCONTENTCLOB ( res IN XDBResource) RETURN CLOB;
This function returns the contents of the resource as an XMLTypeRef.
DBMS_XDBRESEROUCE.GETCONTENTREF ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its content-type.
DBMS_XDBRESEROUCE.GETCONTENTTYPE ( res IN XDBResource) RETURN VARCHAR2;
This function returns the contents of the resource as an XMLTypeRef.
DBMS_XDBRESEROUCE.GETCONTENTXML ( res IN XDBResource) RETURN XMLType;
This function returns the contents of the resource as a string.
DBMS_XDBRESEROUCE.GETCONTENTVARCHAR2 ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its creation date.
DBMS_XDBRESEROUCE.GETCREATIONDATE ( res IN XDBResource) RETURN TIMESTAMP;
Given an XDBResource, this function returns its creator.
DBMS_XDBRESEROUCE.GETCREATOR ( res IN XDBResource) RETURN VARCHAR2;
This function returns the requested custom metadata given the xpath and namespace to the metadata.
DBMS_XDBRESEROUCE.GETCUSTOMMETADATA ( res IN XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2) RETURN XMLType;
Table 166-16 GETCUSTOMMETADATA Function Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 XPath for custom metadata  | 
| 
 
  | 
 Namespace  | 
The first component of the XPath expression must be "Resource".
Given an XDBResource, this function returns its display name.
DBMS_XDBRESEROUCE.GETDISPLAYNAME ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its language.
DBMS_XDBRESEROUCE.GETLANGUAGE ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its last modifier.
DBMS_XDBRESEROUCE.GETLASTMODIFIER ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its modification date.
DBMS_XDBRESEROUCE.GETMODIFICATIONDATE ( res IN XDBResource) RETURN TIMESTAMP;
Given an XDBResource, this function returns its owner.
DBMS_XDBRESEROUCE.GETOWNER ( res IN XDBResource) RETURN VARCHAR2;
Given an XDBResource, this function returns its reference count.
DBMS_XDBRESEROUCE.GETREFCOUNT ( res IN XDBResource) RETURN PLS_INTEGER;
Given an XDBResource, this function returns its version ID.
DBMS_XDBRESEROUCE.GETVERSIONID ( res IN XDBResource) RETURN PLS_INTEGER;
This function returns TRUE if the ACL of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASACLCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the author of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASAUTHORCHANGED ( res IN XDBResource) RETURN BOOLEAN;
Given an XPath, this function determines whether the element or attribute represented by the XPath has changed.
DBMS_XDBRESEROUCE.HASCHANGED ( res IN XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2) RETURN BOOLEAN;
Table 166-26 HASCHANGED Function Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 XPath to check  | 
| 
 
  | 
 Namespace to use  | 
This function returns TRUE if the character set of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASCHARACTERSETCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the comment of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASCOMMENTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the contents of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASCONTENTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the content-type of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASCONTENTTYPECHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the creation date of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASCREATIONDATECHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the creator of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASCREATORCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function checks whether the custom-metadata for a given resource has changed.
DBMS_XDBRESEROUCE.HASCUSTOMMETADATACHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the display name of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASDISPLAYNAMECHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the language of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASLANGUAGECHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the last modifier of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASLASTMODIFIERCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the modification date of the given resource has changed, FALSE otherwise
DBMS_XDBRESEROUCE.HASMODIFICATIONDATECHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the owner of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASOWNERCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the reference count of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASREFCOUNTCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the version ID of the given resource has changed, FALSE otherwise.
DBMS_XDBRESEROUCE.HASVERSIONIDCHANGED ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if the given resource is a folder, FALSE otherwise.
DBMS_XDBRESEROUCE.ISFOLDER ( res IN XDBResource) RETURN BOOLEAN;
This function returns TRUE if input resource is NULL.
DBMS_XDBRESEROUCE.ISNULL ( res IN XDBResource) RETURN BOOLEAN;
This function converts the XDBResource to a DOMDocument which can be operated on using the XMLDOM interface.
See Also:
The DBMS_XMLDOM packageDBMS_XDBRESEROUCE.MAKEDOCUMENT ( res IN XDBResource) RETURN DBMS_XMLDOM.DOMDocument;
This procedures updates the resource with any modifications.
DBMS_XDBRESEROUCE.SAVE ( res IN XDBResource);
This procedure sets the ACL of the given XDBResource to the path specified.
DBMS_XDBRESEROUCE.SETACL ( res IN OUT XDBResource, ACLPath IN VARCHAR2);
Table 166-45 SETACL Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 Absolute path of the new ACL  | 
This procedure sets the author of the given XDBResource to the specified string.
DBMS_XDBRESEROUCE.SETAUTHOR ( res IN OUT XDBResource, author IN VARCHAR2);
This procedure sets the character set of the given XDBResource to a specified character set.
DBMS_XDBRESEROUCE.SETCHARACTERSET ( res IN OUT XDBResource, charSet IN VARCHAR2);
Table 166-47 SETCHARACTERSET Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 New character set  | 
This procedure sets a comment associated with the given XDBResource.
DBMS_XDBRESEROUCE.SETCOMMENT ( res IN OUT XDBResource, comment IN VARCHAR2);
Table 166-48 SETCOMMENT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 New comment  | 
This procedurereplaces the contents of the given resource with the given datatype.
DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN BFILE, csid IN NUMBER); DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN BLOB, csid IN PLS_INTEGER); DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN CLOB); DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN REF SYS.XMLType, sticky IN BOOLEAN := TRUE); DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN VARCHAR2); DBMS_XDBRESEROUCE.SETCONTENT ( res IN OUT XDBResource, data IN SYS.XMLType);
Table 166-49 SETCONTENT Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 Data input as   | 
| 
 
  | 
 Character set ID of the   | 
| 
 
  | 
 If   | 
This procedure sets the content-type of the given XDBResource.
DBMS_XDBRESEROUCE.SETCONTENTTYPE ( res IN OUT XDBResource, conttype IN VARCHAR2);
Table 166-50 SETCONTENTTYPE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 New content-type  | 
This procedure sets the custom metadata specified by the xpath and namespace to new data.
DBMS_XDBRESEROUCE.SETCUSTOMMETADATA ( res IN OUT XDBResource, xpath IN VARCHAR2, namespace IN VARCHAR2, newMetadata IN XMLType);
Table 166-51 SETCUSTOMMETADATA Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 XPath to change  | 
| 
 
  | 
 Namespace to use  | 
| 
 
  | 
 New data that should replace the metadata at the given XPath  | 
The first component of the XPath expression must be "Resource".
This procedure sets the display name of the given XDBResource.
DBMS_XDBRESEROUCE.SETDISPLAYNAME ( res IN OUT XDBResource, name IN VARCHAR2);
Table 166-52 SETDISPLAYNAME Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 New display name  | 
This procedure sets the language of the given XDBResource.
DBMS_XDBRESEROUCE.SETLANGUAGE ( res IN OUT XDBResource, ACLPath IN VARCHAR2);
Table 166-53 SETLANGUAGE Procedure Parameters
| Parameter | Description | 
|---|---|
| 
 
  | 
 XDBResource  | 
| 
 
  | 
 New path  | 
This procedure sets the owner of the given XDBResource.
DBMS_XDBRESEROUCE.SETOWNER ( res IN OUT XDBResource, owner IN VARCHAR2);
The user must have the XDBADMIN privilege to call this subprogram.