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 Aug 31, 2023
2 parents 9eb5401 + 4c81f38 commit 2bc33b5
Show file tree
Hide file tree
Showing 87 changed files with 559 additions and 124 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.gbif.registry</groupId>
<artifactId>registry-parent</artifactId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
<name>GBIF Registry Parent</name>
<description>GBIF Registry project</description>

Expand Down Expand Up @@ -84,7 +84,7 @@
<spring-cloud-sleuth.version>2.2.8.RELEASE</spring-cloud-sleuth.version>

<!-- GBIF -->
<gbif-api.version>1.10.0</gbif-api.version>
<gbif-api.version>1.11.0</gbif-api.version>
<gbif-common.version>0.59</gbif-common.version>
<gbif-common-mybatis.version>1.3</gbif-common-mybatis.version>
<gbif-common-ws.version>1.25</gbif-common-ws.version>
Expand Down
2 changes: 1 addition & 1 deletion registry-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.gbif.registry</groupId>
<artifactId>registry-parent</artifactId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>

<artifactId>registry-cli</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
*/
package org.gbif.registry.cli.datasetindex;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.DateDeserializers;

import com.fasterxml.jackson.databind.module.SimpleModule;

import org.gbif.api.service.registry.DatasetService;
import org.gbif.api.service.registry.InstallationService;
import org.gbif.api.service.registry.NetworkService;
Expand All @@ -42,6 +35,9 @@
import org.gbif.ws.client.ClientBuilder;
import org.gbif.ws.json.JacksonJsonObjectMapperProvider;

import java.io.IOException;
import java.util.Date;

import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
Expand All @@ -57,12 +53,14 @@
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.MapPropertySource;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.DateDeserializers;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.common.collect.ImmutableMap;
import com.zaxxer.hikari.HikariDataSource;

import java.io.IOException;
import java.util.Date;

