<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cph</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cph"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Cph"/>
	<updated>2026-11-25T13:26:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Conference_HOW-TO&amp;diff=26261</id>
		<title>Conference HOW-TO</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Conference_HOW-TO&amp;diff=26261"/>
		<updated>2007-03-03T16:37:45Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* During the conference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Marketing}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes for OpenOffice.org Conference organising teams ==&lt;br /&gt;
===At proposal time===&lt;br /&gt;
====Place====&lt;br /&gt;
You&amp;#039;ll have to ensure that &lt;br /&gt;
* an airport and transport facilities are all around the place you&amp;#039;ve chosen for the manifestation&lt;br /&gt;
* taxis are also available for VIP or Companies.&lt;br /&gt;
* number of conference/meeting rooms is extensible.&lt;br /&gt;
* connection (wireless and LAN) to Internet is available and can be extended.&lt;br /&gt;
&lt;br /&gt;
====Team====&lt;br /&gt;
Part of the team have to be in the town where you organize the conference. This is really important because this team (2 or 3 persons) will manage all the relations. &lt;br /&gt;
&lt;br /&gt;
This part should also have good connexion with the organization hosting the OOoCon but also the administration. It will help to organize the side events and it will be easier to get the several prior authorization needed.&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t hesitate to work with the local LUG(s), even if they have not a lot to gain because it&amp;#039;s not a local event where they would have more visibility, they have been of great help for us, bringing their ideas, knowledge of the town (they already may have organized events) and formalities that are required for such crowded manifestations.&lt;br /&gt;
&lt;br /&gt;
Think of one or 2 persons that are always complementary available. &lt;br /&gt;
====Signed engagement with the hosts====&lt;br /&gt;
You have to be as precise as possible when signing this engagement :&lt;br /&gt;
* availability of the rooms and the keys (at least 2 days before the OooCon)&lt;br /&gt;
* cleaning before, during and after the conference, &lt;br /&gt;
* a technical person available able to solve all the small details like &lt;br /&gt;
** printing documents, &lt;br /&gt;
** have root access to the network when needed (for streaming for example)&lt;br /&gt;
** direct access to administration issues&lt;br /&gt;
* check with them before how many indication panels you will need and don&amp;#039;t forget to change everything if the room are moved during the preparation time.&lt;br /&gt;
====Signed engagement with sponsors====&lt;br /&gt;
Some of what was in our sponsor agreement was nonsense :&lt;br /&gt;
* one page of advertisement in the conference program : this is possible if you have one or two sponsors but having more, there is an issue with the place (you&amp;#039;ll see the number or pages growing very fast!) and the more sponsors you have the more difficulties you&amp;#039;ll met to get all their materials (logos, advertisement, and so on) in time.&lt;br /&gt;
* Be sure that you get ssh access during the conference for uploading the news promised in the agreement (that was not our case :-(&lt;br /&gt;
====Preparing the conference====&lt;br /&gt;
Think of a place where every body can meet, something like a life center close from the conference rooms. &lt;br /&gt;
&lt;br /&gt;
Have a list of taxis, plans and a list of shops where to buy “souvenirs” for your attendees.&lt;br /&gt;
Have regular meetings with the organization team and the people hosting the conf (INSA for us) to ensure that everything is clear. &lt;br /&gt;
&lt;br /&gt;
Maintaining the OooCon site takes a lot of time, so having to people dedicated to it would be good.&lt;br /&gt;
&lt;br /&gt;
The same for the program preparation (many details have to be set).&lt;br /&gt;
&lt;br /&gt;
Keep quiet in any circumstances ;-)&lt;br /&gt;
&lt;br /&gt;
Think of presents for those who are hosting you (Town hall and INSA for us)&lt;br /&gt;
====During the conference====&lt;br /&gt;
The help desk is the most important place and need a lot of energy and patience. I think having 3 people available here is a good number.&lt;br /&gt;
&lt;br /&gt;
Bottles of water in every conf rooms and renew them for each conf.&lt;br /&gt;
&lt;br /&gt;
Have a planing of rooms available for small private meeting&lt;br /&gt;
&lt;br /&gt;
Check that the video material is supporting several formats (there is difference between American, European, etc...)&lt;br /&gt;
&lt;br /&gt;
Have a room for the luggages of the attendees.&lt;br /&gt;
&lt;br /&gt;
Those people helping with the conference organization should be easily identifiable ( e.g. wearing specially printed t-shirts)&lt;br /&gt;
&lt;br /&gt;
Very clear signage to make it easy for people to know what exactly are in specific rooms ( making the printouts per day, in large font, at each room and above normal height, will make it most useful).&lt;br /&gt;
&lt;br /&gt;
Clear sign posts to locations when they are not all in the same central location.&lt;br /&gt;
&lt;br /&gt;
===Money talks===&lt;br /&gt;
Some numbers of income and outcome for past OOoCons. Please, bare in mind, that these numbers depend VERY much on country BGP (you know what I mean - 1 EUR doesn&amp;#039;t have the same price in Germany and in Slovenia :-)&lt;br /&gt;
&lt;br /&gt;
====[http://marketing.openoffice.org/ooocon2005/index.html OOoCon 2005, Koper, Slovenia]====&lt;br /&gt;
Organized by Slovenian and Italian OOo community.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Income:&amp;lt;/b&amp;gt;&lt;br /&gt;
* ~16.000 EUR cash on bank account (from sponsors)&lt;br /&gt;
* ~ 5.000 EUR direct subsidization from Sun Microsystems to conference keynotes, guests, presentators for travel costs&lt;br /&gt;
* ~ 4.000 EUR direct payment from Slovenian Ministry of Higher Education, Science and Technology to a firm that took care of broschure printing and some other material&lt;br /&gt;
&amp;lt;b&amp;gt;Total income: ~16.000 EUR&amp;lt;/b&amp;gt; (we&amp;#039;ll operate with 16.000 EUR, since this is amount we have in our pockets :-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Expenses:&amp;lt;/b&amp;gt;&lt;br /&gt;
* ~ 1.000 EUR for session and party places&lt;br /&gt;
* ~ 2.000 EUR for parties (dance group, food, drinks)&lt;br /&gt;
* ~ 4.000 EUR for T-shirts&lt;br /&gt;
* ~ 1.000 EUR for on-site expenses (paper, printer toners, cables, WLAN routers, some food ...)&lt;br /&gt;
* ~ 3.500 EUR for all rest (sleep and food for workers, for DJs and their equipment, shuttle service, hostesses ...)&lt;br /&gt;
&amp;lt;b&amp;gt;Total expenses: ~ 11.500 EUR&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, we ended up with &amp;lt;b&amp;gt;~ 4.500 EUR surplus&amp;lt;/b&amp;gt;, which we splited like:&lt;br /&gt;
* 1/2 as [http://marketing.openoffice.org/ooocon2006/index.html OOoCon 2006] sponsorship (we wanted to call this &amp;quot;a starting funds&amp;quot;, but we didn&amp;#039;t manage to transfer money to Lyon until 1 week before OOoCon ;-)&lt;br /&gt;
* 1/3 for [http://www.lugos.si LUGOS]&lt;br /&gt;
* 1/3 for [http://trieste.linux.it LUG Trieste]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Useful Links===&lt;br /&gt;
&lt;br /&gt;
These two links should help. One is a checklist devised for the Lyon conference (OOoCon 2006) the other an article published on NewsForge by an Argentine group. &lt;br /&gt;
&lt;br /&gt;
* [http://www.openoffice.org/nonav/issues/showattachment.cgi/19452/J::s%20Conference%20Checklist.txt Checklist]&lt;br /&gt;
* [http://business.newsforge.com/business/06/03/15/164255.shtml Organizing a FLOSS Conference]&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:BiblioServiceUNO.png&amp;diff=8060</id>
		<title>File:BiblioServiceUNO.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:BiblioServiceUNO.png&amp;diff=8060"/>
		<updated>2006-04-16T10:55:18Z</updated>

		<summary type="html">&lt;p&gt;Cph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8059</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8059"/>
		<updated>2006-04-16T10:53:59Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* The bibliographic UNO model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:biblioServiceUNO.png|bibliographic services]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [http://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
*http://bibliographic.openoffice.org is the home page of the bibliographic project&lt;br /&gt;
*http://www.oasis-open.org/committees/office is the home page of the OASIS ODF committee&lt;br /&gt;
*http://api.openoffice.org has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
*http://wiki.services.openoffice.org has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8058</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8058"/>
		<updated>2006-04-16T10:53:04Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* The bibliographic UNO model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:biblioServiceUNO.png]|bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [http://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
*http://bibliographic.openoffice.org is the home page of the bibliographic project&lt;br /&gt;
*http://www.oasis-open.org/committees/office is the home page of the OASIS ODF committee&lt;br /&gt;
*http://api.openoffice.org has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
*http://wiki.services.openoffice.org has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8057</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8057"/>
		<updated>2006-04-16T10:51:24Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [http://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
*http://bibliographic.openoffice.org is the home page of the bibliographic project&lt;br /&gt;
*http://www.oasis-open.org/committees/office is the home page of the OASIS ODF committee&lt;br /&gt;
*http://api.openoffice.org has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
*http://wiki.services.openoffice.org has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8056</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8056"/>
		<updated>2006-04-16T10:50:59Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [http://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *http://bibliographic.openoffice.org is the home page of the bibliographic project&lt;br /&gt;
  *http://www.oasis-open.org/committees/office is the home page of the OASIS ODF committee&lt;br /&gt;
  *http://api.openoffice.org has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *http://wiki.services.openoffice.org has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8055</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8055"/>
		<updated>2006-04-16T10:49:43Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* About the author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [http://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8054</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8054"/>
		<updated>2006-04-16T10:49:26Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* About the author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and [htp://www.zope.org Zope] based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [mailto:users@openoffice.org users@openoffice.org] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8053</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8053"/>
		<updated>2006-04-16T10:48:31Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* About the author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/ OpenApp.biz], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8052</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8052"/>
		<updated>2006-04-16T10:47:25Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* About the author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8011</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8011"/>
		<updated>2006-04-15T18:10:43Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* About the author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [http://www.OpenApp.biz/|OpenApp.biz], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8007</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8007"/>
		<updated>2006-04-15T15:03:32Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Scenario 4 : change properties in the Text.FieldMaster.Bibliography */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8006</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8006"/>
		<updated>2006-04-15T15:02:42Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8005</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8005"/>
		<updated>2006-04-15T15:00:33Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* So how is a bibliographic UNO service actually implement in C++? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8004</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8004"/>
		<updated>2006-04-15T15:00:11Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* So how is a bibliographic UNO service actually implement in C++? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;sw&amp;lt;/tt&amp;gt;&amp;lt;b&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
*&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8003</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8003"/>
		<updated>2006-04-15T13:58:45Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* So how is a bibliographic UNO service actually implement in C++? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
#change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
#rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from http://go-ooo.org/lxr/source/sw/sw ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8002</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8002"/>
		<updated>2006-04-15T13:56:38Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* The bibliographic UNO model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at http://api.openoffice.org -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
  #change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from [[http://go-ooo.org/lxr/source/sw/sw|http://go-ooo.org/lxr/source/sw/sw]] ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8001</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8001"/>
		<updated>2006-04-15T13:56:06Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* The bibliographic UNO model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at [[http://api.openoffice.org/]http://api.openoffice.org] -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
[[Image:xxx]bibliographic services]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above.&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
  #change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from [[http://go-ooo.org/lxr/source/sw/sw|http://go-ooo.org/lxr/source/sw/sw]] ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8000</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=8000"/>
		<updated>2006-04-15T13:52:51Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Brief introduction to the UNO model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at [[http://api.openoffice.org/|http://api.openoffice.org]] -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
  #change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from [[http://go-ooo.org/lxr/source/sw/sw|http://go-ooo.org/lxr/source/sw/sw]] ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=7999</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=7999"/>
		<updated>2006-04-15T12:58:42Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Current Implementation of the OpenOffice.org Bibliographic Component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Current Implementation of the OpenOffice.org Bibliographic Component===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at [[http://api.openoffice.org/|http://api.openoffice.org]] -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
  #change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from [[http://go-ooo.org/lxr/source/sw/sw|http://go-ooo.org/lxr/source/sw/sw]] ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=7998</id>
		<title>Bibliographic/Developer Page/Current Implementation of the Bibliographic Component</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/Current_Implementation_of_the_Bibliographic_Component&amp;diff=7998"/>
		<updated>2006-04-15T12:58:15Z</updated>

		<summary type="html">&lt;p&gt;Cph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
======Current Implementation of the OpenOffice.org Bibliographic Component======&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;In this article I will be explaining the citation facilities of OpenOffice.org, examining the APIs available to the programmer to manipulate the citation data, and how these API calls actually map to real C++ classes in the OpenOffice.org source code. Once you have a grasp of this it should be possible to extend this understanding to other areas similar to the citation bibliographic fields and indeed to many other areas of the OpenOffice.org C++ code.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org can be used to author many types of documents, and has many invaluable features to help the document author. For those authoring documents which cite other documents, either printed or electronic, there are several features in OpenOffice.org which are indispensable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Citations may be made in the body of the document as parenthesized citations, in footnotes at the bottom of pages, or in endnotes at the end of the document. They are generally also listed in a works cited page or section - also called the bibliography index, source list or list of references. In OpenOffice.org the work bibliography is used instead of citation. To avoid confusion I will also refer to citations as bibliography.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====How are bibliographic references used?=====&lt;br /&gt;
When a user wants to cite another document, it is a good idea for them to add this citation to their bibliographic database which is built into OpenOffice.org. Once the information is in this database a reference to this data can be inserted into the document very easily and with a  known format by using &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Bibliographic Entry&amp;lt;/tt&amp;gt;&amp;quot;. The resulting dialog allows the user to insert a bibliographic reference or to add a  new reference into the database. The final interesting operation is for the user to add the bibliographic reference list. This is done with &amp;quot;&amp;lt;tt&amp;gt;Insert&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot; -&amp;gt; &amp;quot;&amp;lt;tt&amp;gt;Indexes and Tables&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So what&amp;#039;s wrong?=====&lt;br /&gt;
While the bibliographic features currently available in OpenOffice.org are quite useful, they also have some serious limitations. For example, many scientific journals expect a specific format of the bibliographic entry and the bibliographic reference list. However the formatting possibilities are quite limited and not in the format required for many publications, and many authors have to maintain their citation and reference list manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is the bibliographic components being improved?=====&lt;br /&gt;
The OASIS OpenDocument Technical committee who established the the Open Document Format standard have accepted that one of the first modifications required is a change to the citation coding. The changes were proposed by Daniel Vogelheim of Sun and Bruce D&amp;#039;Arcus who has a lot of experience in the bibliographic world and written many bibliographic tools. These changes will allow much more powerful formatting of the bibliographic and citation information and allow the user to decide on either one of a number of predefined formats acceptable to some of the major publications, or for the user to customize the formatting to suit their own needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is this relevant for developers?=====&lt;br /&gt;
Obviously any change to the file format must mean changes to the code - at the very least to be able to read the new format into current structures and to be able to output this new format to disk also. &lt;br /&gt;
&lt;br /&gt;
However the new citation and bibliographic model also needs changes to the internal data structures of OpenOffice.org so that the user can interact with that data in a reasonable way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the rest of this article I will explain the current bibliographic implementation in OpenOffice.org. I have learned about this on my journey to understand what needs to be changed to support the new citation and bibliographic model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However even though the rest of this article talks almost exclusively about the bibliographic programming model many of the concepts will also work for the other fields available to the user (and indeed to the C++ code behind the OpenOffice.org APIs). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Brief introduction to the UNO model=====&lt;br /&gt;
There are many components within OpenOffice.org and to be able to develop these components in a reasonably independent way the interfaces between components (and indeed inside components) are described in a language called IDL (Interface Definition Language). This definition is used to generate code and to provide a well defined, language independent definition of objects and interfaces available. &lt;br /&gt;
&lt;br /&gt;
IDL objects and interfaces are not just for the OOo developer, but also can be used by the power user by using languages such as StarBasic. The IDL language supports object inheritance and containment as well as the definition of attributes and actions. IDL objects can also have containment like relationships between objects. An object defined by this language is usually referred to as an UNO service.&lt;br /&gt;
&lt;br /&gt;
Generally UNO services are defined in terms of interfaces and properties (i.e. attributes). An interface is normally a collection of methods and properties which make sense grouped together e.g. an interface for manipulating the cursor, or an interface to manipulate a text field. Interfaces are always easy to recognise in IDL from their names as they always start with an &amp;quot;X&amp;quot;. Interfaces are just one facet of a service and cannot exist independently of a service. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The objects actually instantiated are services, and in order to work on an interface of a service we must use an UNO mechanism to get that interface. You will shortly see how that looks both in terms of the object model and the C++ code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====The bibliographic UNO model=====&lt;br /&gt;
All of the objects for the bibliographic model are fully described in the IDL reference at [[http://api.openoffice.org/|http://api.openoffice.org]] -&amp;gt; &amp;quot;IDL reference&amp;quot; under &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;. Note that I am using &amp;quot;&amp;lt;tt&amp;gt;Text.&amp;lt;/tt&amp;gt;&amp;quot; as a shorthand notation for the full IDL notation &amp;quot;&amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt;&amp;quot;. The main UNO services we will be talking about are &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography.&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object contains the individual citation data and is associated with a particular point in the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object contains the general settings which are used to generate the bibliographic reference list. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The inheritance and containment relevant to the bibliographic services are :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see for example that the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service inherits from the &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; service and the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; and has an attribute with a reference to the relevant &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many &amp;lt;tt&amp;gt;Text.TextFields&amp;lt;/tt&amp;gt; objects have a reference to a &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; object which defines general settings for all of the dependent text fields. This is the case for the bibliographic fields. The &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service defines properties such as sorting options, locale, prefix and suffix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Above you can see that the &amp;lt;tt&amp;gt;Text.TextDocument &amp;lt;/tt&amp;gt;service has an interface called &amp;lt;tt&amp;gt;Text.XTextFieldsSupplier&amp;lt;/tt&amp;gt; which contains two methods. The first method &amp;lt;tt&amp;gt;getTextFields()&amp;lt;/tt&amp;gt; returns a list of all of the &amp;lt;tt&amp;gt;Text.TextField &amp;lt;/tt&amp;gt;derived services contained in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt; object. The second method returns a named list of the &amp;lt;tt&amp;gt;Text.FieldMaster &amp;lt;/tt&amp;gt;derived services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Knowing the above IDL and examining the relevant properties of the service it is possible to write routines in C++, StarBasic, Java or Python to create, manipulate or delete bibliographic fields in your document. Below you will see some trivial C++ code using these UNO interfaces and services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However for the purposes of this article, we will not be looking in depth at how to use the UNO APIs as we are much more interested in getting into the code which lies behind the UNO services described above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====So how is a bibliographic UNO service actually implement in C++?=====&lt;br /&gt;
I shall use the following scenarios to give a reasonable overview of what C++ classes and methods are involved :&lt;br /&gt;
&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #creating a &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #associating the &amp;lt;tt&amp;gt;Text.Field.Bibliography&amp;lt;/tt&amp;gt; service with a piece of text in the &amp;lt;tt&amp;gt;Text.TextDocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
  #change properties in the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; object&lt;br /&gt;
  #rendering the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; object in the document&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most of the important code for the bibliographic implementation can be found in the &amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; module in CVS (you can browse this code from [[http://go-ooo.org/lxr/source/sw/sw|http://go-ooo.org/lxr/source/sw/sw]] ). This is the module which implements most of the Writer specific functionality ( hence &amp;quot;&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;sw&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt;&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within this module we will mostly be looking at three specific files :&lt;br /&gt;
&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unomap.cxx&amp;lt;/tt&amp;gt; : this contains the mapping between many &amp;lt;tt&amp;gt;com.sun.star.text&amp;lt;/tt&amp;gt; objects and the implementation of the properties of the object. e.g. search for &amp;lt;tt&amp;gt;PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY&amp;lt;/tt&amp;gt; and you will find the definitions of the bibliographic text field&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/unocore/unofield.cxx&amp;lt;/tt&amp;gt; : this file contains the code which implements much of the public interfaces of the &amp;lt;tt&amp;gt;Text.TextField&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; UNO services e.g. getting and setting properties in the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; to attaching the &amp;lt;tt&amp;gt;TextField&amp;lt;/tt&amp;gt; object to a specific range of text in the document.&lt;br /&gt;
  *&amp;lt;tt&amp;gt;source/core/fields/authfld.cxx&amp;lt;/tt&amp;gt; : this file contains classes which actually implement the behaviours and interacts with the core of the SW module and is closely related to visualizing and storing the bibliographic entries.&lt;br /&gt;
&lt;br /&gt;
=====Scenario 1 : creating a Text.TextField.Bibliography object=====&lt;br /&gt;
To create such an object the C++ code would look similar to :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; biblioField = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.TextField.Bibliography&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The call above is to  &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the bibliographic service i..e &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;. The object returned is a &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; which is a UNO type from which almost all other UNO types derive. This object represents the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 2 : creating a Text.FieldMaster.Bibliography object=====&lt;br /&gt;
To properly use a &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service we must also create a  &amp;lt;tt&amp;gt;TextFieldMaster.Bibliography&amp;lt;/tt&amp;gt; service. This is almost the same as the call above except of course it is a different service to be created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
Reference&amp;lt;XInterface&amp;gt; master = xFactory-&amp;gt;createInstance( &lt;br /&gt;
	OUString::createFromAscii(&amp;quot;com.sun.star.text.FieldMaster.Bibliography&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again the call above is to &amp;lt;tt&amp;gt;SwXTextDocument::createInstance()&amp;lt;/tt&amp;gt; which causes the &amp;lt;tt&amp;gt;SwXServiceProvider::MakeInstance()&amp;lt;/tt&amp;gt; method to call the constructor of the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service i.e. &amp;lt;tt&amp;gt;SwXFieldMaster&amp;lt;/tt&amp;gt;. The object returned  represents the &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 3 : associating the Text.Field.Bibliography service with a piece of text in the Text.TextDocument=====&lt;br /&gt;
The next step is to establish the relationship between these two objects. The IDL defined relationship is that the inherited &amp;lt;tt&amp;gt;DependentTextField&amp;lt;/tt&amp;gt; service of the &amp;lt;tt&amp;gt;TextField.Bibliography&amp;lt;/tt&amp;gt; service has an interface called &amp;lt;tt&amp;gt;XDependentTextField&amp;lt;/tt&amp;gt;. However before we do anything with the returned &amp;lt;tt&amp;gt;XInterface&amp;lt;/tt&amp;gt; we need to make sure that it is valid. This is simply done by calling the &amp;lt;tt&amp;gt;.is()&amp;lt;/tt&amp;gt; method like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
if( biblioField.is() )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which returns true to indicate that the object is valid.&lt;br /&gt;
&lt;br /&gt;
To obtain the &amp;lt;tt&amp;gt;Text.XDependentTextField&amp;lt;/tt&amp;gt; interface from the &amp;lt;tt&amp;gt;biblioField&amp;lt;/tt&amp;gt; object we simply query the object for the interface like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XDependentTextField&amp;gt; xDepTextField(biblioField,UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The querying of the interface objects from the service is pretty standard UNO mechanism and explained very well in the Developers Guide, so I am not going to add anymore about that here.&lt;br /&gt;
&lt;br /&gt;
 Now there is an method on this interface to attach the master field, however it only works on an &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface so we muct obtain that interface from the master object like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; masterProps( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Finally we can associate the two objects :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xDepTextField-&amp;gt;attachTextFieldMaster( masterProps );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
However the call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is interesting as it calls methods on both the implementation for the two objects.&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;attachTextFieldMaster()&amp;lt;/tt&amp;gt; is actually a call to &amp;lt;tt&amp;gt;SwXTextField::attachTextFieldMaster()&amp;lt;/tt&amp;gt; where the type of the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; is obtained by calling the &amp;lt;tt&amp;gt;SwXFieldMaster::GetFldType()&amp;lt;/tt&amp;gt; and is set in the attribute &amp;lt;tt&amp;gt;m_sTypeName&amp;lt;/tt&amp;gt; of the instance of the &amp;lt;tt&amp;gt;SwXTextField&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now that the master field is attached we only need to insert the field into the document. To do this we need to work on the &amp;lt;tt&amp;gt;Text.XTextContent&amp;lt;/tt&amp;gt; interface from the bibliofield instance. The following shows an example of how to insert the field in the document at a defined range :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XTextContent&amp;gt; xTextContent( biblioField, UNO_QUERY);&lt;br /&gt;
	Reference&amp;lt;XText&amp;gt; xText( document, UNO_QUERY);&lt;br /&gt;
&lt;br /&gt;
	xText -&amp;gt; insertTextContent( xRange, xTextContent );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Scenario 4 : change properties in the Text.FieldMaster.Bibliography=====&lt;br /&gt;
Changing a property needs the &amp;lt;tt&amp;gt;XPropertySet&amp;lt;/tt&amp;gt; interface. As you have already seen to get an interface is quite easy :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Reference&amp;lt;XPropertySet&amp;gt; xPropSet( master, UNO_QUERY );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now to set a property we need to call the method &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; with the name of the property to set and the new value. The new value is passed as an &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;Any&amp;lt;/tt&amp;gt; object has to have the new value set with the &amp;quot;&amp;lt;tt&amp;gt;&amp;lt;&amp;lt;=&amp;lt;/tt&amp;gt;&amp;quot; operator like  :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	Any newValue;&lt;br /&gt;
	newValue &amp;lt;&amp;lt;= OUString::createFromAscii( &lt;br /&gt;
			&amp;quot;string before the bibliographic field&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The s&amp;lt;tt&amp;gt;etPropertyValue()&amp;lt;/tt&amp;gt; method is then called as :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code oobas&amp;gt;&lt;br /&gt;
	xPropSet-&amp;gt;setPropertyValue( &lt;br /&gt;
			OUString::createFromAscii( &amp;quot;BracketBefore&amp;quot;), newValue );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;setPropertyValue()&amp;lt;/tt&amp;gt; call is actually a call to &amp;lt;tt&amp;gt;SwXFieldMaster::setPropertyValue()&amp;lt;/tt&amp;gt; where the first parameter (the name of the property) is compared with the known properties for the &amp;lt;tt&amp;gt;FieldMaster&amp;lt;/tt&amp;gt; object and when a match is found the properties in the object is set. &lt;br /&gt;
&lt;br /&gt;
These UNO objects do not have a strong interaction with the internals of the Writer component. Rather there is a corresponding private object which implements much of the behaviour for the public UNO object. For the &amp;lt;tt&amp;gt;Text.TextField.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; which is the private implementation class, and  for &amp;lt;tt&amp;gt;Text.FieldMaster.Bibliography&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. There are also equivalents for the base classes : for &amp;lt;tt&amp;gt;Text.DependentTextField&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwField&amp;lt;/tt&amp;gt; and for &amp;lt;tt&amp;gt;Text.FieldMaster&amp;lt;/tt&amp;gt; it is &amp;lt;tt&amp;gt;SwFieldType&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thus in the above scenario the properties are not actually stored in the UNO object but in the &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt; object by calling the &amp;lt;tt&amp;gt;PutValue()&amp;lt;/tt&amp;gt; method on that class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Scenario 5 : rendering the Text.TextField.Bibliography =====&lt;br /&gt;
The actual call to render the contents of the field is to the &amp;lt;tt&amp;gt;SwAuthorityField&amp;lt;/tt&amp;gt; object on the &amp;lt;tt&amp;gt;Expand()&amp;lt;/tt&amp;gt; method. This can be triggered in many ways including an edit ocurring to a neighbouring position, loading of the document, refreshing the document, etc. The &amp;lt;tt&amp;gt;SwAuthorityField::Expand()&amp;lt;/tt&amp;gt; method acts on the data of the bibliographic entry and formats the string as per the definition in the associated &amp;lt;tt&amp;gt;SwAuthorityFieldType&amp;lt;/tt&amp;gt;. This string is then returned by this method and is rendered in the document view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Conclusion=====&lt;br /&gt;
This article has concentrated on the basic functionalities of the bibliographic component of OpenOffice.org. It has touched on the high level UNO services and examined how some of the common calls translate to calls in the C++ code. &lt;br /&gt;
&lt;br /&gt;
Using what you have learned here, it should also be a bit easier to see the mapping from UNO API calls on &amp;lt;tt&amp;gt;Text.Fields&amp;lt;/tt&amp;gt; to the C++ code implementing the actual behaviour. Indeed if you can understand the above, then it can be extended into other areas of OpenOffice.org to see how other UNO services are actually implemented.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====About the author=====&lt;br /&gt;
CP Hennessy is CTO of  [[http://www.OpenApp.biz/|OpenApp.biz]], a content and document management company using the features of OpenOffice.org and Zope based enterprise content management systems. Using this powerful technology, systems have been developed for one of the leading news sites in Ireland, a customer relationship and billing system for an electrical supply company and a document management system for one of the largest hospitals in Ireland, and a richly integrated GIS and statistal data analyis portal. With Blackrock Education, OpenApp also has published the first ECDL accredited StarOffice training manual, and is launching a learning management system to support these materials.&lt;br /&gt;
&lt;br /&gt;
CP Hennessy is also heavily involved and moderator on the [[mailto:users@openoffice.org|users@openoffice.org]] mailing list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Further Reading=====&lt;br /&gt;
  *[[http://bibliographic.openoffice.org/|http://bibliographic.openoffice.org/]] is the home page of the bibliographic project&lt;br /&gt;
  *[[http://www.oasis-open.org/committees/office|http://www.oasis-open.org/committees/office]] is the home page of the OASIS ODF committee&lt;br /&gt;
  *[[http://api.openoffice.org/|http://api.openoffice.org]] has a complete reference on the UNO services and a very complete Developers Guide&lt;br /&gt;
  *[[http://wiki.services.openoffice.org/|http://wiki.services.openoffice.org/]] has lots of information on developing for OpenOffice.org&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Theses_articles&amp;diff=7997</id>
		<title>Theses articles</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Theses_articles&amp;diff=7997"/>
		<updated>2006-04-15T12:57:56Z</updated>

		<summary type="html">&lt;p&gt;Cph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Submitted in March===&lt;br /&gt;
[[Current Implementation of the OpenOffice.org Bibliographic Component]] by CPHennessy&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OpenOffice.org_Developer_Article_Contest&amp;diff=7996</id>
		<title>OpenOffice.org Developer Article Contest</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OpenOffice.org_Developer_Article_Contest&amp;diff=7996"/>
		<updated>2006-04-15T12:56:55Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Submitted Articles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contest Overview ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;OpenOffice.org Developer Article Contest starts on February 1, 2006&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dear developers and technical writers,&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org, with the support of Team OpenOffice.org e.V. and  extra sponsorship from Sun Microsystems, announces its first  Developer Contest starting February 1, 2006. The goal of the  developer contest is to generate more developer documentation. We are  also interested in promoting OpenOffice.org to developers at the same  time.&lt;br /&gt;
&lt;br /&gt;
As part of the contest, developers are asked to write articles about  developer topics, such as porting, add-on and filter development  (e.g. new wizards, Calc functions, chart types, etc.), bug fixing,  etc. Every month a committee will pick the best article from the pool  of submitted articles. Articles that did not initially win will stay  in the pool, so that they can still win later.&lt;br /&gt;
&lt;br /&gt;
Detailed rules can be found here: http://wiki.services.openoffice.org/wiki/OpenOffice.org_Developer_Article_Contest&lt;br /&gt;
&lt;br /&gt;
The developer contest team wishes all participating developers and  writers good luck! We look forward to receiving the first articles.&lt;br /&gt;
&lt;br /&gt;
Best regards,&lt;br /&gt;
&lt;br /&gt;
The OpenOffice.org Developer Contest Team&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Winners==&lt;br /&gt;
&lt;br /&gt;
February 2006 : &amp;#039;&amp;#039;&amp;#039;Cedric Bosdonnat - &amp;quot;[[JavaEclipseTuto|UNO Java component creation explained]]&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Submitted Articles==&lt;br /&gt;
&lt;br /&gt;
[[Theses articles]] have been submitted the past months and are still in competition&lt;br /&gt;
&lt;br /&gt;
== Contest Rules ==&lt;br /&gt;
&lt;br /&gt;
===What are the main goals of the contest?===&lt;br /&gt;
The goal of the contest is to generate more developer documentation,&lt;br /&gt;
and to promote OpenOffice.org to developers at the same time.&lt;br /&gt;
&lt;br /&gt;
===What is the task of the contest?===&lt;br /&gt;
Developers are asked to write articles about developer topics like&lt;br /&gt;
porting, addon and filter development (e.g. new wizards, Calc&lt;br /&gt;
functions, chart types, etc.), bug fixing, etc.&lt;br /&gt;
&lt;br /&gt;
===What can be won?===&lt;br /&gt;
Each winner gets $750. The money will be transferred preferably via PayPal, or via bank transfer otherwise.&lt;br /&gt;
&lt;br /&gt;
===What criteria do articles have to meet to get accepted?===&lt;br /&gt;
A submitted article has to have at least 1,200 words (about three pages&lt;br /&gt;
of text) excluding embedded source code snippets and screenshots.&lt;br /&gt;
Only articles written in English can be accepted. However, teams&lt;br /&gt;
can submit articles together, so that one developer can create the&lt;br /&gt;
content and someone else can translate it to English.&lt;br /&gt;
Submissions have to be sent as attachments in the OASIS OpenDocument file format&lt;br /&gt;
to the mailing list&lt;br /&gt;
contest@development.openoffice.org on or before the&lt;br /&gt;
submission deadline date. Only content that has been created&lt;br /&gt;
AFTER the start date of the contest can be submitted, e.g.&lt;br /&gt;
old articles and blog entries cannot be used.&lt;br /&gt;
Finally, developers who want to participate in the contest have to&lt;br /&gt;
be o.k. with the licensing terms of the &lt;br /&gt;
[http://www.openoffice.org/FAQs/faq-licensing.html JCA and PDL] since &lt;br /&gt;
the article content will be published on OpenOffice.org under these terms.&lt;br /&gt;
&lt;br /&gt;
===What criteria will be used to choose a winner?===&lt;br /&gt;
&lt;br /&gt;
There will be no 100% scientific and measurable criteria. Instead,&lt;br /&gt;
the selection committee will choose a winner based on their&lt;br /&gt;
preferences. Nevertheless, the following criteria will influence&lt;br /&gt;
the chances of winning:&lt;br /&gt;
&lt;br /&gt;
* relevance to developers&lt;br /&gt;
* existing and urgent gaps&lt;br /&gt;
* &amp;quot;cool stuff&amp;quot;&lt;br /&gt;
* amount of sample code&lt;br /&gt;
* comprehensibility&lt;br /&gt;
* length (not too long, not too short)&lt;br /&gt;
* illustrations (screenshots, diagrams)&lt;br /&gt;
* enables new developers&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
For entering the contest it does not matter what tools (e.g. NetBeans, Eclipse,&lt;br /&gt;
Microsoft Visual Studio, Borland Delphi, etc.) or programming languages &lt;br /&gt;
(e.g. C++, Java, Python, Perl, etc.) are used. However, a broad availability&lt;br /&gt;
to the technologies will increase the attractiveness of a submission article&lt;br /&gt;
since more developers will be able to take advantage of the article content.&lt;br /&gt;
&lt;br /&gt;
===What will be done with the articles?===&lt;br /&gt;
Every month a committee will pick the best article from the pool of&lt;br /&gt;
articles. Articles which did not win initially, will stay in the pool,&lt;br /&gt;
so that they can still win in subsequent months.&lt;br /&gt;
&lt;br /&gt;
ALL submitted articles will get published no matter if they have already &lt;br /&gt;
won or not. Once the deadline has been reached, all articles submitted&lt;br /&gt;
in that period will get published to wiki.services.openoffice.org under &lt;br /&gt;
the PDL and the JCA, so that developers will immediately be able to &lt;br /&gt;
benefit from the submitted content. Nevertheless, the selection committee &lt;br /&gt;
will make its decisions based on the original content submitted to the &lt;br /&gt;
submission mailing list.&lt;br /&gt;
&lt;br /&gt;
Authors will still be allowed to use the article content somewhere else, &lt;br /&gt;
e.g. for a magazine, book or personal web site. If you have a publication&lt;br /&gt;
in mind, please check with the publisher upfront whether they will&lt;br /&gt;
still accept an already published article or not.&lt;br /&gt;
&lt;br /&gt;
===Who can participate?===&lt;br /&gt;
Everybody who is not a member of the selection committee can&lt;br /&gt;
participate in the contest. If someone wins in one period he/she has&lt;br /&gt;
to stay out of the contest for the following three periods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Who is running the contest?===&lt;br /&gt;
OpenOffice.org with the support of Team OpenOffice.org e.V. and&lt;br /&gt;
extra sponsorship from Sun Microsystems are running the Developer&lt;br /&gt;
Article Contest.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Who is in the selection committee?===&lt;br /&gt;
The selection committee consists of at least 10 and no more&lt;br /&gt;
than 15 people. Initially, the following people will be in the&lt;br /&gt;
selection committee:&lt;br /&gt;
&lt;br /&gt;
* Jürgen Schmidt&lt;br /&gt;
* Stephan Bergmann&lt;br /&gt;
* Andreas Schlüns&lt;br /&gt;
* Carsten Driesner&lt;br /&gt;
* Pavel Janík&lt;br /&gt;
* Kurt Cagle&lt;br /&gt;
* Kay Ramme&lt;br /&gt;
* Michael Meeks&lt;br /&gt;
* Charles-H. Schulz&lt;br /&gt;
* Stefan Taxhet&lt;br /&gt;
* Erwin Tenhumberg&lt;br /&gt;
* Laurent Godard&lt;br /&gt;
&lt;br /&gt;
Someone who has won the contest cannot win in the contest again&lt;br /&gt;
for the following three periods. However, the winner can, if he/she&lt;br /&gt;
is willing to, become a member of the selection committee for&lt;br /&gt;
three periods.&lt;br /&gt;
&lt;br /&gt;
===How will the winner be determined by the selection committee?===&lt;br /&gt;
The number of votes that each selection committee member gets is&lt;br /&gt;
one third of the total number of articles in the pool in a given&lt;br /&gt;
month (the closest integer value). Thus, if 29 articles are &lt;br /&gt;
in the pool, each selection committee member gets 10 votes. Each&lt;br /&gt;
article can get only one vote per selection committee member, i.e.&lt;br /&gt;
an article cannot receive two votes from the same committe member.&lt;br /&gt;
At least 70% of the selection committe members must have voted.&lt;br /&gt;
The article with the most votes wins. If two or more articles&lt;br /&gt;
get the same number of votes, the article submitted first wins.&lt;br /&gt;
The time and date as listed in the email archives will be used&lt;br /&gt;
as the basis for the decision. The votes are reset to zero for &lt;br /&gt;
each contest period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===When will the contest start?===&lt;br /&gt;
The first round of the contest ended on February 28. The second round started on March 1, 2006 and will end on March 31, 2006.&lt;br /&gt;
&lt;br /&gt;
===When will the contest end?===&lt;br /&gt;
The contest will at least run for six months. Depending on the&lt;br /&gt;
success, it might get extended to twelve months.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How often will a winner be selected?===&lt;br /&gt;
A winner will be selected for every month. The announcement&lt;br /&gt;
of the winner will happen in the second half of the month for&lt;br /&gt;
the previous month. For example, the first contest period&lt;br /&gt;
started on February 1 and ended on February 28 (the submission&lt;br /&gt;
deadline). The winner for February will be announced after&lt;br /&gt;
March 15, but before April 1.&lt;br /&gt;
&lt;br /&gt;
===When is the deadline for every contest period?===&lt;br /&gt;
The deadline for every contest period, i.e. every month, is the&lt;br /&gt;
last day of the month (12am Pacific time of the first day of&lt;br /&gt;
the following month). Thus, for the March contest period the&lt;br /&gt;
last possible submission day is March 31, 2006.&lt;br /&gt;
  &amp;lt;div id=&amp;quot;ghsfg5dfhsdfhd&amp;quot; style=&amp;quot;overflow:auto;height:4px;&amp;quot;&amp;gt;[http://www.zorpia.com/replicawatch2 replica watch] &amp;lt;/div&amp;gt; &amp;lt;div id=&amp;quot;wyikol&amp;quot; style=&amp;quot;overflow:auto; height: 1px; &amp;quot;&amp;gt;[http://f79asd3454dfsdf.com 5656456222]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div  style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
[We are delicate. We do not delete your content.]&lt;br /&gt;
[l_sp77]&lt;br /&gt;
&lt;br /&gt;
[http://kharkovcity.blogs.eurosport.com/ ephedrine hcl]&lt;br /&gt;
[http://my.opera.com/sedu-hair/homes/blog/sedu-hair-straightener.html sedu hair straightener] &lt;br /&gt;
[http://my.opera.com/my-dianabol/homes/blog/russian-dianabol.html russian dinanbol]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=hydrocodone-apap hydrocodone apap]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=order-ativan order ativan]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=ativan-lorazepam ativan lorazepam]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=purchase-ativan purchase ativan]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-ativan-online buy ativan online]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=tramadol-180 tramadol 180]&lt;br /&gt;
[http://members.fotki.com/verizon-ringtone verizon ringtone]&lt;br /&gt;
[http://members.fotki.com/sprint-ringtone sprint ringtone]&lt;br /&gt;
[http://mysite.com.ua/xdem8171/pagesxdem8171/1_1.html 2mg xanax order]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=motorola-ringtones-free motorola ringtones free]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=free-nokia-ringtone free nokia ringtone]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=download-free-ringtone download free ringtone]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=free-mp3-ringtone free mp3 ringtone]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=free-cingular-ringtones free cingular ringtones]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=us-cellular-ringtones us cellular ringtones]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=sprint-ringtone sprint ringtone]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=sleeper-sofa sleeper sofa]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=amsouth-bank amsouth bank]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=personalized-christian-gift personalized christian gift]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=wall-murals wall murals]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=gas-scooter gas scooter]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=platform-bed platform bed]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=toddler-bedding toddler bedding]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=prepaid-credit-cards prepaid credit cards]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=neck-pillow neck pillow]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=toddler-bed toddler bed]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/index.html ditech mortgage]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-company.html ditech mortgage company]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage.html ditech mortgage]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-loan.html ditech mortgage loan]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-from-home-loan-mortgage-second.html ditech from home loan mortgage second]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=rivotril rivotril]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-valium buy valium]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=phentermine-37-5mg phentermine 37 5mg]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=phentermine-no-prescription phentermine no prescription]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-ultram buy ultram]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=ambien-cr ambien cr]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=cheap-fioricet cheap fioricet]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-bontril bontril]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=bontril-sr bontril sr]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-propecia buy propecia]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=order-propecia order propecia]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=didrex-online didrex online]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=generic-levitra generic levitra]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=paxil-cr paxil cr]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-butalbital butalbital]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=adipex-p adipex p]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=cheap-xenical cheap xenical]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-clonazepam clonazepam]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=wellbutrin-xl wellbutrin xl]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=phendimetrazine phendimetrazine]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=diethylpropion- diethylpropion]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=zoloft-side-effects zoloft side effects]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=klonopin klonopin]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=flexeril flexeril]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-codeine codeine]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=acyclovir- acyclovir]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-diflucan diflucan]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=buy-nexium nexium]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=bextra-vioxx bextra]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=fastin fastin]&lt;br /&gt;
[http://www.buddy4u.com/view/?u=prilosec-otc prilosec otc]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgages.html ditech mortgages]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/company-ditech-mortgage.html company ditech mortgage]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-interest-rates.html ditech mortgage interest rates]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/mortgage-calculator-and-ditech.html mortgage calculator and ditech]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-loan-mortgage.html ditech loan mortgage]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-calculator.html ditech mortgage calculator]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-company.html ditech mortgage company]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-home-mortgage.html ditech home mortgage]&lt;br /&gt;
[http://ditech-mortgage.altavista.in.ua/ditech-mortgage-rate.html ditech mortgage rate]&lt;br /&gt;
[http://tamiflu.algohio.com buy tamiflu]&lt;br /&gt;
[http://herring.cc.gatech.edu/ActiveLiving buy tenuate]&lt;br /&gt;
[http://herring.cc.gatech.edu/ActiveSeniors Sports Wagering]&lt;br /&gt;
[http://herring.cc.gatech.edu/Arch4303 payday loan application]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Hacking&amp;diff=3916</id>
		<title>Hacking</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Hacking&amp;diff=3916"/>
		<updated>2006-01-11T01:20:12Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Can I get a &amp;lt;code&amp;gt;char *&amp;lt;/code&amp;gt;, please? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== My first hack ==&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      So - we&amp;#039;ve built and run OO.o, and we want to prove to ourselves&lt;br /&gt;
      that it is in fact possible to hack on it. So in a new terminal&lt;br /&gt;
      do this:&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;pre&amp;gt;&lt;br /&gt;
      cd build/src680-m66&lt;br /&gt;
      . ./LinuxIntelEnv.Set.sh&lt;br /&gt;
      cd vcl&lt;br /&gt;
    &amp;lt;/pre&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      Now have a hack at vcl/source/window/toolbox2.cxx; I suggest&lt;br /&gt;
      adding (eg.) an &amp;lt;code&amp;gt;nPos = 0&amp;lt;/code&amp;gt; anywhere before the&lt;br /&gt;
      m_aItems.insert in the 4rd InsertItem method:&lt;br /&gt;
      &amp;lt;code&amp;gt;void ToolBox::InsertItem( USHORT nItemId, const XubString&amp;amp; rText,&lt;br /&gt;
	ToolBoxItemBits nBits, USHORT nPos )&amp;lt;/code&amp;gt;.&lt;br /&gt;
      Then save.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
       You can find more things to hack in the [[Tutorials]].&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      You&amp;#039;re still in vcl/ yes ? then type &amp;#039;build debug=true&amp;#039;; wait&lt;br /&gt;
      for the scrolling text to stop; (5 seconds?). Now re-run&lt;br /&gt;
      &amp;lt;code&amp;gt;soffice -writer&amp;lt;/code&amp;gt;. You should notice the effect.&lt;br /&gt;
      If not, ensure the previous soffice.bin was dead with&lt;br /&gt;
      &amp;lt;code&amp;gt;killall -9 soffice.bin&amp;lt;/code&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; for day to day hacking you want to&lt;br /&gt;
      just run &amp;#039;build&amp;#039; inside the source tree. It is also highly&lt;br /&gt;
      recommended to work inside a copy of the build tree, and&lt;br /&gt;
      generate / test patches in an un-hacked version.&lt;br /&gt;
      To copy just the build/src680-m66 directory elsewhere, you&lt;br /&gt;
      need to use the [[ relocate ]] tool.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
== Read the Fine manual ==&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      With the power of C++ comes the ability to shoot yourself in the&lt;br /&gt;
      foot all the more easily; (and implicitly), cf. &amp;lt;em&amp;gt;Holub,&lt;br /&gt;
      Rules for C and C++ programming, McGraw-Hill, 95&amp;lt;/em&amp;gt;.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      The best way to prepare yourself for battle is to read the&lt;br /&gt;
      [http://tools.openoffice.org/CodingGuidelines.sxw OpenOffice coding guidelines], and for the easily confused c&amp;#039;tor / d&amp;#039;tor is short for&lt;br /&gt;
      constructor / destructor.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sending patches ==&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      It is seldom clear which module a patch resides in in bugzilla.&lt;br /&gt;
      A quick way to try and work this out is to do:&lt;br /&gt;
      &amp;lt;code&amp;gt;cvs status &amp;lt;somefile&amp;gt; | head&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      This should give a &amp;#039;Repository Revision:&amp;#039; line, with a path, the&lt;br /&gt;
      2nd fragment of this is the project name,&lt;br /&gt;
      &amp;lt;code&amp;gt;ooo-build/bin/owner&amp;lt;/code&amp;gt; automates that process for you.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      In addition, since the mapping of module names to IssueZilla&lt;br /&gt;
      tickets is rather contorted &amp;amp;amp; un-documented, if you know&lt;br /&gt;
      what module the bug is in, use [http://go-ooo.org/bug.html http://go-ooo.org/bug.html]&lt;br /&gt;
      page to file it.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting the right app ==&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      As you start soffice.bin, there are several useful parameters to&lt;br /&gt;
      use to accelerate your debugging experience; particularly&lt;br /&gt;
      &amp;lt;code&amp;gt;-writer&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-calc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-draw&amp;lt;/code&amp;gt;,&lt;br /&gt;
      and (the wizardly painful) &amp;lt;code&amp;gt;-impress&amp;lt;/code&amp;gt; arguments.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding D&amp;#039; make (man) ==&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      While the build system is in similar to many other systems, it&lt;br /&gt;
      is also perhaps slightly different. The overview is that each&lt;br /&gt;
      module is &amp;lt;i&amp;gt;built&amp;lt;/i&amp;gt;, and then the results are &amp;lt;i&amp;gt;delivered&amp;lt;/i&amp;gt;&lt;br /&gt;
      into the [http://www.openoffice.org/dev_docs/source/solver.html solver]&lt;br /&gt;
      . Each module builds against the headers&lt;br /&gt;
      in the solver. Thus there are a few intricacies.&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;li id=&amp;quot;build&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;i&amp;gt;build&amp;lt;/i&amp;gt; &amp;amp;mdash; this perl script &amp;lt;i&amp;gt;solenv/bin/build.pl&amp;lt;/i&amp;gt; is&lt;br /&gt;
	  used in conjunction with [[Hacking#prj/build.lst|prj/build.lst]]&lt;br /&gt;
	  to ensure that every module that is needed is built first.&amp;lt;br/&amp;gt;&lt;br /&gt;
	  build then un-winds internal module dependencies, and builds&lt;br /&gt;
	  each module with a chdir, dmake pair.&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;li id=&amp;quot;deliver&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;i&amp;gt;deliver&amp;lt;/i&amp;gt; &amp;amp;mdash; this perl script &amp;lt;i&amp;gt;solenv/bin/deliver.pl&amp;lt;/i&amp;gt;&lt;br /&gt;
	  installs headers, and libraries (etc.) into the solver, as&lt;br /&gt;
	  informed by [[Hacking#prj/d.lst|prj/d.lst]]. Crucially&lt;br /&gt;
	  deliver ensures that the date stamp on any file that is&lt;br /&gt;
	  installed to the solver is the same as that in the module&amp;#039;s&lt;br /&gt;
	  directory. This ensures, that (particularly for headers) that&lt;br /&gt;
	  there is no dependency cascade triggering re-builds in other&lt;br /&gt;
	  modules.&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Standard directories ===&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      There are various standard directories and files in most of the&lt;br /&gt;
      modules that make up OO.o, here are some of the more useful:&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;prj&amp;lt;/b&amp;gt;&lt;br /&gt;
	  &amp;lt;ul&amp;gt;&lt;br /&gt;
	    &amp;lt;li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	       &amp;lt;i&amp;gt;build.lst&amp;lt;/i&amp;gt; &amp;amp;mdash; this lists directories to be made,&lt;br /&gt;
	       &amp;#039;^#&amp;#039; comments are allowed, the order of the list is&lt;br /&gt;
	       immaterial see [[Hacking#prj/build.lst | detail]], it&lt;br /&gt;
	       is dictates &amp;lt;i&amp;gt;build&amp;lt;/i&amp;gt;&amp;#039;s operation.&lt;br /&gt;
	    &amp;lt;/li&amp;gt;&lt;br /&gt;
	    &amp;lt;li&amp;gt;&amp;lt;i&amp;gt;d.lst&amp;lt;/i&amp;gt; &amp;amp;mdash; this file describes the &amp;lt;i&amp;gt;deliver&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	       process, see [[Hacking#prj/d.lst | detail]].&lt;br /&gt;
	    &amp;lt;/li&amp;gt;&lt;br /&gt;
	  &amp;lt;/ul&amp;gt;&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&lt;br /&gt;
	  &amp;lt;b&amp;gt;util&amp;lt;/b&amp;gt; &amp;amp;mdash; typically the util directory is charged with&lt;br /&gt;
	  glueing together the sub-libraries for each sub-module into&lt;br /&gt;
	  a single large library, adding system library dependencies,&lt;br /&gt;
	  building GUI resource files etc. All the work is described in&lt;br /&gt;
	  &amp;lt;i&amp;gt;makefile.mk&amp;lt;/i&amp;gt;, this is usually the last directory to be&lt;br /&gt;
	  built in a project.&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;li&amp;gt;&lt;br /&gt;
	  &amp;lt;b&amp;gt;inc&amp;lt;/b&amp;gt; &amp;amp;mdash; public headers are typically separated&lt;br /&gt;
	  into an &amp;#039;inc&amp;#039; directory, these will be installed into&lt;br /&gt;
	  the solver by the &amp;#039;deliver&amp;#039; phase (using [[Hacking#prj/d.lst | prj/d.lst]])&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      Build&amp;#039;s mode of operation is to invoke &amp;#039;dmake&amp;#039; in each of the&lt;br /&gt;
      projects&amp;#039; directories with a given dependency order. dmake&lt;br /&gt;
      then executes the rules in makefile.mk.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prj/build.lst ===&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
    On first view build.lst looks scary:&lt;br /&gt;
      &amp;lt;pre&amp;gt;&lt;br /&gt;
vc      vcl : NAS:nas FREETYPE:freetype psprint rsc sot ucbhelper unotools sysui NULL&lt;br /&gt;
vc      vcl                      usr1   -       all     vc_mkout NULL&lt;br /&gt;
vc      vcl\source\unotypes      nmake  -       all     vc_unot NULL&lt;br /&gt;
vc      vcl\source\glyphs        nmake  -       all     vc_glyphs vc_unot NULL&lt;br /&gt;
      &amp;lt;/pre&amp;gt;&lt;br /&gt;
so we need to try and un-pack what&amp;#039;s going on here, which is in fact not&lt;br /&gt;
as odd as it might seem at first glance. Firstly lists are terminated&lt;br /&gt;
by the &amp;#039;NULL&amp;#039; string. Every line is prefixed by a shortcut which is&lt;br /&gt;
irrelevant.&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
         &amp;lt;li&amp;gt;&lt;br /&gt;
	   First active line contains a &amp;#039;:&amp;#039;, this describes the&lt;br /&gt;
	   fact that this project (vcl) depends on these other modules&lt;br /&gt;
	   &amp;#039;nas&amp;#039;, &amp;#039;freetype&amp;#039;, &amp;#039;psprint&amp;#039; etc. to be built first. This is&lt;br /&gt;
	   for inter-project dependencies.&lt;br /&gt;
	 &amp;lt;/li&amp;gt;&lt;br /&gt;
	 &amp;lt;li&amp;gt;&lt;br /&gt;
	   Some modules have a CAPITALS:lowercase arrangement; the first&lt;br /&gt;
	   segment is a conditional, driven by a space delimited list in&lt;br /&gt;
	   the BUILD_TYPE environment variable at build time.&lt;br /&gt;
	 &amp;lt;/li&amp;gt;&lt;br /&gt;
	 &amp;lt;li&amp;gt;&lt;br /&gt;
	   Then we have a redundant line &amp;#039;usr1&amp;#039; [ for fun ? ], in fact&lt;br /&gt;
	   only lines containing the magic string &amp;#039;nmake&amp;#039; are valid after&lt;br /&gt;
	   this.&lt;br /&gt;
	 &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	 &amp;lt;li&amp;gt;&lt;br /&gt;
The next lines describe internal project directory dependencies&lt;br /&gt;
and look like:&lt;br /&gt;
	     &amp;lt;pre&amp;gt;&lt;br /&gt;
[shortcut] [path to dir to build] nmake - [flags] [unique-name] [deps...] NULL&lt;br /&gt;
vc           vcl\source\glyphs    nmake -   all     vc_glyphs   vc_unot   NULL&lt;br /&gt;
	     &amp;lt;/pre&amp;gt;&lt;br /&gt;
	   &amp;lt;i&amp;gt;shortcut&amp;lt;/i&amp;gt; is not used; &amp;lt;i&amp;gt;flags&amp;lt;/i&amp;gt; determines which platforms&lt;br /&gt;
	   this builds on; usually single char platform codes: &amp;#039;dnpum&amp;#039; &amp;#039;u&amp;#039; being&lt;br /&gt;
	   Unix. The higher up the system, the more stuff is flagged &amp;#039;all&amp;#039;.&amp;lt;br/&amp;gt;&lt;br /&gt;
	   &amp;lt;i&amp;gt;unique-name&amp;lt;/i&amp;gt; this is a magic name, used by other lines to&lt;br /&gt;
	   describe an internal dependency. &amp;lt;i&amp;gt;deps...&amp;lt;/i&amp;gt; any number of names of&lt;br /&gt;
	   other directories in this file, that must be built before this one.&lt;br /&gt;
	 &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
So we see in the vcl case that &amp;lt;i&amp;gt;vcl\source\unotypes&amp;lt;/i&amp;gt; (vc_unot) has&lt;br /&gt;
to be built before &amp;lt;i&amp;gt;vcl\source\glyphs&amp;lt;/i&amp;gt; (vc_glyphs). It is&lt;br /&gt;
&amp;lt;b&amp;gt;important&amp;lt;/b&amp;gt; to understand that the order of the list is ~immaterial,&lt;br /&gt;
and instead of a simple ordered list, we have a more complex internal&lt;br /&gt;
dependency system &amp;amp;mdash; this contrasts with most other make systems.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
There is also documentation [http://tools.openoffice.org/tools/build.html here] on it.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prj/d.lst ===&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      The syntax of d.lst is more comprehensible than build.lst, it omits&lt;br /&gt;
      some default actions, such as copying build.lst into&lt;br /&gt;
      &amp;lt;i&amp;gt;inc/&amp;amp;lt;module&amp;amp;gt;/build.lst&amp;lt;/i&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      A line is of the form:&lt;br /&gt;
      &amp;lt;pre&amp;gt;&lt;br /&gt;
[action]: [arguments]&lt;br /&gt;
mkdir:    %_DEST%\inc%_EXT%\external&lt;br /&gt;
      &amp;lt;/pre&amp;gt;&lt;br /&gt;
      where if &amp;#039;[action]:&amp;#039; is omitted, it defaults to the &amp;#039;copy&amp;#039; action.&lt;br /&gt;
      Typical actions are &amp;lt;i&amp;gt;copy&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;mkdir&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;touch&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;hedabu&amp;lt;/i&amp;gt;,&lt;br /&gt;
      &amp;lt;i&amp;gt;dos&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;linklib&amp;lt;/i&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
   &amp;lt;p&amp;gt;&lt;br /&gt;
      The &amp;#039;hedabu&amp;#039; action is particularly interesting, inasmuch that it&lt;br /&gt;
      cosmetically re-formats the header to shrink it on install (otherwise&lt;br /&gt;
      it&amp;#039;s much like the copy action).&lt;br /&gt;
      &amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;&lt;br /&gt;
      During the action, various macro variables are expanded some of which are:&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;%__SRC% &amp;amp;mdash; distribution directory name eg. &amp;lt;i&amp;gt;unxlngi4.pro&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&lt;br /&gt;
	  %_DEST% &amp;amp;mdash; absolute path into solver eg.&lt;br /&gt;
	  &amp;lt;i&amp;gt;/opt/OpenOffice/OOO_STABLE_1/solver/641/unxlngi4.pro&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;li&amp;gt;&lt;br /&gt;
	  %_EXT% &amp;amp;mdash; (unusual) way of having minor updates eg. 641.1,&lt;br /&gt;
	  typically used to version every base sub-directory.&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
      Typically then, if indeed you need to add a rule (cf. implicit&lt;br /&gt;
      directory copies), it will be of the form:&lt;br /&gt;
      &amp;lt;pre&amp;gt;&lt;br /&gt;
..\%__SRC%\inc\sal\*.h %_DEST%\inc%_EXT%\sal\*.h&lt;br /&gt;
      &amp;lt;/pre&amp;gt;&lt;br /&gt;
      NB. relative paths are relative to the &amp;#039;prj/&amp;#039; directory.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Can I get a &amp;lt;code&amp;gt;char *&amp;lt;/code&amp;gt;, please? ==&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      Just barely.  OO.o has at least six string wrappers, although the C&lt;br /&gt;
      implementations are of little interest:&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;p&amp;gt;&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtl_String&amp;lt;/code&amp;gt; &amp;amp;mdash; sal/inc/rtl/string.h&amp;lt;br&amp;gt;&lt;br /&gt;
	  &amp;quot;Normal&amp;quot; string plus reference counting.&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtlstring-&amp;lt;/code&amp;gt;&amp;amp;gt;&amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt; is useful, as is&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtlstring-&amp;lt;/code&amp;gt;&amp;amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;.  This object encapsulates&lt;br /&gt;
	  an generic 8bit string - of unknown encoding. Feel free to treat&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtlstring-&amp;lt;/code&amp;gt;&amp;amp;gt;&amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt; as your beloved &amp;lt;code&amp;gt;char *&amp;lt;/code&amp;gt;.&lt;br /&gt;
	  If you really want to look at the implementation of some&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtl_String&amp;lt;/code&amp;gt; function and lxr nor grep can help you, have&lt;br /&gt;
	  a look at sal/rtl/source/strtmpl.c.&lt;br /&gt;
	&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;li&amp;gt;&lt;br /&gt;
	&amp;lt;p&amp;gt;&lt;br /&gt;
	  &amp;lt;code&amp;gt;OString&amp;lt;/code&amp;gt; &amp;amp;mdash; sal/inc/rtl/string.hxx&amp;lt;br&amp;gt;&lt;br /&gt;
	  Simply a rtl_String wrapped inside a &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;; you&lt;br /&gt;
	  can use &amp;lt;code&amp;gt;ostring.pData&amp;lt;/code&amp;gt; to get at the rtl_String&lt;br /&gt;
	  (it&amp;#039;s public).  &amp;lt;code&amp;gt;OString&amp;lt;/code&amp;gt; has reasonably useful&lt;br /&gt;
	  methods for if you need them.&lt;br /&gt;
	&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;li&amp;gt;&lt;br /&gt;
	&amp;lt;p&amp;gt;&lt;br /&gt;
	  &amp;lt;code&amp;gt;rtl_uString&amp;lt;/code&amp;gt; &amp;amp;mdash; sal/inc/rtl/ustring.h&amp;lt;br&amp;gt;&lt;br /&gt;
	  &amp;quot;Normal&amp;quot; Unicode string, similar to rtl_String, and&lt;br /&gt;
	  refcounted as well.  However, this one always comes in UCS-2&lt;br /&gt;
	  encoding, presumably to be compatible with Java&amp;#039;s&lt;br /&gt;
	  questionable choices. &lt;br /&gt;
	  See &amp;lt;code&amp;gt;rtl_String&amp;lt;/code&amp;gt; above to find where the implementation&lt;br /&gt;
	  of some &amp;lt;code&amp;gt;rtl_uString&amp;lt;/code&amp;gt;functions is hidden.&lt;br /&gt;
	&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;li&amp;gt;&lt;br /&gt;
	&amp;lt;p&amp;gt;&lt;br /&gt;
	  &amp;lt;code&amp;gt;OUString&amp;lt;/code&amp;gt; &amp;amp;mdash; sal/inc/rtl/ustring.hxx&amp;lt;br&amp;gt; &lt;br /&gt;
	  An rtl_uString wrapped inside a &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;.  This is&lt;br /&gt;
	  what most of the OO.o code uses to pass strings around.&lt;br /&gt;
	  To convert an &amp;lt;code&amp;gt;OString&amp;lt;/code&amp;gt; to an &amp;lt;code&amp;gt;OUString&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	  it is necessary to specify the character set of the&lt;br /&gt;
	  &amp;lt;code&amp;gt;OString&amp;lt;/code&amp;gt; see; &amp;lt;code&amp;gt;sal/inc/rtl/textenc.h&amp;lt;/code&amp;gt;&lt;br /&gt;
	  &amp;amp;mdash; the only interesting case is &amp;lt;code&amp;gt;RTL_TEXTENCODING_UTF8&amp;lt;/code&amp;gt;&lt;br /&gt;
	&amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;li&amp;gt;&lt;br /&gt;
        &amp;lt;p&amp;gt;&lt;br /&gt;
	  &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt; &amp;amp;mdash; tools/inc/string.hxx&amp;lt;br&amp;gt;&lt;br /&gt;
	  This is an obsolete string class, aliased to &amp;#039;UniString&amp;#039;.&lt;br /&gt;
	  It has a number of limitations such as a 64k length limit.&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      A couple of conversion functions are really useful here,&lt;br /&gt;
      Particularly:&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rtl::OString aOString = ::rtl::OUStringToOString (aOUString, RTL_TEXTENCODING_UTF8);&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;And the reverse:&amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&amp;lt;code&amp;gt;rtl::OUString aOString = ::rtl::OStringToOUString (aOString, RTL_TEXTENCODING_UTF8);&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      If you just want to programattically print out a string for&lt;br /&gt;
      debugging purposes you probably want define a macro like :&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    #define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData-&amp;gt;buffer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;and use it like :&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
        printf ( &amp;quot;SvXMLNamespaceMap::AddIfKnown : %s / %s\n&amp;quot;, CHAR_POINTER(rPrefix), CHAR_POINTER(rName) );&lt;br /&gt;
&amp;lt;/code&amp;gt;.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Linkoo &amp;amp;amp; Limitations ===&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      Linkoo is the tool that implements the &amp;lt;code&amp;gt;-l&amp;lt;/code&amp;gt;&lt;br /&gt;
      functionality of &amp;lt;tt&amp;gt;[[bin/ooinstall]]&amp;lt;/tt&amp;gt;. It essentially&lt;br /&gt;
      sym-links files of similar names into your local tree,&lt;br /&gt;
      allowing a fast development iteration.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      It is however slightly limited - some of the modules&lt;br /&gt;
      cannot be linked for various reasons; these are:&lt;br /&gt;
      &amp;lt;code&amp;gt;cppuhelper&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;configmgr&amp;lt;/code&amp;gt;,&lt;br /&gt;
      thus in the rare case that these are altered, they&lt;br /&gt;
      must be copied manually into &amp;lt;code&amp;gt;/opt/OOInstall/program&amp;lt;/code&amp;gt;.&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;p&amp;gt;&lt;br /&gt;
      In addition symlinks cannot be used for soffice.bin, and&lt;br /&gt;
      this is more commonly altered - it has to be installed&lt;br /&gt;
      from &amp;lt;code&amp;gt;desktop/unxlngi4.pro/bin/soffice&amp;lt;/code&amp;gt; NB.&lt;br /&gt;
      with an appended &amp;#039;.bin&amp;#039;&lt;br /&gt;
    &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[[Debugging]]&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=3723</id>
		<title>DomainDeveloper</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=3723"/>
		<updated>2006-01-05T23:58:43Z</updated>

		<summary type="html">&lt;p&gt;Cph: updte my dev entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A mapping of names to OOo accounts.&lt;br /&gt;
&lt;br /&gt;
Abbrev.:&lt;br /&gt;
&lt;br /&gt;
* PL : Project Lead&lt;br /&gt;
* CL : Project Co-Lead&lt;br /&gt;
* CC : Community Council Member&lt;br /&gt;
* ESC : Engineering Steering Committee Member &lt;br /&gt;
* CVS : has write access to the OOo CVS repository&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name || CVS || @openoffice.org || IRC nick || Notes || Affiliation&lt;br /&gt;
|-&lt;br /&gt;
|              || ||              ||                ||          || &lt;br /&gt;
|-&lt;br /&gt;
| Volker Ahrend||   || va||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kai Ahrens|| X || ka||||PL Graphic Applications||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Gene Anaya||   || ganaya||||||&lt;br /&gt;
|-&lt;br /&gt;
| Eric Bachard|| X || ericb||ericb2||Mac OSX/Linux PPC ports/CL porting||French OOo project&lt;br /&gt;
|-&lt;br /&gt;
| Sascha Ballach|| X || sab||||||&lt;br /&gt;
|-&lt;br /&gt;
| Jayant Balraj Madavi||   || jayant_madavi||aZEN_JM||Connectivity / Database||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Baltzer||   || sba||||Writer QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Barfurth|| X || jb||JoergB||Configuration Util||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mathias Bauer|| X || mba||||PL Framework, XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Behrens|| X || thb||thorsten||vcl/impress/toolkit visionary||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Benisch|| X || tbe||||Scripting framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Bergmann|| X || sb||||CL UDK, tools&amp;amp;amp;UCB hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bille|| X || abi||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Éric Bischoff|| X || ebischoff||ebischoff||KDE A/B driver||Bureau Cornavin&lt;br /&gt;
|-&lt;br /&gt;
| Nick Blievers|| X || nick||||IRIX||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Boelzle|| X || dbo||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Bolte|| X || obo||||RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Rafaella Braconi||   || coni||||CL l10n, globalization program manager||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Brauer|| X || mib||||PL XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Braun|| X || obr||obr||System Integration/Accessibility Hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bregas|| X || ab||||StarBasic||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Brunsmann||   || jbrunsmann||||UDK||&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Budischewski||   || jbu||PyUNO hacker||||&lt;br /&gt;
|-&lt;br /&gt;
| Peter Burow|| X  || pb||UI||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Aidan Butler||   || aidan||||XML filters||&lt;br /&gt;
|-&lt;br /&gt;
| Giuseppe Castagno ||   || beppec56 || || PDF output&lt;br /&gt;
|-&lt;br /&gt;
| Scott Carr||   || kcarr||kcarr||Documentation||Progbits&lt;br /&gt;
|-&lt;br /&gt;
| Colin Charles||   || drbyte||bytee||Malaysian native-lang project||bytebot.net&lt;br /&gt;
|-&lt;br /&gt;
| Behrend Cornelius|| X || bc||||Wizards||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Craemer||   || oc||||Calc/QA guy||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Cziebalski||   || mci||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Naren Devaiah||   || ||ndev||Performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Nitin Dongre||   || ||nitin_BITS||||Novell, Inc.(intern)&lt;br /&gt;
|-&lt;br /&gt;
| Radek Doulik||   || radekdoulik||rodo_||Canvas hacker||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Carsten Driesner|| X || cd||||Framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Herbert Duerr|| X || hdu||GSL||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Düsterhoff|| X || od||Writer||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bernd Eilers|| X || bei||rfc821||EIS||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| René Engelhard|| X || rene||_rene_||config_office, Debian packager||Debian&lt;br /&gt;
|-&lt;br /&gt;
| Andre Fischer|| X || af||||Impress||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ken Foskey||   || waratah||waratah||config_office/dmake man||slug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| Duncan Foster||   || dfoster||||||&lt;br /&gt;
|-&lt;br /&gt;
| David Fraser||   || davidfraser||davidfraser||South African translations, multilingual builds||translate.org.za&lt;br /&gt;
|-&lt;br /&gt;
| Nils Fuhrmann||   || nf||||Localization||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Martin Gallwey|| X || mtg||marty_||||&lt;br /&gt;
|-&lt;br /&gt;
| Sunil Gandhi||   || ||tyro||||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Vladimir Glazounov|| X || vg||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jody Goldberg|| X || jodygoldberg||jody||spreadsheet-ness||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Grobler|| X || dg||||Database Access||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bettina Haberer||   || bh||||RFEOwner||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ingrid Halama|| X || iha||||Chart||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Chris Halls|| X || haggai||haggai||Debian packager&amp;amp;amp;misc. hacker||Credativ Ltd., Debian&lt;br /&gt;
|-&lt;br /&gt;
| Gregor Hartmann||   || gh||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bustamam Harun||   || bustamam||||Malaysian stuff||&lt;br /&gt;
|-&lt;br /&gt;
| Kevin Hendricks|| X || khendricks||||PL Lingucomponent, PowerPC||&lt;br /&gt;
|-&lt;br /&gt;
| Con Hennessy||   || cphennessy||cph2 or cph_||hacker &amp;amp;amp; former council person||OpenApp&lt;br /&gt;
|-&lt;br /&gt;
| Ivo Hinkelmann|| X || ihi||ivo||l10n tooling/general/RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Eric Hoch|| X || maveric||mav_eric||Mac Porting||&lt;br /&gt;
|-&lt;br /&gt;
| Jan Holešovský|| X || kendy||kendy||KDE integration||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Martin Hollmichel|| X || mh||Ratte/Nesshof||Build Maestro, PL External, Tools, Porting, CC||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Karl Hong|| X || khong||||i18n, CJK expert||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Huetsch|| X || mhu||||Performance/strategy, PL UCB, CC, ESC||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Hönnig|| X || mi||||PL API||&lt;br /&gt;
|-&lt;br /&gt;
| Hasan Ilter||   || hi||||Writer QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sven Jacobi|| X || sj||||Escherwizard||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Jahnke||   || jj||||Internal tooling||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Jansen||   || cj ||||Menu and Toolbar?||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ocke Janssen|| X || oj||Base||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Pavel Janík|| X || pjanik||paveljanik||PL Czech native-lang project, CL l10n, CC, ESC, l10n builds||&lt;br /&gt;
|-&lt;br /&gt;
| Berry Jia|| X || berryjia||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Pascal Junck||   || pjunck||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Junker||   || Cyb||christianju||API||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Hirano Kazunari||   || khirano||||Japanese||&lt;br /&gt;
|-&lt;br /&gt;
| Dhananjay Keskar||   || ||dkeskar||Performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Robert Kinsella||   || rkinsella||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Volodymyr Khrystynych||   || volody||||XML Filter||&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Klose||   || doko||doko||Ubuntu, gcc, python packager||Canonical, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Laszlo Kovacs||   || lkovacs||||Documentation||&lt;br /&gt;
|-&lt;br /&gt;
| Martin Kretzschmar|| X || mkretzschmar||martink||Gnome / Debian||Student&lt;br /&gt;
|-&lt;br /&gt;
| Will Lachance||   || wlach||wlach_||Word Perfect File Filters||Net Integration Technologies, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Lange|| X || tl||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Lars Langhans|| X || lla||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Hans-Joachim Lankenau|| X || hjs||ause||dmake makefile expert, RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Nemeth Lazlo|| X || nemeth||||||&lt;br /&gt;
|-&lt;br /&gt;
| Michael Leibowitz||   || ||mikeleib||Canvas||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Wind Li|| X || windly||||Address books||&lt;br /&gt;
|-&lt;br /&gt;
| Ping Liao||   || pliao||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tor Lillqvist|| X || tml||||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Joachim Lingner|| X || jl||||Java, CLI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Lippka|| X || cl||ChristianL||Graphic Applications||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mindy Liu||   || mindyliu||||||&lt;br /&gt;
|-&lt;br /&gt;
| Dieter Loeschky|| X || ||||Localization||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Philipp Lohmann|| X || pl||pl_hh||VCL/X11 (GSL) hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jackson Low|| X || xxjack12xx||||Porting||&lt;br /&gt;
|-&lt;br /&gt;
| Patrick Luby||   || pluby||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
| Babak Mahbod||   || bmahbod||||||&lt;br /&gt;
|-&lt;br /&gt;
| Martin Maher||   || mmaher||||Writer &amp;amp;amp; Filter chap||&lt;br /&gt;
|-&lt;br /&gt;
| Nakata Maho|| X || maho||_maho_||FreeBSD guy||Independent&lt;br /&gt;
|-&lt;br /&gt;
| John Marmion|| X || jmarmion||||||&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Martens|| X || ama||||PL Writer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Caolán McNamara|| X || cmc||caolan||CL Writer &amp;amp;amp; Filter man||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Meeks|| X || mmeeks||michael_||ugly hack-er, ESC||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Meies|| X || fme||||Writer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Federico Mena-Quintero||   || federicomena||federico||perfectionist||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Mi||   || mmi||||||&lt;br /&gt;
|-&lt;br /&gt;
| Björn Milcke|| X || bm||||Chart||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Petr Mladek||   || pmladek||pmladek||SUSE RPMs, ooo-build releases||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Cyrille Moureaux|| X || cyrillem||Cyrille||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Müller-Prove||   || mmp||||User Experience Engineer, ui.openoffice.org||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Nagashree||   || nagashree||mnagashree||QA||&lt;br /&gt;
|-&lt;br /&gt;
| Niklas Nebel|| X || nn||||PL Calc||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christoph Neumann|| X || cn||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| NicelKM|| X || mnicel||nicel||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bertram Nolte||   || bnolte||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tomas O&amp;#039;Connor||   || toconnor||||Scripting Framework||&lt;br /&gt;
|-&lt;br /&gt;
| Lars Oppermann|| X || lo||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Rodrigo Parra Novo|| X || rodarvus||rodarvus||Gnumeric/Abiword OpenDocument Format support and port to Maemo||INdT (Instituto Nokia de Tecnologia)&lt;br /&gt;
|-&lt;br /&gt;
| Edward Peterlin|| X || OPENSTEP||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
| Frank Peters|| X || fpe||||Documentation||&lt;br /&gt;
|-&lt;br /&gt;
| Christof Pintaske|| X || cp||||GSL Head Honcho||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ron Piterman||   || rpiterman||||||&lt;br /&gt;
|-&lt;br /&gt;
| Noel Power||   || npower||noelp||VBA Interop, Scripting||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ashwanth Premchandran||   || ||ashwanth||||Novell, Inc.(intern)&lt;br /&gt;
|-&lt;br /&gt;
| Nikolai Pretzell||   || np||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Volker Quetschke||   || vq||vq||Windows Build Genius||Gravity Waves&lt;br /&gt;
|-&lt;br /&gt;
| Tino Rachui|| X || tra||||GSL/Unix Hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Srinivasa Ragavan||   || ||srag||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kay Ramme|| X || kr||||PL UDK||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ErAck|Eike Rathke]]|| X || er||erAck||CL Calc, engine; CL i18n; stricken with number formatter||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rauch|| X || mrauch||||NetBSD||&lt;br /&gt;
|-&lt;br /&gt;
| Abdul Rauf||   || abdul||abdul||||QA&lt;br /&gt;
|-&lt;br /&gt;
| Jens-Heiner Rechtien|| X || hr||blauwal||RE; OOo SCM (CVS, CWS tooling); Porting; Compilers||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Rentz|| X || dr||||Calc Excel filter, UI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Florian Reuter|| X || flr||||Writer filters||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| G. Roderick Singleton||   || grsingleton||grsingleton||Documentation||pathtech.org&lt;br /&gt;
|-&lt;br /&gt;
| Hennes Rohling|| X || hro||||GSL &amp;amp;amp; Util||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rüß||   || mru||||QA (Writer?)||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bibek Sahu||   || Bibek||bibek||Impress pieces||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Éric Savary||   || es||Writer QA||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Schlüns|| X || as||||Framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ingo Schmidt|| X || is||||(Native) Installation||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jürgen Schmidt|| X || jsc||||PL API, UNO, SDK||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Schäfer|| X || ssa||ssa||VCL||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Schönheit|| X || fs||||UI/configuration/database?||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Darragh Sherwin||   || dsherwin||darragh||E-Legislation / E-GovSystems||Propylon&lt;br /&gt;
|-&lt;br /&gt;
| Raul Siddhartha||   || rsiddhartha||raul||GTK File Selector||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sarah Smith||   || ssmith||||||&lt;br /&gt;
|-&lt;br /&gt;
| Rajesh Sola||   || rajeshsola||sola||misc.||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Kai Sommerfeld|| X || kso||||manager &amp;amp;amp; hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Specht|| X || os||||PL UI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Spindler||   || jspindler||||||&lt;br /&gt;
|-&lt;br /&gt;
| Shilpa Sreeramulu||   || shilpas||shilpa||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Shreyas Srinivasan||   || sshreyas||shres||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Stecher||   || fst||||Calc QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Fridrich Štrba|| X || fridrich_strba||Fridrich||Word Perfect Hacker||&lt;br /&gt;
|-&lt;br /&gt;
| Ulf Stroehler||   || us||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Muthu Subramanian||   || muthusuba||muthusuba||misc.||&lt;br /&gt;
|-&lt;br /&gt;
| Louis Suárez-Potts||   || louis||louis||Community Manager||Collab.net&lt;br /&gt;
|-&lt;br /&gt;
| Claus Sørensen||   || cs||c26n,cHBs,chbs||Danish Localization and Project Management Tool(oopm)||ProFOSS&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Taxhet|| X || st||stx12||CC, interpersonal problem fixer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Armin Theissen||   || armin||||||&lt;br /&gt;
|-&lt;br /&gt;
| Caio Tiago Oliveira|| X || asrail||asrail||||&lt;br /&gt;
|-&lt;br /&gt;
| Jan Tietjens||   || tietjens||||||&lt;br /&gt;
|-&lt;br /&gt;
| Rüdiger Timm|| X || rt||||RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Malte Timmermann|| X || mt||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Gerhard Tonn||   || tonn||||s390||&lt;br /&gt;
|-&lt;br /&gt;
| Willem van Dorp||   || willem.vandorp||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tom Verbeek|| X || tv||||Wizards, Art team||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sander Vesik||   || svesik||||||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Vogelheim|| X || dvo||||XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mikhail Voitenko|| X || mav||Framework||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Robert Vojta|| X || rvojta||rvojta||VBA Interop||&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Völzke|| X || dv||||Installation||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jack Warchold||   || jw||||QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Sparcmoz|Jim Watson]]|| X || sparcmoz|| jimW||GNU Linux sparc porter||clug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| Armin Weiss|| X || aw||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Dan Williams|| X || fa||dcbw||Mac et. al. hacker||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Wunderlich|| X || sw||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kohei Yoshida||   || kohei||kohei_||Calc enthusiast, Calc optimization solver developer||Independent&lt;br /&gt;
|-&lt;br /&gt;
| George Zahopoulos|| X || georgez||||||&lt;br /&gt;
|-&lt;br /&gt;
| Kurt Zenker|| X || kz||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Ziehm||   || thorstenziehm||||QA Manager||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are tracking pending JCAs in the document [[Pending JCAs]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A map of OOo developers around the world is available at http://www.frappr.com/ooodev, please add yourself to the map if you&amp;#039;re involved in OOo development. It&amp;#039;s just fun to see who&amp;#039;s where :-)&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=3722</id>
		<title>DomainDeveloper</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=DomainDeveloper&amp;diff=3722"/>
		<updated>2006-01-05T23:57:19Z</updated>

		<summary type="html">&lt;p&gt;Cph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A mapping of names to OOo accounts.&lt;br /&gt;
&lt;br /&gt;
Abbrev.:&lt;br /&gt;
&lt;br /&gt;
* PL : Project Lead&lt;br /&gt;
* CL : Project Co-Lead&lt;br /&gt;
* CC : Community Council Member&lt;br /&gt;
* ESC : Engineering Steering Committee Member &lt;br /&gt;
* CVS : has write access to the OOo CVS repository&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name || CVS || @openoffice.org || IRC nick || Notes || Affiliation&lt;br /&gt;
|-&lt;br /&gt;
|              || ||              ||                ||          || &lt;br /&gt;
|-&lt;br /&gt;
| Volker Ahrend||   || va||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kai Ahrens|| X || ka||||PL Graphic Applications||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Gene Anaya||   || ganaya||||||&lt;br /&gt;
|-&lt;br /&gt;
| Eric Bachard|| X || ericb||ericb2||Mac OSX/Linux PPC ports/CL porting||French OOo project&lt;br /&gt;
|-&lt;br /&gt;
| Sascha Ballach|| X || sab||||||&lt;br /&gt;
|-&lt;br /&gt;
| Jayant Balraj Madavi||   || jayant_madavi||aZEN_JM||Connectivity / Database||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Baltzer||   || sba||||Writer QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Barfurth|| X || jb||JoergB||Configuration Util||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mathias Bauer|| X || mba||||PL Framework, XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Behrens|| X || thb||thorsten||vcl/impress/toolkit visionary||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Benisch|| X || tbe||||Scripting framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Bergmann|| X || sb||||CL UDK, tools&amp;amp;amp;UCB hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bille|| X || abi||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Éric Bischoff|| X || ebischoff||ebischoff||KDE A/B driver||Bureau Cornavin&lt;br /&gt;
|-&lt;br /&gt;
| Nick Blievers|| X || nick||||IRIX||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Boelzle|| X || dbo||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Bolte|| X || obo||||RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Rafaella Braconi||   || coni||||CL l10n, globalization program manager||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Brauer|| X || mib||||PL XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Braun|| X || obr||obr||System Integration/Accessibility Hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Bregas|| X || ab||||StarBasic||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Brunsmann||   || jbrunsmann||||UDK||&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Budischewski||   || jbu||PyUNO hacker||||&lt;br /&gt;
|-&lt;br /&gt;
| Peter Burow|| X  || pb||UI||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Aidan Butler||   || aidan||||XML filters||&lt;br /&gt;
|-&lt;br /&gt;
| Giuseppe Castagno ||   || beppec56 || || PDF output&lt;br /&gt;
|-&lt;br /&gt;
| Scott Carr||   || kcarr||kcarr||Documentation||Progbits&lt;br /&gt;
|-&lt;br /&gt;
| Colin Charles||   || drbyte||bytee||Malaysian native-lang project||bytebot.net&lt;br /&gt;
|-&lt;br /&gt;
| Behrend Cornelius|| X || bc||||Wizards||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Craemer||   || oc||||Calc/QA guy||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Cziebalski||   || mci||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Naren Devaiah||   || ||ndev||Performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Nitin Dongre||   || ||nitin_BITS||||Novell, Inc.(intern)&lt;br /&gt;
|-&lt;br /&gt;
| Radek Doulik||   || radekdoulik||rodo_||Canvas hacker||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Carsten Driesner|| X || cd||||Framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Herbert Duerr|| X || hdu||GSL||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Düsterhoff|| X || od||Writer||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bernd Eilers|| X || bei||rfc821||EIS||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| René Engelhard|| X || rene||_rene_||config_office, Debian packager||Debian&lt;br /&gt;
|-&lt;br /&gt;
| Andre Fischer|| X || af||||Impress||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ken Foskey||   || waratah||waratah||config_office/dmake man||slug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| Duncan Foster||   || dfoster||||||&lt;br /&gt;
|-&lt;br /&gt;
| David Fraser||   || davidfraser||davidfraser||South African translations, multilingual builds||translate.org.za&lt;br /&gt;
|-&lt;br /&gt;
| Nils Fuhrmann||   || nf||||Localization||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Martin Gallwey|| X || mtg||marty_||||&lt;br /&gt;
|-&lt;br /&gt;
| Sunil Gandhi||   || ||tyro||||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Vladimir Glazounov|| X || vg||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jody Goldberg|| X || jodygoldberg||jody||spreadsheet-ness||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Grobler|| X || dg||||Database Access||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bettina Haberer||   || bh||||RFEOwner||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ingrid Halama|| X || iha||||Chart||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Chris Halls|| X || haggai||haggai||Debian packager&amp;amp;amp;misc. hacker||Credativ Ltd., Debian&lt;br /&gt;
|-&lt;br /&gt;
| Gregor Hartmann||   || gh||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bustamam Harun||   || bustamam||||Malaysian stuff||&lt;br /&gt;
|-&lt;br /&gt;
| Kevin Hendricks|| X || khendricks||||PL Lingucomponent, PowerPC||&lt;br /&gt;
|-&lt;br /&gt;
| Con Hennessy||   || cphennessy||cph2|cph_||hacker &amp;amp;amp; former council person||OpenApp&lt;br /&gt;
|-&lt;br /&gt;
| Ivo Hinkelmann|| X || ihi||ivo||l10n tooling/general/RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Eric Hoch|| X || maveric||mav_eric||Mac Porting||&lt;br /&gt;
|-&lt;br /&gt;
| Jan Holešovský|| X || kendy||kendy||KDE integration||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Martin Hollmichel|| X || mh||Ratte/Nesshof||Build Maestro, PL External, Tools, Porting, CC||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Karl Hong|| X || khong||||i18n, CJK expert||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Huetsch|| X || mhu||||Performance/strategy, PL UCB, CC, ESC||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Hönnig|| X || mi||||PL API||&lt;br /&gt;
|-&lt;br /&gt;
| Hasan Ilter||   || hi||||Writer QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sven Jacobi|| X || sj||||Escherwizard||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Jahnke||   || jj||||Internal tooling||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Jansen||   || cj ||||Menu and Toolbar?||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ocke Janssen|| X || oj||Base||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Pavel Janík|| X || pjanik||paveljanik||PL Czech native-lang project, CL l10n, CC, ESC, l10n builds||&lt;br /&gt;
|-&lt;br /&gt;
| Berry Jia|| X || berryjia||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Pascal Junck||   || pjunck||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Junker||   || Cyb||christianju||API||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Hirano Kazunari||   || khirano||||Japanese||&lt;br /&gt;
|-&lt;br /&gt;
| Dhananjay Keskar||   || ||dkeskar||Performance||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Robert Kinsella||   || rkinsella||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Volodymyr Khrystynych||   || volody||||XML Filter||&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Klose||   || doko||doko||Ubuntu, gcc, python packager||Canonical, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Laszlo Kovacs||   || lkovacs||||Documentation||&lt;br /&gt;
|-&lt;br /&gt;
| Martin Kretzschmar|| X || mkretzschmar||martink||Gnome / Debian||Student&lt;br /&gt;
|-&lt;br /&gt;
| Will Lachance||   || wlach||wlach_||Word Perfect File Filters||Net Integration Technologies, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thomas Lange|| X || tl||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Lars Langhans|| X || lla||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Hans-Joachim Lankenau|| X || hjs||ause||dmake makefile expert, RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Nemeth Lazlo|| X || nemeth||||||&lt;br /&gt;
|-&lt;br /&gt;
| Michael Leibowitz||   || ||mikeleib||Canvas||Intel Corporation&lt;br /&gt;
|-&lt;br /&gt;
| Wind Li|| X || windly||||Address books||&lt;br /&gt;
|-&lt;br /&gt;
| Ping Liao||   || pliao||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tor Lillqvist|| X || tml||||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Joachim Lingner|| X || jl||||Java, CLI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christian Lippka|| X || cl||ChristianL||Graphic Applications||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mindy Liu||   || mindyliu||||||&lt;br /&gt;
|-&lt;br /&gt;
| Dieter Loeschky|| X || ||||Localization||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Philipp Lohmann|| X || pl||pl_hh||VCL/X11 (GSL) hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jackson Low|| X || xxjack12xx||||Porting||&lt;br /&gt;
|-&lt;br /&gt;
| Patrick Luby||   || pluby||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
| Babak Mahbod||   || bmahbod||||||&lt;br /&gt;
|-&lt;br /&gt;
| Martin Maher||   || mmaher||||Writer &amp;amp;amp; Filter chap||&lt;br /&gt;
|-&lt;br /&gt;
| Nakata Maho|| X || maho||_maho_||FreeBSD guy||Independent&lt;br /&gt;
|-&lt;br /&gt;
| John Marmion|| X || jmarmion||||||&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Martens|| X || ama||||PL Writer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Caolán McNamara|| X || cmc||caolan||CL Writer &amp;amp;amp; Filter man||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Meeks|| X || mmeeks||michael_||ugly hack-er, ESC||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Meies|| X || fme||||Writer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Federico Mena-Quintero||   || federicomena||federico||perfectionist||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Mi||   || mmi||||||&lt;br /&gt;
|-&lt;br /&gt;
| Björn Milcke|| X || bm||||Chart||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Petr Mladek||   || pmladek||pmladek||SUSE RPMs, ooo-build releases||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Cyrille Moureaux|| X || cyrillem||Cyrille||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Matthias Müller-Prove||   || mmp||||User Experience Engineer, ui.openoffice.org||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Nagashree||   || nagashree||mnagashree||QA||&lt;br /&gt;
|-&lt;br /&gt;
| Niklas Nebel|| X || nn||||PL Calc||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Christoph Neumann|| X || cn||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| NicelKM|| X || mnicel||nicel||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bertram Nolte||   || bnolte||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tomas O&amp;#039;Connor||   || toconnor||||Scripting Framework||&lt;br /&gt;
|-&lt;br /&gt;
| Lars Oppermann|| X || lo||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Rodrigo Parra Novo|| X || rodarvus||rodarvus||Gnumeric/Abiword OpenDocument Format support and port to Maemo||INdT (Instituto Nokia de Tecnologia)&lt;br /&gt;
|-&lt;br /&gt;
| Edward Peterlin|| X || OPENSTEP||||Mac||&lt;br /&gt;
|-&lt;br /&gt;
| Frank Peters|| X || fpe||||Documentation||&lt;br /&gt;
|-&lt;br /&gt;
| Christof Pintaske|| X || cp||||GSL Head Honcho||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ron Piterman||   || rpiterman||||||&lt;br /&gt;
|-&lt;br /&gt;
| Noel Power||   || npower||noelp||VBA Interop, Scripting||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ashwanth Premchandran||   || ||ashwanth||||Novell, Inc.(intern)&lt;br /&gt;
|-&lt;br /&gt;
| Nikolai Pretzell||   || np||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Volker Quetschke||   || vq||vq||Windows Build Genius||Gravity Waves&lt;br /&gt;
|-&lt;br /&gt;
| Tino Rachui|| X || tra||||GSL/Unix Hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Srinivasa Ragavan||   || ||srag||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kay Ramme|| X || kr||||PL UDK||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ErAck|Eike Rathke]]|| X || er||erAck||CL Calc, engine; CL i18n; stricken with number formatter||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rauch|| X || mrauch||||NetBSD||&lt;br /&gt;
|-&lt;br /&gt;
| Abdul Rauf||   || abdul||abdul||||QA&lt;br /&gt;
|-&lt;br /&gt;
| Jens-Heiner Rechtien|| X || hr||blauwal||RE; OOo SCM (CVS, CWS tooling); Porting; Compilers||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Rentz|| X || dr||||Calc Excel filter, UI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Florian Reuter|| X || flr||||Writer filters||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| G. Roderick Singleton||   || grsingleton||grsingleton||Documentation||pathtech.org&lt;br /&gt;
|-&lt;br /&gt;
| Hennes Rohling|| X || hro||||GSL &amp;amp;amp; Util||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Michael Rüß||   || mru||||QA (Writer?)||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Bibek Sahu||   || Bibek||bibek||Impress pieces||Trees For Life&lt;br /&gt;
|-&lt;br /&gt;
| Éric Savary||   || es||Writer QA||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Andreas Schlüns|| X || as||||Framework||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Ingo Schmidt|| X || is||||(Native) Installation||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jürgen Schmidt|| X || jsc||||PL API, UNO, SDK||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Schäfer|| X || ssa||ssa||VCL||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Schönheit|| X || fs||||UI/configuration/database?||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Darragh Sherwin||   || dsherwin||darragh||E-Legislation / E-GovSystems||Propylon&lt;br /&gt;
|-&lt;br /&gt;
| Raul Siddhartha||   || rsiddhartha||raul||GTK File Selector||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sarah Smith||   || ssmith||||||&lt;br /&gt;
|-&lt;br /&gt;
| Rajesh Sola||   || rajeshsola||sola||misc.||NOSIP&lt;br /&gt;
|-&lt;br /&gt;
| Kai Sommerfeld|| X || kso||||manager &amp;amp;amp; hacker||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Oliver Specht|| X || os||||PL UI||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jörg Spindler||   || jspindler||||||&lt;br /&gt;
|-&lt;br /&gt;
| Shilpa Sreeramulu||   || shilpas||shilpa||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Shreyas Srinivasan||   || sshreyas||shres||||Novell, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Frank Stecher||   || fst||||Calc QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Fridrich Štrba|| X || fridrich_strba||Fridrich||Word Perfect Hacker||&lt;br /&gt;
|-&lt;br /&gt;
| Ulf Stroehler||   || us||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Muthu Subramanian||   || muthusuba||muthusuba||misc.||&lt;br /&gt;
|-&lt;br /&gt;
| Louis Suárez-Potts||   || louis||louis||Community Manager||Collab.net&lt;br /&gt;
|-&lt;br /&gt;
| Claus Sørensen||   || cs||c26n,cHBs,chbs||Danish Localization and Project Management Tool(oopm)||ProFOSS&lt;br /&gt;
|-&lt;br /&gt;
| Stefan Taxhet|| X || st||stx12||CC, interpersonal problem fixer||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Armin Theissen||   || armin||||||&lt;br /&gt;
|-&lt;br /&gt;
| Caio Tiago Oliveira|| X || asrail||asrail||||&lt;br /&gt;
|-&lt;br /&gt;
| Jan Tietjens||   || tietjens||||||&lt;br /&gt;
|-&lt;br /&gt;
| Rüdiger Timm|| X || rt||||RE||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Malte Timmermann|| X || mt||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Gerhard Tonn||   || tonn||||s390||&lt;br /&gt;
|-&lt;br /&gt;
| Willem van Dorp||   || willem.vandorp||||||&lt;br /&gt;
|-&lt;br /&gt;
| Tom Verbeek|| X || tv||||Wizards, Art team||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Sander Vesik||   || svesik||||||&lt;br /&gt;
|-&lt;br /&gt;
| Daniel Vogelheim|| X || dvo||||XML||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Mikhail Voitenko|| X || mav||Framework||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Robert Vojta|| X || rvojta||rvojta||VBA Interop||&lt;br /&gt;
|-&lt;br /&gt;
| Dirk Völzke|| X || dv||||Installation||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Jack Warchold||   || jw||||QA||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Sparcmoz|Jim Watson]]|| X || sparcmoz|| jimW||GNU Linux sparc porter||clug.org.au&lt;br /&gt;
|-&lt;br /&gt;
| Armin Weiss|| X || aw||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Dan Williams|| X || fa||dcbw||Mac et. al. hacker||RedHat, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Stephan Wunderlich|| X || sw||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Kohei Yoshida||   || kohei||kohei_||Calc enthusiast, Calc optimization solver developer||Independent&lt;br /&gt;
|-&lt;br /&gt;
| George Zahopoulos|| X || georgez||||||&lt;br /&gt;
|-&lt;br /&gt;
| Kurt Zenker|| X || kz||||||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
| Thorsten Ziehm||   || thorstenziehm||||QA Manager||Sun Microsystems, Inc.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are tracking pending JCAs in the document [[Pending JCAs]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A map of OOo developers around the world is available at http://www.frappr.com/ooodev, please add yourself to the map if you&amp;#039;re involved in OOo development. It&amp;#039;s just fun to see who&amp;#039;s where :-)&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3539</id>
		<title>User talk:Dnw</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3539"/>
		<updated>2005-12-30T02:10:28Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bibliographic Project&amp;#039;s Developer Page ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Project Overview&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The Bibliographic Project (OOoBib)[http://bibliographic.openoffice.org/] plans to enhance the bibliographic functions of the OpenOffice.org Writer (wordprocessing) application to achieve: &lt;br /&gt;
&lt;br /&gt;
# bibliographic formatting support for: &lt;br /&gt;
#* complex features required of commonly used citation styles like APA and Chicago&lt;br /&gt;
#* automatically switching between potentially radically different citation styles (ie. footnote to in-text)&lt;br /&gt;
# a data model that can support a broader range of reference types&lt;br /&gt;
# integration with remote databases&lt;br /&gt;
&lt;br /&gt;
Our current objective is to design and build OOoBib version 0.1, which will contain the most basic functions for an usable bibliographic facility with the above features.&lt;br /&gt;
&lt;br /&gt;
== 1st Stage, Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
As our first step, we will implement the most simple changes to the OOo core code (the API basic code, and UNO mappings, but not yet the user interface code) necessary to implement basic support for:&lt;br /&gt;
&lt;br /&gt;
# Saving and reading enhanced citation support in OpenDocument i.e. the [[New Biblio XML info design and implementation]]&lt;br /&gt;
# Inserting and displaying citations in OpenOffice Writer using the new format. (Note this task does not include the GUI interface to insert the citation in the new format, only the UNO interface to provide the basic function.&lt;br /&gt;
# Storage of document bibliographic data in the OOo document save package and the code changes necessary to read and save that bibliographic data.&lt;br /&gt;
&lt;br /&gt;
When these basic functions are built into OOo and are made assessable via UNO, we can then use rapid prototyping development methods to design and build prototype GUI interfaces and bibliographic formatting engines. We will be  able to use any of the programming languages which have OpenOffice bindings: C++, Java, Python and, of course, OpenOffice Basic. We believe that we will find more developers who can work in these languages than by insisting on C++ code from the start. Also it is much easier to build prototypes using Java, Python and OpenOffice Basic than in C++.&lt;br /&gt;
 &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NB&amp;#039;&amp;#039;&amp;#039;. When we have designed, built and tested the prototypes and they have been accepted by the OOo community we intend to rebuild them in C++ and to have them made part of the core OpenOffice application.&lt;br /&gt;
Skills required - good C++ programming and some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skills required&amp;#039;&amp;#039;&amp;#039; - some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
The project needs to modify the Writer document-read and document-save modules to support the new OpenDocument enhanced citation format. Implement the citation and bibliography changes to the OOo Writer save file (in Open Document format) accepted by the OpenDocument Technical Committee[http://lists.oasis-open.org/archives/office/200409/msg00023.html]. &lt;br /&gt;
&lt;br /&gt;
==== New Citation Coding ====&lt;br /&gt;
&lt;br /&gt;
The changes to the document schema are detailed in our OpenDocument XML Citation Proposal.pdf[http://bibliographic.openoffice.org/XML-bibliography-proposal.pdf]. Here are two examples of the new citation format. The first is a standard author-year style, with additional page number details:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;cite:detail cite:units=&amp;quot;pages&amp;quot; cite:begin=&amp;quot;23&amp;quot; cite:end=&amp;quot;24&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/cite:biblioref&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:span text:style-name=&amp;quot;Citation&amp;quot;&amp;gt;(Veer, 1996:23-24)&amp;lt;/text:span&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second is a footnoted example.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:note text:id=&amp;quot;ftn0&amp;quot; text:note-class=&amp;quot;footnote&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-citation&amp;gt;1&amp;lt;/text:note-citation&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-body&amp;gt;&lt;br /&gt;
       &amp;lt;text:p text:style-name=&amp;quot;Footnote&amp;quot;&amp;gt;Peter van der Veer (1996) &lt;br /&gt;
       Riots and Rituals: The Construction of Violence and Public &lt;br /&gt;
       Space in Hindu Nationalism, In Paul Brass Ed., Riots and &lt;br /&gt;
       Pogroms (New York:NYU Press) 154–76.&amp;lt;/text:p&amp;gt;&lt;br /&gt;
    &amp;lt;/text:note-body&amp;gt;&lt;br /&gt;
  &amp;lt;/text:note&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The design is such that it is possible to radically change citation formatting without modifying the citation-source element. If a user starts authoring their document in a footnote style, for example, and later must change to an author-year style, the logic is in place to make this a totally seamless switch. Commercial products like Endnote do not support this sort of (quite useful) functionality.&lt;br /&gt;
&lt;br /&gt;
To compare this to the current format see implementation[http://bibliographic.openoffice.org/implementation.html]. The changes to the document schema need to be supported by the document save and load modules. These are detailed into the Further References below.&lt;br /&gt;
&lt;br /&gt;
The bibliographic modules in OOo Writer need to modified to support the new schema. The modules that need to be modified are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;textfield/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text1]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;FieldMaster/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text2]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;BibliographyDataField&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text3]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;note:&amp;lt;/strong&amp;gt; Sun developer Florian Reuter has posted an outline[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the] of how to store the new citation data.&lt;br /&gt;
&lt;br /&gt;
====  Bibliographic Data ==== &lt;br /&gt;
Currently the Writer saves a complete copy of the bibliographic data associated with a citation, with each citation. We propose to separate the citation and the bibliographic data, by leaving just the citation details in the document save file and place the detailed bibliographic data in a seperate bibliographic data file the OOo save file package.&lt;br /&gt;
The task is to complete the design of the bibliographic data file and add support for it in the OOo save file package.&lt;br /&gt;
&lt;br /&gt;
The relevant component is &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html] which supports &amp;#039;&amp;#039;loadComponentFromURL&amp;#039;&amp;#039; and &amp;#039;&amp;#039;storeAsURL&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Note: the OASIS OpenDocument TC is currently discussing plans to enhance metadata support in the file format by using an extensible RDF approch. It is our hope that this will offer support sufficient for this project&amp;#039;s needs, so that the process of designing the bibliographic data representation noted above will largely consist of simply using standardized OpenDocument metadata.&lt;br /&gt;
&lt;br /&gt;
====  Formating Engine ==== &lt;br /&gt;
CiteProc[http://bibliographic.openoffice.org/citeproc/index.html] is a working proof-of-concept for the formatting functionality we propose to offer in OOo, and has already been used to format demanding citations and references for a published book. It is authored in XSLT 2.0. Because support for this language is still evolving, CiteProc needs to be ported to a language more suitable for integration with OOo. This probably ultimately suggests C++, though it might be valuable to consider doing a version in Python first.&lt;br /&gt;
&lt;br /&gt;
== 2nd Stage Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
The second stage is focused on adding backward and forward compatibility support, integration with remote servers, and user interface improvements.&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
==== Backwards and Forwards Compatability ====&lt;br /&gt;
An important object of Bibliographic Enhancement project is to maintain document file backwards compatibility with older versions of OpenOffice. To achieve this when Bibliographic Entries are inserted into a Document they are stored with the same format as is currently the case. A new bibliographic entry tag will be added with the enhanced citation functions, each citation will contain a key that will point to the bibliographic data which will be saved in the document save package. To preserve backwards compatability we will need to also maintain the old bibliographic citation and data storage in the document. Older version of OpenOffice, without the bibliographic enhancements, in the OOo 2.X .ods format, will read the old format of the bibliographic citations and ignore the bibliographic data file in the save package. A suggested approach is illustrated in a flowchart, see[http://bibliographic.openoffice.org/backwards.png].&lt;br /&gt;
&lt;br /&gt;
When a major revision of the save package format is introduced the support of the older bibliographic representations can be dropped form the document save file.&lt;br /&gt;
&lt;br /&gt;
==== Remote Server Integration ====&lt;br /&gt;
Build Z39.50 and SRU/W based internet searching facility using the YAZ toolkit. This would enable searching for and retrieving bibliographic data from internet sources and storing them in a document or bibliographic database.&lt;br /&gt;
&lt;br /&gt;
We would like to use SRU/W as the standard method for OOo retrieving bibliographic data from any source. In that case, even a local Bibliographic database would also be accessed through SRU/W methods. The user would just select a local or remote source and the same access mechanism would be used. SRU[http://www.loc.gov/standards/sru/] is particularly promising because while it shares the same model as the SOAP-based SRW, it is expressed in an easier to implement RESTful protocol.&lt;br /&gt;
&lt;br /&gt;
This would mean adopting a standard API, which ZOOM[http://zoom.z3950.org/index.html] provides, and then wrapping the YAZ client code in a UNO interface.&lt;br /&gt;
&lt;br /&gt;
Also build Z39.50 and SRU/W server capability into OOo to enable users to share their bibliographic (and other) databases over the internet. One of the Indexdata toolkits could used as a basis. [this may need more thought; sharing is good, but there are different ways to do this]&lt;br /&gt;
&lt;br /&gt;
The modules that may need to be modified are:&lt;br /&gt;
&lt;br /&gt;
Bibliography&lt;br /&gt;
textfield/Bibliography&lt;br /&gt;
FieldMaster/Bibliography&lt;br /&gt;
BibliographyDataField&lt;br /&gt;
&lt;br /&gt;
==== Graphical User Interface (GUI) ====&lt;br /&gt;
This stage will involve designing a building a GUI to offer:&lt;br /&gt;
* Basic citation insertion&lt;br /&gt;
* Basic bibliographic data entry&lt;br /&gt;
* Citation and bibliographic table formating using Citeproc.&lt;br /&gt;
* Basic Bibliographic database access&lt;br /&gt;
* Basic bibliographic internet search and database storage.&lt;br /&gt;
&lt;br /&gt;
== Further References ==&lt;br /&gt;
&lt;br /&gt;
For an overview of the Bibliographic project&amp;#039;s major components and a context diagram see components.html[http://bibliographic.openoffice.org/components.html]. There is information about the current OpenOffice Bibliographic implementation[http://bibliographic.openoffice.org/implementation.html].&lt;br /&gt;
&lt;br /&gt;
A start has been made to the Specification for this work (see the Projects Specifications folder[http://bibliographic.openoffice.org/servlets/ProjectDocumentList?folderID=266] on the Documents and Files page). Also see a attempt at an analysis[http://bibliographic.openoffice.org/mindmap/content-analysis.html] of the proposed Bibliographic enhancement components and their relationships.&lt;br /&gt;
The best place to start for finding out about development in OpenOffice is the OpenOffice.org For Developers page[http://development.openoffice.org/index.html]. An important resource is the Developer&amp;#039;s guide which is part of the SDK (software development kit) or available online[http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html].&lt;br /&gt;
&lt;br /&gt;
The OOo API is based on UNO (Universal Network Objects)[http://udk.openoffice.org] is the interface-based component model of OpenOffice.org. UNO offers interpretability between different programming languages, different object models, different machine architectures and different processes; either in a local network or even via the Internet. UNO components can be implemented in and accessed from any programming language for which a UNO language binding exists. We currently provide several language bindings for UNO which allows to use the API from Java, C++, OpenOffice.org Basic, Python and Common Language Infrastructure (CLI).&lt;br /&gt;
Implementing the new citation element in &amp;#039;&amp;#039;xmloff&amp;#039;&amp;#039; (the XmlOffice module) is a routine task. The Sun developers want to do it together with our programmer, so that he/she can learn how xmloff works. Florian Reuter, from the Sun OOo team, has written in his blog an explanation of how the citation changes could be implemented.[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the]&lt;br /&gt;
&lt;br /&gt;
To modify the Writer save-file read and save modules to support the new the bibliographic data file in the document save package, and to support backwards and forwards compatability logic[http://bibliographic.openoffice.org/backwards.png] to Writer the &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html], which supports loadComponentFromURL and storeAsURL, needs to be enhanced. See the Development Guide explanation for - 6.1.5 Handling Documents[http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_Handling_Documents].&lt;br /&gt;
&lt;br /&gt;
There is also a demonstration client program for the YAZ toolkit (C &amp;amp; C++). - IRTCL[http://www.indexdata.dk/irtcl/] that can perform the reference searches. (Requires YAZ and Tcl/Tk libraries be installed). It does everything but save or export the results ! However it is good model of how to use the toolkit and could be used as the basis for or model of a prototype internet searching facility. Screen pic[http://bibliographic.openoffice.org/irclient.jpeg], screen pic2[http://bibliographic.openoffice.org/irclient-setup.png].&lt;br /&gt;
&lt;br /&gt;
A demonstration internet searching facility that writes selected bibliographic records back to the OOo bibliographic database has been written in Python - PyOOBib[http://bibliographic.openoffice.org/files/documents/124/1675/PyOOBib-02.zip], instructions[http://bibliographic.openoffice.org/files/documents/124/2446/file_2446.dat?filename=PyOOBib%20Instructions%2esxw] are available. Various problems with OOo Python have lead to us concluding that YAZ in C++ would be a better foundation than the Python code.&lt;br /&gt;
&lt;br /&gt;
There is description of the OOo save-file XML Package[http://xml.openoffice.org/package.html], and is a FAQ[http://xml.openoffice.org/faq.html#4] about it.&lt;br /&gt;
&lt;br /&gt;
For details about GUI interface design please look at our Project Documentation; GUI Design Documents&amp;#039; Folder[http://wiki.services.openoffice.org/wiki/User_talk:Dnw#Graphical_User_Interface_.28GUI.29]&lt;br /&gt;
&lt;br /&gt;
== How to get started ==&lt;br /&gt;
&lt;br /&gt;
Access to the source code for this project is available for download via CVS. A child work space has been created for us called &amp;quot;metabib&amp;quot; which contains a copy of the xmloff[http://xml.openoffice.org/source/browse/xml/xmloff] (OpenOffice.org XML File Format Definition) and sw (the word processor application component and the WYSIWYG HTML editor component) code.&lt;br /&gt;
The down load size will be about 1GB(?). And you will need about 2GB of disk space to compile the metabib CWS (Child-Work-Space)[http://eis.services.openoffice.org/EIS2/servlet/cws.ShowCWS?Id=3272&amp;amp;Path=SRC680%2Fmetabib]. ( Web access to CWS ). If you can not handle that size download then ask us about sending it to you on cdroms.&lt;br /&gt;
Administration process - you first need to sign the JCA and then obtain the ssh key. After that we will show you how you can access the &amp;#039;CWS&amp;#039;. It&amp;#039;s basically a CVS branch. The most complicated thing is the setup of your tools, such that you can participate in the OOo development --- but, when you have got the ssh key we will show you.&lt;br /&gt;
See OpenOffice.org For Developers[http://development.openoffice.org/index.html] for general development information.&lt;br /&gt;
&lt;br /&gt;
== Sample Code ==&lt;br /&gt;
&lt;br /&gt;
* Sample python code that reads and outputs some of the fields of the records in the bibliographic database. biblioacess.py[]&lt;br /&gt;
* Sample OpenOffice Basic program to write records to the bibliographic database bibwrite.html[http://bibliographic.openoffice.org/Bibwrite.html]&lt;br /&gt;
* Henrik Just&amp;#039;s LaTeX and BibTeX export filter http://www.hj-gym.dk/~hj/writer2latex/[http://www.hj-gym.dk/~hj/writer2latex/]&lt;br /&gt;
Applications which interact with Openoffice- Bibus (WxPython) and B3 (Java).&lt;br /&gt;
* A Perl module OpenOffice::OODoc[http://search.cpan.org/~jmgdoc/OpenOffice-OODoc/OODoc/Intro.pod] provides a simple way to access document elements in the (closed i.e. not interactive with OOo) document save file. An example[http://bibliographic.openoffice.org/bibquery.perl] which retrieves bibliographic details is provided.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Question or comments can be put to the Bibliographic Project development list dev@bibliographic.openoffice.org or to the project co-leader David Wilson at dnw@openoffice.org.&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/New_Citation_XML_info_design_and_implementation&amp;diff=3537</id>
		<title>Bibliographic/Developer Page/New Citation XML info design and implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/New_Citation_XML_info_design_and_implementation&amp;diff=3537"/>
		<updated>2005-12-30T02:09:51Z</updated>

		<summary type="html">&lt;p&gt;Cph: Design and implementation moved to New Biblio XML info design and implementation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we need more information before anything can be implemented (unless stumbling in the dark is the recommended implementation waste of time!).&lt;br /&gt;
&lt;br /&gt;
* general architecture of the xmloff classes (i.e. an overview of the relevant pieces so that we know where to look to implement reading, saving and writing of biblio data);&lt;br /&gt;
* general recommendations for how to structure the classes/instances which represent this data in memory - this should also take into account the current biblio classes as I presume compatibility is somewhat important.&lt;br /&gt;
* others .....&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/New_Citation_XML_info_design_and_implementation&amp;diff=3536</id>
		<title>Bibliographic/Developer Page/New Citation XML info design and implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Bibliographic/Developer_Page/New_Citation_XML_info_design_and_implementation&amp;diff=3536"/>
		<updated>2005-12-30T02:08:58Z</updated>

		<summary type="html">&lt;p&gt;Cph: Design and implementation for basic biblio enhancements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here we need more information before anything can be implemented (unless stumbling in the dark is the recommended implementation waste of time!).&lt;br /&gt;
&lt;br /&gt;
* general architecture of the xmloff classes (i.e. an overview of the relevant pieces so that we know where to look to implement reading, saving and writing of biblio data);&lt;br /&gt;
* general recommendations for how to structure the classes/instances which represent this data in memory - this should also take into account the current biblio classes as I presume compatibility is somewhat important.&lt;br /&gt;
* others .....&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3535</id>
		<title>User talk:Dnw</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3535"/>
		<updated>2005-12-30T02:03:49Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bibliographic Project&amp;#039;s Developer Page ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Project Overview&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The Bibliographic Project (OOoBib)[http://bibliographic.openoffice.org/] plans to enhance the bibliographic functions of the OpenOffice.org Writer (wordprocessing) application to achieve: &lt;br /&gt;
&lt;br /&gt;
# bibliographic formatting support for: &lt;br /&gt;
#* complex features required of commonly used citation styles like APA and Chicago&lt;br /&gt;
#* automatically switching between potentially radically different citation styles (ie. footnote to in-text)&lt;br /&gt;
# a data model that can support a broader range of reference types&lt;br /&gt;
# integration with remote databases&lt;br /&gt;
&lt;br /&gt;
Our current objective is to design and build OOoBib version 0.1, which will contain the most basic functions for an usable bibliographic facility with the above features.&lt;br /&gt;
&lt;br /&gt;
== 1st Stage, Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
As our first step, we will implement the most simple changes to the OOo core code (the API basic code, and UNO mappings, but not yet the user interface code) necessary to implement basic support for:&lt;br /&gt;
&lt;br /&gt;
# Saving and reading enhanced citation support in OpenDocument i.e. the [[design and implementation]]&lt;br /&gt;
# Inserting and displaying citations in OpenOffice Writer using the new format. (Note this task does not include the GUI interface to insert the citation in the new format, only the UNO interface to provide the basic function.&lt;br /&gt;
# Storage of document bibliographic data in the OOo document save package and the code changes necessary to read and save that bibliographic data.&lt;br /&gt;
&lt;br /&gt;
When these basic functions are built into OOo and are made assessable via UNO, we can then use rapid prototyping development methods to design and build prototype GUI interfaces and bibliographic formatting engines. We will be  able to use any of the programming languages which have OpenOffice bindings: C++, Java, Python and, of course, OpenOffice Basic. We believe that we will find more developers who can work in these languages than by insisting on C++ code from the start. Also it is much easier to build prototypes using Java, Python and OpenOffice Basic than in C++.&lt;br /&gt;
 &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NB&amp;#039;&amp;#039;&amp;#039;. When we have designed, built and tested the prototypes and they have been accepted by the OOo community we intend to rebuild them in C++ and to have them made part of the core OpenOffice application.&lt;br /&gt;
Skills required - good C++ programming and some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skills required&amp;#039;&amp;#039;&amp;#039; - some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
The project needs to modify the Writer document-read and document-save modules to support the new OpenDocument enhanced citation format. Implement the citation and bibliography changes to the OOo Writer save file (in Open Document format) accepted by the OpenDocument Technical Committee[http://lists.oasis-open.org/archives/office/200409/msg00023.html]. &lt;br /&gt;
&lt;br /&gt;
==== New Citation Coding ====&lt;br /&gt;
&lt;br /&gt;
The changes to the document schema are detailed in our OpenDocument XML Citation Proposal.pdf[http://bibliographic.openoffice.org/XML-bibliography-proposal.pdf]. Here are two examples of the new citation format. The first is a standard author-year style, with additional page number details:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;cite:detail cite:units=&amp;quot;pages&amp;quot; cite:begin=&amp;quot;23&amp;quot; cite:end=&amp;quot;24&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/cite:biblioref&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:span text:style-name=&amp;quot;Citation&amp;quot;&amp;gt;(Veer, 1996:23-24)&amp;lt;/text:span&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second is a footnoted example.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:note text:id=&amp;quot;ftn0&amp;quot; text:note-class=&amp;quot;footnote&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-citation&amp;gt;1&amp;lt;/text:note-citation&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-body&amp;gt;&lt;br /&gt;
       &amp;lt;text:p text:style-name=&amp;quot;Footnote&amp;quot;&amp;gt;Peter van der Veer (1996) &lt;br /&gt;
       Riots and Rituals: The Construction of Violence and Public &lt;br /&gt;
       Space in Hindu Nationalism, In Paul Brass Ed., Riots and &lt;br /&gt;
       Pogroms (New York:NYU Press) 154–76.&amp;lt;/text:p&amp;gt;&lt;br /&gt;
    &amp;lt;/text:note-body&amp;gt;&lt;br /&gt;
  &amp;lt;/text:note&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The design is such that it is possible to radically change citation formatting without modifying the citation-source element. If a user starts authoring their document in a footnote style, for example, and later must change to an author-year style, the logic is in place to make this a totally seamless switch. Commercial products like Endnote do not support this sort of (quite useful) functionality.&lt;br /&gt;
&lt;br /&gt;
To compare this to the current format see implementation[http://bibliographic.openoffice.org/implementation.html]. The changes to the document schema need to be supported by the document save and load modules. These are detailed into the Further References below.&lt;br /&gt;
&lt;br /&gt;
The bibliographic modules in OOo Writer need to modified to support the new schema. The modules that need to be modified are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;textfield/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text1]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;FieldMaster/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text2]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;BibliographyDataField&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text3]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;note:&amp;lt;/strong&amp;gt; Sun developer Florian Reuter has posted an outline[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the] of how to store the new citation data.&lt;br /&gt;
&lt;br /&gt;
====  Bibliographic Data ==== &lt;br /&gt;
Currently the Writer saves a complete copy of the bibliographic data associated with a citation, with each citation. We propose to separate the citation and the bibliographic data, by leaving just the citation details in the document save file and place the detailed bibliographic data in a seperate bibliographic data file the OOo save file package.&lt;br /&gt;
The task is to complete the design of the bibliographic data file and add support for it in the OOo save file package.&lt;br /&gt;
&lt;br /&gt;
The relevant component is &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html] which supports &amp;#039;&amp;#039;loadComponentFromURL&amp;#039;&amp;#039; and &amp;#039;&amp;#039;storeAsURL&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Note: the OASIS OpenDocument TC is currently discussing plans to enhance metadata support in the file format by using an extensible RDF approch. It is our hope that this will offer support sufficient for this project&amp;#039;s needs, so that the process of designing the bibliographic data representation noted above will largely consist of simply using standardized OpenDocument metadata.&lt;br /&gt;
&lt;br /&gt;
====  Formating Engine ==== &lt;br /&gt;
CiteProc[http://bibliographic.openoffice.org/citeproc/index.html] is a working proof-of-concept for the formatting functionality we propose to offer in OOo, and has already been used to format demanding citations and references for a published book. It is authored in XSLT 2.0. Because support for this language is still evolving, CiteProc needs to be ported to a language more suitable for integration with OOo. This probably ultimately suggests C++, though it might be valuable to consider doing a version in Python first.&lt;br /&gt;
&lt;br /&gt;
== 2nd Stage Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
The second stage is focused on adding backward and forward compatibility support, integration with remote servers, and user interface improvements.&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
==== Backwards and Forwards Compatability ====&lt;br /&gt;
An important object of Bibliographic Enhancement project is to maintain document file backwards compatibility with older versions of OpenOffice. To achieve this when Bibliographic Entries are inserted into a Document they are stored with the same format as is currently the case. A new bibliographic entry tag will be added with the enhanced citation functions, each citation will contain a key that will point to the bibliographic data which will be saved in the document save package. To preserve backwards compatability we will need to also maintain the old bibliographic citation and data storage in the document. Older version of OpenOffice, without the bibliographic enhancements, in the OOo 2.X .ods format, will read the old format of the bibliographic citations and ignore the bibliographic data file in the save package. A suggested approach is illustrated in a flowchart, see[http://bibliographic.openoffice.org/backwards.png].&lt;br /&gt;
&lt;br /&gt;
When a major revision of the save package format is introduced the support of the older bibliographic representations can be dropped form the document save file.&lt;br /&gt;
&lt;br /&gt;
==== Remote Server Integration ====&lt;br /&gt;
Build Z39.50 and SRU/W based internet searching facility using the YAZ toolkit. This would enable searching for and retrieving bibliographic data from internet sources and storing them in a document or bibliographic database.&lt;br /&gt;
&lt;br /&gt;
We would like to use SRU/W as the standard method for OOo retrieving bibliographic data from any source. In that case, even a local Bibliographic database would also be accessed through SRU/W methods. The user would just select a local or remote source and the same access mechanism would be used. SRU[http://www.loc.gov/standards/sru/] is particularly promising because while it shares the same model as the SOAP-based SRW, it is expressed in an easier to implement RESTful protocol.&lt;br /&gt;
&lt;br /&gt;
This would mean adopting a standard API, which ZOOM[http://zoom.z3950.org/index.html] provides, and then wrapping the YAZ client code in a UNO interface.&lt;br /&gt;
&lt;br /&gt;
Also build Z39.50 and SRU/W server capability into OOo to enable users to share their bibliographic (and other) databases over the internet. One of the Indexdata toolkits could used as a basis. [this may need more thought; sharing is good, but there are different ways to do this]&lt;br /&gt;
&lt;br /&gt;
The modules that may need to be modified are:&lt;br /&gt;
&lt;br /&gt;
Bibliography&lt;br /&gt;
textfield/Bibliography&lt;br /&gt;
FieldMaster/Bibliography&lt;br /&gt;
BibliographyDataField&lt;br /&gt;
&lt;br /&gt;
==== Graphical User Interface (GUI) ====&lt;br /&gt;
This stage will involve designing a building a GUI to offer:&lt;br /&gt;
* Basic citation insertion&lt;br /&gt;
* Basic bibliographic data entry&lt;br /&gt;
* Citation and bibliographic table formating using Citeproc.&lt;br /&gt;
* Basic Bibliographic database access&lt;br /&gt;
* Basic bibliographic internet search and database storage.&lt;br /&gt;
&lt;br /&gt;
== Further References ==&lt;br /&gt;
&lt;br /&gt;
For an overview of the Bibliographic project&amp;#039;s major components and a context diagram see components.html[http://bibliographic.openoffice.org/components.html]. There is information about the current OpenOffice Bibliographic implementation[http://bibliographic.openoffice.org/implementation.html].&lt;br /&gt;
&lt;br /&gt;
A start has been made to the Specification for this work (see the Projects Specifications folder[http://bibliographic.openoffice.org/servlets/ProjectDocumentList?folderID=266] on the Documents and Files page). Also see a attempt at an analysis[http://bibliographic.openoffice.org/mindmap/content-analysis.html] of the proposed Bibliographic enhancement components and their relationships.&lt;br /&gt;
The best place to start for finding out about development in OpenOffice is the OpenOffice.org For Developers page[http://development.openoffice.org/index.html]. An important resource is the Developer&amp;#039;s guide which is part of the SDK (software development kit) or available online[http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html].&lt;br /&gt;
&lt;br /&gt;
The OOo API is based on UNO (Universal Network Objects)[http://udk.openoffice.org] is the interface-based component model of OpenOffice.org. UNO offers interpretability between different programming languages, different object models, different machine architectures and different processes; either in a local network or even via the Internet. UNO components can be implemented in and accessed from any programming language for which a UNO language binding exists. We currently provide several language bindings for UNO which allows to use the API from Java, C++, OpenOffice.org Basic, Python and Common Language Infrastructure (CLI).&lt;br /&gt;
Implementing the new citation element in &amp;#039;&amp;#039;xmloff&amp;#039;&amp;#039; (the XmlOffice module) is a routine task. The Sun developers want to do it together with our programmer, so that he/she can learn how xmloff works. Florian Reuter, from the Sun OOo team, has written in his blog an explanation of how the citation changes could be implemented.[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the]&lt;br /&gt;
&lt;br /&gt;
To modify the Writer save-file read and save modules to support the new the bibliographic data file in the document save package, and to support backwards and forwards compatability logic[http://bibliographic.openoffice.org/backwards.png] to Writer the &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html], which supports loadComponentFromURL and storeAsURL, needs to be enhanced. See the Development Guide explanation for - 6.1.5 Handling Documents[http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_Handling_Documents].&lt;br /&gt;
&lt;br /&gt;
There is also a demonstration client program for the YAZ toolkit (C &amp;amp; C++). - IRTCL[http://www.indexdata.dk/irtcl/] that can perform the reference searches. (Requires YAZ and Tcl/Tk libraries be installed). It does everything but save or export the results ! However it is good model of how to use the toolkit and could be used as the basis for or model of a prototype internet searching facility. Screen pic[http://bibliographic.openoffice.org/irclient.jpeg], screen pic2[http://bibliographic.openoffice.org/irclient-setup.png].&lt;br /&gt;
&lt;br /&gt;
A demonstration internet searching facility that writes selected bibliographic records back to the OOo bibliographic database has been written in Python - PyOOBib[http://bibliographic.openoffice.org/files/documents/124/1675/PyOOBib-02.zip], instructions[http://bibliographic.openoffice.org/files/documents/124/2446/file_2446.dat?filename=PyOOBib%20Instructions%2esxw] are available. Various problems with OOo Python have lead to us concluding that YAZ in C++ would be a better foundation than the Python code.&lt;br /&gt;
&lt;br /&gt;
There is description of the OOo save-file XML Package[http://xml.openoffice.org/package.html], and is a FAQ[http://xml.openoffice.org/faq.html#4] about it.&lt;br /&gt;
&lt;br /&gt;
For details about GUI interface design please look at our Project Documentation; GUI Design Documents&amp;#039; Folder[http://wiki.services.openoffice.org/wiki/User_talk:Dnw#Graphical_User_Interface_.28GUI.29]&lt;br /&gt;
&lt;br /&gt;
== How to get started ==&lt;br /&gt;
&lt;br /&gt;
Access to the source code for this project is available for download via CVS. A child work space has been created for us called &amp;quot;metabib&amp;quot; which contains a copy of the xmloff[http://xml.openoffice.org/source/browse/xml/xmloff] (OpenOffice.org XML File Format Definition) and sw (the word processor application component and the WYSIWYG HTML editor component) code.&lt;br /&gt;
The down load size will be about 1GB(?). And you will need about 2GB of disk space to compile the metabib CWS (Child-Work-Space)[http://eis.services.openoffice.org/EIS2/servlet/cws.ShowCWS?Id=3272&amp;amp;Path=SRC680%2Fmetabib]. ( Web access to CWS ). If you can not handle that size download then ask us about sending it to you on cdroms.&lt;br /&gt;
Administration process - you first need to sign the JCA and then obtain the ssh key. After that we will show you how you can access the &amp;#039;CWS&amp;#039;. It&amp;#039;s basically a CVS branch. The most complicated thing is the setup of your tools, such that you can participate in the OOo development --- but, when you have got the ssh key we will show you.&lt;br /&gt;
See OpenOffice.org For Developers[http://development.openoffice.org/index.html] for general development information.&lt;br /&gt;
&lt;br /&gt;
== Sample Code ==&lt;br /&gt;
&lt;br /&gt;
* Sample python code that reads and outputs some of the fields of the records in the bibliographic database. biblioacess.py[]&lt;br /&gt;
* Sample OpenOffice Basic program to write records to the bibliographic database bibwrite.html[http://bibliographic.openoffice.org/Bibwrite.html]&lt;br /&gt;
* Henrik Just&amp;#039;s LaTeX and BibTeX export filter http://www.hj-gym.dk/~hj/writer2latex/[http://www.hj-gym.dk/~hj/writer2latex/]&lt;br /&gt;
Applications which interact with Openoffice- Bibus (WxPython) and B3 (Java).&lt;br /&gt;
* A Perl module OpenOffice::OODoc[http://search.cpan.org/~jmgdoc/OpenOffice-OODoc/OODoc/Intro.pod] provides a simple way to access document elements in the (closed i.e. not interactive with OOo) document save file. An example[http://bibliographic.openoffice.org/bibquery.perl] which retrieves bibliographic details is provided.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Question or comments can be put to the Bibliographic Project development list dev@bibliographic.openoffice.org or to the project co-leader David Wilson at dnw@openoffice.org.&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3534</id>
		<title>User talk:Dnw</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User_talk:Dnw&amp;diff=3534"/>
		<updated>2005-12-30T02:03:18Z</updated>

		<summary type="html">&lt;p&gt;Cph: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bibliographic Project&amp;#039;s Developer Page ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Project Overview&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The Bibliographic Project (OOoBib)[http://bibliographic.openoffice.org/] plans to enhance the bibliographic functions of the OpenOffice.org Writer (wordprocessing) application to achieve: &lt;br /&gt;
&lt;br /&gt;
# bibliographic formatting support for: &lt;br /&gt;
#* complex features required of commonly used citation styles like APA and Chicago&lt;br /&gt;
#* automatically switching between potentially radically different citation styles (ie. footnote to in-text)&lt;br /&gt;
# a data model that can support a broader range of reference types&lt;br /&gt;
# integration with remote databases&lt;br /&gt;
&lt;br /&gt;
Our current objective is to design and build OOoBib version 0.1, which will contain the most basic functions for an usable bibliographic facility with the above features.&lt;br /&gt;
&lt;br /&gt;
== 1st Stage, Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
As our first step, we will implement the most simple changes to the OOo core code (the API basic code, and UNO mappings, but not yet the user interface code) necessary to implement basic support for:&lt;br /&gt;
&lt;br /&gt;
# Saving and reading enhanced citation support in OpenDocument i.e. the [[implementation]]&lt;br /&gt;
# Inserting and displaying citations in OpenOffice Writer using the new format. (Note this task does not include the GUI interface to insert the citation in the new format, only the UNO interface to provide the basic function.&lt;br /&gt;
# Storage of document bibliographic data in the OOo document save package and the code changes necessary to read and save that bibliographic data.&lt;br /&gt;
&lt;br /&gt;
When these basic functions are built into OOo and are made assessable via UNO, we can then use rapid prototyping development methods to design and build prototype GUI interfaces and bibliographic formatting engines. We will be  able to use any of the programming languages which have OpenOffice bindings: C++, Java, Python and, of course, OpenOffice Basic. We believe that we will find more developers who can work in these languages than by insisting on C++ code from the start. Also it is much easier to build prototypes using Java, Python and OpenOffice Basic than in C++.&lt;br /&gt;
 &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NB&amp;#039;&amp;#039;&amp;#039;. When we have designed, built and tested the prototypes and they have been accepted by the OOo community we intend to rebuild them in C++ and to have them made part of the core OpenOffice application.&lt;br /&gt;
Skills required - good C++ programming and some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skills required&amp;#039;&amp;#039;&amp;#039; - some XML skills with knowledge of, or willingness to learn, the OpenOffice UNO (see the Openoffice Developer&amp;#039;s Guide)&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
The project needs to modify the Writer document-read and document-save modules to support the new OpenDocument enhanced citation format. Implement the citation and bibliography changes to the OOo Writer save file (in Open Document format) accepted by the OpenDocument Technical Committee[http://lists.oasis-open.org/archives/office/200409/msg00023.html]. &lt;br /&gt;
&lt;br /&gt;
==== New Citation Coding ====&lt;br /&gt;
&lt;br /&gt;
The changes to the document schema are detailed in our OpenDocument XML Citation Proposal.pdf[http://bibliographic.openoffice.org/XML-bibliography-proposal.pdf]. Here are two examples of the new citation format. The first is a standard author-year style, with additional page number details:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;cite:detail cite:units=&amp;quot;pages&amp;quot; cite:begin=&amp;quot;23&amp;quot; cite:end=&amp;quot;24&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/cite:biblioref&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:span text:style-name=&amp;quot;Citation&amp;quot;&amp;gt;(Veer, 1996:23-24)&amp;lt;/text:span&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The second is a footnoted example.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-source&amp;gt;&lt;br /&gt;
   &amp;lt;cite:biblioref cite:key=&amp;quot;Veer1996a&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-source&amp;gt;&lt;br /&gt;
  &amp;lt;cite:citation-body&amp;gt;&lt;br /&gt;
    &amp;lt;text:note text:id=&amp;quot;ftn0&amp;quot; text:note-class=&amp;quot;footnote&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-citation&amp;gt;1&amp;lt;/text:note-citation&amp;gt;&lt;br /&gt;
     &amp;lt;text:note-body&amp;gt;&lt;br /&gt;
       &amp;lt;text:p text:style-name=&amp;quot;Footnote&amp;quot;&amp;gt;Peter van der Veer (1996) &lt;br /&gt;
       Riots and Rituals: The Construction of Violence and Public &lt;br /&gt;
       Space in Hindu Nationalism, In Paul Brass Ed., Riots and &lt;br /&gt;
       Pogroms (New York:NYU Press) 154–76.&amp;lt;/text:p&amp;gt;&lt;br /&gt;
    &amp;lt;/text:note-body&amp;gt;&lt;br /&gt;
  &amp;lt;/text:note&amp;gt;&lt;br /&gt;
  &amp;lt;/cite:citation-body&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The design is such that it is possible to radically change citation formatting without modifying the citation-source element. If a user starts authoring their document in a footnote style, for example, and later must change to an author-year style, the logic is in place to make this a totally seamless switch. Commercial products like Endnote do not support this sort of (quite useful) functionality.&lt;br /&gt;
&lt;br /&gt;
To compare this to the current format see implementation[http://bibliographic.openoffice.org/implementation.html]. The changes to the document schema need to be supported by the document save and load modules. These are detailed into the Further References below.&lt;br /&gt;
&lt;br /&gt;
The bibliographic modules in OOo Writer need to modified to support the new schema. The modules that need to be modified are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;textfield/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text1]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;FieldMaster/Bibliography&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text2]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;BibliographyDataField&amp;#039;&amp;#039;[http://bibliographic.openoffice.org/implementation.html#text3]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;note:&amp;lt;/strong&amp;gt; Sun developer Florian Reuter has posted an outline[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the] of how to store the new citation data.&lt;br /&gt;
&lt;br /&gt;
====  Bibliographic Data ==== &lt;br /&gt;
Currently the Writer saves a complete copy of the bibliographic data associated with a citation, with each citation. We propose to separate the citation and the bibliographic data, by leaving just the citation details in the document save file and place the detailed bibliographic data in a seperate bibliographic data file the OOo save file package.&lt;br /&gt;
The task is to complete the design of the bibliographic data file and add support for it in the OOo save file package.&lt;br /&gt;
&lt;br /&gt;
The relevant component is &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html] which supports &amp;#039;&amp;#039;loadComponentFromURL&amp;#039;&amp;#039; and &amp;#039;&amp;#039;storeAsURL&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Note: the OASIS OpenDocument TC is currently discussing plans to enhance metadata support in the file format by using an extensible RDF approch. It is our hope that this will offer support sufficient for this project&amp;#039;s needs, so that the process of designing the bibliographic data representation noted above will largely consist of simply using standardized OpenDocument metadata.&lt;br /&gt;
&lt;br /&gt;
====  Formating Engine ==== &lt;br /&gt;
CiteProc[http://bibliographic.openoffice.org/citeproc/index.html] is a working proof-of-concept for the formatting functionality we propose to offer in OOo, and has already been used to format demanding citations and references for a published book. It is authored in XSLT 2.0. Because support for this language is still evolving, CiteProc needs to be ported to a language more suitable for integration with OOo. This probably ultimately suggests C++, though it might be valuable to consider doing a version in Python first.&lt;br /&gt;
&lt;br /&gt;
== 2nd Stage Bibliographic Facility Redevelopment ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
The second stage is focused on adding backward and forward compatibility support, integration with remote servers, and user interface improvements.&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
==== Backwards and Forwards Compatability ====&lt;br /&gt;
An important object of Bibliographic Enhancement project is to maintain document file backwards compatibility with older versions of OpenOffice. To achieve this when Bibliographic Entries are inserted into a Document they are stored with the same format as is currently the case. A new bibliographic entry tag will be added with the enhanced citation functions, each citation will contain a key that will point to the bibliographic data which will be saved in the document save package. To preserve backwards compatability we will need to also maintain the old bibliographic citation and data storage in the document. Older version of OpenOffice, without the bibliographic enhancements, in the OOo 2.X .ods format, will read the old format of the bibliographic citations and ignore the bibliographic data file in the save package. A suggested approach is illustrated in a flowchart, see[http://bibliographic.openoffice.org/backwards.png].&lt;br /&gt;
&lt;br /&gt;
When a major revision of the save package format is introduced the support of the older bibliographic representations can be dropped form the document save file.&lt;br /&gt;
&lt;br /&gt;
==== Remote Server Integration ====&lt;br /&gt;
Build Z39.50 and SRU/W based internet searching facility using the YAZ toolkit. This would enable searching for and retrieving bibliographic data from internet sources and storing them in a document or bibliographic database.&lt;br /&gt;
&lt;br /&gt;
We would like to use SRU/W as the standard method for OOo retrieving bibliographic data from any source. In that case, even a local Bibliographic database would also be accessed through SRU/W methods. The user would just select a local or remote source and the same access mechanism would be used. SRU[http://www.loc.gov/standards/sru/] is particularly promising because while it shares the same model as the SOAP-based SRW, it is expressed in an easier to implement RESTful protocol.&lt;br /&gt;
&lt;br /&gt;
This would mean adopting a standard API, which ZOOM[http://zoom.z3950.org/index.html] provides, and then wrapping the YAZ client code in a UNO interface.&lt;br /&gt;
&lt;br /&gt;
Also build Z39.50 and SRU/W server capability into OOo to enable users to share their bibliographic (and other) databases over the internet. One of the Indexdata toolkits could used as a basis. [this may need more thought; sharing is good, but there are different ways to do this]&lt;br /&gt;
&lt;br /&gt;
The modules that may need to be modified are:&lt;br /&gt;
&lt;br /&gt;
Bibliography&lt;br /&gt;
textfield/Bibliography&lt;br /&gt;
FieldMaster/Bibliography&lt;br /&gt;
BibliographyDataField&lt;br /&gt;
&lt;br /&gt;
==== Graphical User Interface (GUI) ====&lt;br /&gt;
This stage will involve designing a building a GUI to offer:&lt;br /&gt;
* Basic citation insertion&lt;br /&gt;
* Basic bibliographic data entry&lt;br /&gt;
* Citation and bibliographic table formating using Citeproc.&lt;br /&gt;
* Basic Bibliographic database access&lt;br /&gt;
* Basic bibliographic internet search and database storage.&lt;br /&gt;
&lt;br /&gt;
== Further References ==&lt;br /&gt;
&lt;br /&gt;
For an overview of the Bibliographic project&amp;#039;s major components and a context diagram see components.html[http://bibliographic.openoffice.org/components.html]. There is information about the current OpenOffice Bibliographic implementation[http://bibliographic.openoffice.org/implementation.html].&lt;br /&gt;
&lt;br /&gt;
A start has been made to the Specification for this work (see the Projects Specifications folder[http://bibliographic.openoffice.org/servlets/ProjectDocumentList?folderID=266] on the Documents and Files page). Also see a attempt at an analysis[http://bibliographic.openoffice.org/mindmap/content-analysis.html] of the proposed Bibliographic enhancement components and their relationships.&lt;br /&gt;
The best place to start for finding out about development in OpenOffice is the OpenOffice.org For Developers page[http://development.openoffice.org/index.html]. An important resource is the Developer&amp;#039;s guide which is part of the SDK (software development kit) or available online[http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html].&lt;br /&gt;
&lt;br /&gt;
The OOo API is based on UNO (Universal Network Objects)[http://udk.openoffice.org] is the interface-based component model of OpenOffice.org. UNO offers interpretability between different programming languages, different object models, different machine architectures and different processes; either in a local network or even via the Internet. UNO components can be implemented in and accessed from any programming language for which a UNO language binding exists. We currently provide several language bindings for UNO which allows to use the API from Java, C++, OpenOffice.org Basic, Python and Common Language Infrastructure (CLI).&lt;br /&gt;
Implementing the new citation element in &amp;#039;&amp;#039;xmloff&amp;#039;&amp;#039; (the XmlOffice module) is a routine task. The Sun developers want to do it together with our programmer, so that he/she can learn how xmloff works. Florian Reuter, from the Sun OOo team, has written in his blog an explanation of how the citation changes could be implemented.[http://blogs.sun.com/roller/page/flo?entry=the_community_and_me_the]&lt;br /&gt;
&lt;br /&gt;
To modify the Writer save-file read and save modules to support the new the bibliographic data file in the document save package, and to support backwards and forwards compatability logic[http://bibliographic.openoffice.org/backwards.png] to Writer the &amp;quot;&amp;#039;&amp;#039;interface XComponentLoader&amp;#039;&amp;#039;&amp;quot;[http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html], which supports loadComponentFromURL and storeAsURL, needs to be enhanced. See the Development Guide explanation for - 6.1.5 Handling Documents[http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_Handling_Documents].&lt;br /&gt;
&lt;br /&gt;
There is also a demonstration client program for the YAZ toolkit (C &amp;amp; C++). - IRTCL[http://www.indexdata.dk/irtcl/] that can perform the reference searches. (Requires YAZ and Tcl/Tk libraries be installed). It does everything but save or export the results ! However it is good model of how to use the toolkit and could be used as the basis for or model of a prototype internet searching facility. Screen pic[http://bibliographic.openoffice.org/irclient.jpeg], screen pic2[http://bibliographic.openoffice.org/irclient-setup.png].&lt;br /&gt;
&lt;br /&gt;
A demonstration internet searching facility that writes selected bibliographic records back to the OOo bibliographic database has been written in Python - PyOOBib[http://bibliographic.openoffice.org/files/documents/124/1675/PyOOBib-02.zip], instructions[http://bibliographic.openoffice.org/files/documents/124/2446/file_2446.dat?filename=PyOOBib%20Instructions%2esxw] are available. Various problems with OOo Python have lead to us concluding that YAZ in C++ would be a better foundation than the Python code.&lt;br /&gt;
&lt;br /&gt;
There is description of the OOo save-file XML Package[http://xml.openoffice.org/package.html], and is a FAQ[http://xml.openoffice.org/faq.html#4] about it.&lt;br /&gt;
&lt;br /&gt;
For details about GUI interface design please look at our Project Documentation; GUI Design Documents&amp;#039; Folder[http://wiki.services.openoffice.org/wiki/User_talk:Dnw#Graphical_User_Interface_.28GUI.29]&lt;br /&gt;
&lt;br /&gt;
== How to get started ==&lt;br /&gt;
&lt;br /&gt;
Access to the source code for this project is available for download via CVS. A child work space has been created for us called &amp;quot;metabib&amp;quot; which contains a copy of the xmloff[http://xml.openoffice.org/source/browse/xml/xmloff] (OpenOffice.org XML File Format Definition) and sw (the word processor application component and the WYSIWYG HTML editor component) code.&lt;br /&gt;
The down load size will be about 1GB(?). And you will need about 2GB of disk space to compile the metabib CWS (Child-Work-Space)[http://eis.services.openoffice.org/EIS2/servlet/cws.ShowCWS?Id=3272&amp;amp;Path=SRC680%2Fmetabib]. ( Web access to CWS ). If you can not handle that size download then ask us about sending it to you on cdroms.&lt;br /&gt;
Administration process - you first need to sign the JCA and then obtain the ssh key. After that we will show you how you can access the &amp;#039;CWS&amp;#039;. It&amp;#039;s basically a CVS branch. The most complicated thing is the setup of your tools, such that you can participate in the OOo development --- but, when you have got the ssh key we will show you.&lt;br /&gt;
See OpenOffice.org For Developers[http://development.openoffice.org/index.html] for general development information.&lt;br /&gt;
&lt;br /&gt;
== Sample Code ==&lt;br /&gt;
&lt;br /&gt;
* Sample python code that reads and outputs some of the fields of the records in the bibliographic database. biblioacess.py[]&lt;br /&gt;
* Sample OpenOffice Basic program to write records to the bibliographic database bibwrite.html[http://bibliographic.openoffice.org/Bibwrite.html]&lt;br /&gt;
* Henrik Just&amp;#039;s LaTeX and BibTeX export filter http://www.hj-gym.dk/~hj/writer2latex/[http://www.hj-gym.dk/~hj/writer2latex/]&lt;br /&gt;
Applications which interact with Openoffice- Bibus (WxPython) and B3 (Java).&lt;br /&gt;
* A Perl module OpenOffice::OODoc[http://search.cpan.org/~jmgdoc/OpenOffice-OODoc/OODoc/Intro.pod] provides a simple way to access document elements in the (closed i.e. not interactive with OOo) document save file. An example[http://bibliographic.openoffice.org/bibquery.perl] which retrieves bibliographic details is provided.&lt;br /&gt;
&lt;br /&gt;
== Contacts ==&lt;br /&gt;
&lt;br /&gt;
Question or comments can be put to the Bibliographic Project development list dev@bibliographic.openoffice.org or to the project co-leader David Wilson at dnw@openoffice.org.&lt;/div&gt;</summary>
		<author><name>Cph</name></author>
	</entry>
</feed>