File tree 4 files changed +40
-2
lines changed
4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,8 @@ disableAlertLinks: false
214
214
disableLoggerLinks : false
215
215
biocacheServicesUrl : https://biocache.ala.org.au/ws
216
216
biocacheUiURL : https://biocache.ala.org.au
217
+ # eventsUiURL: https://events.ala.org.au/?datasetKey=
218
+ # eventsURL: https://api.ala.org.au/event/graphql
217
219
isPipelinesCompatible : true
218
220
showExtraInfoInDataSetsView.enabled : false
219
221
showExtraInfoInDataSetsView.relativeTime : false
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ public.show.rt.des04=Looking up... the number of records that
142
142
public.show.rt.des05=can be accessed through the {0}
143
143
public.show.rt.des06=Click to view all records for the
144
144
public.show.rt.des07=No database records for this collection can be accessed through the {0}
145
+ public.show.rt.des08=events
145
146
public.show.setprogress.01=There is no estimate of the total number of {0} in this collection.
146
147
public.show.setprogress.02=No records are available for viewing in the {0}
147
148
public.show.setprogress.accessions=accessions
Original file line number Diff line number Diff line change 7
7
};
8
8
9
9
// records
10
- if (${ ! instance. hasProperty(' resourceType' ) || instance. resourceType == ' records' } ) {
10
+ if (${ ! instance. hasProperty(' resourceType' ) || instance. resourceType == ' records' || instance . resourceType == ' events ' } ) {
11
11
// summary biocache data
12
12
var queryUrl = CHARTS_CONFIG.biocacheServicesUrl + "/occurrences/search?pageSize=0&q=${ facet } :${ instance. uid } ";
13
13
40
40
});
41
41
}
42
42
43
+ if (${ instance. hasProperty(' resourceType' ) && instance. resourceType == ' events' && org.apache.commons.lang. StringUtils . isNotEmpty(grailsApplication. config. eventsURL ?: ' ' ) } ) {
44
+ // summary events data
45
+ var queryUrl = '${ grailsApplication. config. eventsURL } ';
46
+ var body = {
47
+ query: 'query list($datasetKey: JSON){' +
48
+ 'eventSearch(predicate: {type: equals, key: \"datasetKey\", value: $datasetKey}) {' +
49
+ 'documents(size: 1) {total}' +
50
+ '}' +
51
+ '}',
52
+ variables: '{"datasetKey":"${ instance. uid } "}'
53
+ }
54
+
55
+ $.ajax({
56
+ url: queryUrl,
57
+ dataType: 'json',
58
+ data: body,
59
+ timeout: 30000,
60
+ complete: function(jqXHR, textStatus) {
61
+ if (textStatus == 'timeout' || textStatus == 'error') {
62
+ // noData();
63
+ }
64
+ },
65
+ success: function(data) {
66
+ if (data.data.eventSearch.documents.total > 0){
67
+ $('#eventRecordsWrapper').css({display:'block'});
68
+ $('#totalEventCount').html(data.data.eventSearch.documents.total.toLocaleString() + " ${ g. message(code: ' public.show.rt.des08' ) } ");
69
+ }
70
+ }
71
+ });
72
+ }
73
+
43
74
</asset:script >
44
75
45
76
<asset:script type =" text/javascript" >
Original file line number Diff line number Diff line change 5
5
<a id =" totalRecordCountLink" href =" ${ grailsApplication. config. biocacheUiURL } /occurrences/search?q=${ facet } :${ instance. uid } " >
6
6
</a >
7
7
</h3 >
8
+ <h3 id =" eventRecordsWrapper" style =" display :none " >
9
+ <a id =" totalEventCount" href =" ${ grailsApplication. config. eventsUiURL } ${ instance. uid } " >
10
+ </a >
11
+ </h3 >
8
12
9
13
<h4 ><g:message code =" dataAccess.title" /></h4 >
10
14
<div class =" dataAccess btn-group-vertical" >
20
24
<cl:createNewAnnotationsAlertsLink query =" ${ facet } :${ instance. uid } " displayName =" ${ instance. name } "
21
25
linkText =" ${ g. message(code: ' dataAccess.alert.annotations.alt' ) } " altText =" ${ g. message(code: ' dataAccess.alert.annotations' ) } ${ instance. name } " />
22
26
</div >
23
- </div >
27
+ </div >
You can’t perform that action at this time.
0 commit comments