Skip to Content
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.   image    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.   image   The following configuration is for the module part, where I specified the Module Bean.  image
To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. Jason Scott
    Hi Felix,

    Great weblog, however I was wondering if you could include a little bit more information about how to setup this module? You also state that the code shown is only a small part of the module, what else is required?

    thx,
    Jason.

    (0) 
    1. Jason,
      Setting up this module is no different from setting up any module. Also, the code provided is the most important part in that module. I also felt that setting up a module is out of the scope of this weblog.
      Regards,
      Felix
      (0) 
      1. Jason Scott
        Hi Felix, is there any chance you could maybe describe the process of setting up a module in a further weblog or forum post…
        (0) 
  2. Saravana Kumar Kuppusamy
    Hi Felix, Nice blog. One issue i foresee is the support of Excel “versions” by the open source API. It may happen that you may receive an excel file created by an external party in production env , however that particular version of MS-Excel was not supported by the API and because of which it failed(assuming a worst case scenario). Anyways it is a call to be made on a NEED basis 🙂

    Thanks
    Saravana

    (0) 
  3. Reuben Olumese
    Hi Felix,

    Thanks for your blog. I’m new to using Modules in the Adapter Framework, and wanted your opinion on 2 conversion scenarios:

    1) Conversion from XLS to CSV using a File Adapter?

    2). Conversion from non_ASCII character sets to ASCII character sets, again using the File Adapter?

    Many thanks in advance!

    Reuben.

    (0) 

Leave a Reply