Document Library Container

From Apache OpenOffice Wiki
Jump to: navigation, search



While application libraries are stored directly in the file system, document libraries are stored inside the document's package file. In documents, the Basic library container and dialog library container are stored separately:

  • The root of the Basic library container hierarchy is a folder inside the package file named Basic. This folder is not created when the Basic library container contains an empty Standard library in the case of a new document.
  • The root of the dialog library container hierarchy is a folder inside the package file named Dialogs. This folder is not created when the dialog library container contains an empty Standard library in the case of a new document.

The libraries are stored as sub folders in these library container folders. The structure inside the libraries is basically the same as in an application. One difference relates to the stream - "files" inside the package or package folders – names. In documents, all XML stream or file names have the extension .xml. Special extensions like .xba, .xdl are not used. Instead of different extensions, the names are extended for the library and library container index files. In documents they are named script-lc.xml (Basic library container index file), script-lb.xml (Basic library index file), dialog-lc.xml (dialog library container index file) and dialog-lb.xml (dialog library index file).

In example 1, the package structure for a document with one Basic Standard library containing three modules:

 <Package> ExampleDocument1
 |
 |--<DIR> Basic
 |  |
 |  |--<DIR> Standard      ' Folder: Contains library "Standard"
 |  |  |
 |  |  |--Module1.xml      ' Stream: Basic module file
 |  |  |--Module2.xml      ' Stream: Basic module file
 |  |  |--Module3.xml      ' Stream: Basic module file
 |  |  |--script-lb.xml    ' Stream: Basic library index file
 |  |
 |  |--script-lc.xml       ' Stream: Basic library container index file
 |
 | ' From here the folders and streams have nothing to do with libraries
 |--<DIR> Meta-Inf
 |--content.xml
 |--settings.xml
 |--styles.xml

In example 2, package structure for a document with two Basic and one dialog libraries:

 <Package> ExampleDocument2
 |
 |--<DIR> Basic
 |  |
 |  |--<DIR> Standard      ' Folder: Contains library "Standard"
 |  |  |
 |  |  |--Module1.xml      ' Stream: Basic module file
 |  |  |--Module2.xml      ' Stream: Basic module file
 |  |  |--script-lb.xml    ' Stream: Basic library index file
 |  |
 |  |--<DIR> Library1      ' Folder: Contains library "Library1"
 |  |  |
 |  |  |--Module1.xml      ' Stream: Basic module file
 |  |  |--script-lb.xml    ' Stream: Basic library index file
 |  |
 |  |--script-lc.xml       ' Stream: Basic library container index file
 |
 |--<DIR> Dialogs
 |  |
 |  |--<DIR> Standard      ' Folder: Contains library "Standard"
 |  |  |
 |  |  |--Dialog1.xml      ' Stream: Dialog file
 |  |  |--dialog-lb.xml    ' Stream: Dialog library index file
 |  | 
 |  |--<DIR> Library1      ' Folder: Contains library "Library1"
 |  |  |
 |  |  |--Dialog1.xml      ' Stream: Dialog file
 |  |  |--Dialog2.xml      ' Stream: Dialog file
 |  |  |--dialog-lb.xml    ' Stream: Dialog library index file
 |  |
 |  |--dialog-lc.xml       ' Stream: Dialog library container index file
 |
 | ' From here the folders and streams have nothing to do with libraries
 |--<DIR> Meta-Inf
 |--content.xml
 |--settings.xml
 |--styles.xml

If a document Basic library is password protected, the file structure does not differ as much from an unprotected library as in the Application Basic case. The differences are:

  • The module files of a password-protected Basic library have the same name as without the password protection, but they are scrambled with the password.
  • There is an additional binary file named like the library with the extension .bin for each module. Similar to the file code.bin in the Application Basic .pba files, this file contains the compiled Basic code that executes the module without access to the source code.

The following example shows the package structure for a document with two Basic and one dialog libraries where only the Basic library Library1 contains any of the modules:

 <Package> ExampleDocument3
 |
 |--<DIR> Basic
 |  |
 |  |--<DIR> Standard      ' Folder: Contains library "Standard"
 |  |  |
 |  |  |--script-lb.xml    ' Stream: Basic library index file
 |  | 
 |  |--<DIR> Library1      ' Folder: Contains library "Library1"
 |  |  |
 |  |  |--Module1.xml      ' Stream: Scrambled Basic module source file
 |  |  |--Module1.bin      ' Stream: Basic module compiled code file
 |  |  |--Module2.xml      ' Stream: Scrambled Basic module source file
 |  |  |--Module2.bin      ' Stream: Basic module compiled code file
 |  |  |--Module3.xml      ' Stream: Scrambled Basic module source file
 |  |  |--Module3.bin      ' Stream: Basic module compiled code file
 |  |  |--script-lb.xml    ' Stream: Basic library index file
 |  |
 |  |--script-lc.xml       ' Stream: Basic library container index file
 |
 |--<DIR> Dialogs
 |  |
 |  |--<DIR> Standard      ' Folder: Contains library "Standard"
 |  |  |
 |  |  |--dialog-lb.xml    ' Stream: Dialog library index file
 |  | 
 |  |--<DIR> Library1      ' Folder: Contains library "Library1"
 |  |  |
 |  |  |--dialog-lb.xml    ' Stream: Dialog library index file
 |  |
 |  |--dialog-lc.xml       ' Stream: Dialog library container index file
 |
 | ' From here the folders and streams have nothing to do with libraries
 |--<DIR> Meta-Inf
 |--content.xml
 |--settings.xml
 |--styles.xml

This example also shows that a Dialogs folder is created in the document package file although the library Standard and the library Library1 do not contain dialogs. This is done because the Dialog library Library1 would be lost after reloading the document. Only a single empty library Standard is assumed to exist, even if it is not stored explicitly.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages