Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
Adam Collins committed Jan 17, 2024
2 parents 83403c0 + 9424bda commit 040426a
Show file tree
Hide file tree
Showing 79 changed files with 1,239 additions and 1,174 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
version "5.0.0"
version "5.1.0"
group "au.org.ala"
}

Expand Down Expand Up @@ -114,7 +114,7 @@ dependencies {
implementation "org.grails.plugins:audit-logging:4.0.3"
implementation 'dk.glasius:external-config:3.1.1'
implementation "org.grails.plugins:ala-admin-plugin:2.3.0"
implementation 'au.org.ala.plugins:openapi:1.1.0'
implementation 'au.org.ala.plugins:openapi:1.3.0'

console "org.grails:grails-console"
profile "org.grails.profiles:web"
Expand Down
11 changes: 9 additions & 2 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ uploadExternalUrlPath: http://localhost/upload
gbifApiUrl: 'https://api.gbif.org/v1/'
gbifUniqueKeyTerm: "http://rs.gbif.org/terms/1.0/gbifID"

# country 3 digit ISO code. Non-empty value required at startup
gbifDefaultEntityCountry:

gbif:
citations:
lookup: "https://www.gbif.org/api/resource/search?contentType=literature&gbifDatasetKey="
Expand Down Expand Up @@ -189,7 +192,7 @@ security:
enabled: false
oidc:
enabled: true
discovery-uri: 'https://auth-test.ala.org.au/cas/oidc/.well-known'
discoveryUri: 'change me'
clientId: 'change me'
secret: 'change me'
allowUnsignedIdTokens: true
Expand Down Expand Up @@ -261,6 +264,7 @@ dataResource:
contentTypesList:
- "authoritative"
- "behaviour"
- "citizen science"
- "commercial uses"
- "common names"
- "conservation management"
Expand Down Expand Up @@ -403,6 +407,8 @@ environments:
url: jdbc:mysql://localhost:3306/collectory?autoReconnect=true&connectTimeout=0&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Australia/Sydney
username: specieslist
password: "specieslist"
logSql: false
gbifDefaultEntityCountry: AUS
test:
grails:
assets:
Expand All @@ -413,6 +419,7 @@ environments:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
gbifDefaultEntityCountry: AUS
production:
grails:
assets:
Expand Down Expand Up @@ -442,7 +449,7 @@ environments:
openapi:
title: Collectory REST services
description: REST services for interacting with the collectory webapp
terms: https://www.ala.org.au/terms
terms: https://www.ala.org.au/terms-of-use
contact:
name: Support
email: [email protected]
Expand Down
78 changes: 0 additions & 78 deletions grails-app/conf/logback.old.groovy

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package au.org.ala.collectory

import grails.converters.JSON
import grails.validation.Validateable
import org.springframework.validation.annotation.Validated

import java.text.NumberFormat
Expand All @@ -15,6 +14,8 @@ class CollectionController extends ProviderGroupController {
}

def idGeneratorService
def collectionService
def institutionService

def index = {
redirect(action:"list")
Expand Down Expand Up @@ -113,9 +114,8 @@ class CollectionController extends ProviderGroupController {
*/
def summary = {
Collection collectionInstance = findCollection(params.id)
println ">> summary id = " + params.id
if (collectionInstance) {
render collectionInstance.buildSummary() as JSON
render collectionService.buildSummary(collectionInstance) as JSON
} else {
log.error "Unable to find collection for id = ${params.id}"
def error = ["error":"unable to find collection for id = " + params.id]
Expand Down Expand Up @@ -143,7 +143,12 @@ class CollectionController extends ProviderGroupController {
}
ProviderGroup pg = ProviderMap.findMatch(inst, coll)
if (pg) {
render pg.buildSummary() as JSON
if (pg[0..1] == 'co') {
render collectionService.buildSummary(pg) as JSON
} else {
// institution
render institutionService.buildSummary(pg) as JSON
}
} else {
def error = ["error":"unable to find collection with inst code = ${inst} and coll code = ${coll}"]
render error as JSON
Expand Down Expand Up @@ -205,7 +210,7 @@ class CollectionController extends ProviderGroupController {
} else {
collection.collectionType = (params.collectionType as JSON).toString()
}

params.remove('collectionType')

// special handling for keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CollectoryWebServicesInterceptor {

}
boolean before() {

// set default role requirement for protected ROLE_EDITOR as the same info is only available to ROLE_EDITOR via the UI.
String requiredRole = grailsApplication.config.ROLE_EDITOR

Expand Down
Loading

0 comments on commit 040426a

Please sign in to comment.