Difference between revisions of "Configmgr Refactoring/Design"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: '''Design''' Please view [http://wiki.services.openoffice.org/wiki/Configmgr_Refactoring Configmgr Refactoring] about analysis. This document explain configmgr new design and some discuss...)
 
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Design'''
+
{{Note|The <code>configmgr</code> has been re-implemented for OpenOffice.org&nbsp;3.3, see [[Performance/Configuration]]. This page describes an alternative approach that has not been implemented, so it is somewhat obsolete.}}
  
Please view [http://wiki.services.openoffice.org/wiki/Configmgr_Refactoring Configmgr Refactoring] about analysis. This document explain configmgr new design and some discuss only .
+
Please view [http://wiki.services.openoffice.org/wiki/Configmgr_Refactoring Configmgr Refactoring] about analysis. This document explain configmgr new design and some discussion
  
= Processing flow =
+
only .
[[Image:|thumb|===== processing flow =====]]
+
  
We can divid configuration data processing into two phases:
+
= The Configuration files placement  =
 +
We will discuss the placement two scenarios:
  
== OOo Packaging ==
+
== Placement after OOo install ==
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 .
+
$BaseInstallation/share/registry/templates              <nowiki>### Only xcs templates definition</nowiki>
 +
                                  /data                    <nowiki>### Complete configuration data</nowiki>
 +
                                  /res/en-US              <nowiki>### Multilingual configuration data</nowiki>
 +
                                      /zh-CN              <nowiki>### </nowiki>
 +
                                      ...
 +
    /UnoSharedPackages/$(package_name)/templates  <nowiki>### Only current UNO xcs templates definition</nowiki>
 +
                                            /data  <nowiki>### Only current UNO Complete configuration data(default language)</nowiki>
 +
                                        /res/en-US  <nowiki>### Only current UNO Multilingual configuration data</nowiki>
 +
                                            /zh-CN  <nowiki>###</nowiki>
 +
                                              ...
  
 +
$UserInstallation/user/registry/data              <nowiki>###</nowiki>
  
Here have three steps:
+
== Placement In UNO Package ==
 +
/templates                    <nowiki>### Only xcs templates definition</nowiki>
 +
/data                          <nowiki>### Complete configuration data</nowiki>
 +
/res/en-US                    <nowiki>### Multilingual configuration data</nowiki>
 +
    /zh-CN
 +
    …
  
=== Merger .xcu files and .xcs files and .sdf into new schema configuration files. ===
+
 
=== Replace some values in configuration files and do other procesings. ===
+
= The Configuration Data Definition =
=== Converter XML format configuration files in to binary configuration files. ===
+
According to the configuration file placement, Configuration data can be divided into two types:
== OOo Running ==
+
 
Other module of OOo access and process the configuration data through the services of configmgr module.
+
== Complete configuration data ==
 +
With configuration information is Multilingual, it will contain current language information .
 +
 
 +
 
 +
 +
<nowiki><group name="Option"></nowiki>
 +
    <nowiki><prop name="max" type="xs:int"></nowiki>
 +
        <nowiki><default-value>1000</default-value></nowiki>       
 +
    <nowiki></prop></nowiki>
 +
    <nowiki><prop name="min" type="xs:int"></nowiki>
 +
        <nowiki><default-value>1</default-value></nowiki>       
 +
    <nowiki></prop></nowiki>
 +
    <nowiki><prop name="regard" type="xs:string" lang= "true" lang_name= "en-US"></nowiki>
 +
        <nowiki><default-value>hello</default-value></nowiki>
 +
        <nowiki><user-value>hello world</user-value></nowiki>
 +
    <nowiki></prop></nowiki>
 +
<nowiki></group></nowiki>
 +
 +
 
 +
== Multilingual configuration data ==
 +
Only contains language related information (similar to the current OOo "res" multilingual directory)
 +
 
 +
res/zh-CN:
 +
 
 +
 +
<nowiki><group name="Option"></nowiki>
 +
    <nowiki><prop name="regard" type="xs:string" lang= "true" lang_name= "zh-CN"></nowiki>
 +
        <nowiki><default-value>你好</default-value></nowiki>
 +
        <nowiki><user-value>世界你好</user-value></nowiki>
 +
    <nowiki></prop></nowiki>
 +
<nowiki></group></nowiki>
 +
 +
 
 +
res/en-US
 +
 
 +
 +
<nowiki><group name="Option"></nowiki>
 +
    <nowiki><prop name="regard" type="xs:string" lang= "true" lang_name= "</nowiki>en-US">
 +
        <nowiki><default-value>hello</default-value></nowiki>
 +
        <nowiki><user-value>hello world</user-value></nowiki>
 +
    <nowiki></prop></nowiki>
 +
<nowiki></group></nowiki>
 +
 +
 
 +
== 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.
 +
 
 +
 
 +
<nowiki><template></nowiki>
 +
    <nowiki><templates name="LDAP" package="org.openoffice"></nowiki>
 +
        <nowiki><group name="ServerDefinition"></nowiki>
 +
            <nowiki><prop name="Server" type="xs:string"/></nowiki>
 +
            <nowiki><prop name="Port" type="xs:int"></nowiki>
 +
                <nowiki><default-value>389</default-value></nowiki>
 +
            <nowiki></prop></nowiki>
 +
            <nowiki><prop name="BaseDN" type="xs:string"/></nowiki>
 +
        <nowiki></group></nowiki>
 +
    <nowiki></templates></nowiki>
 +
    <nowiki><templates name="Views" package="org.openoffice.Office"></nowiki>
 +
            <nowiki><group name="DialogType"></nowiki>
 +
                <nowiki><prop name="WindowState" type="xs:string"/></nowiki>
 +
                <nowiki><group name="UserData" extensible="true"/></nowiki>
 +
            <nowiki></group></nowiki>
 +
    <nowiki><group name="TabDialogType"></nowiki>
 +
            <nowiki><prop name="WindowState" type="xs:string"/></nowiki>
 +
            <nowiki><prop name="PageID" type="xs:int"/></nowiki>
 +
            <nowiki><group name="UserData" extensible="true"/></nowiki>
 +
    <nowiki></group></nowiki>
 +
    <nowiki><group name="TabPageType"></nowiki>
 +
            <nowiki><prop name="WindowState" type="xs:string"/></nowiki>
 +
            <nowiki><group name="UserData" extensible="true"/></nowiki>
 +
    <nowiki></group></nowiki>
 +
    <nowiki><group name="WindowType"></nowiki>
 +
            <nowiki><prop name="WindowState" type="xs:string"/></nowiki>
 +
            <nowiki><prop name="Visible" type="xs:boolean"/></nowiki>
 +
            <nowiki><group name="UserData" extensible="true"/></nowiki>
 +
    <nowiki></group></nowiki>
 +
  <nowiki></templates></nowiki>
 +
  ............
 +
<nowiki></template> </nowiki>
  
 
= The relationship of new schema nodes in OOo running =
 
= The relationship of new schema nodes in OOo running =
Line 68: Line 162:
  
  
[[Image:]]
+
Please note the inserted/removed attributes and user-value/default-value nodes ; and that will be describe below.
 +
 
 +
 
 +
[[Image:Configmgr_design_node_relationship.PNG]]
 +
 
 +
= 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).
 +
 
 +
[[Image:Configmgr_read_file_flow.png]]
 +
 
 +
 
 +
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).
 +
 
 +
[[Image:Configmgr_write_file_flow.png]]
 +
 
 +
= Configuration data handling cases =
 +
== Product Packaging Process ==
 +
==== OOo source code Configuration data file: ====
 +
        officecfg/registry/schema            <nowiki>### configuration schema definition</nowiki>
 +
                                /data            <nowiki>### </nowiki> configuration data
 +
 
 +
        filter/source/config/fragments      <nowiki>### </nowiki> org.openoffice.TypeDetection.Filter/GraphicFilter/Misc/Types/UISort/  data fragements
 +
 
 +
==== Configuration data file placement in package: ====
 +
    /templates        <nowiki>### Only xcs templates definition</nowiki>
 +
        /data        <nowiki>### Complete configuration data and language configuration information </nowiki> with en-US
 +
        /res/en-US    <nowiki>### Multilingual configuration data</nowiki>
 +
            /zh-CN
 +
            /zh-TW
 +
            /ja
 +
            /pa-IN
 +
            /ru 
 +
 
 +
== Product Installation Process ==
 +
==== Configuration data file placement after OOo install: ====
 +
$BaseInstallation/share/registry/templates  <nowiki>### Only xcs templates definition</nowiki>
 +
                                  /data      <nowiki>### Complete configuration data and language </nowiki>configuration information  with current UI language
 +
                                  /res/en-US  <nowiki>### Multilingual configuration data backup</nowiki>
 +
                                      /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                          <nowiki>### Only xcs templates definition</nowiki>
 +
    /data                              <nowiki>### Complete configuration data</nowiki>
 +
    /res/en-US                          <nowiki>### Multilingual configuration data</nowiki>
 +
        /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  <nowiki>### Only current UNO xcs templates definition</nowiki>
 +
                                                                    /data      <nowiki>### Only current UNO Complete configuration data(default language)</nowiki>
 +
                                                                    /res/en-US  <nowiki>### Only current UNO Multilingual configuration data</nowiki>
 +
                                                                        /zh-CN  <nowiki>###</nowiki>
 +
                                                                    ...
 +
 
 +
==== 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 =
  
Please note the inserted/removed attributes and user-value/default-value nodes 。
+
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 )
  
= 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) 。
+
[[Category:Performance]]

Latest revision as of 19:12, 6 July 2018

Documentation note.png 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.


Configmgr design node relationship.PNG

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


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

Configmgr write file flow.png

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.

    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

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 )

Personal tools