The Free and Open Productivity Suite
New: Apache OpenOffice 4.1.1 released!

Defining Modules With Language Specific Files

Before understanding this section, you have to know the scp item Module. Documentation about this item can be found here.

The strict separation of language dependent and language independent files that is required for the new package structure of an OpenOffice.org 3.0 and the huge number of supported languages, made is necessary to introduce a new process of module creation in scp tooling.

This new process supports automatic module generation for all languages supported by OpenOffice.org. Therefore it was necessary to add to the existing script particle files (scp) the new script template files (sct). sct files contain abstract module definitions, without assignments of scp items like "Files", "Dirs", ... and with placeholders for language settings. This sct files are evaluated during scp2 build by Perl programs, that resolve the language settings in the abstract module definitions. In this process the sct file is expanded to an inc file, which is again included into a scp file. The result is a scp file that can be very big. Because of the huge number of languages it can contain thousand of module definitions.

The assignments of scp items like "Files", "Dirs", ... should not be done inside the sct file, but as you are used to, inside a scp file. Therefore template modules were introduced, that are not a visible module during product installation, but are only used for assignments. This modules must have the flag TEMPLATEMODULE and are defined in scp files. Especially language specific files should be assigned to modules with flag TEMPLATEMODULE in the future. The abstract modules that are defined in the sct files can reference this modules using the new key "Assigns=...". If the module shall also be used for package creation (RPM, Solaris Package, ...), it is additionally necessary to define a file, containing the package information for this module. This happens with the key "PackageInfo=..." in the Module definition.

In the following there is a step-by-step explanation of this new process for language dependent modules with language specific files:

Step 1:
All sct files are currently located in the folder scp2/source/templates, where they are found by the Perl program, that resolves the languages. The Perl program expands the abstract modules for each available language to an inc file. The inc files are created at scp2/<platform>/inc/<incfilename>. From there they can be included into scp files.
Example for an abstract module definition:

Module gid_Module_Langpack_Calc_<LANGUAGE_>
ParentID = gid_Module_Prg_Calc_Bin;
Sortkey = "450";
Language = "<LANGUAGE>";
Assigns = gid_Module_Langpack_Calc_Template;
Name = "gid_Module_Langpack_Calc_<LANGUAGE_>";
Description = "gid_Module_Langpack_Calc_<LANGUAGE_>";
PackageInfo = "packinfo_office_lang.txt";

The occurences of "<LANGUAGE>" and "<LANGUAGE_>" are resolved for all supported languages (taking care of underlines, like "en-US" or "en_US"). In this example the file can be named "alllangmodules_calc.inc".

Step 2:
The created inc file is included into a real scp file, for example in scp2/source/calc/module_calc.scp:

#include "alllangmodules_calc.inc"

Step 3:
The assignments of files and directories to modules with language dependent files must be done at modules that have the flag TEMPLATEMODULE. This modules can be defined in scp files. From this modules no packages can be created. They are only used as "assignment-container" for other modules, that reference this module.
Example for a template module:

Module gid_Module_Langpack_Calc_Template
ParentID = gid_Module_Prg_Calc_Bin;
Name = "gid_Module_Langpack_Calc_Template";
Description = "gid_Module_Langpack_Calc_Template";
Files = (gid_File_Help_Scalc_Zip,

Step 4:
Modules can reference another module, that has style TEMPLATEMODULE. This happens with the key "Assigns" in the module definition (see example in step 1).
Assigns = gid_Module_Langpack_Calc_Template;

The standard case is the following:
The module definition in the sct file is language dependent. But all languages use the same assignments. Therefore this module definition uses the "Assigns"-key. The referenced module must have the style TEMPLATEMODULE. The files and directories, that are assigned to the module with flag TEMPLATEMODULE are assigned to the referencing module during packaging process.

Step 5:
Package creation cannot be done for abstract template modules, but only for specific modules. The modules defined in sct files normally are used for package creation. Therefore this modules have to know file containing the package info. This file has to be found in the solver. It can be referenced with the key "PackageInfo" (see example in step 1).
PackageInfo = packinfo_office_lang.txt;

Step 6:
Modules with language dependent files must have the flag "LANGUAGEMODULE" (see example in step 1). This is necessary, because not all language modules are required during packaging of one specific installation set.

Because of this changes in the SRC680 m242 it is strictly recommended, that all language specific files are assigned to modules with flag TEMPLATEMODULE. If there are wrong assignments, so that language specific files and not language specific files are assigned to one module, the packaging process can find this errors and stops the creation of the installation set.

Copyright & License | Privacy | Website Feedback | Contact Us | Donate | Thanks

Apache and the Apache feather logo are trademarks of The Apache Software Foundation. OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.