Difference between revisions of "Discussion of Bibliographic - Writer proposals"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Writer support of citation elements)
Line 3: Line 3:
 
Suggestions by Oliver Specht <Oliver.Specht@sun.com>
 
Suggestions by Oliver Specht <Oliver.Specht@sun.com>
  
The Writer has two possible content types that could be extended to
+
The Writer has two possible content types that could be extended to support the citation element (and other elements generically.
support the citation element (and other elements generically.
+
  
The first is the text field ([http://bibliographic.openoffice.org/implementation.html#Text com.sun.star.text.TextField]). A generic
+
The first is the text field ([https://www.openoffice.org/bibliographic/implementation.html#Text 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.
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
+
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.
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
+
Another possible solution is to add a new object that is similar to bookmarks ([https://www.openoffice.org/api/docs/common/ref/com/sun/star/text/Bookmark.html 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.
bookmarks ([http://api.openoffice.org/docs/common/ref/com/sun/star/text/Bookmark.html 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
+
In both cases an interface to access the new elements needs to be implemented (sorted by document position).
implemented (sorted by document position).
+
  
The DOM interfaces are in [http://api.openoffice.org/source/browse/api/offapi/com/sun/star/xml/dom/?hideattic=1#dirlist com.sun.star.xml.dom].
+
The DOM interfaces are in [https://www.openoffice.org/api/docs/common/ref/com/sun/star/xml/dom/#dirlist com.sun.star.xml.dom].
(e.g. [http://api.openoffice.org/source/browse/api/offapi/com/sun/star/xml/dom/XDocument.idl?hideattic=1 XDocument.idl], [http://api.openoffice.org/source/browse/api/offapi/com/sun/star/xml/dom/XNode.idl?hideattic=1 XNode.idl], [http://api.openoffice.org/source/browse/api/offapi/com/sun/star/xml/dom/XElement.idl?hideattic=1 XElement.idl])
+
(e.g. [https://www.openoffice.org/api/docs/common/ref/com/sun/star/xml/dom/XDocument.html XDocument.idl], [https://www.openoffice.org/api/docs/common/ref/com/sun/star/xml/dom/XNode.html XNode.idl], [https://www.openoffice.org/api/docs/common/ref/com/sun/star/xml/dom/ XElement.idl])
  
There's also a service [http://api.openoffice.org/source/browse/api/offapi/com/sun/star/xml/dom/DocumentBuilder.idl?hideattic=1 com.sun.star.xml.dom.DocumentBuilder] available
+
There's also a service [https://www.openoffice.org/api/docs/common/ref/com/sun/star/xml/dom/DocumentBuilder com.sun.star.xml.dom.DocumentBuilder] available that supports the creation of DOM trees.
that supports the creation of DOM trees.
+
  
The bibliography component works on the DOM tree and can manipulate it  
+
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.
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.
 
Using the field is a bit easier and using the bookmark is more powerful.
  
 
[[Category:Bibliographic]]
 
[[Category:Bibliographic]]

Revision as of 16:09, 8 August 2021

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