Extension repository ratings
- XWiki
- Implementation
- Completed
- [xwiki-devs] [Proposal] Extension repository ratings ( http://xwiki.markmail.org/message/k7gwpnrx77vxtfrk ) on Nov 17, 2014
- [xwiki-devs] Storing protected information in a wiki ( http://xwiki.markmail.org/message/twdgrwmr5i53fbu5 ) on Nov 18, 2014
Description
I'm looking to improve the Extensions Repository Application by implementing a rating system.
The ratings for each individual extension should be available from the Extension Repository Application as well as from Extension Manager.
Besides its first role to weed out the extensions of questionable quality this would also be a good way to differentiate between extensions which were developed to fulfill a specific need and very handy extensions which are commonly used.
The information regarding ratings should not be modifiable by anyone except admins.
So in the current implementation of the Repository App, the ratings can't just be an object on the extension page.
Storing the rating where anyone can modify it would make the feature pretty useless.
Requirements
- Store the ratings somewhere nobody (except admins) can modify it
- Update the Extension REST API so that it includes ratings information
- information should be sent both ways if we want to be able to rate extensions from within Extension Manager
- Add a new java interface to manipulate ratings in repositories or directly in extensions
- Call the new API and display the rating in the Extension Manager UI
Implementation
1. Store the ratings somewhere nobody (except admins) can modify it
To start implementing this feature we first have to decide what is the best approach to store the relevant data.
There are a few approaches to storing this data:
- create a custom table in the database
- having all the information in a single place
- not accessible by common users
- I'm referring to the fact that they don't have access to alter the information contained here other than their own. And this is through an API
- associating a new document for each extension in which we would store the ratings information
- this would contain only the ratings information
- the associated document would be editable only by admins
- store ratings in the user profile
- store each rating a user gives to an extension in his profile
- to show the average rating on each extension page we have to query all ratings objects which have the extension id matching the current extension page
- refactor the Extension Repository App so that regular users can edit just parts of an extension page
- making a different UI for adding/editing extension information
- for example a single doc used to edit the extension information which receives the actual extension doc as a parameter ( ../bin/view/Extension/Editor?extension=Extension.MyExtension )
- the extensions will still be viewable by accessing ../bin/view/Extension/Extension_Name but the editing part will be done as described above
- with this approach we have all the neccessary data in one place so we don't need to execute extra queries
- making a different UI for adding/editing extension information
Usecases
While implementing this feature we should keep in mind what improvements could be brought to this in the future so that we don't end up hitting a brick wall.
Possible improvements for the future: