[Library] [Contents] [Revisions] [Prev Topic] [Next Topic] [Search] [Search Results] [Prev Topic Match] [Next Topic Match] [Notes] [List Notes] [Print] [Download] [Help]

2.4.1 Binding

As with most objects, only the data part is stored when the document is saved. The data is stored in the OpenDoc storage system Bento. A part handler on the other hand is loaded into the memory only once, although it may be used by several active objects of the same kind. Therefore, there must be a binding process to associate the data part with the right part handler at the documents loading time as shown in Figure 22.


PICTURE 22


Figure 22. OpenDoc Binding

To define those associations, OpenDoc provides a notebook in the OpenDoc folder called Part Editor Preferences, where part editor associations can be defined for different component kinds (see Figure 23). It can also define preferred editors for component categories (see Figure 24).

OpenDoc provides a six step sequence for that binding process. OpenDoc uses a special service class ODBinding to make the right decision. OpenDoc maintains a table that maps data types to the part handler. This is defined with another service class, ODNameSpace. (For class relationship, seeFigure 47 in topic 2.7.5.) The binding is done in a recursive way, starting with the topmost container part of the document hierarchy, which then invokes the binding for its embedded parts.


PICTURE 23


Figure 23. Part Editor Preferences for Kinds

This binding is done from OpenDoc in the following order:

1. ODBinding starts to look for a part handler by checking whether there is a preferred editor for this kind specified, as shown in Figure 23. 2. If no preferred editor was specified, it looks for the part editor with which the part was created. 3. If such an editor is not available, it looks for any installed part handler supporting this part kind. 4. Then it looks for another part handler of the same category which can work with the data type the part has stored its data with. 5. Then it looks whether there are translations supported by a special object ODTranslation to another data type understood by a part handler available. 6. If nothing is available, it binds the part to an editor as a last resort. This editor will show the part as a black box, so a user can work with the rest of the document.


PICTURE 24


Figure 24. Part Editor Preferences for Categories


[Prev Topic] [Next Topic] © Copyright IBM Corp. 1996

IBM BookManager® BookServer Copyright 1989, 1999 IBM Corporation. All rights reserved.