public class SpringContextBuilder {

private static EsClient.EsClientConfiguration toEsClientConfiguration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.gbif.registry.persistence.mapper.DoiMapper;
import org.gbif.registry.persistence.mapper.OccurrenceDownloadMapper;
import org.gbif.registry.persistence.mapper.UserMapper;
import org.gbif.registry.persistence.mapper.params.DatasetListParams;

import java.io.File;
import java.io.IOException;
Expand All @@ -40,9 +41,6 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

import org.gbif.registry.persistence.mapper.params.DatasetListParams;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import org.gbif.registry.persistence.mapper.DatasetMapper;
import org.gbif.registry.persistence.mapper.DoiMapper;
import org.gbif.registry.persistence.mapper.OccurrenceDownloadMapper;
import org.gbif.registry.persistence.mapper.params.DatasetListParams;

import java.util.stream.Collectors;

import org.gbif.registry.persistence.mapper.params.DatasetListParams;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
2 changes: 1 addition & 1 deletion registry-directory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-doi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.gbif.api.model.registry.Contact;
import org.gbif.api.model.registry.Dataset;
import org.gbif.api.model.registry.Endpoint;
import org.gbif.api.util.VocabularyUtils;
import org.gbif.api.vocabulary.ContactType;
import org.gbif.api.vocabulary.DatasetSubtype;
import org.gbif.api.vocabulary.DatasetType;
import org.gbif.api.vocabulary.EndpointType;
import org.gbif.api.vocabulary.Language;
Expand Down Expand Up @@ -73,6 +75,7 @@ public class LegacyDataset extends Dataset implements LegacyEntity {
private String serviceTypes;
private String serviceUrls;
private DOI datasetDoi;
private String rawSubtype;

// created from combination of fields after injection
private Contact primaryContact;
Expand Down Expand Up @@ -141,6 +144,17 @@ public void setOrganizationKey(String organizationKey) {
}
}

@XmlTransient
@Nullable
public String getRawSubtype() {
return rawSubtype;
}

@ParamName(LegacyResourceConstants.SUBTYPE_PARAM)
public void setRawSubtype(String rawSubtype) {
this.rawSubtype = rawSubtype;
}

/**
* Get the publishing organization key. This is a required field in Registry2, and is required by
* the web services. This method is not used but it is needed otherwise this Object can't be
Expand Down Expand Up @@ -634,6 +648,7 @@ public void prepare() {
addArchiveEndpoint();
addDataPackageEndpoint();
setType(resolveType());
setSubtype(resolveSubtype());
}

/**
Expand Down Expand Up @@ -811,6 +826,18 @@ public DatasetType resolveType() {
return DatasetType.METADATA;
}

/**
* Return the DatasetSubtype from the string.
*/
public DatasetSubtype resolveSubtype() {
try {
return VocabularyUtils.lookupEnum(rawSubtype, DatasetSubtype.class);
} catch (Exception e) {
LOG.error("Failed to resolve subtype", e);
return null;
}
}

/**
* Return a new GBIF API Dataset instance, derived from the LegacyDataset. Needed because of:
* http://dev.gbif.org/issues/browse/REG-459
Expand All @@ -830,6 +857,7 @@ public Dataset toApiDataset() {
dataset.setLogoUrl(getLogoUrl());
dataset.setHomepage(getHomepage());
dataset.setType(getType());
dataset.setSubtype(getSubtype());
dataset.setDoi(datasetDoi);
return dataset;
}
Expand All @@ -853,7 +881,8 @@ public boolean equals(Object o) {
&& Objects.equal(primaryContact, that.primaryContact)
&& Objects.equal(emlEndpoint, that.emlEndpoint)
&& Objects.equal(archiveEndpoint, that.archiveEndpoint)
&& Objects.equal(dataPackageEndpoint, that.dataPackageEndpoint);
&& Objects.equal(dataPackageEndpoint, that.dataPackageEndpoint)
&& Objects.equal(rawSubtype, that.rawSubtype);
}

@Generated
Expand All @@ -873,7 +902,8 @@ public int hashCode() {
primaryContact,
emlEndpoint,
archiveEndpoint,
dataPackageEndpoint);
dataPackageEndpoint,
rawSubtype);
}

@Generated
Expand All @@ -893,6 +923,7 @@ public String toString() {
.add("emlEndpoint", emlEndpoint)
.add("archiveEndpoint", archiveEndpoint)
.add("dataPackageEndpoint", dataPackageEndpoint)
.add("rawSubtype", rawSubtype)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class LegacyResourceConstants {
public static final String TYPE_DESCRIPTION_PARAM = "typeDescription";
public static final String ACCESS_POINT_URL_PARAM = "accessPointURL";
public static final String DOI_PARAM = "doi";
public static final String SUBTYPE_PARAM = "subtype";

// request / response value names
public static final String ADMINISTRATIVE_CONTACT_TYPE = "administrative";
Expand Down
2 changes: 1 addition & 1 deletion registry-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions registry-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>registry-examples</artifactId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>

<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion registry-identity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion registry-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>registry-parent</artifactId>
<groupId>org.gbif.registry</groupId>
<version>3.94.17-SNAPSHOT</version>
<version>3.95.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.gbif.registry.ws.client.InstallationClient;
import org.gbif.registry.ws.client.NodeClient;
import org.gbif.registry.ws.client.OrganizationClient;
import org.gbif.registry.ws.provider.networkEntitiesList.BaseRequestSearchParamsHandlerMethodArgumentResolver;
import org.gbif.registry.ws.resources.DatasetResource;
import org.gbif.utils.file.FileUtils;
import org.gbif.ws.NotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@
import org.gbif.api.model.registry.Identifier;
import org.gbif.api.model.registry.Installation;
import org.gbif.api.model.registry.MachineTag;
import org.gbif.api.model.registry.Node;
import org.gbif.api.model.registry.Organization;
import org.gbif.api.model.registry.search.DatasetRequestSearchParams;
import org.gbif.api.model.registry.search.InstallationRequestSearchParams;
import org.gbif.api.model.registry.search.OrganizationRequestSearchParams;
import org.gbif.api.service.registry.InstallationService;
import org.gbif.api.service.registry.NodeService;
import org.gbif.api.service.registry.OrganizationService;
import org.gbif.api.util.Range;
import org.gbif.api.vocabulary.Country;
import org.gbif.api.vocabulary.IdentifierType;
import org.gbif.api.vocabulary.InstallationType;
import org.gbif.registry.search.test.EsManageServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
import org.gbif.api.model.registry.Installation;
import org.gbif.api.model.registry.MachineTag;
import org.gbif.api.model.registry.Network;
import org.gbif.api.model.registry.Node;
import org.gbif.api.model.registry.Organization;
import org.gbif.api.model.registry.search.NetworkRequestSearchParams;
import org.gbif.api.model.registry.search.NodeRequestSearchParams;
import org.gbif.api.service.registry.DatasetService;
import org.gbif.api.service.registry.NetworkService;
import org.gbif.api.service.registry.NodeService;
import org.gbif.api.util.Range;
import org.gbif.api.vocabulary.IdentifierType;
import org.gbif.registry.identity.service.IdentityService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gbif.registry.ws.it.collections.service.batch;

import org.gbif.api.model.collections.Address;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gbif.registry.ws.it.collections.service.batch;

import org.gbif.api.model.collections.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gbif.registry.ws.it.collections.service.batch;

import org.gbif.api.model.collections.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gbif.registry.ws.it.collections.service.batch;

import org.gbif.api.model.collections.CollectionEntityType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gbif.registry.ws.it.collections.service.batch;

import org.gbif.api.model.collections.CollectionEntityType;
Expand Down
Loading

0 comments on commit 2bc33b5

Please sign in to comment.