Difference between revisions of "Spring minions DHIS2 Discussion forum web app"

From mn/ifi/inf5750
Jump to: navigation, search
(Hononyms / synonyms)
(Like / dislike / user rating)
 
(9 intermediate revisions by 2 users not shown)
Line 27: Line 27:
 
* Content rating/voting system
 
* Content rating/voting system
  
====Search features added====
+
 
 +
=Back end=
 +
The needed amendments and additions to the web API is as follows:
 +
 
 +
* A (reasonably powerful) search feature for interpretations and associated comments - '''STATUS: IN DONE'''
 +
* The ability to title posts/interpretations - '''STATUS: DONE'''
 +
* Exposing user/owner/creator information along with the content - '''STATUS: DONE'''
 +
* The ability to rate content given by others. - '''STATUS: DONE'''
 +
 
 +
==Search==
 +
Search will be implemented using Hibernate Search, which integrates the Apache Lucene indexing and search engine with the Hibernate persistence model already used for DHIS2. The wanted key features of the search implementation is:
 +
 
 +
* Searchable by text/comments
 +
* Searchable by user/owner
 +
* Searchable by analytical item (chart, map, pivot)
 +
* Searchable by data elements + indicators + data set
 +
 
 +
===Search features added===
 
We can now search on text in interpretations, text in comments and user.
 
We can now search on text in interpretations, text in comments and user.
 
These are part of the standard search string.
 
These are part of the standard search string.
Line 33: Line 50:
 
There is also implemented a more specific search on a user, to get all interpretations and comments from a specific user.
 
There is also implemented a more specific search on a user, to get all interpretations and comments from a specific user.
  
=====Use of searchmethods in the API=====
+
====Use of searchmethods in the API====
 
To make a search on text in interpretations and comments and on users:
 
To make a search on text in interpretations and comments and on users:
 
*Use HTTP GET on URL http://.../api/interpretations?search=anc
 
*Use HTTP GET on URL http://.../api/interpretations?search=anc
Line 49: Line 66:
 
*Use HTTP GET on URL http://.../api/interpretations?search=anc&type=chart&from=20130301&to=20130430&page=1&pageSize=2
 
*Use HTTP GET on URL http://.../api/interpretations?search=anc&type=chart&from=20130301&to=20130430&page=1&pageSize=2
  
====Avatar====
+
===Hononyms / synonyms===
 +
We implemented search on synonyms in revision 12828/12829 with a synonymlist from WordNet. This was later removed for causing compilation problems on some computers. Another reason why it was removed is that the searches were very general. You could search for almost any word and get lots of results, most of which were quite irrelevant. This should not be enabled by default, and a better fit would be as an option under advanced search. This has not been a priority and therefore not implemented.
 +
 
 +
==Avatar==
 
To get a more forum-like feeling we have implemented avatars for users.
 
To get a more forum-like feeling we have implemented avatars for users.
 
To upload an avatar to a user in the wep-api:
 
To upload an avatar to a user in the wep-api:
Line 59: Line 79:
 
Where "uid" is a specific users unique id.
 
Where "uid" is a specific users unique id.
  
====Rating system====
+
==Rating system==
 
Users now have the opportunity to give rating to interpretations.
 
Users now have the opportunity to give rating to interpretations.
 
This is done in the web-api:
 
This is done in the web-api:
Line 65: Line 85:
 
Where "uid" is the unique id of the specific interpretations you want to rate, and "rating" is the number of points you want give. This is limited to minimum 1 and maximum 5.
 
Where "uid" is the unique id of the specific interpretations you want to rate, and "rating" is the number of points you want give. This is limited to minimum 1 and maximum 5.
  
==Back end==
+
==Database==
The needed amendments and additions to the web API is as follows:
+
We have made some minor changes to the database to support the wanted functionality.
 
+
*Added titles to interpretations
* A (reasonably powerful) search feature for interpretations and associated comments - '''STATUS: IN PROGRESS'''
+
*Created a new table to support rating of interpretations
* The ability to title posts/interpretations - '''STATUS: DONE'''
+
*Added two new columns in the userinfo table to support avatars
* Exposing user/owner/creator information along with the content - '''STATUS: DONE'''
 
