Reporting Workflow. Decision Support. Real-Time.
Developer documentation for ReportHub modules
- The following opinionated AngularJs Style Guide is recommended for coding patterns
- Build kobo reporting tool as module in ReportHub
- Create Kobo form i.e. example
- The kobo form will need to use the
theme-grid pages
style defined in the settings tab. - See the xlsForm Standards for more details.
- In order to create a new database, ReportEngine requires a database connection string (once ReportHub is installed).
- Update
/home/ubuntu/nginx/www/ngm-reportEngine/config/local.js
. i.e. example - Include the following config object in addition to the existing database connections to establish a new Mongo database with sailsjs
ngmiMMAPServer: {
adapter: 'sails-mongo',
host: 'localhost',
port: 27017,
// user: 'username',
// password: 'password',
database: 'ngmiMMAP',
schema: false
},
- Make
iMMAP/Reporting
folder structure in models
- Inside models are the schema (as json files) that will be created in the
ngmiMMAP
database as Mongo Collections when you use the Waterline ORM syntax toCreate
,Read
,Update
,Delete
(CRUD) in controllers.
- The monthly report processing script will be an API that fetches Kobo API data for the Monthly Report form and processes it into standardised data tables.
- Create branch in ngm-reportEngine folder
git checkout -b feature-monthly-reporting
- Create project folder
iMMAP/Reporting
in controllers - Processing script in
iMMAP/Reporting
sample - Routes to access the script to make it RestFULL. i.e. routes
- Resulting tables required to store the processed data need to be added as model. i.e. models
- You will need to configure KOBO connection params in
/home/ubuntu/nginx/www/ngm-reportEngine/config/kobo.js
.
- Create indicators and stats from the database available as RestFULL APIs.
- Processing script in
iMMAP/Reporting
i.e. sample - Routes to access the script to make it RestFULL. i.e. routes
- The dashboard page will require a route that will load a dashboard configuration
App
- Create
immap
folder in modules - Define
app.js
inimmap
folder. - Create base routes in
immap/app.js
as i.e. sample
.when( '/immap/reporting/monthly', {
templateUrl: '/views/app/dashboard.html',
controller: 'DashboardiMMAPReportingMonthlyCtrl',
resolve: {
access: [ 'ngmAuth', function(ngmAuth) {
return ngmAuth.grantPublicAccess();
}],
}
})
- Name module in
app.js
asngmiMMAP
- Add
ngmiMMAP
into the main app.js file
Dashboard
- Create
reporting
folder inmodules/immap
folder - Create
dashboards
folder in abovemodules/immap/reporting
folder - Create
dashboard.immap.reporting.monthly.js
file in abovemodules/immap/reporting/dashboards
folder - Name module in
dashboard.immap.reporting.monthly.js
asDashboardiMMAPReportingMonthlyCtrl
file in abovemodules/immap/reporting
folder - Create dashboard configuration i.e. sample
Index
- Add all scripts into
app/index.html
<!-- iMMAP -->
<script src="scripts/modules/immap/app.js"></script>
<!-- dashboards -->
<script src="scripts/modules/immap/reporting/dashboards/dashboard.immap.reporting.monthly.js"></script>
- Add all new files into the repository at ngm-reportHub
git stage -A
- Commit all changes in ngm-reportHub
git commit -m "Feature: New dashboard page for monthly reporting" -a
- Test the URL before making changes to the configuration
- if you get lost just copy the other examples in modules
- Make a landing splash page in HTML that will load for the iMMAP team members.
- Create branch in ngm-reportHub
git checkout -b feature-monthly-reporting
Page View
- In
modules/immap
folder createviews
folder - in
modules/immap/views
folder createimmap.landing.html
- Create HTML template with cards as
Monthly Report
,Training Report
andDashboards
i.e. sample
Page Controller
modules/immap
folder createpages
foldermodules/immap/pages
folder createimmap.landing.js
file i.e. sample- Update controller name to
iMMAPLandingCtrl
- in controller update line 53 to the HTML Page View above
/scripts/modules/reporting/immap/views/immap.landing.html
Page Route
- Create route in
modules/immap/app.js
as
.when( '/immap', {
templateUrl: '/views/app/dashboard.html',
controller: 'iMMAPLandingCtrl',
resolve: {
access: [ 'ngmAuth', function(ngmAuth) {
return ngmAuth.isAuthenticated();
}]
}
})
Index
10. Add all scripts into app/index.html
<!-- IMMAP -->
<! -- OTHER IMMAP FILES -->
<!-- pages -->
<script src="scripts/modules/immap/pages/immap.landing.js"></script>
- Test the URL before making changes to the configuration
- If you get lost just copy the other examples in modules