File bmc/mods/MODULE/make_mod.def

From prokee
Revision as of 15:26, 2 September 2019 by Andy (talk | contribs)
Jump to navigation Jump to search
 1 //GLOBAL::
 2 
 3 DEF WMC;
 4 DEF RUN;
 5 DEF DOCUMENT;
 6 
 7 DEF MODULE
 8 {
 9     DEF print_doc:RUN
10     {
11         write(
12             BLOCKS="_:DOCUMENT[]";
13             OUTPATH="PATH";
14             PRINTER="OUTPUT";
15             );
16     }
17 }
18 
19 DEF MAIN:WMC
20 {
21     set(TARGET_PATH="./";);
22     set(FILES_LOG="true";LOGPATH="log/files0.log";);
23     run(MODULE="module";RUN="print_doc";);
24 }
25 
26 DEF module:MODULE
27 {
28     INCLUDE="../common/def/module_min0.def";
29 }
30 
31 DEF THE_MODULE_NAME="MyModuleName";
32 DEF THE_MODULE_VERSION="MyModuleVersion";
33 DEF THE_MAIN_TABLE_PATH="MyModuleName.MyMainDatabaseName.MyMainTableName";
34 DEF THE_MAIN_DATABSE_PATH="MyModuleName.MyMainDatabaseName";
35 
36 DEF TEXTS
37 {
38     DEF COPY
39     {
40         ->
41         //FILE: @PATH
42         @root.NAME[code='testing:intro()']
43         <--
44     }
45 }

Line 28

Put one or more INCLUDE statements here.

Additional includes should be added by the stating the following definition blocks (on level root).

 1 DEF MODULE_additional_sys_tasks
 2 {
 3     ->
 4         INCLUDE="mods/@THE_MODULE_NAME[]/db/sql/create2.def";
 5         ...
 6     <--
 7 }
 8 DEF MODULE_additional_content_files
 9 {
10     ->
11         INCLUDE="mods/@THE_MODULE_NAME[]/content/text/create2.def";
12         ...
13     <--
14 }

Lines 31-34

Define the following global strings:

THE_MODULE_NAME 
This has to be equal to the name of the module.
THE_MODULE_VERSION 
Set this to the version string of the module. E.g. "v01", "v02", ... or any other string.
THE_MAIN_TABLE_PATH 
Some operations refer to the main table used by this module. The main table is referred to by its virtual path: name_of_module.name_of_database.name_of_table
THE_MAIN_DATABSE_PATH 
This specifies the main database used by this module. (given as virtual path: name_of_module.name_of_database)

Lines 41-42

This creates a copyright note which is included in some of the files generated by bmc. You may change this to your own copyright statement.