Configmgr Refactoring/Design
The configmgr has been re-implemented for OpenOffice.org 3.3, see Performance/Configuration. This page describes an alternative approach that has not been implemented, so it is somewhat obsolete.
|
Please view Configmgr Refactoring about analysis. This document explain configmgr new design and some discussion
only .
The Configuration files placement
We will discuss the placement two scenarios:
Placement after OOo install
$BaseInstallation/share/registry/templates ### Only xcs templates definition /data ### Complete configuration data /res/en-US ### Multilingual configuration data /zh-CN ### ... /UnoSharedPackages/$(package_name)/templates ### Only current UNO xcs templates definition /data ### Only current UNO Complete configuration data(default language) /res/en-US ### Only current UNO Multilingual configuration data /zh-CN ### ...
$UserInstallation/user/registry/data ###
Placement In UNO Package
/templates ### Only xcs templates definition /data ### Complete configuration data /res/en-US ### Multilingual configuration data /zh-CN …
The Configuration Data Definition
According to the configuration file placement, Configuration data can be divided into two types:
Complete configuration data
With configuration information is Multilingual, it will contain current language information .
… <group name="Option"> <prop name="max" type="xs:int"> <default-value>1000</default-value> </prop> <prop name="min" type="xs:int"> <default-value>1</default-value> </prop> <prop name="regard" type="xs:string" lang= "true" lang_name= "en-US"> <default-value>hello</default-value> <user-value>hello world</user-value> </prop> </group> …
Multilingual configuration data
Only contains language related information (similar to the current OOo "res" multilingual directory)
res/zh-CN:
… <group name="Option"> <prop name="regard" type="xs:string" lang= "true" lang_name= "zh-CN"> <default-value>你好</default-value> <user-value>世界你好</user-value> </prop> </group> …
res/en-US
… <group name="Option"> <prop name="regard" type="xs:string" lang= "true" lang_name= "en-US"> <default-value>hello</default-value> <user-value>hello world</user-value> </prop> </group> …
Template
As we can see templat struct will be used only occurred in inserted new node. So can we split template struct from configuration data file.
<template> <templates name="LDAP" package="org.openoffice"> <group name="ServerDefinition"> <prop name="Server" type="xs:string"/> <prop name="Port" type="xs:int"> <default-value>389</default-value> </prop> <prop name="BaseDN" type="xs:string"/> </group> </templates> <templates name="Views" package="org.openoffice.Office"> <group name="DialogType"> <prop name="WindowState" type="xs:string"/> <group name="UserData" extensible="true"/> </group> <group name="TabDialogType"> <prop name="WindowState" type="xs:string"/> <prop name="PageID" type="xs:int"/> <group name="UserData" extensible="true"/> </group> <group name="TabPageType"> <prop name="WindowState" type="xs:string"/> <group name="UserData" extensible="true"/> </group> <group name="WindowType"> <prop name="WindowState" type="xs:string"/> <prop name="Visible" type="xs:boolean"/> <group name="UserData" extensible="true"/> </group> </templates> ............ </template>
The relationship of new schema nodes in OOo running
New schema use OOo schema as standard, and adjust some places .
Node
compoents:
component:
component-data:
templates:
set:
group :
prop:
user-value:
default-value:
Attribute
package:
component:
node-type:
inserted:
removed:
extensible:
name:
readlnly:
nillable:
separator:
type:
additional:
Please note the inserted/removed attributes and user-value/default-value nodes ; and that will be describe below.
Processing flow in OOo Runing
We can see the user configuration data file has a copy of default configuration data( admin configuration data) and user modification data.
By user-value/default-value nodes in user configuration data file, we can tell the value is user modification data or default data.
By inserted/removed attributes in user configuration data file, we can tell the node is user new data or user removed data or default data.
The below image is the processing flow about get configuration data from configuration data file. It is our complete solution after we discuss( It is not exactly same as our current source).
The below image is the processing flow about write configuration data from configuration data file. As mentioned above,It is our complete solution after we discuss( It is not exactly same as our current source).
Configuration data handling cases
Product Packaging Process
OOo source code Configuration data file:
officecfg/registry/schema ### configuration schema definition /data ### configuration data
filter/source/config/fragments ### org.openoffice.TypeDetection.Filter/GraphicFilter/Misc/Types/UISort/ data fragements
Configuration data file placement in package:
/templates ### Only xcs templates definition /data ### Complete configuration data and language configuration information with en-US /res/en-US ### Multilingual configuration data /zh-CN /zh-TW /ja /pa-IN /ru
Product Installation Process
Configuration data file placement after OOo install:
$BaseInstallation/share/registry/templates ### Only xcs templates definition /data ### Complete configuration data and language configuration information with current UI language /res/en-US ### Multilingual configuration data backup /zh-CN /zh-TW /ja /pa-IN /ru
Process:
a) Generate org.openoffice.System configuration data
b) Replace language configuration information in complete configuration data with current UI language.
c) Copy /templates & /res/en-US & /res/zh-CN & /res/zh-TW …
UNO Component Packing Process
UNO Component configuration data file placement in package:
/templates ### Only xcs templates definition /data ### Complete configuration data /res/en-US ### Multilingual configuration data /zh-CN /zh-TW /ja /pa-IN /ru ...
UNO Component Installation Process
UNO Component configuration data file placement after UNO component install
$BaseInstallation/share/registry/UnoSharedPackages/$(package_name)/templates ### Only current UNO xcs templates definition /data ### Only current UNO Complete configuration data(default language) /res/en-US ### Only current UNO Multilingual configuration data /zh-CN ### ...
Process:
a) copy configuration data files from UNO packages to OOo “UnoSharedPackages” 。
b) merge UNO “templates” to OOo “templates”。
c)If UNO Component installed for current user, merge “$BaseInstallation/share/registry/data” or “$UserInstallation/user/data” with “/data” to “$UserInstallation/user/data”。
If UNO Component installed for every one, merge “$BaseInstallation/share/registry/data” with “/data” to “$BaseInstallation/share/registry/data”。
UNO Component Removal Process
a) Remove UNO “templates” from OOo “templates”。
b) If UNO Component installed for current user, match remove UNO data from “$UserInstallation/user/data”。
If UNO Component installed for every one, match remove UNO data from “$BaseInstallation/share/registry/data”
Change UI Language
Traverse UNO products and components multi-language directory, Replace "$UserInstallation/user/data" or "$BaseInstallation/share/registry/data" configuration multi-language information.
Merger multi-components
Now we define three types config item in “configmgr.ini” file.
-
- ARG_MERGER_COUNT:the count of multi-components merged files
- ARG_MERGER_MERGERNAME + n :the file name of the n-th merged configuration file
- ARG_MERGER_COMOPNENTS + n :the component name list which be merged to the n-th merger configuration file.
ARG_MERGER_COUNT=2 ARG_MERGER_COMOPNENTS0=org.openoffice.System;org.openoffice.ucb.Configuration ARG_MERGER_MERGERNAME0=org.openoffice.MERGER0 ARG_MERGER_COMOPNENTS1=org.openoffice.Office.Commands;org.openoffice.Office.ProtocolHandler ARG_MERGER_MERGERNAME1=org.openoffice.MERGER1
Security
Could we compress user configuration data encryption. And also we can compress share configuration data for improve performance( http://wiki.services.openoffice.org/wiki/Performance/file_number_size_compress_cool_read_performance_test )