Difference between revisions of "Creating a new Web-Module"
(→Update the module) |
|||
| Line 38: | Line 38: | ||
# In some cases you might also want to modify the script responsible for updating your module files: bmc/mods/<i>module</i>/run.sh. | # In some cases you might also want to modify the script responsible for updating your module files: bmc/mods/<i>module</i>/run.sh. | ||
| − | == Update the | + | == Update the Module == |
Run the update script. | Run the update script. | ||
Revision as of 15:42, 15 July 2019
A new Web-Module can be created following the steps described below:
Contents
Run inimod.sh script
Run the script from the baseman project-folder: web/bmc/inimod/.
The program bmc has to be available.
user$ ./inimod.sh module
module has to be the name of the new module to be created.
The script executes bmc main.def, which creates some required initial files. Most of them are "dummy-files" (placeholders) and will be replaced later. The files are created within a sub-folder within OUTPUT/.
Integration into Baseman
- Copy the files created in the step before from folder
OUTPUT/to the appropriate folder of your Baseman project hierarchy. New modules may be placed under web/mods/ or any other folder accessible by baseman. - Next step is to make the new module available in Baseman. Therefor one or more Baseman configuration files have to be updated manually. If you have put the module files in a sub-folder of web/mods/, then the module has to be added as a new project record in the file web/mods/projects.csv.
- E.g. if the name of the new module is "module" and the sub-folder is "module/", the csv-record would look line this.
module,module/,1,,,optional description- See documentation of Baseman for detailed information about the configuration of projects with csv-files. (You may also want to update the version.csv and files.csv files of your new module.)
- Include the new module into your existing web-application, or create a new web-project within Baseman. Please be referred to the Baseman documentation for instructions on how to do so.
- Run
baseman mergeorbaseman exporton your project, to update the files within your testing environment.
Database Specifications
If your module does require access to a database, the full specifications of all parts of the database required by the module (as tables and fields of tables) have to be available to the module. If you use an existing database and existing tables, you can import the required specifications from other modules. Otherwise add the new databases, tables and fields to bmc-configuration files of your module. These files should be placed at bmc/mods/module/db/, where again module has to be replaced by the name of your module.
Module Specifications
Copy the default make.def and make_mod.def files to the folder bmc/mods/module/.
The following files provide basic information of the module and should be carefully updated to correctly describe your module.
- bmc/mods/module/intro/main.def
- bmc/mods/module/flow/main.def
- bmc/mods/module/make.def
- bmc/mods/module/make_mod.def
- In some cases you might also want to modify the script responsible for updating your module files: bmc/mods/module/run.sh.
Update the Module
Run the update script.
user$ bmc/mods/module/run.sh
You may have to run the script a second time after the first run.
To update Baseman, call baseman merge for existing files. For new files, you may use the experimental command baseman import_p to let Baseman guess, which new files should be part of which projects within Baseman.
Setup/Update the Database
There is a php script placed at /setup/admin/ which creates required tables and fields in your database. This script is intended to be used within your testing environment only. Running this script on a production system is strongly discouraged. Tu run the script open http://localhost/.../setup/admin/index.php within your browser and click on the name of the module for which you want to setup (or update) the database.