|
|
The Transient Document Content Provider
PrefaceThe Transient Document Content Provider (TDCP) implements a Content Provider for the Universal Content Broker (UCB). It provides access to the hierachical structure of the documents that are active in a running OpenOffice.org process. As long as a document was not closed, the TDCP can access it. All documents that have been loaded – regardless of their persistent document format--- or that have been created but not yet saved to any storage medium, are supported. The TDCP is not able to load any documents itself. This is exclusively done by the OpenOffice.org document handling framework. The document contents provided by the TDCP represent live data, which may differ from any persistent representation of the document, for instance, because the user modified the document after loading, but did not yet save it. TDCP ContentsThe TDCP provides four different types of contents: Stream, Folder, Document and Root.
Creation Of New TDCP ContentsTDCP Folders and TDCP Documents implement the interface XContentCreator. TDCP Streams and TDCP Folders support the command „insert“; the TDCP Root and TDCP Documents do not. TDCP Folders and TDCP Documents can create new TDCP Folders and TDCP Streams. To create a new child of a TDCP Folder or TDCP Document:
Another, more convenient way for creating streams is simply to assemble the URL for the new content ( last part of the path will become the title of the new stream ) and to obtain a Content object for that URL from the UCB. Then let the content execute the command "insert". The command will fail, if you set the command's parameter "ReplaceExisting" to false and there is already a stream with the title given by the content's URL.
URL Scheme for TDCP ContentsEach TDCP content has an identifier corresponding to the following scheme: tdcp-URL = "vnd.sun.star.tdoc:" abs-path abs-path = +( "/" segment ) segment = *( pchar ) pchar = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | "," unreserved = alphanum | mark mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" escaped = "%" hex hex
Examples:
AppendixThe following table gives an overview of the different TDCP contents.
*) The „transfer“ command only transfers TDCP documents, TDCP folders and TDCP streams to TDCP folders or TDCP documents. It does not handle contents with a URL scheme other than the TDOC URL scheme. **) always a reference to a storage opened in read-only mode. No write operations are possible. UCB content must be used for operations that modify the storage (if equivalent functionality is available) or a writable storage must be obtained from somewhere else. |



