Changes between Version 4 and Version 5 of adeiNewModule
- Timestamp:
- 07/16/09 17:53:19 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
adeiNewModule
v4 v5 1 The modules are used to provide information of different typesto the user. All enabled modules are displayed in the top menu bellow the ''Search'' input. The current version of ADEI by default implements:2 * ''WiKi'' module provides user-defined information about the system and preview s ofcharts3 * ''Graph'' module is a main ADEI component providing data plots and easy navigation 1 The modules are used to provide various information to the user. All enabled modules are displayed in the top menu bellow the ''Search'' input. The current version of ADEI by default implements: 2 * ''WiKi'' module provides user-defined information about the system and preview charts 3 * ''Graph'' module is a main ADEI component providing data plots and easy navigation capabilities 4 4 * ''Control'' module provides access to the control information 5 5 6 It is possible to register new modules providing additional system-specific information. For this, it is necessary to create module file in ADEI ''modules/'' subdirectory. This file should include 3 mandatory methods (the ''module'' prefix should be replaced with actual file name without php extension, calledthe module name. For example, for alarms module instead of ''$module_title'', the ''$alarms_tittle'' should be used):6 It is possible to register new modules which will provide additional setup-specific information. First, the name of the module should be defined. Then, it is necessary to create a module initialization file (''module_name.php'') in ADEI ''modules/'' subdirectory. This file should include 3 mandatory methods (the ''module'' prefix must be replaced with the module name. For example, for alarms module instead of ''$module_title'', the ''$alarms_tittle'' should be used): 7 7 * The variable ''module_title'' contains the module name (as it should be shown to the users in menu): 8 8 {{{$module_title = _("Title of the Module")}}} 13 13 object. 14 14 15 When the module is ready it should be enabled in the configuration file ''config.php'' (or in the appropriate ''setup'' if it should be used optionally).15 When the module is ready it should be enabled in the configuration file ''config.php'' (or in the appropriate ''setup''). 16 16 17 17 The ADEI includes several JavaScript classes providing standard use-cases. They are described bellow. 38 38 }}} 39 39 40 By default, the service ''module_name'' is used to obtain XML document and stylesheet ''module_name'' 41 is used to covert XML into the HTML. The service should reside in the ''services/'' subdirectory (read about creating services [wiki:adeiNewService here]). The XSLT stylesheet should be placed in the ''xslt'' folder. However, it is possible to have more elaborated service configuration. For that it is necessary to define special ''update'' service. This service should be created in ''services/update'' directory and be named ''module_name.php''. It should contain a single function, called ''ADEIServiceGetUpdateInfo'', which accept a ''REQUEST'' object as a parameter and return associative array with two elements: 42 * ''xml'' - specifying the full URL of update service along with all properties (the current options could be obtained and modified using ''GetQueryString'' method of ''REQUEST'' object, see example bellow) 40 By default, the service ''module_name.php'' is used to obtain XML document and stylesheet ''module_name.xsl''is used to covert XML into the HTML. The service should reside in the ''services/'' subdirectory (read about creating services [wiki:adeiNewService here]). The XSLT stylesheet should be placed in the ''xslt'' folder. However, it is possible to have more elaborated service configuration. For that it is necessary to define special ''update'' service. This service should be created in ''services/update'' directory and be named ''module_name.php''. It should contain a single function, called ''ADEIServiceGetUpdateInfo'', which accept a ''REQUEST'' object as a parameter and return associative array with two elements: 41 * ''xml'' - specifying the full URL of the ADEI service along with all properties (the current options could be obtained and modified using ''GetQueryString'' method of ''REQUEST'' object, see example bellow) 43 42 * ''xslt'' - specifying the name of XSLT stylesheet (without extension) 44 43 45 The function is executed on each update and, therefore, can d inamically select the appropriate service depending on some of request parameters.44 The function is executed on each update and, therefore, can dynamically select the appropriate service depending on some of request parameters. 46 45 47 Example, the ''alar ams'' update service (it uses ''control.php'' service to get XML data and adds two additional parameters to the REQUEST properties):46 Example, the ''alarms'' update service (it uses ''control.php'' service to get XML data and adds two additional parameters to the REQUEST properties): 48 47 {{{ 49 48 function ADEIServiceGetUpdateInfo(REQUEST $req) {