=== modified file 'src/docbkx/en/dhis2_implementation_guide_installation.xml' --- src/docbkx/en/dhis2_implementation_guide_installation.xml 2013-09-01 20:15:45 +0000 +++ src/docbkx/en/dhis2_implementation_guide_installation.xml 2013-09-10 13:32:28 +0000 @@ -221,7 +221,12 @@
Enabling SSL on nginx - In order to improve security it is recommended to configure the server running DHIS to communicate with clients over an encrypted connection and to identify itself to clients using a trusted certificate. This can be achieved through SSL which is an cryptographic communication protocol running on top of TCP/IP. + In order to improve security it is recommended to configure the server running DHIS to + communicate with clients over an encrypted connection and to identify itself to clients + using a trusted certificate. This can be achieved through SSL which is an cryptographic + communication protocol running on top of TCP/IP. First, install the required openssl library: + sudo apt-get install openssl To configure nginx to use SSL you will need a proper SSL certificate from an SSL provider. The cost of a certificate varies a lot depending on encryption strength. An affordable certificate from Rapid SSL Online should serve most purposes. To generate the CSR (certificate signing request) you can invoke the command below. When you are prompted for the Common Name, enter the fully qualified domain name for the site you are securing. openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr When you have received your certificate files (.pem or .crt) you will need to place it === modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-04 13:58:59 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-10 13:32:28 +0000 @@ -1412,6 +1412,208 @@ http://apps.dhis2.org/dev/api/sqlViews/dI68mLkP1wN/data.csv?level:4
+ Dashboard + The dashboard is designed to give you an overview of multiple analytical items like maps, + charts, pivot tables and reports which together can provide a comprehensive overview of your + data. Dashboards are available in the Web API through the dashboards resource. A dashboard contains a list of dashboard items. An item can represent a single resource, like a chart, map + or report table, or represent a list of links to analytical resources, like reports, + resources, tabular reports and users. A dashboard item can contain up to eight links. + Typically, a dashboard client could choose to visualize the single-object items directly in a + user interface, while rendering the multi-object items as clickable links. +
+ Browsing dashboards + To get a list of your dashboards with basic information including identifier, name and + link in JSON format you can make a GET request to the + following URL: + /api/dashboards.json + The dashboards resource will provide a list of dashboards. Remember that the dashboard + object is shared so the list will be affected by the currently authenticated user. You can + retrieve more information about a specific dashboard by following its link, similar to + this: + api/dashboards/vQFhmLJU5sK.json + A dashboard contains information like name and creation date and an array of dashboard + items. The response in JSON format will look something like this (access and user attributes + omitted for + brevity):{ + "name": "Antenatal Care", + "created": "2013-09-08T20:55:58.060+0000", + "items": [{ + "created": "2013-09-09T18:28:37.813+0000", + "chart": { + "name": "ANC: Visits by facility type", + "created": "2013-05-30T09:58:42.023+0000", + "href": "http://apps.dhis2.org/demo/api/charts/iRCGbznvyG8", + "id": "iRCGbznvyG8" + }, + "map": null, + "reportTable": null, + "type": "chart", + "contentCount": 1, + "id": "FeQp4qJ63M8" + }, + { + "created": "2013-09-08T21:00:07.266+0000", + "user": null, + "chart": null, + "map": null, + "reportTable": null, + "reports": [{ + "name": "ANC: 1st Visit Cumulative Chart", + "created": "2012-11-13T13:49:45.007+0000", + "href": "http://apps.dhis2.org/demo/api/reports/Kvg1AhYHM8Q", + "id": "Kvg1AhYHM8Q" + }, { + "name": "ANC: Coverages This Year", + "created": "2012-11-13T13:52:01.630+0000", + "href": "http://apps.dhis2.org/demo/api/reports/qYVNH1wkZR0", + "id": "qYVNH1wkZR0" + }], + "type": "reports", + "contentCount": 2, + "id": "AWUUWkPzops" + }] +} +
+
+ Searching dashboards + When setting a dashboard it is convenient from a consumer point of view to be able to + search for various analytical resources using the /dashboards/q resource. This resource lets you search for matches on the name + property of the following objects: charts, maps, report tables, users, reports and + resources. You can do a search by making a GET request on + the following resource URL pattern, where my-query should be replaced by the preferred + search query: + api/dashboards/q/my-query.json + JSON and XML response formats are currently supported. The response in JSON format will + contain references to matching resources and counts of how many matches were found in total + and for each type of resource. It will look similar to this: + { + "charts": [{ + "name": "ANC: 1-3 dropout rate Yearly", + "id": "LW0O27b7TdD" + }, { + "name": "ANC: 1 and 3 coverage Yearly", + "id": "UlfTKWZWV4u" + }, { + "name": "ANC: 1st and 3rd trends Monthly", + "id": "gnROK20DfAA" + }], + "maps": [{ + "name": "ANC: 1st visit at facility (fixed) 2013", + "id": "YOEGBvxjAY0" + }, { + "name": "ANC: 3rd visit coverage 2012 by district", + "id": "ytkZY3ChM6J" + }], + "reportTables": [{ + "name": "ANC: ANC 1 Visits Cumulative Numbers", + "id": "tWg9OiyV7mu" + }], + "reports": [{ + "name": "ANC: 1st Visit Cumulative Chart", + "id": "Kvg1AhYHM8Q" + }, { + "name": "ANC: Coverages This Year", + "id": "qYVNH1wkZR0" + }], + "searchCount": 8, + "chartCount": 3, + "mapCount": 2, + "reportTableCount": 1, + "reportCount": 2, + "userCount": 0, + "patientTabularReportCount": 0, + "resourceCount": 0 +} +
+
+ Creating, updating and removing dashboards + Creating, updating and deleting dashboards follow standard REST semantics. In order to + create a new dashboard you can make a POST request to the + /api/dashboards resource. From a consumer perspective + it might be convenient to first create a dashboard and later add items to it. JSON and XML + formats are supported for the request payload. To create a dashboard with the name "My + dashboard" you can use a payload in JSON like this: + { + "name": "My dashboard" +} + To update, e.g. rename, a dashboard, you can make a PUT request with a similar request payload the same api/dasboards + resource. + To remove a dashboard, you can make a DELETE request + to the specific dashboard resource similar to this: + api/dashboards/vQFhmLJU5sK.json +
+
+ Adding, moving and removing dashboard items and content + In order to add dashboard items a consumer can use the /api/dashboards/<dashboard-id>/items/content resource, where + <dashboard-id> should be replaced by the relevant dashboard identifier. The request must + use the POST method. The URL syntax and parameters are + described in detail in the following table. + + Items content parameters + + + + + + + Query parameter + Description + Options + + + + + type + Type of the resource to be represented by the dashboard item + chart | map | reportTable | users | reports | reportTables | resources | + patientTabularReports + + + id + Identifier of the resource to be represented by the dashboard item + Resource identifier + + + +
+ A POST request URL for adding a chart to a specific + dashboard could look like this, where the last id query parameter value is the chart + resource identifier: + /api/dashboards/vQFhmLJU5sK/items/content?type=chart&id=LW0O27b7TdD + When adding resource of type map, chart and report table, the API will create and add a + new item to the dashboard. When adding a resource of type users, reports, report tables and + resources, the API will try to add the resource to an existing dashboard item of the same + type. If no item of same type or no item of same type with less than eight resources + associated with it exists, the API will create a new dashboard item and the resource to + it. + In order to move a dashboard item to a new position within the list of items in a + dashboard, a consumer can make a POST request to the + following resource URL, where <dashboard-id> should be replaced by the identifier of the + dashboard, <item-id> should be replaced by the identifier of the dashboard item and + <index> should be replaced by the new position of the item in the dashboard, where the + index is + zero-based:/api/dashboards/<dashboard-id>/items/<item-id>/position/<index> + To remove a dashboard item completely from a specific dashboard a consumer can make a + DELETE request to the below resource URL, where + <dashboard-id> should be replaced by the identifier of the dashboard and <item-id> + should be replaced by the identifier of the dashboard item. The dashboard item identifiers + can be retrieved through a GET request to the dashboard resource URL. + /api/dashboards/<dashboard-id>/items/<item-id> + To remove a specific content resource within a dashboard item a consumer can make a + DELETE request to the below resource URL, where + <content-resource-id> should be replaced by the identifier of a resource associated with + the dasboard item; e.g. the identifier of a report or a user. For instance, this can be used + to remove a single report from a dashboard item of type reports, as opposed to removing the + dashboard item completely: + /api/dashboards/<dashboard-id>/items/<item-id>/content/<content-resource-id> +
+
+
Analytics To access analytical, aggregated data in DHIS 2 you can work with the analytics resource. The analytics resource is powerful as it lets you query and retrieve data aggregated along all available data dimensions. For instance, you