Exporting Standardized Data

From IHRIS Wiki

In this tutorial we show how to export standardized cadre data from a central site to be shared among regional and district installations.

Note: This module assume that the cadre form is stored in magic data. This is the default for iHRIS Manage version 4.0.


Overview

We will create a module called standard-data-cadre that will contain all of the cadre's defined in the system. We will use the Magic Data Browser to automatically generate a configuration .xml file which we will save as standard-data-cadre.xml. Once we have created this module, we should make it available and required to each of the regional and district installations.

First Steps -- Enabling the Magic Data Browser

We will export the cadre list using the "Magic Data Browser" module. If it is not available under the "Configure System" menu, then follow these steps to enable it:

  • Browse to "Configure System"
  • Click the "Configure Modules" link
  • Click the link "Sub-Modules" to the right of the "Pages" module
  • Check the check box next to "Magic Data Browser"
  • Click the "Enable" button at the bottom of the page

Creating the module

Browsing in Magic Data

Creating the module is very easy. Go to:

  • Browse to "Configure System"
  • Click the "Browse Magic Data" link
  • Click the "I2CE" link
  • Click the "formsData" link
  • Click the "forms" link
  • Click the "cadre" link

You should now see a page that looks like:

Magic Data Browser

Setting Export Options

Now that we have browser in magic data to /I2CE/formsData/forms/cadre we are ready to export the module:

  • Click on the "(options)" link under the "Export" button
  • Set the following data:
    • Module Name: "standard-data-cadre"
    • Displayed Named: "Standardized Cadre List"
    • Version: Change it from "1.0.2010.08.20" to "4.0.2010.08.20"
    • Description: "The Standardized Cadre list set by the central office of the Ministry of Health"

Your page should look like:

Export Options

Now click the "Export" button and your web-browser should ask you where to save the .xml file. We will save it as the file standard-data-cadre.xml. See the next section for some hints about where to save this file.


Note: The module in general should have version 4.0.YYYY.MM.DD where we replace YYYY with the year, MM with the numeric month and DD with the numeric day. For example the version would be 4.0.2010.08.17 if the data was exported on August 27, 2010. If we update the cadre list, at a later date (August 20, 2010), then we can re-export the list into the same module standard-data-cadre but this time with version 4.0.2010.08.20.

Managing Decentralized iHRIS with Launchpad

First please see the article Decentralized iHRIS Data Policy for some background explanation.

Please also read Managing A Site In Launchpad for some background information on creating teams and working with bazaar on Launchpad.

Let us assume that we are working with a national site (National), and four regional sites (North,South,East and West) in the fictional country Taifeki


For example create a launchpad team, called ihris+taifeki, which you and all members of your development team will join. You should also create a project ihris-manage-taifeki with the code hosted on Launchpad.

Code Structure

Here is a template for the directory layout for Taifeki's customizations which contains both the national and regional sites. Directories are indicated in blue.

  • modules: the main modules directory which will contain all of the modules required by each of the sites.
    • standard-data-cadre: a sub-directory of the modules directory which will hold our standard cadre list module
      • standard-data-cadre.xml: the module we exported from the magic data browser
  • sites: A directory which will contain the four sites as well as the data management policy.
    • data-policy-national.xml:
    • data-policy-regional.xml
    • national: contains the national site.
      • nataional-site.xml: The site configuration file for the southern site. Xincludes the data-policy-national.xml and requires the module standard-data-cadre
    • north: contains the northern region site.
      • northern-site.xml: The site configuration file for the northern site. Xincludes the data-policy-regional.xml and requires the module standard-data-cadre
    • south: contains the southern region site.
      • southern-site.xml: The site configuration file for the southern site. Xincludes the data-policy-regional.xml and requires the module standard-data-cadre
    • east: contains the eastern region site.
      • eastern-site.xml: The site configuration file for the eastern site. Xincludes the data-policy-regional.xml and requires the module standard-data-cadre
    • west: contains the western region site.
      • western-site.xml: The site configuration file for the western site. Xincludes the data-policy-regional.xml and requires the module standard-data-cadre

data-policy-national.xml

In the data-policy-national.xml will be xincluded in our national site's configuration file. We want to set it so that the national site has the cadre list stored in magic data and is read-write. It should look like this: <source lang='xml'>

 <configurationGroup name='form_storage' path='/modules/forms/forms'>
   <version>4.0.5.0</version>
   <configurationGroup name='cadre'>
       <configuration name='read_only' >
             <value>0</value>
       </configuration>
       <configuration name='storage'>
             <value>magicdata</value>
       </configuration>
   </configurationGroup>
 </configurationGroup>  

</source>

data-policy-regional.xml

In the data-policy-regional.xml will be xincluded in our regional site's configuration files. We want to set it so that the regional sites have the cadre list stored in magic data and is read-only. It should look like this: <source lang='xml'>

 <configurationGroup name='form_storage' path='/modules/forms/forms'>
   <version>4.0.5.0</version>
   <configurationGroup name='cadre'>
       <configuration name='read_only' >
             <value>1</value>
       </configuration>
       <configuration name='storage'>
             <value>magicdata</value>
       </configuration>
   </configurationGroup>
 </configurationGroup>

</source>