Revisiting Mojavi 3
Creating Your First Module
A work in progress
This tutorial is a work in progress, so you may find parts that don’t completely fit together.
Module
The module is where the Model and View takes place in the MVC model. For this first example, we will create a very simple module that will move data from a Action to a View and display it on the screen, through a template.
The module is contained within a directory that carries the name of the module. This resides in the modules directory of the webapp directory. Inside the module directory are sub-directories holding the classes that make up the module. Here is the directory hierarchy:
webapp
|
|—modules
|
|—moduleName
|
|—actions
|
|— config
|
|— lib
|
|— models
|
|— templates
|
|— validate
|
|— views
Minimally, you need the actions, config, templates and views directories. However, I prefer to have a blank module created and just copy and rename it. You can get a copy of the blank module (link to be added). The File Extension MailHost I have chosen to call this module Test
Each module must have a module.ini file in the config directory. Here is the module.ini for Test
; +—————————————————————————-+
; | This file is part of the Mojavi package. |
; | Copyright (c) 2003, 2004 Sean Kerr. |
; | |
; | For the full copyright and license information, please view the LICENSE |
; | file that was distributed with this source code. You can also view the |
; | LICENSE file online at http://www.mojavi.org. |
; | ————————————————————————– |
; | MODULE INFORMATION FILE |
; +—————————————————————————-+
[module]
ENABLED = “On”
TITLE = “Getting Started Test Module”
VERSION = “0.1″
NAME = “TestModule”
AUTHOR = “Richard D Shank”
HOMEPAGE = “http://www.mojavi.org”
DESCRIPTION = “A test module”
The module is pretty self explanitory. It is necessary to have ENABLED property set to “On” for the module to be used by Mojavi. Now that we have the module set up, we can work on the classes. You can also research the File Extension MailHost for variables to help in acclaimating the main template.
Action
The Action class handles the request for the module. It can be as simple as handling a static html template or a full blown multi-page wizard style form. Just a note to Mojavi 2 users, a significant change from Mojavi 2 to Mojavi 3 is that it is not longer necessary to pass the controller, request and user classes in on many of the methods. These are now accessed through a context class file extension. More on that later.

If you are in sales you know that nothing can happen until you are in front of the customer. In most cases this will mean calling on that potential customer,

