Skip to content

Commit

Permalink
Addressed code review comments #945
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed May 16, 2024
1 parent 383462a commit 1d63d99
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ app {
if (!ala.baseURL) {
ala.baseURL = "https://www.ala.org.au"
}
bie.ws.url = "https://www.bie.ala.org.au/ws"
bie.url = "https://www.bie.ala.org.au"
bie.ws.url = "https://bie-ws.ala.org.au/"
bie.url = "https://bie.ala.org.au/"

if (!collectory.baseURL) {
//collectory.baseURL = "https://collectory-dev.ala.org.au/"
Expand Down
2 changes: 2 additions & 0 deletions grails-app/domain/au/org/ala/ecodata/Record.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import org.bson.types.ObjectId

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

static mapping = {
occurrenceID index: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ class ParatooService {
}

// record is only created if guid is present
result.guid = result.guid ?: "A_GUID"
result.guid = result.guid ?: Record.UNMATCHED_GUID
result
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SpeciesReMatchService {
name = name?.toLowerCase() ?: ""
cacheService.get('bie-search-auto-' + name, {
def encodedQuery = URLEncoder.encode(name ?: '', "UTF-8")
def url = "${grailsApplication.config.getProperty('bie.url')}ws/search/auto.jsonp?q=${encodedQuery}&limit=${limit}&idxType=TAXON"
def url = "${grailsApplication.config.getProperty('bie.ws.url')}ws/search/auto.jsonp?q=${encodedQuery}&limit=${limit}&idxType=TAXON"

webService.getJson(url)
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package au.org.ala.ecodata.metadata

import pl.touk.excel.export.getters.Getter
import au.org.ala.ecodata.Record

class SpeciesUrlGetter extends OutputDataGetter implements Getter<String> {
String biePrefix
Expand All @@ -15,8 +16,10 @@ class SpeciesUrlGetter extends OutputDataGetter implements Getter<String> {
if (!val?.name) {
return ""
}

return val?.guid ? biePrefix+val.guid : "Unmatched name"
if (!val?.guid || val.guid == Record.UNMATCHED_GUID) {
return "Unmatched name"
}
return biePrefix+val.guid
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TabbedExporter {
ReportingService reportingService = Holders.grailsApplication.mainContext.getBean("reportingService")
ActivityFormService activityFormService = Holders.grailsApplication.mainContext.getBean("activityFormService")
OutputModelProcessor processor = new OutputModelProcessor()
String biePrefix = Holders.grailsApplication.config.getProperty("bie.url")+'/species/'
String biePrefix = Holders.grailsApplication.config.getProperty("bie.url")+'species/'

static String DATE_CELL_FORMAT = "dd/MM/yyyy"
Map<String, AdditionalSheet> sheets
Expand Down

0 comments on commit 1d63d99

Please sign in to comment.