SUNScholar/Elastic Statistics/4.X

Back to Elastic Statistics

Step 1 - Modify "xmlui.xconf"
Type the following as the "dspace" user: nano $HOME//dspace/config/xmlui.xconf Enable "Elastic Statistics" and disable "SOLR Statistics".

Remove the enclosing markers to the left and right of the Elastic Search aspect and add markers around the Statistics aspect.

See an example below.



Step 2 - Enable the Elastic Statistics event listener
Type the following as the "dspace" user: nano $HOME//dspace-xmlui/src/main/webapp/WEB-INF/spring/applicationContext.xml Enable the Elastic Statistics event listener (remove the enclosing markers). See example below:  

Step 3 - Open network ports
Also see: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Firewall

Type the following: sudo ufw allow 9200

sudo ufw allow 9300

Custom modification
Download the modified "sitemap.xmap" aspect file which allows for public viewing of statistics. (Thanks to [mailto:peter@longsight.com Peter Dietz] of Longsight)

Type the following: cd $HOME//dspace-xmlui/src/main/resources/aspects/StatisticsElasticSearch

rm sitemap.xmap

wget --no-check-certificate https://gist.githubusercontent.com/peterdietz/0bac2c720d8373477897/raw/44c8aaf9703c216f72fae82c6aa3ea1da67809fa/sitemap.xmap

Official setup

 * Create the group "statistics_viewer" in DSpace and add other groups or e-persons to the group.
 * These added members will be allowed to view the "Elastic Statistics" after they have logged into DSpace.

Step 5 - Rebuild DSpace
Click on the heading above.

Step 6 - Import old log data
Click on the heading above.

Customisation
At present the elastic statistics are not very configurable. See below:
 * https://github.com/DSpace/DSpace/blob/master/dspace/config/modules/elastic-search-statistics.cfg

Default Country View
By default the US map is displayed for top cities downloads, however not all institutions would like to display downloads from the US only.

At Stellenbosch University in South Africa we would like to see city downloads for South Africa.

At present this parameter is hard coded, If you want to change it then modify the source code starting at the following locations:
 * https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/statisticsElasticSearch/ElasticSearchStatsViewer.java#L79
 * https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/static/js/statisticsElasticSearch/visualizeData.js#L321

Chart Styling
Modify the CSS at the following location:
 * https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/static/css/statisticsElasticSearch/style.css