Services and Interfaces
Each UCB content implements the service com.sun.star.ucb.Content. The UCB content service interfaces include:
- com.sun.star.container.XChild (optional)
- com.sun.star.ucb.XCommandProcessor2 (optional)
- com.sun.star.ucb.XContentCreator (optional)
The interface com.sun.star.ucb.XContent provides access to a content's type and identifier. The com.sun.star.ucb.XCommandProcessor executes commands at the content object, such as opening a content that provides access to the content's data stream or its children, and setting and getting property values. The interface com.sun.star.beans.XPropertyContainer adds new properties to a content or removes properties that were previously added using this interface. The properties added are always made persistent.
The com.sun.star.ucb.XContentCreator interface is for creating new resources, such as a new folder in the local file system. Not all content implementation can create new resources, therefore this interface is optional. The optional interface com.sun.star.container.XChild provides access to the content object's parent content object. Not all data sources represented by content implementations are organized hierarchically, therefore a parent cannot always be specified.
|The interface com.sun.star.ucb.XCommandProcessor2 is the improved version of com.sun.star.ucb.XCommandProcessor. It has been introduced to release command identifiers retrieved through createCommandIdentifier() at the XCommandProcessor interface. To avoid resource leaks, use XCommandProcessor2.|
Some content commands defined by the UCB API are listed in the following table:
|Selected Command Names for com.sun.star.ucb.XCommandProcessor|
||Obtains an interface that queries information on commands supported by a content.|
||Obtains an interface that queries information on properties supported by a content.|
||Obtains property values from the content.|
||Sets property values of the content.|
||Gives access to the data stream of a document or to the children of a folder.|
||Destroys a resource.|
||Commits newly-created resources. Writes new data stream of existing document resources.|
||Copies or moves a content object.|
Some interesting content properties defined by the UCB API:
|Selected Properties of UCB Contents|
||Contains a unique(!), read-only type string for the content, for example, "application/vnd.sun.star.hierarchy-link". This is not the Media-Type!|
||Indicates whether a content can contain other contents.|
||Indicates whether a content is a document.|
||Contains the title of an object, for example, the name of a file.|
||Contains the date and time the object was created.|
||Contains the date and time the object was last modified.|
||Contains the media type (MIME type) of a content.|
||Contains the size, usually in bytes, of an object.|
Every UCP implements the service com.sun.star.ucb.ContentProvider. The UCP core interface is com.sun.star.ucb.XContentProvider. This interface facilitates the creation of content objects based on a given content identifier.
A UCB implements the service com.sun.star.ucb.UniversalContentBroker. The UCB core interfaces are com.sun.star.ucb.XContentProvider and com.sun.star.ucb.XContentProviderManager. The com.sun.star.ucb.XContentProvider interface implementation delegates requests to create content objects to the content provider registered for the supplied content identifier. The com.sun.star.ucb.XContentProviderManagerinterface is used to query the UCPs registered with a given UCB, and to register and remove UCPs.
|A specification for the implementation for each of the UCPs, including URL schemes, content types, supported commands and properties is located in Universal Content Providers.|
|Content on this page is licensed under the Public Documentation License (PDL).|