Difference between revisions of "Configmgr Refactoring/Design"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Merger multi-components)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Please view [http://wiki.services.openoffice.org/wiki/Configmgr_Refactoring Configmgr Refactoring] about analysis. This document explain configmgr new design and some discussions only.
+
{{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.}}
  
= Processing flow =
+
Please view [http://wiki.services.openoffice.org/wiki/Configmgr_Refactoring Configmgr Refactoring] about analysis. This document explain configmgr new design and some discussion
  
We can divid configuration data processing into two phases:
+
only .
  
[[Image:Configmgr_design_processing_flow.PNG]]
+
= 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
 +
    …
  
(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.
+
= The Configuration Data Definition =
 +
According to the configuration file placement, Configuration data can be divided into two types:
  
(3) Converter XML format configuration files in to binary configuration files.
+
== Complete configuration data ==
 +
With configuration information is Multilingual, it will contain current language information .
  
== 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.
+
 +
<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 160:
  
 
additional:
 
additional:
 +
 +
 +
Please note the inserted/removed attributes and user-value/default-value nodes ; and that will be describe below.
  
  
 
[[Image:Configmgr_design_node_relationship.PNG]]
 
[[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.
  
Please note the inserted/removed attributes and user-value/default-value nodes ; and that will be describe below.
+
By user-value/default-value nodes in user configuration data file, we can tell the value is user modification data or default data.  
  
= The configuration files placement after OOo install =
+
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.  
It is same as the currently OOo implementation, and has some adjustment in some places.
+
  
It has two main directories too :
+
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).
  
Default configuration directory ($BaseInstallation/share/registry/) 。
+
[[Image:Configmgr_read_file_flow.png]]
  
User configuration directory ($UserInstallation/user/registry) 。
 
  
And subdirectories with Multi-Linguistic:
+
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]]
  
$BaseInstallation/share/registry/en-US
+
= Configuration data handling cases =
                                      /zh-CN         
+
== Product Packaging Process ==
$UserInstallation/user/registry/en-US
+
==== OOo source code Configuration data file: ====
                                    /zh-CN
+
        officecfg/registry/schema            <nowiki>### configuration schema definition</nowiki>
 +
                                /data            <nowiki>### </nowiki> configuration data
  
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.
+
        filter/source/config/fragments      <nowiki>### </nowiki> org.openoffice.TypeDetection.Filter/GraphicFilter/Misc/Types/UISort/  data fragements
  
= Processing flow in OOo Runing =
+
==== Configuration data file placement in package: ====
We can see the user configuration data file has a copy of default configuration data( admin configuration data) and user modification data.
+
    /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 
  
By user-value/default-value nodes in user configuration data file, we can tell the value is user modification data or default data.
+
== 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
  
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.
+
==== Process: ====
 +
a) Generate org.openoffice.System configuration 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).
+
b) Replace language configuration information in complete configuration data with current UI language.
  
[[Image:Configmgr_read_file_flow.png]]
+
c) Copy /templates & /res/en-US & /res/zh-CN & /res/zh-TW …
  
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]]
+
== 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 =
 
= Merger multi-components =
 
Now we define three types config item in “configmgr.ini” file.
 
Now we define three types config item in “configmgr.ini” file.
  
 +
#
 
## ARG_MERGER_COUNT:the count of multi-components merged files
 
## 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_MERGERNAME + n :the file name of the n-th merged configuration file  
Line 122: Line 273:
 
  ARG_MERGER_MERGERNAME1=org.openoffice.MERGER1
 
  ARG_MERGER_MERGERNAME1=org.openoffice.MERGER1
  
= Discussion =
+
= Security =
== Multi-Linguistic  ==
+
 
== 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 )
 +
 
  
  
 
[[Category:Performance]]
 
[[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