From 81f708b121a2467a13f330eb3108da533d70e0c9 Mon Sep 17 00:00:00 2001 From: Sushant G <105408469+sughics@users.noreply.github.com> Date: Fri, 2 Sep 2022 15:41:31 +1000 Subject: [PATCH 01/10] Bumping snapshot version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4010679a..9feaddce 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ plugins { id "com.gorylenko.gradle-git-properties" version "2.4.0-rc2" } -version "3.0.11-SNAPSHOT" +version "3.1.1-SNAPSHOT" group "au.org.ala" From ff77440b8d7dc9f83342e8ba32cc70dc0a0d4d6b Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Fri, 2 Sep 2022 09:46:48 +0100 Subject: [PATCH 02/10] Fixes #141 (#143) --- .../services/au/org/ala/collectory/EmlRenderService.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grails-app/services/au/org/ala/collectory/EmlRenderService.groovy b/grails-app/services/au/org/ala/collectory/EmlRenderService.groovy index edb9e5f0..c825dc7a 100644 --- a/grails-app/services/au/org/ala/collectory/EmlRenderService.groovy +++ b/grails-app/services/au/org/ala/collectory/EmlRenderService.groovy @@ -591,6 +591,8 @@ class EmlRenderService { gbif() { /* dateStamp, metadataLanguage, hierarchyLevel, resourceLogoUrl */ commonElements2 xml, pg + citation pg.citation?:'' + rights pg.rights?:'' } } } From 3ddc8148ca0b42288a1530e9352673c6fd50628d Mon Sep 17 00:00:00 2001 From: Sushant Date: Mon, 19 Sep 2022 18:01:32 +1000 Subject: [PATCH 03/10] #159 adding check for null value on formatSpaceSeparatedList --- grails-app/services/au/org/ala/collectory/CrudService.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/services/au/org/ala/collectory/CrudService.groovy b/grails-app/services/au/org/ala/collectory/CrudService.groovy index 35a64217..511b003f 100644 --- a/grails-app/services/au/org/ala/collectory/CrudService.groovy +++ b/grails-app/services/au/org/ala/collectory/CrudService.groovy @@ -971,7 +971,7 @@ class CrudService { } def formatSpaceSeparatedList(str) { - str.tokenize(" ") + str?.tokenize(" ") } } From 4cf9bc01dcf13c45df3adbf28ea0f93472189bd6 Mon Sep 17 00:00:00 2001 From: vjrj Date: Wed, 21 Sep 2022 10:23:51 +0200 Subject: [PATCH 04/10] Fix for 156 --- grails-app/views/providerMap/_form.gsp | 31 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/grails-app/views/providerMap/_form.gsp b/grails-app/views/providerMap/_form.gsp index f3f57c13..475f01e2 100644 --- a/grails-app/views/providerMap/_form.gsp +++ b/grails-app/views/providerMap/_form.gsp @@ -3,12 +3,22 @@
- + + + + + +
- + + + + + +
@@ -91,10 +101,19 @@ $('#institutionSelect').change(function() { $.each( data.collections, function( key, collection ) { console.log(collection); - $('#collectionSelect') - .append($("") - .attr("value", collection.id) - .text(collection.name)); + let collectionUid = collection.uid; + $.get(collection.uri, function(collectionDetail) { + if (collectionDetail.recordsProviderMapping == null) { + // only add to the select collections without mappings + console.log("Adding " + collectionUid + " because does not have a mapping"); + $('#collectionSelect') + .append($("") + .attr("value", collection.id) + .text(collection.name)); + } else { + console.log("Not adding "+ collectionUid + " because already have a mapping"); + } + }); }); }); } From 1634bc982e47263aaaf931362632dc098fa7ebaa Mon Sep 17 00:00:00 2001 From: vjrj Date: Tue, 4 Oct 2022 19:33:23 +0200 Subject: [PATCH 05/10] Fix for #163 and #164 --- .../org/ala/collectory/ProviderMapController.groovy | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/grails-app/controllers/au/org/ala/collectory/ProviderMapController.groovy b/grails-app/controllers/au/org/ala/collectory/ProviderMapController.groovy index e7834a47..46d82660 100644 --- a/grails-app/controllers/au/org/ala/collectory/ProviderMapController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/ProviderMapController.groovy @@ -42,9 +42,10 @@ class ProviderMapController { providerMapInstance.properties = params println "createFor = ${params.createFor}" if (params.createFor) { - def pg = Collection._get(params.createFor) as Collection + def pg = Collection.findByUid(params.createFor) as Collection if (pg) { providerMapInstance.collection = pg + providerMapInstance.institution = pg.institution } } return [providerMapInstance: providerMapInstance, returnTo: params.returnTo] @@ -125,12 +126,8 @@ class ProviderMapController { // remove collection link providerMapInstance.collection?.providerMap = null // remove code links - providerMapInstance.collectionCodes.each { - providerMapInstance.removeFromCollectionCodes it - } - providerMapInstance.institutionCodes.each { - providerMapInstance.removeFromInstitutionCodes it - } + providerMapInstance.collectionCodes.removeAll(providerMapInstance.collectionCodes) + providerMapInstance.institutionCodes.removeAll(providerMapInstance.institutionCodes) // remove map providerMapInstance.delete(flush: true) flash.message = "${message(code: 'default.deleted.message', args: [message(code: 'providerMap.label', default: 'ProviderMap'), params.id])}" From 2c316e6e1a37068e5881d0a4ff1e990997db4492 Mon Sep 17 00:00:00 2001 From: Sushant <105408469+sughics@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:18:18 +1100 Subject: [PATCH 06/10] issue #167 removing redundant param from swagger specs --- .../au/org/ala/collectory/DataController.groovy | 9 +-------- .../au/org/ala/collectory/GbifController.groovy | 1 - .../au/org/ala/collectory/IptController.groovy | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/grails-app/controllers/au/org/ala/collectory/DataController.groovy b/grails-app/controllers/au/org/ala/collectory/DataController.groovy index 8d1bb2aa..bbc65767 100644 --- a/grails-app/controllers/au/org/ala/collectory/DataController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/DataController.groovy @@ -259,8 +259,7 @@ class DataController { description = "restrict to associated object names that contain this value", schema = @Schema(implementation = String), required = false - ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) + ) ], requestBody = @RequestBody( required = true, @@ -566,9 +565,6 @@ class DataController { tags = "gbif", operationId = "syncGBIF", summary = "Update All registrations with GBIF", - parameters =[ - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) - ], responses = [ @ApiResponse( description = "Status of GBIF sync operation", @@ -904,7 +900,6 @@ class DataController { schema = @Schema(implementation = String), required = true ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) ], responses = [ @ApiResponse( @@ -1011,7 +1006,6 @@ class DataController { schema = @Schema(implementation = String), required = true ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) ], requestBody = @RequestBody( required = true, @@ -1325,7 +1319,6 @@ class DataController { schema = @Schema(implementation = String), required = true ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) ], requestBody = @RequestBody( required = true, diff --git a/grails-app/controllers/au/org/ala/collectory/GbifController.groovy b/grails-app/controllers/au/org/ala/collectory/GbifController.groovy index ec84533f..e8e5b5af 100644 --- a/grails-app/controllers/au/org/ala/collectory/GbifController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/GbifController.groovy @@ -173,7 +173,6 @@ class GbifController { schema = @Schema(implementation = String), required = true ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) ], responses = [ @ApiResponse( diff --git a/grails-app/controllers/au/org/ala/collectory/IptController.groovy b/grails-app/controllers/au/org/ala/collectory/IptController.groovy index 22d2b927..06cfe21c 100644 --- a/grails-app/controllers/au/org/ala/collectory/IptController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/IptController.groovy @@ -78,7 +78,6 @@ class IptController { schema = @Schema(implementation = Boolean), required = false ), - @Parameter(name = "Authorization", in = HEADER, schema = @Schema(implementation = String), required = true) ], responses = [ @ApiResponse( From 1dfe02576d0ec47fc2d6313849bf162cad1823a1 Mon Sep 17 00:00:00 2001 From: Adam Collins Date: Fri, 4 Nov 2022 12:27:41 +1000 Subject: [PATCH 07/10] remove username/password from repat form --- .../au/org/ala/collectory/ManageController.groovy | 7 ++++++- grails-app/views/manage/repatriate.gsp | 10 +--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/grails-app/controllers/au/org/ala/collectory/ManageController.groovy b/grails-app/controllers/au/org/ala/collectory/ManageController.groovy index 0433b28e..ac1dd3cb 100644 --- a/grails-app/controllers/au/org/ala/collectory/ManageController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/ManageController.groovy @@ -116,6 +116,11 @@ class ManageController { */ def searchForRepatResources() { log.debug "Searching for resources from external source: ${params}" + + // Use login credentials from configuration + params.username = grailsApplication.config.gbifApiUser + params.password = grailsApplication.config.gbifApiPassword + DataSourceConfiguration configuration = new DataSourceConfiguration(params) def dataResources = DataResource.all.findAll({ dr -> dr.resourceType == 'records' }).sort({ it.name }) def resources = externalDataService.searchForDatasets(configuration) @@ -206,7 +211,7 @@ class ManageController { /** * Landing page for self-service management of entities. - * + * * @param show = user will display user login/cookie/roles details */ def list = { diff --git a/grails-app/views/manage/repatriate.gsp b/grails-app/views/manage/repatriate.gsp index d420013f..a60dc097 100644 --- a/grails-app/views/manage/repatriate.gsp +++ b/grails-app/views/manage/repatriate.gsp @@ -69,14 +69,6 @@
-
- - -
-
- - -
@@ -93,4 +85,4 @@ - \ No newline at end of file + From 10720d9a94f0d151daa24bc5465f90505bf83c84 Mon Sep 17 00:00:00 2001 From: Sushant <105408469+sughics@users.noreply.github.com> Date: Mon, 14 Nov 2022 17:46:13 +1100 Subject: [PATCH 08/10] issue #167 adding exmaple data for openai specs --- .../org/ala/collectory/DataController.groovy | 84 +++++++------------ .../org/ala/collectory/GbifController.groovy | 1 + .../org/ala/collectory/IptController.groovy | 20 +++++ .../ala/collectory/LookupController.groovy | 30 +++++-- 4 files changed, 71 insertions(+), 64 deletions(-) diff --git a/grails-app/controllers/au/org/ala/collectory/DataController.groovy b/grails-app/controllers/au/org/ala/collectory/DataController.groovy index bbc65767..581418f4 100644 --- a/grails-app/controllers/au/org/ala/collectory/DataController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/DataController.groovy @@ -225,18 +225,21 @@ class DataController { * @param pg - optional instance specified by uid (added in beforeInterceptor) * @param json - the body of the request */ + // NOTE - Sine the same method below saveEntity is used for saving and updating an entity - OpenAPI specs for both save and update operations cannot be added on Code. + // API Gateway handles the below by using the {entity+} wildcard but for swagger specs in the documentation portal. additional spec has been added for just the /{entity} path - which allows Inserting of an entity @Operation( method = "POST", tags = "collection, institution, dataProvider, dataResource, tempDataResource, dataHub", - operationId = "saveEntity", + operationId = "updateEntity", summary = "Insert or update an entity", description = "Insert or update an entity - if uid is specified, entity must exist and is updated with the provided data", parameters = [ @Parameter( name = "entity", in = PATH, - description = "entity e.g. datResource, dataProvider etc", + description = "entity i.e. collection, institution, dataProvider, dataResource, tempDataResource, dataHub", schema = @Schema(implementation = String), + example ="collection", required = true ), @Parameter( @@ -244,20 +247,7 @@ class DataController { in = PATH, description = "optional uid of an instance of entity", schema = @Schema(implementation = String), - required = false - ), - @Parameter( - name = "pg", - in = QUERY, - description = "optional instance specified by uid ", - schema = @Schema(implementation = String), - required = false - ), - @Parameter( - name = "q", - in = QUERY, - description = "restrict to associated object names that contain this value", - schema = @Schema(implementation = String), + example = "co43", required = false ) ], @@ -286,26 +276,11 @@ class DataController { @Header(name = 'Access-Control-Allow-Methods', description = "CORS header", schema = @Schema(type = "String")), @Header(name = 'Access-Control-Allow-Origin', description = "CORS header", schema = @Schema(type = "String")) ] - ), - @ApiResponse( - description = "Status of operation - updated", - responseCode = "200", - content = [ - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Object) - ) - ], - headers = [ - @Header(name = 'Access-Control-Allow-Headers', description = "CORS header", schema = @Schema(type = "String")), - @Header(name = 'Access-Control-Allow-Methods', description = "CORS header", schema = @Schema(type = "String")), - @Header(name = 'Access-Control-Allow-Origin', description = "CORS header", schema = @Schema(type = "String")) - ] ) ], security = [@SecurityRequirement(name = 'openIdConnect')] ) - @Path("/ws/{entity}/{uid}?") + @Path("/ws/{entity}/{uid}") @Produces("application/json") def saveEntity () { def ok = check(params) @@ -408,45 +383,35 @@ class DataController { * @param api_key - optional param for displaying any sensitive data */ - // since this method provides response for all entity types and optionally specific instance of an entity type with the optional {uid} path param, the specs for api gateway will need to be specified with a special proxy character e.g. /ws/{entity+} to support the optional {uid} param. + // since this method provides response for all entity types and optionally specific instance of an entity type with the optional {uid} path param, the specs for api gateway will are to be specified with a special proxy character e.g. /ws/{entity+} to support the optional {uid} param. + // additional spec has also been added to swagger json file used in docs portal for /ws/{entity} to got a list of entities. @Operation( method = "GET", tags = "collection, institution, dataProvider, dataResource, tempDataResource, dataHub", operationId = "getEntity", - summary = "Get a list of entities for a data type or details of a record.", - description = "Get a summary of entities that exist for a data type or detailed information for a specific entity.", + summary = "Get an entity for a specified entity uid", + description = "Get detailed information for a specific entity", parameters = [ @Parameter( name = "entity", in = PATH, - description = "entity e.g. datResource, dataProvider etc", + description = "entity type - e.g. datResource, dataProvider etc", schema = @Schema(implementation = String), + example = "collection", required = true ), @Parameter( name = "uid", in = PATH, - description = "optional uid of an instance of entity", + description = "uid of an instance of entity", schema = @Schema(implementation = String), - required = false - ), - @Parameter( - name = "summary", - in = QUERY, - description = "false to include the summary", - schema = @Schema(implementation = Boolean), - required = false - ), - @Parameter( - name = "q", - in = QUERY, - description = "restrict to associated object names that contain this value", - schema = @Schema(implementation = String), - required = false - )], + example = "co43", + required = true + ) + ], responses = [ @ApiResponse( - description = "List of entities", + description = "Entity Info", responseCode = "200", content = [ @Content( @@ -730,6 +695,7 @@ class DataController { in = PATH, description = "Id of the field", schema = @Schema(implementation = String), + example = "dr368", required = true ), @Parameter( @@ -737,6 +703,7 @@ class DataController { in = QUERY, description = "starting index for associated objects", schema = @Schema(implementation = Long), + example = "0", required = false ), @Parameter( @@ -744,6 +711,7 @@ class DataController { in = QUERY, description = "number of associated objects to return", schema = @Schema(implementation = Long), + example = "1", required = false ), @Parameter( @@ -751,6 +719,7 @@ class DataController { in = QUERY, description = "restrict to associated object names that contain this value", schema = @Schema(implementation = String), + example ="Environment", required = false ) ], @@ -898,6 +867,7 @@ class DataController { in = PATH, description = "contact identifier value", schema = @Schema(implementation = String), + example = "31", required = true ), ], @@ -1004,6 +974,7 @@ class DataController { in = PATH, description = "contact identifier value", schema = @Schema(implementation = String), + example = "31", required = true ), ], @@ -1301,8 +1272,9 @@ class DataController { @Parameter( name = "entity", in = PATH, - description = "entity an entity type in url form ie one of collection, institution, dataProvider, dataResource, dataHub", + description = "metadata entity type i.e. collection, institution, dataProvider, dataResource, dataHub", schema = @Schema(implementation = String), + example = "collection", required = true ), @Parameter( @@ -1310,6 +1282,7 @@ class DataController { in = PATH, description = "uid the entity instance", schema = @Schema(implementation = String), + example = "co43", required = true ), @Parameter( @@ -1317,6 +1290,7 @@ class DataController { in = PATH, description = "contact identifier value", schema = @Schema(implementation = String), + example = "844", required = true ), ], diff --git a/grails-app/controllers/au/org/ala/collectory/GbifController.groovy b/grails-app/controllers/au/org/ala/collectory/GbifController.groovy index e8e5b5af..6d806d75 100644 --- a/grails-app/controllers/au/org/ala/collectory/GbifController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/GbifController.groovy @@ -171,6 +171,7 @@ class GbifController { in = PATH, description = "provider uid", schema = @Schema(implementation = String), + example = "1", required = true ), ], diff --git a/grails-app/controllers/au/org/ala/collectory/IptController.groovy b/grails-app/controllers/au/org/ala/collectory/IptController.groovy index 06cfe21c..34c670a9 100644 --- a/grails-app/controllers/au/org/ala/collectory/IptController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/IptController.groovy @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.headers.Header import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.parameters.RequestBody import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.security.SecurityRequirement @@ -56,12 +57,29 @@ class IptController { operationId = "scanIpt", summary = "Scan an IPT instance described by a data provider id", description = "Scan an IPT instance described by a data provider id", + requestBody = @RequestBody( + content = [ + @Content( + mediaType = "application/json", + schema = @Schema(implementation = ArrayList) + ), + @Content( + mediaType = "test/xml", + schema = @Schema(implementation = ArrayList) + ), + @Content( + mediaType = "text/plain", + schema = @Schema(implementation = ArrayList) + ) + ] + ), parameters = [ @Parameter( name = "uid", in = PATH, description = "provider uid", schema = @Schema(implementation = String), + example = "dp1518", required = true ), @Parameter( @@ -69,6 +87,7 @@ class IptController { in = QUERY, description = "Boolean flag to determine whether to update existing datasets and create data resources for new datasets", schema = @Schema(implementation = Boolean), + example = "false", required = false ), @Parameter( @@ -76,6 +95,7 @@ class IptController { in = QUERY, description = "Boolean flag to check to see ifresource needs updating by looking at the data currency", schema = @Schema(implementation = Boolean), + example = "true", required = false ), ], diff --git a/grails-app/controllers/au/org/ala/collectory/LookupController.groovy b/grails-app/controllers/au/org/ala/collectory/LookupController.groovy index 1adb6ba5..b0ed391f 100644 --- a/grails-app/controllers/au/org/ala/collectory/LookupController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/LookupController.groovy @@ -45,6 +45,7 @@ class LookupController { in = PATH, description = "Institution code", schema = @Schema(implementation = String), + example = "in105", required = true ), @Parameter( @@ -52,6 +53,7 @@ class LookupController { in = PATH, description = "Collection code", schema = @Schema(implementation = String), + example = "co229", required = true ) ], @@ -169,6 +171,7 @@ class LookupController { in = PATH, description = "Entity id", schema = @Schema(implementation = String), + example = "dp3874", required = true ), ], @@ -297,15 +300,6 @@ class LookupController { tags = "citations", operationId = "getCitations", summary = "Get citations for a list of data resource UIDs.", - parameters = [ - @Parameter( - name = "Accept", - in = HEADER, - description = "Response format; text/csv, text/plain, application/json", - schema = @Schema(implementation = String), - required = true - ) - ], requestBody = @RequestBody( required = true, description = "A JSON array containing dataResource UIDs.", @@ -318,6 +312,24 @@ class LookupController { value = "[\"dr654\",\"dr653\"]" ) ] + ), + @Content( + mediaType = "text/csv", + array = @ArraySchema(schema = @Schema(implementation = String)), + examples = [ + @ExampleObject( + value = "[\"dr654\",\"dr653\"]" + ) + ] + ), + @Content( + mediaType = "text/plain", + array = @ArraySchema(schema = @Schema(implementation = String)), + examples = [ + @ExampleObject( + value = "[\"dr654\",\"dr653\"]" + ) + ] ) ] ), From a6d80b8003acbfa1502d20dccfb3cbcefd906b53 Mon Sep 17 00:00:00 2001 From: Adam Collins Date: Thu, 1 Dec 2022 14:12:50 +1000 Subject: [PATCH 09/10] remove biocache-service jsonp requests and deprecated ".json" URLs. --- grails-app/assets/javascripts/images.js | 6 +++--- .../au/org/ala/collectory/AdminController.groovy | 2 +- .../au/org/ala/collectory/PublicController.groovy | 4 ++-- .../au/org/ala/collectory/ReportsController.groovy | 10 +++++----- grails-app/views/public/_charts.gsp | 4 ++-- grails-app/views/public/_progress.gsp | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/grails-app/assets/javascripts/images.js b/grails-app/assets/javascripts/images.js index a34e83cb..ae3644be 100644 --- a/grails-app/assets/javascripts/images.js +++ b/grails-app/assets/javascripts/images.js @@ -2,13 +2,13 @@ * Populate Images tab body with images via AJAX call to Biocache */ function loadImagesTab() { - var wsBase = "/occurrences/search.json"; + var wsBase = "/occurrences/search"; var uiBase = "/occurrences/search"; var imagesQueryUrl = "?facets=type_status&fq=multimedia%3AImage&pageSize=100&q=" + (SHOW_REC.isPipelinesCompatible? "collectionUid:" : "collection_uid:") + SHOW_REC.instanceUuid; $.ajax({ url: SHOW_REC.biocacheServicesUrl + wsBase + imagesQueryUrl, - dataType: 'jsonp', + dataType: 'json', timeout: 20000, complete: function(jqXHR, textStatus) { if (textStatus == 'timeout') { @@ -39,4 +39,4 @@ function loadImagesTab() { } } }); -} \ No newline at end of file +} diff --git a/grails-app/controllers/au/org/ala/collectory/AdminController.groovy b/grails-app/controllers/au/org/ala/collectory/AdminController.groovy index ffa003fb..cdd68480 100644 --- a/grails-app/controllers/au/org/ala/collectory/AdminController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/AdminController.groovy @@ -89,7 +89,7 @@ class AdminController { def search = { // use bie search and filter results - def url = grailsApplication.config.biocacheServicesUrl + "search.json?q=" + params.term.encodeAsURL() + "&pageSize=1000" + def url = grailsApplication.config.biocacheServicesUrl + "search?q=" + params.term.encodeAsURL() + "&pageSize=1000" def conn = new URL(url).openConnection() try { diff --git a/grails-app/controllers/au/org/ala/collectory/PublicController.groovy b/grails-app/controllers/au/org/ala/collectory/PublicController.groovy index 1b878dfc..f2aca926 100644 --- a/grails-app/controllers/au/org/ala/collectory/PublicController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/PublicController.groovy @@ -194,7 +194,7 @@ class PublicController { } def newBiocacheBreakdown = { - def url = "http://ala-bie1.vm.csiro.au:8080/biocache-service/occurrences/search.json?q=*:*&pageSize=0"; + def url = "http://ala-bie1.vm.csiro.au:8080/biocache-service/occurrences/search?q=*:*&pageSize=0"; def conn = new URL(url).openConnection() conn.setConnectTimeout 1500 def dataTable = null @@ -751,7 +751,7 @@ class PublicController { def chart = {} - + /************************************ helpers ***********************************/ private String limit(str, int length) { if (str?.size() > length) { diff --git a/grails-app/controllers/au/org/ala/collectory/ReportsController.groovy b/grails-app/controllers/au/org/ala/collectory/ReportsController.groovy index f0633215..944e8413 100644 --- a/grails-app/controllers/au/org/ala/collectory/ReportsController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/ReportsController.groovy @@ -235,7 +235,7 @@ class ReportsController { Collection.list([sort: 'name']).each { if (it.numRecordsDigitised > 0) { // find the number of biocache records - def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/collections/" + it.generatePermalink() + ".json?pageSize=0" + def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/collections/" + it.generatePermalink() + "?pageSize=0" def count = 0 def conn = new URL(url).openConnection() conn.setConnectTimeout 3000 @@ -260,7 +260,7 @@ class ReportsController { Collection.list([sort: 'name']).each { def rec = new Records() // find the number of biocache records - def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/searchForUID.JSON?pageSize=0&q=" + it.uid + def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/searchForUID?pageSize=0&q=" + it.uid def count = 0 def conn = new URL(url).openConnection() conn.setConnectTimeout 3000 @@ -285,7 +285,7 @@ class ReportsController { DataProvider.list([sort: 'name']).each { def rec = new Records() // find the number of biocache records - def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/searchForUID.JSON?pageSize=0&q=" + it.uid + def url = grailsApplication.config.biocacheServicesUrl + "/occurrences/searchForUID?pageSize=0&q=" + it.uid def count = 0 def conn = new URL(url).openConnection() @@ -307,7 +307,7 @@ class ReportsController { def dataLinks = { [links: DataLink.list([sort:'provider'])] } - + class ReportCommand { int totalCollections int totalInstitutions @@ -451,7 +451,7 @@ class ReportsController { " and administratorForEntity = 1 and admin = 1")[0] latestActivity = ActivityLog.list([sort: 'timestamp', order:'desc', max:10]) break - + case 'membership': partners = Institution.findAllByIsALAPartner(true) diff --git a/grails-app/views/public/_charts.gsp b/grails-app/views/public/_charts.gsp index 3b680f18..e9301609 100644 --- a/grails-app/views/public/_charts.gsp +++ b/grails-app/views/public/_charts.gsp @@ -9,11 +9,11 @@ // records if (${!instance.hasProperty('resourceType') || instance.resourceType == 'records'}) { // summary biocache data - var queryUrl = CHARTS_CONFIG.biocacheServicesUrl + "/occurrences/search.json?pageSize=0&q=${facet}:${instance.uid}"; + var queryUrl = CHARTS_CONFIG.biocacheServicesUrl + "/occurrences/search?pageSize=0&q=${facet}:${instance.uid}"; $.ajax({ url: queryUrl, - dataType: 'jsonp', + dataType: 'json', timeout: 30000, complete: function(jqXHR, textStatus) { if (textStatus == 'timeout') { diff --git a/grails-app/views/public/_progress.gsp b/grails-app/views/public/_progress.gsp index 0a9e36e1..7b8e251a 100644 --- a/grails-app/views/public/_progress.gsp +++ b/grails-app/views/public/_progress.gsp @@ -1,9 +1,9 @@ - var queryUrl = CHARTS_CONFIG.biocacheServicesUrl + "/occurrences/search.json?pageSize=0&q=${facet}:${instance.uid}"; + var queryUrl = CHARTS_CONFIG.biocacheServicesUrl + "/occurrences/search?pageSize=0&q=${facet}:${instance.uid}"; $.ajax({ url: queryUrl, - dataType: 'jsonp', + dataType: 'json', timeout: 30000, complete: function(jqXHR, textStatus) { }, From 37a7e5f3f0722abcebf623a34e5bb3c51bf630c0 Mon Sep 17 00:00:00 2001 From: Sushant <105408469+sughics@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:41:24 +1100 Subject: [PATCH 10/10] issue #172 adding missing param uid as hiddenField required for updating of dataProvider descrption --- grails-app/views/dataProvider/description.gsp | 1 + 1 file changed, 1 insertion(+) diff --git a/grails-app/views/dataProvider/description.gsp b/grails-app/views/dataProvider/description.gsp index 18efc41d..13faa196 100644 --- a/grails-app/views/dataProvider/description.gsp +++ b/grails-app/views/dataProvider/description.gsp @@ -20,6 +20,7 @@ +