IHRIS XML Import Export

From IHRIS Wiki
Revision as of 09:22, 2 October 2015 by Litlfred (talk | contribs) (Created page with "This described the XML import and export present in iHRIS 4.2. The XML used for import and export uses the same structure which is based on the form relationship. ==Forms,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This described the XML import and export present in iHRIS 4.2.

The XML used for import and export uses the same structure which is based on the form relationship.

Forms, Fields

iHRIS data is structured as forms with data fields. You can see these forms and fields here:

  • [iHRIS Manage Form Fields]
  • [iHRIS Qualify Form Fields]

The data fields can be one of several data types, for example STRING_LINE, MAP, FLOAT, or INT.

Some forms are related to each other. There are two main ways forms are related together:

  • A form can have child forms. For example, the person form has one child person_contact_work and many person_scheduled_training_course forms, one for each training event that person attended. The parent to child form relationship is used to indicate when data is "owned" by another form.
  • A form can use a MAP field to link to another form. This could be example the residence field in the person form which links to the country or district form.


Exporting XML Data

Exporting data is a two step process.

Creating a Form Relationship

To export data in XML the first step is to create a form relationship which contains all of the information desired.

There are many ways that forms can be related to each other. These form relationships are described here and can be built using the iHRIS web interface. You can all see the video demo below for more details.

Creating an Export Page

Once you have create a form relationship, you will want to create a new page in iHRIS to create the export. Using the "Page Builder" under "Configure System" you will want to create a "I2CE_PageXMLRelationship" page. Once the page has been created, you will want to "Edit" the page and specify:

  • The form relationship that will be used for export. This will be the form relationship you created in the last step.
  • The data fields to include in the export. You can select fields by form or select to include all the data fields

See the video demo below for more details.

XML Import

The XML import process uses the same XML form relationship format. Imported data is validated according to the forms validation rules before being imported -- invalid forms are not saved to the system. Any forms linked via a MAP field (such as a cadre list) will be added if they are not already there.

With the XML import there are a few options:

  • Preserve IDs. Optionally a form relationship can put the IDs of the form. When importing data, you can chose to preserve or not to preserve the iHRIS form id's of the primary form in the relationship as well
  • Ignore invalid forms: You can choose to ignore the validation checks for forms before saving. This could be used for example if you are importing a person and know you will have duplicate names.

The URL to access the form relationship import is:

 http://localhost/ihris-manage/form_relationship_can_import

You can submit the data as an HTTP POST with the XML content encoded as multipart/form-data. You can also set the 'ignore_ids' to 1 if you want the IDs ignored, if present.

You can also run the import on command line with:

 php index.php --page=/I2C2/form_relationship_can_import 


Video Demo

Here is a video demo of an export of Jobs and Cadres from one iHRIS system to another. https://youtu.be/UbgawQKywz0


XML Data Structure