Read Excel instead of XML through FileAdapter
Is there a restriction that a file adapter can read only xml files? You will say a ‘NO’ after you read this blog. This blog is a very simple example about how to read data from an external source like excel and pass it into the Adapter Framework. After reading this blog you will find the real use of modules and ask yourself the need for an adapter for JDBC, JMS, Http etc (Just Kidding). h3. A little bit of theory Here is the design of the process. The diagram explains about the FileAdapter Sender which gets the excel as input and sends the fetched data to the module in Module Processor. It is here the Excel Module gets called. Similarly, the FileAdapter Receiver gives the output as XML. The module can be place anywhere (rewriting the code accordingly), ie., in Sender or Receiver according to the need. Required JAR File ** jxl.jar +(Java Excel API – open source Java API)+ Assuming, you have little knowledge about modules let’s go directly into the coding part of Excel Module. Please note that most of the coding part are stripped for simplicity. The process function of the Excel Module for File Adapter is as follows. h3. The process function h3. Configuration in Integration Directory The configuration on Sender Communication Channel (Integration Directory) is as follows. The key things to note are that the Adapter used is a FileAdapter and the file is an Excel File. The following configuration is for the module part, where I specified the Module Bean.