Create a New Feed

April 29, 2009

Copyright 2006, R. James Holton. All rights reserved.

 

Note: To create your own feed, you will need to be able to program in Java and have a suitable Java development environment set up. This document does not cover Java programming or Java development environments.

 

Requirements

 

One of the more power features of the Expense Submittal System (ESS) is the FeedAPI interface.  This interface allows anyone to incorporate a customized feed into the end-of-day process.  There are some requirements.  They are:

 

  1. The feed must be written in Java.
  2. The Java class must use the ess.FeedAPI interface.  More about this later.

 

Anyone writing an end-of-day feed for will need to download the release ZIP file.  The release ZIP file contains source code for Java classes that will serve as references and examples.  The release ZIP file for release 6.2.0 is ess_6_2_0.zip.  The source code for the Java classes is located in the ess sub-folder under the source folder.  The ess sub-folder represents the ess package.  In order to create a feed, you will need to install the ess package into your development environment.

 

The FeedAPI interface

 

The FeedAPI interface must be implemented by any feed that is going to be added to the end-of-day process.  This interface defines the API methods that will be called when the feed class is initialized, for each report processed, and when the feed is “closed.”

 

The init method

 

The init method is called right after the feed is instantiated.  The following objects are passed into the init method:

 

 

Typical the init method will open files for output and load in any parameters from configuration files that are needed.

 

The post method

The post method creates the output for each report that is processed with the end-of-day process.  It is called once for each report that is being processed. There are two objects that are passed in as part of the call:

 

·        Report object – This is the expense report that is being processed and a collection of methods to persists, manipulate and extract information. 

·        PersonnelTable object – This is the user record associated with the report being processed.

 

Some methods important to end-of-day processing for the Report and PersonnelTable objects are described below.

 

The close method

 

After the last report has been processed, the close method is called.  The feed should use the close method to write out any total and control records, as well as, closing any output files.  There are no parameters associated with the close method.

 

Executing the feed via system.xml

 

To execute a feed as part of the end-of-day process, it needs to be added as a feed sub-element to the endofday element in the system.xml file.

 

Important Report.class methods

 

The following Report.class methods are useful in the post method:

 

·        getDeNormal – returns an array of denormalized expenses that can be used to generate G/L entries.  This array includes all the internal mapping that is setup in the expense type and payment method tables, as well as the purpose information.  The array has the same structure as the EOD element in the export.xml file. The export.xml file is found in the xmls folder under the default setup.

·        getReimburseTotal – returns the amount the reporter should be reimbursed for this report.

·        getAdvanceTotal – returns the advance amount

·        getTotalReceipts – returns the total receipts for the report

·        getPaymentMethod – returns the method by which the user should be paid

·        getACHPaymentInfo – includes payment amount as well as all the other ACH information for this user.

·        getEmailAddress – returns the email address associated with reporter

·        getPrintableEmailAddress – returns email address in the form that can be placed in an HTML document.

·        getCreateDate – returns the date the report was created.

·        getPersNum – returns the personnel number of the reporter.

 

For more methods, review the PersonnelTable.class file.

 

PersonnelTable.class methods

 

(Section to be completed later)

 

Examples to consult

 

The basic ess package comes with the following classes, and associated source code, that implement the FeedAPI interface:

 

 

###