Difference between revisions of "SUNScholar/Elastic Statistics/5.X"
(Created page with "<center> '''Back to Elastic Statistics''' </center> ==Requirements== ===Java version=== {{Java7}} ===Source symlink=== Please see: http://wi...") |
|||
| (6 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
===Java version=== | ===Java version=== | ||
{{Java7}} | {{Java7}} | ||
| − | |||
| − | |||
| − | |||
| − | |||
==Installation== | ==Installation== | ||
| Line 14: | Line 10: | ||
Type the following as the "dspace" user: | Type the following as the "dspace" user: | ||
nano $HOME/{{Source}}/dspace/config/xmlui.xconf | nano $HOME/{{Source}}/dspace/config/xmlui.xconf | ||
| − | Enable "Elastic Statistics" and disable "SOLR Statistics". | + | <font color="red">'''Enable "Elastic Statistics" and disable "SOLR Statistics".'''</font> |
Remove the enclosing markers to the left and right of the Elastic Search aspect and add markers around the Statistics aspect. | Remove the enclosing markers to the left and right of the Elastic Search aspect and add markers around the Statistics aspect. | ||
| Line 66: | Line 62: | ||
cd $HOME/{{Source}}/dspace-xmlui/src/main/resources/aspects/StatisticsElasticSearch | cd $HOME/{{Source}}/dspace-xmlui/src/main/resources/aspects/StatisticsElasticSearch | ||
| − | + | mv sitemap.xmap sitemap.xmap-orig | |
wget --no-check-certificate https://gist.githubusercontent.com/peterdietz/0bac2c720d8373477897/raw/44c8aaf9703c216f72fae82c6aa3ea1da67809fa/sitemap.xmap | wget --no-check-certificate https://gist.githubusercontent.com/peterdietz/0bac2c720d8373477897/raw/44c8aaf9703c216f72fae82c6aa3ea1da67809fa/sitemap.xmap | ||
| Line 75: | Line 71: | ||
===Step 5 - [[SUNScholar/Rebuild_DSpace|Rebuild DSpace]]=== | ===Step 5 - [[SUNScholar/Rebuild_DSpace|Rebuild DSpace]]=== | ||
| − | + | ||
===Step 6 - [[SUNScholar/Elastic Statistics/Import Logs|Import old log data]]=== | ===Step 6 - [[SUNScholar/Elastic Statistics/Import Logs|Import old log data]]=== | ||
| − | |||
==Customisation== | ==Customisation== | ||
| Line 94: | Line 89: | ||
Modify the CSS at the following location: | Modify the CSS at the following location: | ||
*https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/static/css/statisticsElasticSearch/style.css | *https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/static/css/statisticsElasticSearch/style.css | ||
| − | + | [[Category:Customisation]] | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 17:41, 25 September 2016
Back to Elastic Statistics
Contents
Requirements
Java version
Please see: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Java_Version_7
Installation
Step 1 - Modify "xmlui.xconf"
Type the following as the "dspace" user:
nano $HOME/source/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.
<!-- ========================
Usage Statistics Engines
======================== -->
<!-- By default, DSpace uses a Statistics engine based on SOLR -->
<!-- <aspect name="Statistics" path="resource://aspects/Statistics/" /> -->
<!--
If you prefer to use "Elastic Search" Statistics, you can uncomment the below
aspect and COMMENT OUT the default "Statistics" aspect above.
You must also enable the ElasticSearchLoggerEventListener.
-->
<aspect name="Statistics - Elastic Search" path="resource://aspects/StatisticsElasticSearch/" />
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
Step 2 - Enable the Elastic Statistics event listener
Type the following as the "dspace" user:
nano $HOME/source/dspace-xmlui/src/main/webapp/WEB-INF/spring/applicationContext.xml
Enable the Elastic Statistics event listener (remove the enclosing markers). See example below:
<!-- Elastic Search -->
<bean class="org.dspace.statistics.ElasticSearchLoggerEventListener">
<property name="eventService">
<ref bean="dspace.eventService" />
</property>
</bean>
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
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
Step 4 - Enable public viewing of statistics
Custom modification
Download the modified "sitemap.xmap" aspect file which allows for public viewing of statistics. (Thanks to Peter Dietz of Longsight)
Type the following:
cd $HOME/source/dspace-xmlui/src/main/resources/aspects/StatisticsElasticSearch
mv sitemap.xmap sitemap.xmap-orig
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
Step 6 - Import old log data
Customisation
At present the elastic statistics are not very configurable. See below:
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: