Configmgr Refactoring/Design

From Apache OpenOffice Wiki
Jump to: navigation, search

Please view Configmgr Refactoring about analysis. This document explain configmgr new design and some discussion

only .

Processing flow

We can divid configuration data processing into two phases:


File:Configmgr design processing flow.PNG


OOo Packaging

Using tools and scripts, merger configuration files from sources to default configuration files which will be instaled into “$BaseInstallation/share/registry/”(as admin configuration file). The result files can be XML file or binary file. Two tools (configmgr_tools /configmgr_converter ) and some scripts files be used in this phase.


Here have three steps:

(1) Merger .xcu files and .xcs files and .sdf into new schema configuration files.

(2) Replace some values in configuration files and do other procesings.

(3) Converter XML format configuration files in to binary configuration files.

OOo Running

Other module of OOo access and process the configuration data through the services of configmgr module.and we will discuss this at Processing flow in OOo Runing.

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:


Configmgr design node relationship.PNG


Please note the inserted/removed attributes and user-value/default-value nodes ; and that will be describe below.

The configuration files placement after OOo install

It is same as the currently OOo implementation, and has some adjustment in some places.

It has two main directories too :

Default configuration directory ($BaseInstallation/share/registry/) 。

User configuration directory ($UserInstallation/user/registry) 。

And subdirectories with Multi-Linguistic:


$BaseInstallation/share/registry/en-US
                                /zh-CN           
$UserInstallation/user/registry/en-US
                               /zh-CN

Each language has a complete configuration data. It is our current implementation. Of course, it will occupy more disk space. Another plan we discuss at Multi-Linguistic.

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


Configmgr read file flow.pngThe 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).


Configmgr write file flow.png


Merger multi-components

Now we define three types config item in “configmgr.ini” file.

    1. ARG_MERGER_COUNT:the count of multi-components merged files
    2. ARG_MERGER_MERGERNAME + n :the file name of the n-th merged configuration file
    3. 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

Discussion

Multi-Linguistic

As we discuss at “The configuration files placement after OOo install” , that occupy more disk space as our curent plan.

Can we split different language value in different nodes. So value node it is multi-linguistic define as below:


<prop lang= "true">
<default-value>
    <lang name= “en-US”>hello</lang>
    <lang name= “zh-CN”>你好</lang> 
    ......
</default-value>
<user-value>
    <lang name= “en-US”>hello world</lang>
    <lang name= “zh-CN”>世界你好</lang> 
    ......
</user-value>
</prop>

And Ordinary value node as this:

<default-value >true</default-value>
<user-value>false</user-value>


Security

So, it's OK for current features (consider the better performance) except the secure problem 。Can we discuss that from those cases.

Not all configuration data will be writ to user directory. It is that only this configuration module data has been modified.

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> 
Personal tools