Skip to content

Commit

Permalink
logger URL configurable
Browse files Browse the repository at this point in the history
logger URL configurable
  • Loading branch information
djtfmartin committed Sep 17, 2014
1 parent efafe25 commit 3729127
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ app.build=163
app.grails.version=2.3.8
app.name=collectory
app.servlet.version=2.5
app.version=1.1.2-SNAPSHOT
app.version=1.1.2
2 changes: 1 addition & 1 deletion grails-app/views/public/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ function onLoadCallback() {
// $('div.learnMaps').css('display','none');
// }

loadDownloadStats("${instance.uid}","${instance.name}", "1002");
loadDownloadStats("${grailsApplication.config.loggerURL}", "${instance.uid}","${instance.name}", "1002");

// records
$.ajax({
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/public/showDataProvider.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
\************************************************************/
function onLoadCallback() {
// stats
loadDownloadStats("${instance.uid}", "${instance.name}", "1002");
loadDownloadStats("${grailsApplication.config.loggerURL}", "${instance.uid}", "${instance.name}", "1002");
}
/************************************************************\
Expand Down
4 changes: 2 additions & 2 deletions grails-app/views/public/showDataResource.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@
function onLoadCallback() {
// stats
if (${instance.resourceType == 'website'}) {
loadDownloadStats("${instance.uid}","${instance.name}", "2000");
loadDownloadStats("${grailsApplication.config.loggerURL}", "${instance.uid}","${instance.name}", "2000");
} else if (${instance.resourceType == 'records'}) {
loadDownloadStats("${instance.uid}","${instance.name}", "1002");
loadDownloadStats("${grailsApplication.config.loggerURL}", "${instance.uid}","${instance.name}", "1002");
}

// species pages
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/public/showInstitution.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
function onLoadCallback() {

// stats
loadDownloadStats("${instance.uid}","${instance.name}", "1002");
loadDownloadStats("${grailsApplication.config.loggerURL}", "${instance.uid}","${instance.name}", "1002");

// records
$.ajax({
Expand Down
7 changes: 5 additions & 2 deletions web-app/js/collectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,15 @@ function contactCurator(email, firstName, uid, instUid, name) {
/************************************************************\
******* LOAD DOWNLOAD STATS *****
\************************************************************/
function loadDownloadStats(uid, name, eventType) {
function loadDownloadStats(loggerServicesUrl, uid, name, eventType) {
if (eventType == '') {
// nothing to show
return;
}
var loggerServicesUrl = "http://logger.ala.org.au/service/";
if (loggerServicesUrl == ''){
return;
}

var url = loggerServicesUrl + uid + "/events/" + eventType + "/counts.json";
$.ajax({
url: url,
Expand Down

0 comments on commit 3729127

Please sign in to comment.