Discussion of Bibliographic - Writer proposals

From Apache OpenOffice Wiki
Jump to: navigation, search

Writer support of citation elements

Suggestions by Oliver Specht <Oliver.Specht@sun.com>

The Writer has two possible content types that could be extended to support the citation element (and other elements generically.

The first is the text field (com.sun.star.text.TextField). A generic field service could be added to the API of the Writer that would have a property that contains a DOM tree. This DOM tree contains the citation-element. The bibliography creates the DOM tree of those fields and inserts them into the text together with a string that contains the presentation text.

Such fields can only be formatted as a whole. It is not possible to have e.g. parts of this presentation printed in bold. This text can not be spanned over paragraphs. The text cannot be changed manually.

Another possible solution is to add a new object that is similar to bookmarks (com.sun.star.text.Bookmark). This extended bookmark would also carry a DOM tree property. This 'bookmark' can span over formatted text longer than a paragraph. The user can modify the text inside of this bookmark easily.

In both cases an interface to access the new elements needs to be implemented (sorted by document position).

The DOM interfaces are in com.sun.star.xml.dom. (e.g. XDocument.idl, XNode.idl, XElement.idl)

There's also a service com.sun.star.xml.dom.DocumentBuilder available that supports the creation of DOM trees.

The bibliography component works on the DOM tree and can manipulate it independently. In case of using a field the component has to set the resulting string representation of the reference at this field.

Using the field is a bit easier and using the bookmark is more powerful.

Personal tools