This is an old revision of the document!
Table of Contents
Create a New Report Source
If you have a need for data that can only be retrieved via a query because the reporter can't construct it, or if you base numerous reports on a specific set of data that you don't want to have to rebuild every time you create a template, you can create a new class in the fieldmapper that can be used by the reporter going forward.
First, you will need to construct a SQL query that retrieves the data you wish to make available in your source. Once you are satisfied, then you have two options:
Option 1: Create a (faux) View in the Fieldmapper Only
This option adds the SQL directly to the Fieldmapper. This is the easiest approach to code and the reporter (and most other parts of Evergreen) will be able to make use of it, but it does have limitations. For example, it will not be available to a direct database query. Also, other fieldmapper classes cannot link to this class as they would be able to with option 2.
Option 2: Create a Database View
More Details (WIP)
1. Scroll to the bottom of the fieldmapper. You're going to insert your new class below the last closing </class> tag, and above the <!— *> tag.
NOTE: The Fieldmapper cares about indentation. Make sure to follow the indentation examples from other classes.
Class id –
Controller – You have options for what this should be, and you can combine several.
- open-ils.cstore
- open-ils.reporter-store
- open-ils.pcrud
oils_object:fieldmapper –
oils_persist:readonly
oils_persist:virtual
reporter:label – What should the name of the view be in the reporter?