diff --git a/pom.xml b/pom.xml index a960ee288..862e447a1 100644 --- a/pom.xml +++ b/pom.xml @@ -90,17 +90,17 @@ 1.17.0-SNAPSHOT 0.59 - 1.4-SNAPSHOT + 1.4 1.28-SNAPSHOT 1.13 2.22-SNAPSHOT - 1.53.0-SNAPSHOT + 1.53.0 0.10 2.6 0.67 1.8.1 4.1.0-gbif-4 - 0.195.4 + 0.195.7-H3-SNAPSHOT 1.0.12 2.127-SNAPSHOT diff --git a/registry-domain/src/main/java/org/gbif/registry/domain/ws/LegacyDataset.java b/registry-domain/src/main/java/org/gbif/registry/domain/ws/LegacyDataset.java index fdab8d3b2..0b7f3b0d1 100644 --- a/registry-domain/src/main/java/org/gbif/registry/domain/ws/LegacyDataset.java +++ b/registry-domain/src/main/java/org/gbif/registry/domain/ws/LegacyDataset.java @@ -88,9 +88,10 @@ public class LegacyDataset extends Dataset implements LegacyEntity { LegacyResourceConstants.MATERIAL_ENTITY_SERVICE_TYPE_1, LegacyResourceConstants.MATERIAL_ENTITY_SERVICE_TYPE_2, LegacyResourceConstants.SAMPLING_EVENT_SERVICE_TYPE); - private static final Set DATA_PACKAGE_ENDPOINT_TYPE_ALTERNATIVES = + private static final Set CAMTRAP_DP_ENDPOINT_TYPE_ALTERNATIVES = ImmutableSet.of( - EndpointType.CAMTRAP_DP.name(), LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE); + LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE_1, + LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE_2); /** Default constructor. */ public LegacyDataset() { @@ -750,15 +751,26 @@ private void addDataPackageEndpoint() { while (serviceTypesTokenizer.hasMoreTokens() && serviceUrlsTokenizer.hasMoreTokens()) { String type = serviceTypesTokenizer.nextToken(); String url = serviceUrlsTokenizer.nextToken(); - if (type != null && url != null && DATA_PACKAGE_ENDPOINT_TYPE_ALTERNATIVES.contains(type)) { - // create endpoint - Endpoint endpoint = createEndpoint(url, EndpointType.CAMTRAP_DP); - if (endpoint != null) { - // set it - dataPackageEndpoint = endpoint; + if (type != null && url != null) { + if (CAMTRAP_DP_ENDPOINT_TYPE_ALTERNATIVES.contains(type)) { + // create Camtrap DP endpoint + Endpoint endpoint = createEndpoint(url, EndpointType.CAMTRAP_DP); + if (endpoint != null) { + // set it + dataPackageEndpoint = endpoint; + } + // only 1 is expected + break; + } else if (LegacyResourceConstants.COLDP_SERVICE_TYPE.equals(type)) { + // create ColDP enpoint + Endpoint endpoint = createEndpoint(url, EndpointType.COLDP); + if (endpoint != null) { + // set it + dataPackageEndpoint = endpoint; + } + // only 1 is expected + break; } - // only 1 is expected - break; } } } @@ -766,7 +778,7 @@ private void addDataPackageEndpoint() { /** * Creates a new Endpoint, or retrieves an existing Endpoint from the dataset. This method assumes - * that the dataset only has 1 endpoint for each type: EML and DWC_ARCHIVE. + * that the dataset only has 1 endpoint for each type: EML, DWC_ARCHIVE, CAMTRAP_DP or COLDP. * * @param url Endpoint URL * @param type Endpoint type @@ -804,11 +816,13 @@ private Endpoint createEndpoint(String url, EndpointType type) { public DatasetType resolveType() { if (serviceTypes != null) { if (serviceTypes.contains(LegacyResourceConstants.CHECKLIST_SERVICE_TYPE_1) - || serviceTypes.contains(LegacyResourceConstants.CHECKLIST_SERVICE_TYPE_2)) { + || serviceTypes.contains(LegacyResourceConstants.CHECKLIST_SERVICE_TYPE_2) + || serviceTypes.contains(LegacyResourceConstants.COLDP_SERVICE_TYPE)) { return DatasetType.CHECKLIST; } else if (serviceTypes.contains(LegacyResourceConstants.OCCURRENCE_SERVICE_TYPE_1) || serviceTypes.contains(LegacyResourceConstants.OCCURRENCE_SERVICE_TYPE_2) - || serviceTypes.contains(LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE)) { + || serviceTypes.contains(LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE_1) + || serviceTypes.contains(LegacyResourceConstants.CAMTRAP_DP_SERVICE_TYPE_2)) { return DatasetType.OCCURRENCE; } else if (serviceTypes.contains(LegacyResourceConstants.MATERIAL_ENTITY_SERVICE_TYPE_1) || serviceTypes.contains(LegacyResourceConstants.MATERIAL_ENTITY_SERVICE_TYPE_2)) { diff --git a/registry-domain/src/main/java/org/gbif/registry/domain/ws/util/LegacyResourceConstants.java b/registry-domain/src/main/java/org/gbif/registry/domain/ws/util/LegacyResourceConstants.java index 940875608..502448fe8 100644 --- a/registry-domain/src/main/java/org/gbif/registry/domain/ws/util/LegacyResourceConstants.java +++ b/registry-domain/src/main/java/org/gbif/registry/domain/ws/util/LegacyResourceConstants.java @@ -61,7 +61,9 @@ public class LegacyResourceConstants { public static final String MATERIAL_ENTITY_SERVICE_TYPE_1 = "DWC-ARCHIVE-MATERIAL-ENTITY"; public static final String MATERIAL_ENTITY_SERVICE_TYPE_2 = "DWC_ARCHIVE_MATERIAL_ENTITY"; public static final String SAMPLING_EVENT_SERVICE_TYPE = "DWC-ARCHIVE-SAMPLING-EVENT"; - public static final String CAMTRAP_DP_SERVICE_TYPE = "CAMTRAP_DP"; + public static final String CAMTRAP_DP_SERVICE_TYPE_1 = "CAMTRAP_DP"; + public static final String CAMTRAP_DP_SERVICE_TYPE_2 = "CAMTRAP-DP"; + public static final String COLDP_SERVICE_TYPE = "COLDP"; // web service paging request size public static final int WS_PAGE_SIZE = 100; diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/BaseNetworkEntityResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/BaseNetworkEntityResource.java index 0051736b1..246e78f96 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/BaseNetworkEntityResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/BaseNetworkEntityResource.java @@ -193,7 +193,7 @@ protected BaseNetworkEntityResource( @Parameter( name = "modified", description = - "The modified date of the dataset. Accepts ranges and a '*' can be used as a wildcard, e.g.:modified=2023-04-01,*", + "The modified date of the dataset. Accepts ranges and a `*` can be used as a wildcard, e.g. `modified=2023-04-01,*`", schema = @Schema(implementation = Range.class), in = ParameterIn.QUERY, explode = Explode.TRUE), diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java index b048cb67a..6249fd825 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java @@ -311,14 +311,14 @@ public DatasetResource( @Parameter( name = "recordCount", description = - "Number of records of the dataset. Accepts ranges and a '*' can be used as a wildcard.", + "Number of records of the dataset. Accepts ranges and a `*` can be used as a wildcard.", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY, example = "100,*"), @Parameter( name = "modifiedDate", description = - "Date when the dataset was modified the last time. Accepts ranges and a '*' can be used as a wildcard.", + "Date when the dataset was modified the last time. Accepts ranges and a `*` can be used as a wildcard.", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY, example = "2022-05-01,*"), diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/BaseCollectionEntityResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/BaseCollectionEntityResource.java index 7592741b0..423d3a0d1 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/BaseCollectionEntityResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/BaseCollectionEntityResource.java @@ -210,7 +210,7 @@ protected BaseCollectionEntityResource( @Parameter( name = "numberSpecimens", description = - "Number of specimens. It supports ranges and a '*' can be used as a wildcard", + "Number of specimens. It supports ranges and a `*` can be used as a wildcard", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( @@ -226,13 +226,13 @@ protected BaseCollectionEntityResource( @Parameter( name = "occurrenceCount", description = - "Count of occurrences linked. It supports ranges and a '*' can be used as a wildcard", + "Count of occurrences linked. It supports ranges and a `*` can be used as a wildcard", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( name = "typeSpecimenCount", description = - "Count of type specimens linked. It supports ranges and a '*' can be used as a wildcard", + "Count of type specimens linked. It supports ranges and a `*` can be used as a wildcard", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/CollectionResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/CollectionResource.java index 89f04acd5..71eadd9e1 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/CollectionResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/collections/CollectionResource.java @@ -798,7 +798,7 @@ private static Path zipFiles( @Parameter( name = "individualCount", description = - "Individual count of the descriptor. It supports ranges and a '*' can be used as a wildcard", + "Individual count of the descriptor. It supports ranges and a `*` can be used as a wildcard", schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/legacy/IptResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/legacy/IptResource.java index daf077b0d..267508db0 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/legacy/IptResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/legacy/IptResource.java @@ -220,11 +220,13 @@ public ResponseEntity updateIpt( /** * Register IPT dataset, handling incoming request with path /ipt/resource. The primary contact * and publishing organization key are mandatory. Only after both the dataset and primary contact - * have been persisted is a response with {@link HttpStatus#CREATED} returned.
Before being + * have been persisted is a response with {@link HttpStatus#CREATED} returned. + *

+ * Before being * persisted, the dataset is the UNSPECIFIED license. This will be replaced (if possible) by the * publisher assigned license when the dataset gets crawled the first time. Since IPT 2.2, the IPT * EML metadata document always includes a machine-readable license. See discussion at - * https://github.com/gbif/registry/issues/71 + * GitHub * * @param dataset LegacyDataset with HTTP form parameters * @return {@link ResponseEntity} with {@link HttpStatus#CREATED} if successful