Enhance the Text-Field or Bookmark functions to include formatted text

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Enhance the Text-Field or Bookmark functions to include formatted text

David Wilson-7
I would like to enter an issue to enhance database and text fields to support
formatted text.

The Bibliographic project wants this enhancement because some data fields in
the bibliography need to support formatted text. For example some scientific
document titles need to be able to display words in Italics. Mathematical
titles need to represent equations.  Currently fields can only hold
unformatted text.

This enhancement would would  be of wider interest than just to the
Bibliographic project.

Oliver Specht has suggested that there are two ways in which this might be
achieved - to enhance the text-field, or by enhancing bookmarks. (I have
quoted his comments below.)

I would like to get some discussion on this topic and to determine which is
the better approach.

regards

David

=========================

In discussing how to achieve formatted text in fields, Oliver Specht
<[hidden email]>, wrote the following -

"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."

This issues is also detailed at the wiki address below. The wiki page has web
links to some of the relevant api and DOM descriptions.

http://wiki.services.openoffice.org/wiki/Writer_enhancements_for_OOBib#Enhanced_Field_or_Bookmark_Function_to_Include_Formatted_Text

Regards

David
--
-------------------
David N. Wilson
Co-Project Lead for the Bibliographic
OpenOffice Project
http://bibliographic.openoffice.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Enhance the Text-Field or Bookmark functions to include formatted text

Bruce D'Arcus

On Jun 26, 2006, at 9:46 PM, David Wilson wrote:

> I would like to enter an issue to enhance database and text fields to
> support
> formatted text.
>
> The Bibliographic project wants this enhancement because some data
> fields in
> the bibliography need to support formatted text. For example some
> scientific
> document titles need to be able to display words in Italics.
> Mathematical
> titles need to represent equations.  Currently fields can only hold
> unformatted text.

Actually, the need for this is more general than just markup within
fields. IIRC, this discussion happened when CPH looked into
implementing the citation support and was hoping to make use of
existing field support to display the formatted citations. The text
field didn't allow anything but plain text, so that was out.

> This enhancement would would  be of wider interest than just to the
> Bibliographic project.

Yes, I agree.

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]