Difference between revisions of "IRStats 2"

From EPrints Documentation
Jump to: navigation, search
Line 12: Line 12:
 
The following perl libraries are required:
 
The following perl libraries are required:
  
  * Geo::IP or Geo::IP::PurePerl
+
* Geo::IP or Geo::IP::PurePerl
  * Date::Calc
+
* Date::Calc
  
 
Both can usually be installed via your Linux package managers (apt-get, yum, ...) or via CPAN if you must.
 
Both can usually be installed via your Linux package managers (apt-get, yum, ...) or via CPAN if you must.
Line 26: Line 26:
 
==== EPrints 3.3.1 to 3.3.10 ====
 
==== EPrints 3.3.1 to 3.3.10 ====
  
Install IRStats from the bazaar following installation of dependencies.  Two patches need to be applied if you would like to use the Google "map of the world" in your reports.  Everything else should work as normal without the patches.
+
Following bazaar installation, two patches need to be applied if you would like to use the Google "map of the world" in your reports.  Everything else should work as normal without the patches.
  
 
The patches relate to an incompatibility between the Prototype JS library (used by EPrints) and Google Charts (used by IRStats2). The two patches you need to apply are:
 
The patches relate to an incompatibility between the Prototype JS library (used by EPrints) and Google Charts (used by IRStats2). The two patches you need to apply are:
Line 34: Line 34:
  
 
=== EPrints 3.2 ===
 
=== EPrints 3.2 ===
 +
 +
You will have to manually copy the required files to your EPrints installation path. It is a low-risk operation since IRStats2 is a true add-on to EPrints and it does not interact with the core software.
 +
 +
Get the files from [https://github.com/eprints/irstats2|]GitHub or by following this [https://github.com/eprints/irstats2/tarball/master|direct link] [tar.gz].  Copy the modules and various configuration files to your local archive (create the bin and cgi directories if they don't exist):
 +
<pre>
 +
cp bin/* /opt/eprints3/archives/ARCHIVEID/bin/
 +
cp cfg/* /opt/eprints3/archives/ARCHIVEID/cfg/
 +
cp cgi/* /opt/eprints3/archives/ARCHIVEID/cgi/
 +
</pre>
 +
 +
It's a good idea to run a test at this point to see if anything has broken:
 +
 +
/opt/eprints3/bin/epadmin test
 +
 +
Add in the <head> sections of your template files (usually located in /opt/eprints3/archives/ARCHIVEID/cfg/lang/en/templates/) the following:
 +
 +
<script type="text/javascript" src="http://www.google.com/jsapi">// <!-- No script --></script>
 +
<script type="text/javascript">
 +
        google.load("visualization", "1", {packages:["corechart", "geochart"]});
 +
</script>
 +
 +
Finally, restart the web server

Revision as of 13:54, 5 December 2014


IRStats2 is a statistical framework for EPrints - It comes with some cool default tools and reports and it can also be customised to, for instance, add new metrics or data sets. It has a Javascript API to include stats on any pages you want.

IRStats2 is developed against EPrints 3.3 but it was written to also work on EPrints 3.2. Older versions of EPrints are, however, not supported.

Installation

Dependencies

The following perl libraries are required:

* Geo::IP or Geo::IP::PurePerl
* Date::Calc

Both can usually be installed via your Linux package managers (apt-get, yum, ...) or via CPAN if you must.

EPrints 3.3

IRStats2 can be installed directly via the Bazaar on EPrints 3.3 which makes the installation much simpler than with EPrints 3.2.

EPrints 3.3.11 onwards

Install IRStats from the bazaar following installation of dependencies. Restarting apache afterwards is recommended.

EPrints 3.3.1 to 3.3.10

Following bazaar installation, two patches need to be applied if you would like to use the Google "map of the world" in your reports. Everything else should work as normal without the patches.

The patches relate to an incompatibility between the Prototype JS library (used by EPrints) and Google Charts (used by IRStats2). The two patches you need to apply are:

EPrints 3.2

You will have to manually copy the required files to your EPrints installation path. It is a low-risk operation since IRStats2 is a true add-on to EPrints and it does not interact with the core software.

Get the files from [1]GitHub or by following this link [tar.gz]. Copy the modules and various configuration files to your local archive (create the bin and cgi directories if they don't exist):

cp bin/* /opt/eprints3/archives/ARCHIVEID/bin/
cp cfg/* /opt/eprints3/archives/ARCHIVEID/cfg/
cp cgi/* /opt/eprints3/archives/ARCHIVEID/cgi/

It's a good idea to run a test at this point to see if anything has broken:

/opt/eprints3/bin/epadmin test

Add in the <head> sections of your template files (usually located in /opt/eprints3/archives/ARCHIVEID/cfg/lang/en/templates/) the following:

<script type="text/javascript" src="http://www.google.com/jsapi">// </script> <script type="text/javascript">

       google.load("visualization", "1", {packages:["corechart", "geochart"]});

</script>

Finally, restart the web server