Commit 9b0f6f245347a5c7975d4f508d4d19314b6927b7

Authored by Fernando Ribeiro
1 parent 48009bb959

Added the README.md (missing)

Showing 2 changed files with 47 additions and 49 deletions   Show diff stats
README
1   -To add piwik (statistics access for openaire)
2   -
3   -In the footer add the following code:
4   -
5   - <%@ page import="org.dspace.core.ConfigurationManager" %>
6   - <%@ page import="org.dspace.content.Item" %>
7   -
8   - <%
9   -
10   - String piwikID = ConfigurationManager.getProperty("piwik.id");
11   - String baseUrl = ConfigurationManager.getProperty("dspace.hostname");
12   - String handle;
13   -
14   -
15   - try{
16   - Item item = (Item) request.getAttribute("item");
17   -
18   - // get the handle if the item has one yet
19   - handle = item.getHandle();
20   - }
21   - catch(Exception e){
22   - handle = null;
23   - //e.printstacktrace();
24   - }
25   -
26   - %>
27   -
28   - <!-- Piwik -->
29   - <script type="text/javascript">
30   - var _paq = _paq || [];
31   - _paq.push(['trackPageView']);
32   - _paq.push(['enableLinkTracking']);
33   - (function() {
34   - var u="//analytics.openaire.eu/";
35   - _paq.push(['setTrackerUrl', u+'piwik.php']);
36   - _paq.push(['setSiteId', <%=piwikID%>]);
37   - <% if(handle != null){%>
38   - _paq.push(['setCustomVariable', 1, 'oaipmhID',"oai:<%= baseUrl %>/<%=handle %>", 'page']);
39   - <%}%>
40   - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
41   - g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
42   - })();
43   - </script>
44   - <noscript><p><img src="//analytics.openaire.eu/piwik.php?idsite=<%=piwikID%>" style="border:0;" alt="" /></p></noscript>
45   -
46   -
47   -And in the build.properties have to be defined piwik.id with the piwik of the institution.
48   -
49   -
50 1 DSpace version information can be viewed online at
51 2 - https://wiki.duraspace.org/display/DSDOC/
52 3  
... ...
README.md
... ... @@ -0,0 +1,47 @@
  1 +To add piwik (statistics access for openaire)
  2 +
  3 +In the footer add the following code:
  4 +
  5 + <%@ page import="org.dspace.core.ConfigurationManager" %>
  6 + <%@ page import="org.dspace.content.Item" %>
  7 +
  8 + <%
  9 +
  10 + String piwikID = ConfigurationManager.getProperty("piwik.id");
  11 + String baseUrl = ConfigurationManager.getProperty("dspace.hostname");
  12 + String handle;
  13 +
  14 +
  15 + try{
  16 + Item item = (Item) request.getAttribute("item");
  17 +
  18 + // get the handle if the item has one yet
  19 + handle = item.getHandle();
  20 + }
  21 + catch(Exception e){
  22 + handle = null;
  23 + //e.printstacktrace();
  24 + }
  25 +
  26 + %>
  27 +
  28 + <!-- Piwik -->
  29 + <script type="text/javascript">
  30 + var _paq = _paq || [];
  31 + _paq.push(['trackPageView']);
  32 + _paq.push(['enableLinkTracking']);
  33 + (function() {
  34 + var u="//analytics.openaire.eu/";
  35 + _paq.push(['setTrackerUrl', u+'piwik.php']);
  36 + _paq.push(['setSiteId', <%=piwikID%>]);
  37 + <% if(handle != null){%>
  38 + _paq.push(['setCustomVariable', 1, 'oaipmhID',"oai:<%= baseUrl %>/<%=handle %>", 'page']);
  39 + <%}%>
  40 + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
  41 + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  42 + })();
  43 + </script>
  44 + <noscript><p><img src="//analytics.openaire.eu/piwik.php?idsite=<%=piwikID%>" style="border:0;" alt="" /></p></noscript>
  45 +
  46 +
  47 +And in the build.properties have to be defined piwik.id with the piwik of the institution.
0 48 \ No newline at end of file
... ...