Skip to content
Stephane Carrez edited this page Dec 1, 2015 · 1 revision

Application Module

Introduction

A module is a software component that can be integrated in the web application. The module can bring a set of service APIs, some Ada beans and some presentation files. The AWA framework allows to configure various parts of a module when it is integrated in an application. Some modules are designed to be re-used by several applications (for example a mail module, a users module, ...). Other modules could be specific to an application. An application will be made of several modules, some will be generic some others specific to the application.

Registration

The module should have only one instance per application and it must be registered when the application is initialized. The module instance should be added to the application record as follows:

type Application is new AWA.Applications.Application with record
   Xxx       : aliased Xxx_Module;
end record;

The application record must override the Initialize_Module procedure and it must register the module instance. This is done as follows:

overriding
procedure Initialize_Modules (App : in out Application) is
begin
   Register (App    => App.Self.all'Access,
             Name   => Xxx.Module.NAME,
             URI    => "xxx",
             Module => App.User_Module'Access);
end Initialize_Modules;

The module is registered under a unique name. That name is used to load the module configuration.

Configuration

The module is configured by using an XML or a properties file. The configuration file is used to define:

  • the Ada beans that the module defines and uses,
  • the events that the module wants to receive and the action that must be performed when the event is posted,
  • the permissions that the module needs and how to check them,
  • the navigation rules which are used for the module web interface,
  • the servlet and filter mappings used by the module

The module configuration is located in the config directory and must be the name of the module followed by the file extension (example: module-name.xml or module-name.properties).


Generated by Dynamo from awa-modules.ads

Clone this wiki locally