* The ability to rate content given by others. - '''STATUS: IN PROGRESS/CONSIDERATION'''
 
 
 
===Search===
 
Search will be implemented using Hibernate Search, which integrates the Apache Lucene indexing and search engine with the Hibernate persistence model already used for DHIS2. The wanted key features of the search implementation is:
 
  
* Searchable by text/comments
+
==Note:==
* Searchable by user/owner
 
* Searchable by analytical item (chart, map, pivot)
 
* Searchable by data elements + indicators + data set
 
 
 
The details of implementing these are still a bit fuzzy. Current status is that '''text and user fields are fully searchable''', but no user-selectable discrimination between "search categories" has been implemented fully just yet. Wheter this is really wanted or needed is still to be decided...
 
 
 
====Hononyms / synonyms====
 
We implemented search on synonyms in revision 12828/12829 with a synonymlist from WordNet. This was later removed for causing compilationproblems on some computers. Another reason why it was removed is that the searches were very general. You could search for almost any word and get lots of results, most of which were quite irrelevant. This should not be enabled by default, and a better fit would be as an option under advanced search. This has not been a priority and therefore not implemented.
 
 
 
====Note:====
 
 
We have chosen to freely add to the existing backend, including database schema and API behaviour. We do, however, strive to make any changes compatible with the existing application and existing installations without breaking features or data stores. We also strive to stick as well as possible to the existing conventions of the DHIS2 source code framework by keeping any additions as modularised and separate as possible.
 
We have chosen to freely add to the existing backend, including database schema and API behaviour. We do, however, strive to make any changes compatible with the existing application and existing installations without breaking features or data stores. We also strive to stick as well as possible to the existing conventions of the DHIS2 source code framework by keeping any additions as modularised and separate as possible.
  
==Front end==
+
=Front end=
  
 
In short, we wish to achieve a "forum style" view of the interpretations. We believe this is a cleaner and more user friendly presentation format. Do note, though, that this will not attempt to replicate the functionality and architecture of traditional web forums such as phpbb et. al. The underlying data simply don't support this type of structure as there are no categories, no titles etc.
 
In short, we wish to achieve a "forum style" view of the interpretations. We believe this is a cleaner and more user friendly presentation format. Do note, though, that this will not attempt to replicate the functionality and architecture of traditional web forums such as phpbb et. al. The underlying data simply don't support this type of structure as there are no categories, no titles etc.
Line 95: Line 100:
 
Here is a (way too long) list of the ambitions of the web app:
 
Here is a (way too long) list of the ambitions of the web app:
  
===Front page view with subject, last updated date, last author===
+
==Front page view with subject, last updated date, last author==
 
*<s>baseurl</s>
 
*<s>baseurl</s>
 
*<s>Order by date</s>
 
