SUNScholar/Elastic Statistics/5.X

From Libopedia
Jump to navigation Jump to search
Back to Elastic Statistics

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:

Chart Styling

Modify the CSS at the following location: