From a15ececddd9dbcaf33c37057819f5c57c1f36029 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Fri, 22 Apr 2022 10:25:00 +0200 Subject: [PATCH] added field lastConsentTermsOfUseDate --- apps/dnet-exporter-api/pom.xml | 2 +- .../dsm/dao/utils/DsmMappingUtils.java | 1 + .../dsm/domain/DatasourceDetails.java | 17 ++++++++++++-- .../dsm/domain/DatasourceDetailsUpdate.java | 23 +++++++++++++++---- .../dsm/domain/DatasourceSnippetExtended.java | 22 ++++++++++++++---- 5 files changed, 54 insertions(+), 11 deletions(-) diff --git a/apps/dnet-exporter-api/pom.xml b/apps/dnet-exporter-api/pom.xml index 0a5a8369..122aed3d 100644 --- a/apps/dnet-exporter-api/pom.xml +++ b/apps/dnet-exporter-api/pom.xml @@ -123,7 +123,7 @@ eu.dnetlib dnet-datasource-manager-common - 1.2.0-EOSC-SNAPSHOT + [2.0.1,3.0.0) diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/dao/utils/DsmMappingUtils.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/dao/utils/DsmMappingUtils.java index 8d0bf806..86ce80cb 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/dao/utils/DsmMappingUtils.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/dao/utils/DsmMappingUtils.java @@ -53,6 +53,7 @@ public class DsmMappingUtils { ds.setDescription(d.getDescription()); ds.setConsentTermsOfUse(d.getConsentTermsOfUse()); ds.setConsentTermsOfUseDate(d.getConsentTermsOfUseDate()); + ds.setLastConsentTermsOfUseDate(d.getLastConsentTermsOfUseDate()); ds.setFullTextDownload(d.getFullTextDownload()); if (d.getOrganizations() != null) { ds.setOrganizations(d.getOrganizations().stream().map(DsmMappingUtils::asOrganizationDetail).collect(Collectors.toSet())); diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java index a5d27048..5285fb6e 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetails.java @@ -114,6 +114,9 @@ public class DatasourceDetails extends DatasourceIgnoredProperties { @ApiModelProperty(position = 30) private Date consentTermsOfUseDate; + @ApiModelProperty(position = 31) + private Date lastConsentTermsOfUseDate; + @ApiModelProperty(position = 26) private Set organizations; @@ -124,7 +127,7 @@ public class DatasourceDetails extends DatasourceIgnoredProperties { private String status; @Deprecated - @ApiModelProperty(position = 32) + @ApiModelProperty(position = 33) private String typology; public String getId() { @@ -421,8 +424,18 @@ public class DatasourceDetails extends DatasourceIgnoredProperties { } @Deprecated - public void setTypology(final String typology) { + public DatasourceDetails setTypology(final String typology) { this.typology = typology; + return this; + } + + public Date getLastConsentTermsOfUseDate() { + return lastConsentTermsOfUseDate; + } + + public DatasourceDetails setLastConsentTermsOfUseDate(final Date lastConsentTermsOfUseDate) { + this.lastConsentTermsOfUseDate = lastConsentTermsOfUseDate; + return this; } } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java index 06c8ce5a..311773a9 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceDetailsUpdate.java @@ -75,7 +75,10 @@ public class DatasourceDetailsUpdate { @ApiModelProperty(position = 29) private Date consentTermsOfUseDate; - @ApiModelProperty(position = 30) + @ApiModelProperty(position = 29) + private Date lastConsentTermsOfUseDate; + + @ApiModelProperty(position = 31) private Boolean fullTextDownload; public String getId() { @@ -217,24 +220,36 @@ public class DatasourceDetailsUpdate { return consentTermsOfUse; } - public void setConsentTermsOfUse(final Boolean consentTermsOfUse) { + public DatasourceDetailsUpdate setConsentTermsOfUse(final Boolean consentTermsOfUse) { this.consentTermsOfUse = consentTermsOfUse; + return this; } public Date getConsentTermsOfUseDate() { return consentTermsOfUseDate; } - public void setConsentTermsOfUseDate(final Date consentTermsOfUseDate) { + public DatasourceDetailsUpdate setConsentTermsOfUseDate(final Date consentTermsOfUseDate) { this.consentTermsOfUseDate = consentTermsOfUseDate; + return this; } public Boolean getFullTextDownload() { return fullTextDownload; } - public void setFullTextDownload(final Boolean fullTextDownload) { + public DatasourceDetailsUpdate setFullTextDownload(final Boolean fullTextDownload) { this.fullTextDownload = fullTextDownload; + return this; + } + + public Date getLastConsentTermsOfUseDate() { + return lastConsentTermsOfUseDate; + } + + public DatasourceDetailsUpdate setLastConsentTermsOfUseDate(final Date lastConsentTermsOfUseDate) { + this.lastConsentTermsOfUseDate = lastConsentTermsOfUseDate; + return this; } } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java index 168a249f..69dcab91 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/domain/DatasourceSnippetExtended.java @@ -53,13 +53,16 @@ public class DatasourceSnippetExtended { private Date consentTermsOfUseDate; @ApiModelProperty(position = 12) - private Boolean fullTextDownload; + private Date lastConsentTermsOfUseDate; @ApiModelProperty(position = 13) + private Boolean fullTextDownload; + + @ApiModelProperty(position = 14) private Set organizations; @Deprecated - @ApiModelProperty(position = 14) + @ApiModelProperty(position = 15) private String typology; public String getId() { @@ -167,8 +170,9 @@ public class DatasourceSnippetExtended { return organizations; } - public void setOrganizations(final Set organizations) { + public DatasourceSnippetExtended setOrganizations(final Set organizations) { this.organizations = organizations; + return this; } @Deprecated @@ -177,8 +181,18 @@ public class DatasourceSnippetExtended { } @Deprecated - public void setTypology(final String typology) { + public DatasourceSnippetExtended setTypology(final String typology) { this.typology = typology; + return this; + } + + public Date getLastConsentTermsOfUseDate() { + return lastConsentTermsOfUseDate; + } + + public DatasourceSnippetExtended setLastConsentTermsOfUseDate(final Date lastConsentTermsOfUseDate) { + this.lastConsentTermsOfUseDate = lastConsentTermsOfUseDate; + return this; } }