Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed Nov 12, 2024
2 parents 918eb50 + 04b301d commit 4f28802
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 26 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@
<!-- GBIF -->
<gbif-api.version>1.17.0-SNAPSHOT</gbif-api.version>
<gbif-common.version>0.59</gbif-common.version>
<gbif-common-mybatis.version>1.4-SNAPSHOT</gbif-common-mybatis.version>
<gbif-common-mybatis.version>1.4</gbif-common-mybatis.version>
<gbif-common-ws.version>1.28-SNAPSHOT</gbif-common-ws.version>
<gbif-directory.version>1.13</gbif-directory.version>
<gbif-doi.version>2.22-SNAPSHOT</gbif-doi.version>
<gbif-download-query-tools.version>1.53.0-SNAPSHOT</gbif-download-query-tools.version>
<gbif-download-query-tools.version>1.53.0</gbif-download-query-tools.version>
<gbif-httputils.version>0.10</gbif-httputils.version>
<gbif-metadata-profile.version>2.6</gbif-metadata-profile.version>
<gbif-parsers.version>0.67</gbif-parsers.version>
<gbif-postal-service.version>1.8.1</gbif-postal-service.version>
<xoai.version>4.1.0-gbif-4</xoai.version>
<gbif-occurrence.version>0.195.4</gbif-occurrence.version>
<gbif-occurrence.version>0.195.7-H3-SNAPSHOT</gbif-occurrence.version>
<gbif-vocabulary.version>1.0.12</gbif-vocabulary.version>
<checklistbank.version>2.127-SNAPSHOT</checklistbank.version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> DATA_PACKAGE_ENDPOINT_TYPE_ALTERNATIVES =
private static final Set<String> 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() {
Expand Down Expand Up @@ -750,23 +751,34 @@ 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;
}
}
}
}

/**
* 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
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,*"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ public ResponseEntity<Void> 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. </br> Before being
* have been persisted is a response with {@link HttpStatus#CREATED} returned.
* <p>
* 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
* <a href="https://github.com/gbif/registry/issues/71">GitHub</a>
*
* @param dataset LegacyDataset with HTTP form parameters
* @return {@link ResponseEntity} with {@link HttpStatus#CREATED} if successful
Expand Down

0 comments on commit 4f28802

Please sign in to comment.