Updateing stats

19 views
Skip to first unread message

Anja Le Blanc

unread,
Oct 18, 2013, 8:35:15 AM10/18/13
to dspac...@googlegroups.com
Hello,

I got now code to update stats when an item is viewed or a bitstream downloaded.
There is a config file in which you can specify whether stats should be updated or not. If set to true a UsageEvent is fired.
I had some trouble receiving those events; the only way I found was to change the servlet to a SpringServlet so that I could inject the UsageEventListeners. I am not a Spring expert and I have no idea whether I could have done something else.

In our instance we are interested in the data of the user rather than the application using REST. Since I can't attach the original HttpRequest to the REST query I added optional parameters for the user's IP, user agent,... That meant I modified the UsageEvent class to make it work without an HttpRequest. If the request does not have a parameter with an IP - the HttpRequest is used for stats.

I am not too happy changing the main DSpace API for that but I could not see an alternative.

Best regards
Anja

Anja Le Blanc

unread,
Oct 28, 2013, 11:49:21 AM10/28/13
to dspac...@googlegroups.com
Update:

Communities view and Collections view now trigger usage events (if enabled).

Peter Dietz

unread,
Oct 29, 2013, 12:26:49 PM10/29/13
to dspac...@googlegroups.com
I have merged in this Pull Request. I believe it was complete, if you had more to add to it, you can piggy-back in a sub-sequent tree.
Reply all
Reply to author
Forward
0 new messages