Home About Us Our Work Software Development Software Integration Support Services Contact Us
 
OpenLinks Capabilities
Software Features
Data Mapping
Handlers
Standard Validators
Custom Validators
Scheduling System
Monitoring
Dashboard
back to Software Integration...

OpenLinks > Handlers


What is a Handler?

A hanlder is a peice of code a developer writes that is triggered during the processing of an "OpenLinks Feed" Configuraion file when special processing is needed. We create handlers to enable non-standard data processing (prior to, or after data insert.  For example, if you want to update other db tables after importing this data

A handler does not have to be related to a database update can be anything you need as it call a distinct java class for processing during the execution of the XML source file.

Example code:

Below we can see some example code with the highlighted text indicating the call to a handler

<?xml version="1.0" encoding="UTF-8"?>
<openlinks>
   <incomingfeed>
      <feedsource>file:E:\\stores\\HEN\\_tmp\\XML\\CategoryLevel.xml</feedsource>
      <element rootpath="//product">
         <table>elements_products</table>
         <keymapping>
            <xpath>/product/code</xpath>
            <column>ATTR_ModelNumber</column>
         </keymapping>
         <mapping>
            <xpath>/product/title</xpath>
            <column>ATTR_Headline</column>
         </mapping>
         <mapping>
            <xpath>/product/description/text()</xpath>
            <column>ATTR_description</column>
         </mapping>
         <mapping>
            <xpath>/product/unit</xpath>
            <column>ATTR_Unit</column>
         </mapping>
         <mapping>
            <xpath>/product/image</xpath>
            <column>ATTR_Image</column>
         </mapping>
      </element>
      <element rootpath="//product/items/item" handler="ci.henselite.feed.ItemHandler">
         <table>elements_flex20</table>
         <keymapping validator="maxlength:100">
            <xpath>/item/code</xpath>
            <column>ATTR_Code</column>
         </keymapping>
         <mapping>
            <xpath>/item/title</xpath>
            <column>ATTR_Title</column>
         </mapping>
         <mapping>
            <xpath>/item/price</xpath>
            <column>ATTR_Price</column>
         </mapping>
         <mapping>
            <xpath>/item/attributes/attribute[@name='Size']</xpath>
            <column>ATTR_Size</column>
         </mapping>
         <mapping>
            <xpath>/item/attributes/attribute[@name='Weight']</xpath>
            <column>ATTR_Weight</column>
         </mapping>
         <mapping>
            <xpath>/item/attributes/attribute[@name='Grip']</xpath>
            <column>ATTR_Grip</column>
         </mapping>
         <mapping>
            <xpath>/item/attributes/attribute[@name='Colour']</xpath>
            <column>ATTR_Colour</column>
         </mapping>
      </element>
   </incomingfeed>
</openlinks>