Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:module_convention [2007/06/23 12:55] chamindra |
dev:module_convention [2010/01/06 20:56] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
The module structure is Sahana is built for flexibility and automation with the least amount of technical configuration details. All you effectively need to do to install a module is untar it in the /mod directory and to remove it just delete the directory. | The module structure is Sahana is built for flexibility and automation with the least amount of technical configuration details. All you effectively need to do to install a module is untar it in the /mod directory and to remove it just delete the directory. | ||
+ | |||
Line 13: | Line 14: | ||
* logical schema | * logical schema | ||
* Navigation graph | * Navigation graph | ||
- | * The next stage is start developing the module or get some people to work with you to build the module. You should now share this with the [[https:// | + | * The next stage is start developing the module or get some people to work with you to build the module. You should now share this with the [[https:// |
* The steps below are an initial guide, but it is not complete. Thus it is essential for you to collaborate on the sahana-maindev list in building your module. | * The steps below are an initial guide, but it is not complete. Thus it is essential for you to collaborate on the sahana-maindev list in building your module. | ||
Line 32: | Line 33: | ||
* **inst/ | * **inst/ | ||
- | |||
- | |||
===== Main Module Skeleton and Convention ===== | ===== Main Module Skeleton and Convention ===== | ||
As mentioned earlier Sahana dynamic plugin architecture is based on certain naming conventions of files and functions. | As mentioned earlier Sahana dynamic plugin architecture is based on certain naming conventions of files and functions. | ||
Line 40: | Line 39: | ||
1. decide on a name unique to it amongst modules, (lets say myapp) | 1. decide on a name unique to it amongst modules, (lets say myapp) | ||
- | 2. create a directory called myapp in the /mod | + | |
+ | 2. make sure your module' | ||
+ | |||
+ | 3. create a directory called myapp in the /mod | ||
mkdir -p mod/myapp | mkdir -p mod/myapp | ||
- | 3. Add the following files as required above | + | 4. Add the following files as required above |
ration variables | ration variables | ||
- | 4. Add the default function for main.inc | + | 5. Add the default function for main.inc |
< | < | ||
Line 105: | Line 107: | ||
admin function prefix: | admin function prefix: | ||
default admin function: | default admin function: | ||
+ | |||
===== conf.inc ===== | ===== conf.inc ===== | ||
- | The conf.inc file is used for a few purposes. Please do not add you other module specific configurations into this as all conf.inc files included for every HTTP request. The primary use of the conf.inc is to provide a nice name and display order for your module in the main menu. The two variable set for this are $conf[' | + | The conf.inc file is used for a few purposes. Please do not add you other module specific configurations into this as all conf.inc files included for every HTTP request. The primary use of the conf.inc is to provide a nice name and display order for your module in the main menu. The two variable set for this are $conf[' |
Typical usage is as follows | Typical usage is as follows | ||
Line 143: | Line 146: | ||
</ | </ | ||
- | ==== Checking | + | |
+ | ===== Module Dependencies ===== | ||
+ | |||
+ | ==== Checking | ||
Now that Sahana modules have become far more integrated, it is important for us to check if modules we are depending on exist before we present a feature in our module. E.g. Inventory management' | Now that Sahana modules have become far more integrated, it is important for us to check if modules we are depending on exist before we present a feature in our module. E.g. Inventory management' | ||
Line 154: | Line 161: | ||
the function lives in / | the function lives in / | ||
+ | ==== Module Database Dependencies ==== | ||
+ | As Sahana becomes more integrated you may find yourself referencing and even creating data in tables belonging to other modules. For example adding an item in your module to the gis. Remember that it is your responsibility to clean up after yourself. So remember to use the aproprate **Create Modify** and **Delete** interfaces in other modules so as not to leave residual/ |