*<s>Order by date</s>
*Angular templates
+
*<s>Angular templates(forum view and interpretations view. </s>
 
+
*<s>Search tab and bookmarks tab</s>
*Fetch more posts when scrolldown
+
*<s>Fetch more posts when scrolldown</s>
*<s>display type icon</s>
+
*<s>Display type icon</s>
 
+
*<s>Display avatar with link to userpage</s>
<s>*Fetch name. In Progress: Halvdan, Thomas og Johannes</s>
 
*Style(css)
 
  
==== Comment hierarchy====
+
<s>*</s>
 +
*<s>Style(css)</s>
  
 +
=== Comment hierarchy===
 +
<s>*Show comments</s>
 +
<s>*Write comments</s>
 
*display comment within comment
 
*display comment within comment
*show comments
+
<s>*Style(css)</s>
*Style(css)
 
  
====Like / dislike / user rating====
+
===Like / dislike / user rating===
 +
<s>*Display rating.</s>
 
*WIP at backend team.
 
*WIP at backend team.
  
====Search====
+
===Search===
*In progress
+
<s>*Fetching and displaying standard search results</s>
 
+
*Fetching and displaying advanced search results
====Wanted (but not prioritised) features====
 
  
 +
===Wanted (but not prioritised) features===
 
*View posts per user
 
*View posts per user
*Avatar for users
+
<s>*Avatar for users</s>
 
*Browsing interpretations by Categories(diagnosis)?
 
*Browsing interpretations by Categories(diagnosis)?
 
*Attach data / files to interpretations
 
*Attach data / files to interpretations
Line 127: Line 134:
 
*RSS / Atom support
 
*RSS / Atom support
  
==Division of tasks==
+
=Division of tasks=
 
Thomas and Halvdan is doing the Back end (Hibernate search/Lucene, general API enhancements)
 
Thomas and Halvdan is doing the Back end (Hibernate search/Lucene, general API enhancements)
 
Trine and Johannes is doing the Front end (Forum view, AngularJS)  
 
Trine and Johannes is doing the Front end (Forum view, AngularJS)  
==Lacking from this wiki:==
+
 
 +
=Lacking from this wiki:=
 
*Screenshots and screen flows
 
*Screenshots and screen flows
 
*Documented learning during project
 
*Documented learning during project
 
*Suggested improvements to APIs etc
 
*Suggested improvements to APIs etc
  
==Time schedule / Milestones==
+
=Time schedule / Milestones=
 
* <s>01. nov: Finish wiki-page and make link to repository</s>
 
* <s>01. nov: Finish wiki-page and make link to repository</s>
 
* <s>15. nov: First prototype of features</s> <- Front end not on schedule due to work load in other courses.
 
* <s>15. nov: First prototype of features</s> <- Front end not on schedule due to work load in other courses.
Line 141: Line 149:
 
* 08. dec: Deliver prototype
 
* 08. dec: Deliver prototype
  
==Resources==
+
=Resources=
 
*Repository: https://code.launchpad.net/~spring-minions/dhis2-academy/springminions-forum
 
*Repository: https://code.launchpad.net/~spring-minions/dhis2-academy/springminions-forum
  
==DHIS2 bugs==
+
=DHIS2 bugs=
 
* '''Fixed''' interpretations pagination not working as intended - See commit [http://bazaar.launchpad.net/~spring-minions/dhis2-academy/springminions-forum/revision/12815]
 
* '''Fixed''' interpretations pagination not working as intended - See commit [http://bazaar.launchpad.net/~spring-minions/dhis2-academy/springminions-forum/revision/12815]
 
* '''Open''' Choosing views through request parameter doesn't work for interpretations. Try for yourself here [http://apps.dhis2.org/demo/api/interpretations.json?viewClass=export] <- must be logged in to the DHIS2 demo application
 
* '''Open''' Choosing views through request parameter doesn't work for interpretations. Try for yourself here [http://apps.dhis2.org/demo/api/interpretations.json?viewClass=export] <- must be logged in to the DHIS2 demo application
 +
 +
==Bugs in search==
 +
*'''Open''' Pager information not compatible with search on interpretations. Shows information for all interpretations.

Latest revision as of 20:03, 10 December 2013

Overview

In vanilla DHIS2 there is a (fairly bare bones) "interpretations" system. In essence, this system allows users to annotate analytical objects such as charts, maps and tables with their interpretation (or other relevant information) of the data. UX-wise, interpretations are browsed through a Facebook-style news feed. Except the ability to comment an interpretation shared by another user, some obvious major features are missing:

  • There is no way for a user to actively keep track of an interpretation they find interesting. Over time it will be swallowed by the newsfeed and there is no URL to a specific interpretation supplied to the user.
  • There is no functionality to search interpretations for issues/items of particular interest.

In short, the existing interpretations feature set is only usable for posting (fairly) disposable data, and is not fit for encouraging proper discussion and interaction between users.

The task of this group project is to attempt to mend some of these issues through creating a separate web-app for exploring and discussing interpretations utilising the DHIS2 web-api.

Key project aspects and technologies

  • Hibernate search
  • Gameification / content rating
  • AngularJS

Group members

  • Thomas Iversen
  • Trine Frimannslund
  • Halvdan Hoem Grelland
  • Johannes Akse

Major aspects

The existing DHIS2 web-api is lacking a lot of the basic features needed to achieve our goals, therefore we have elected to focus a large amount of resources on implementing new features and extending current ones where need be.

New API features

  • Search feature
  • Content rating/voting system


Back end

The needed amendments and additions to the web API is as follows:

  • A (reasonably powerful) search feature for interpretations and associated comments - STATUS: IN DONE
  • The ability to title posts/interpretations - STATUS: DONE
  • Exposing user/owner/creator information along with the content - STATUS: DONE
  • The ability to rate content given by others. - STATUS: DONE

Search

Search will be implemented using Hibernate Search, which integrates the Apache Lucene indexing and search engine with the Hibernate persistence model already used for DHIS2. The wanted key features of the search implementation is:

  • Searchable by text/comments
  • Searchable by user/owner
  • Searchable by analytical item (chart, map, pivot)
  • Searchable by data elements + indicators + data set

Search features added

We can now search on text in interpretations, text in comments and user. These are part of the standard search string. In addition to this, we have implemented a more advanced search which allows us to search on type(chart, map, reporttable, dataset) and date(from and to). All these searchmethods can be used either with or without pagination. There is also implemented a more specific search on a user, to get all interpretations and comments from a specific user.

Use of searchmethods in the API

To make a search on text in interpretations and comments and on users:

To get results only posted by a specific user:

To make a advanced search with type:

To make a advanced search with date:

Advanced search with type, date and pagination:

Hononyms / synonyms

We implemented search on synonyms in revision 12828/12829 with a synonymlist from WordNet. This was later removed for causing compilation problems on some computers. Another reason why it was removed is that the searches were very general. You could search for almost any word and get lots of results, most of which were quite irrelevant. This should not be enabled by default, and a better fit would be as an option under advanced search. This has not been a priority and therefore not implemented.

Avatar

To get a more forum-like feeling we have implemented avatars for users. To upload an avatar to a user in the wep-api:

To get a users avatar from the wep-api:

Where "uid" is a specific users unique id.

Rating system

Users now have the opportunity to give rating to interpretations. This is done in the web-api:

Where "uid" is the unique id of the specific interpretations you want to rate, and "rating" is the number of points you want give. This is limited to minimum 1 and maximum 5.

Database

We have made some minor changes to the database to support the wanted functionality.

  • Added titles to interpretations
  • Created a new table to support rating of interpretations
  • Added two new columns in the userinfo table to support avatars

Note:

We have chosen to freely add to the existing backend, including database schema and API behaviour. We do, however, strive to make any changes compatible with the existing application and existing installations without breaking features or data stores. We also strive to stick as well as possible to the existing conventions of the DHIS2 source code framework by keeping any additions as modularised and separate as possible.

Front end

In short, we wish to achieve a "forum style" view of the interpretations. We believe this is a cleaner and more user friendly presentation format. Do note, though, that this will not attempt to replicate the functionality and architecture of traditional web forums such as phpbb et. al. The underlying data simply don't support this type of structure as there are no categories, no titles etc.

Here is a (way too long) list of the ambitions of the web app:

Front page view with subject, last updated date, last author

  • baseurl
  • Order by date
  • Angular templates(forum view and interpretations view.
  • Search tab and bookmarks tab
  • Fetch more posts when scrolldown
  • Display type icon
  • Display avatar with link to userpage

*

  • Style(css)

Comment hierarchy

*Show comments *Write comments

  • display comment within comment

*Style(css)

Like / dislike / user rating

*Display rating.

  • WIP at backend team.

Search

*Fetching and displaying standard search results

  • Fetching and displaying advanced search results

Wanted (but not prioritised) features

  • View posts per user

*Avatar for users

  • Browsing interpretations by Categories(diagnosis)?
  • Attach data / files to interpretations
  • Moderation feature
  • RSS / Atom support

Division of tasks

Thomas and Halvdan is doing the Back end (Hibernate search/Lucene, general API enhancements) Trine and Johannes is doing the Front end (Forum view, AngularJS)

Lacking from this wiki:

  • Screenshots and screen flows
  • Documented learning during project
  • Suggested improvements to APIs etc

Time schedule / Milestones

  • 01. nov: Finish wiki-page and make link to repository
  • 15. nov: First prototype of features <- Front end not on schedule due to work load in other courses.
  • 30. nov: Finished prototype
  • 08. dec: Deliver prototype

Resources

DHIS2 bugs

  • Fixed interpretations pagination not working as intended - See commit [1]
  • Open Choosing views through request parameter doesn't work for interpretations. Try for yourself here [2] <- must be logged in to the DHIS2 demo application

Bugs in search

  • Open Pager information not compatible with search on interpretations. Shows information for all interpretations.