The Hierarchy Content Provider
The Hierarchy Content Provider (HCP) implements a content provider for the Universal Content Broker (UCB). It provides access to a persistent, customizable hierarchy of contents.
HCP Contents
The HCP provides three different types of contents: link, folder and root folder.
- An HCP link is a content that "points" to another UCB content. It is always contained in an HCP Folder. An HCP Link has no children.
- An HCP folder is a container for other HCP Folders and HCP Links.
- There is at least one instance of an HCP root folder at a time. All other HCP contents are children of this folder. The HCP root folder contains HCP folders and links. It has the URL vnd.sun.star.hier:/.
Creation of New HCP Content
HCP folders and the HCP root folder implement the interface com.sun.star.ucb.XContentCreator. HCP links and HCP folders support the command "insert" allowing all the HCP folders, as well as the HCP root folder to create new HCP folders and HCP links. To create a new child of an HCP folder:
- The parent folder creates a new content by calling its
createNewContent()
method. The content type for new folders is "application/vnd.sun.star.hier-folder". To create a new link, use the type string "application/vnd.sun.star.hier-link
". - Set a title at the new folder or link. The new child executes the "
setPropertyValues
" command that sets the propertyTitle
to a non-empty value. For a link, set the propertyTargetURL
to a non-empty value. - The new child, not the parent executes the command "
insert
". This commits the creation process.
URL Scheme for HCP Contents
Each HCP content has an identifier corresponding to the following scheme:
vnd.sun.star.hier:/<path>
where <path> is a hierarchical path of the form
<name>/<name>/.../<name>
where <name>
is an encoded string according to the URL conventions.
Examples:
vnd.sun.star.hier:/(The URL of the HCP Root Folder) vnd.sun.star.hier:/Bookmarks/Sun%20Microssystems%20Home%20Page vnd.sun.star.hier:/Workplace/Printers
Commands and Properties
UCB Type (returned by XContent::getContentType ) | Properties | Commands | Interfaces | |
---|---|---|---|---|
Link | application/vnd.sun.star.hier-link | [readonly] ContentType [readonly] IsDocument |
getCommandInfo getPropertySetInfo |
XTypeProvider XServiceInfo |
Folder | application/vnd.sun.star.hier-folder | [readonly] ContentType [readonly] IsDocument |
getCommandInfo getPropertySetInfo |
same as HCP Link, plus XContentCreator |
Root Folder | application/vnd.sun.star.hier-folder | [readonly] ContentType [readonly] IsDocument |
getCommandInfo getPropertySetInfo |
same as HCP Link, plus XContentCreator |
1 The "transfer" command only transfers HCP-contents to HCP folders. It does not handle contents with a URL scheme other then the HCP-URL-scheme.
Content on this page is licensed under the Public Documentation License (PDL). |