johnwoodlock edited a comment on New Feature MIFOS-5701

OVERVIEW
----------------
The Mifos X screen-based reporting functionality

1 Allows Mifos X devs/integrators to add core and MFI specific reports (dynamically without redeployment) by specifying the SQL and any parameters required to run the SQL. (key thing is no additional reporting software is used so no look and feel or reporting related work is required).

2 has a reporting api (see https://ec2-46-137-62-163.eu-west-1.compute.amazonaws.com:8443/api-docs/apiLive.htm#reports) which can run a report and returns the output in json.
The json is in "Generic Resultset" format which has columnheader information and datarow data (one datarow for each sql row returned). This works fastest and easiest with the jquery plugin (described later). However, there is code to turn this "Generic Resultset" format into the more familiar json object format (GenericDataService.generateJsonFromGenericResultsetData) for non default UI usage (but I doubt that matters for normal report usage).

3 A JQuery plugin called stretchyreporting.js (current version is 0.999) provides a default UI that gets a list of reports for display and gets all the parameters required... allowing the end user to select a report, enter parameters, run the report and see the output all on one page. JQuery data tables are used to display the output and default pagination, search and export functionality is included. The plugin also allows charts to be seen if the 'report' is defined as a chart and the sql returns the correct columns (a label and a number). Pentaho reports can be declared and run also but that facility is already available in Mifos (Mifos has more mature functionality such as end-user uploading).

The reason for the overview above is to see whether it is worth investing in screen based reporting for Mifos at this stage. I think its okay to say its not. It would provide additional reporting choices/flexibility but may also be confusing (having a number of ways of producing reports) and might just be a 'nice to have' at this stage. Obviously, it's Ed's ( and product managements') call.

Anyway, if it helps, what from Mifos X screen-based reporting would be most useful:
a) The way the UI allows selection and running of a report on the same page?
b) The ability to knock up just SQL and get a running report with some search and export functionality?

If its only a) then its just a matter of changing the Mifos UI so that it presents differently. No need to implement the full screen-based functionality.
If its b) then you have to implement the full functionality.

INTEGRATING INTO MIFOS
------------------------------------
I think the work can be broken into 2 main areas (i.e. 2 sub tasks). If you choose to go ahead with the work I can expand on any of the items below as they are being worked on.

1) Integrate the back-end api
In Mifos X the api is in ReportsApiResource.java... There are only a couple of dependencies ReadReportingServiceImpl.java and GenericDataServiceImpl being pretty much all of it.

See https://github.com/keithwoodlock/mifosx to clone the Mifos X back-end api.

Obvious differences when Integrating

  • The Mifos X security implementation is probably quite different to Mifos's i.e. context.authenticatedUser() is used to get the current user's information for permission checking.
  • Error throwing
  • The api itself (maybe Mifos will use some struts action instead of the http api in Mifos X?).
  • Permissions (Currently there is no maintenance function in Mifos X for maintaining the reporting meta data (its done using any MySql GUI). There will be... but its not a high priority. It does mean than when a report is created, deleted (or has its name updated) that the specific report permission associated has to be added, updated or deleted manually. In additional to allowing users having the permissions "ALL_FUNCTIONS" or "ALL_FUNCTIONS_READ", Mifos X checks for a permission which follows the naming standard "CAN_RUN_" + reportName - Mifos might be very different which is okay)
  • Parameters (Mifos X comes with some parameters and the SQL to get the allowed values if necessary. The SQL will be different for Mifos. Extra parameters may be required - see meta data SQL for examples).

Data Scoping
Mifos X reporting supports placeholders that are (optionally) included in the SQL that allow for data scoping (restricting report data to the users' office hierarchy).
$

{currentUserHierarchy}

the users office hierarchy value
$

{currentUserId}

current user id (for getting allowed reports back)
To better understand the usage, look at the sql in the report meta tables.

Database Tables
(https://mifosforge.jira.com/wiki/display/MIFOSX/Mifos+X+Database and see "MifosX Reporting MetaData Tables (pdf)" for a simple diagram and, in the "table of table information" see "Reporting MetaData Tables".

2) Integrate the JQuery stretchyreporting Plug-in
see https://github.com/keithwoodlock/mifosx-community-apps to clone the Mifos X community apps repository.

Include the JQuery plug-in in the _javascript_ headers - see Mifos X file IndivLendHome.html
The stretchyreporting directory structure (with all _javascript_ code, css, datatables etc) is also called stretchyreporting
Set up a link or tab in Mifos that the user can click on to show the 'reporting page(s)'.
See function showILReporting in IndividualLendingCode-x.xx.js to see how to set up reporting html and call the JQuery plug-in.
The plug-in does (optionally) use the I18N JQuery for translation. IndivLendHome.html shows how to include that (and other _javascript_ dependencies).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to