Skip to content

Commit 1d63d99

Browse files
committed
Addressed code review comments #945
1 parent 383462a commit 1d63d99

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

grails-app/conf/application.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ app {
501501
if (!ala.baseURL) {
502502
ala.baseURL = "https://www.ala.org.au"
503503
}
504-
bie.ws.url = "https://www.bie.ala.org.au/ws"
505-
bie.url = "https://www.bie.ala.org.au"
504+
bie.ws.url = "https://bie-ws.ala.org.au/"
505+
bie.url = "https://bie.ala.org.au/"
506506

507507
if (!collectory.baseURL) {
508508
//collectory.baseURL = "https://collectory-dev.ala.org.au/"

grails-app/domain/au/org/ala/ecodata/Record.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import org.bson.types.ObjectId
66

77
class Record {
88
// def grailsApplication
9+
/** Represents a species guid that was unable to be matched against the ALA names list */
10+
static final String UNMATCHED_GUID = "A_GUID"
911

1012
static mapping = {
1113
occurrenceID index: true

grails-app/services/au/org/ala/ecodata/ParatooService.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ class ParatooService {
20522052
}
20532053

20542054
// record is only created if guid is present
2055-
result.guid = result.guid ?: "A_GUID"
2055+
result.guid = result.guid ?: Record.UNMATCHED_GUID
20562056
result
20572057
}
20582058
}

grails-app/services/au/org/ala/ecodata/SpeciesReMatchService.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class SpeciesReMatchService {
8585
name = name?.toLowerCase() ?: ""
8686
cacheService.get('bie-search-auto-' + name, {
8787
def encodedQuery = URLEncoder.encode(name ?: '', "UTF-8")
88-
def url = "${grailsApplication.config.getProperty('bie.url')}ws/search/auto.jsonp?q=${encodedQuery}&limit=${limit}&idxType=TAXON"
88+
def url = "${grailsApplication.config.getProperty('bie.ws.url')}ws/search/auto.jsonp?q=${encodedQuery}&limit=${limit}&idxType=TAXON"
8989

9090
webService.getJson(url)
9191
})

src/main/groovy/au/org/ala/ecodata/metadata/SpeciesUrlGetter.groovy

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package au.org.ala.ecodata.metadata
22

33
import pl.touk.excel.export.getters.Getter
4+
import au.org.ala.ecodata.Record
45

56
class SpeciesUrlGetter extends OutputDataGetter implements Getter<String> {
67
String biePrefix
@@ -15,8 +16,10 @@ class SpeciesUrlGetter extends OutputDataGetter implements Getter<String> {
1516
if (!val?.name) {
1617
return ""
1718
}
18-
19-
return val?.guid ? biePrefix+val.guid : "Unmatched name"
19+
if (!val?.guid || val.guid == Record.UNMATCHED_GUID) {
20+
return "Unmatched name"
21+
}
22+
return biePrefix+val.guid
2023
}
2124

2225

src/main/groovy/au/org/ala/ecodata/reporting/TabbedExporter.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TabbedExporter {
2727
ReportingService reportingService = Holders.grailsApplication.mainContext.getBean("reportingService")
2828
ActivityFormService activityFormService = Holders.grailsApplication.mainContext.getBean("activityFormService")
2929
OutputModelProcessor processor = new OutputModelProcessor()
30-
String biePrefix = Holders.grailsApplication.config.getProperty("bie.url")+'/species/'
30+
String biePrefix = Holders.grailsApplication.config.getProperty("bie.url")+'species/'
3131

3232
static String DATE_CELL_FORMAT = "dd/MM/yyyy"
3333
Map<String, AdditionalSheet> sheets

0 commit comments

Comments
 (0)