Changes between Version 1 and Version 2 of adeiNewModule

Show
Ignore:
Author:
csa (IP: 141.52.232.84)
Timestamp:
07/16/09 16:21:24 (15 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • adeiNewModule

    v1 v2  
    1  The modules are used to provide information of different types to the user. All enabled modules are displayed in the top menu bellow the ''Search'' input. The current version of ADEI by default implements: 
     1The modules are used to provide information of different types to the user. All enabled modules are displayed in the top menu bellow the ''Search'' input. The current version of ADEI by default implements: 
    22 * ''WiKi'' module provides user-defined information about the system and previews of charts 
    33 * ''Graph'' module is a main ADEI component providing data plots and easy navigation 
    1010 * The function ''modulePage'' contains HTML code of the page 
    1111 
    12 Since, the modules are normally dynamically updated during the ADEI execution. The real HTML context should not be set by ''modulesPage'' functions, but provided using services. The ''moduleJS'' function should initialize JavaScript class which will take care of context updating.  
     12Since, the modules are normally dynamically updated during the ADEI execution. The real HTML context should not be set by ''modulesPage'' functions, but provided using services. The ''moduleJS'' function should initialize JavaScript object which will take care of context updating and return the name of this 
     13object.  
    1314 
    1415When 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). 
    1718The ADEI includes several JavaScript classes providing standard use-cases. They are described bellow. 
    1819 
    19 === XML Module === 
     20== XML Module == 
     21 This module uses an ''ADEI service'' generating XML content and XSLT stylesheet to update information on the page. The ''modulePage'' function should just define a single ''div'' element: 
     22     {{{<div id="module_div" class="xml_module">Loading...</div>}}} 
     23The ''moduleJS'' function initializes new XMLMODULE object supplying the id of div created in ''modulePage'' function: 
     24     {{{ module_object = new XMLMODULE("module_div"); }}} 
     25and returns the name of created object: 
     26     {{{ return "module_object"; }}} 
     27 
     28Complete example (alarms module): 
     29{{{ 
     30  $alarms_title = _("Alarms"); 
     31  function alarmsJS() {  
     32    echo 'alarms = new XMLMODULE("alarms_div");'; 
     33    echo 'alarms.SetModuleType(CONTROL_MODULE_TYPE);'; 
     34    return "alarms"; 
     35  } 
     36  function alarmsPage() {  
     37    echo '<div id="alarms_div" class="xml_module">Loading...</div>'; 
     38  } 
     39}}}