Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?
The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.
he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.
The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.
Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?
Thank you Lars! Looks like the Oslo course work is the way to go. I assume MongoDB is not part of any DHIS2 architecture currently in use?
···
On Fri, Dec 5, 2014 at 12:57 PM, Lars Kristian Roland lars@roland.bz wrote:
Hi Greg,
The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.
he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.
The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.
Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?
It is not, but another similar Json based database api is being considered. This could use the postgres Json support, which would limit the database choice. That would probably be for other app specific data, rather than dhis core data. At least at first. But the postgres Json support also allows you to link Json and sql/relational stuff.
Hence it would probably provide similar functions to Mongodb, but be linkable to the dhis data model.
For now, the system and user settings are the only ways to store raw Json, but it’s quite limited…
On Fri, Dec 5, 2014 at 12:57 PM, Lars Kristian Roland lars@roland.bz wrote:
Hi Greg,
The DHIS2 Web API uses built-in functions from Spring MVC, which converts Java objects to various formats such as XML, JSON etc. Spring lets you deploy exisiting converters or allow you to write your own if you want some special format. Each of the API endpoints are Spring MVC controllers that handle the various REST-calls.
he slides from lectures 2, 3 and 4 of the INF5750 course (http://www.uio.no/studier/emner/matnat/ifi/INF5750/h14/lecture-presentations/ ) gives you some background on how this is done. However, some of the calls in the API are a bit magical, which makes it a bit difficult to read, going beyond ‘plain Spring MVC’.
The API implementation is a module within DHIS2, so while it’s modular, it’s closely linked to the internal APIs and data models.
Can anyone elaborate on the tools or systems used to present DHIS2 data through the webAPI? I’m trying to understand how DHIS2’s database interacts with the webAPI to present output data. Is there a plugin/converter installed alongside DHIS2 that runs in the background or is that built into the java core that DHIS2 is built upon?