add maxInMemorySizeInBytes

This commit is contained in:
Efstratios Giannopoulos 2024-05-15 16:37:49 +03:00
parent 643fa896b0
commit ae573e9de2
6 changed files with 44 additions and 15 deletions

View File

@ -280,14 +280,14 @@ public class ZenodoBuilder {
List<ReferenceModel> dmpGrants = this.getReferenceModelOfType(dmp, zenodoServiceProperties.getGrantReferenceCode());
List<ReferenceModel> dmpFunders = this.getReferenceModelOfType(dmp, zenodoServiceProperties.getFunderReferenceCode());
if (dmpGrants != null && !dmpGrants.isEmpty()) {
if (!dmpGrants.isEmpty()) {
ReferenceModel depositGrant = dmpGrants.stream().filter(x-> x.getSource().equalsIgnoreCase(zenodoServiceProperties.getOpenaireGrantSourceCode())).findFirst().orElse(null);
if (depositGrant != null) {
String grantReferenceTail = depositGrant.getReference().split(":")[2];
List<FunderProperties.DoiFunder> doiFunders = this.funderProperties.getAvailable();
if (dmpFunders != null && !dmpFunders.isEmpty()) {
ReferenceModel depositFunder = dmpFunders.get(0);
if (!dmpFunders.isEmpty()) {
ReferenceModel depositFunder = dmpFunders.getFirst();
FunderProperties.DoiFunder doiFunder = doiFunders.stream()
.filter(doiFunder1 -> depositFunder.getLabel().contains(doiFunder1.getFunder()) || doiFunder1.getFunder().contains(depositFunder.getLabel()))
.findFirst().orElse(null);

View File

@ -369,7 +369,10 @@ public class ZenodoDepositServiceImpl implements ZenodoDepositService {
return WebClient.builder().filters(exchangeFilterFunctions -> {
exchangeFilterFunctions.add(logRequest());
exchangeFilterFunctions.add(logResponse());
}).build();
}).codecs(codecs -> codecs
.defaultCodecs()
.maxInMemorySize(this.zenodoServiceProperties.getMaxInMemorySizeInBytes())
).build();
}
private static ExchangeFilterFunction logRequest() {

View File

@ -22,6 +22,7 @@ public class ZenodoServiceProperties {
private String licensesReferenceCode;
private String openaireGrantSourceCode;
private String orcidResearcherSourceCode;
private int maxInMemorySizeInBytes;
public String getLogo() {
return logo;
@ -118,4 +119,12 @@ public class ZenodoServiceProperties {
public void setOrcidResearcherSourceCode(String orcidResearcherSourceCode) {
this.orcidResearcherSourceCode = orcidResearcherSourceCode;
}
public int getMaxInMemorySizeInBytes() {
return maxInMemorySizeInBytes;
}
public void setMaxInMemorySizeInBytes(int maxInMemorySizeInBytes) {
this.maxInMemorySizeInBytes = maxInMemorySizeInBytes;
}
}

View File

@ -0,0 +1,14 @@
IDP_ISSUER_URI=http://dev03.local.cite.gr:60201/realms/dmp-development
WEB_PORT=8082
ZENODO_AUTHORIZATION_URL=https://sandbox.zenodo.org/oauth/authorize
ZENODO_ACCESS_TOKEN_URL=https://sandbox.zenodo.org/oauth/token
ZENODO_CLIENT_ID=mdwl77ZpDaY4DKxzaHdfpUz4vpjtusfSdLuHzfxe
ZENODO_CLIENT_SECRET=cvTkkzmfkO7OBYIJQ2ZEWfc309ELwJBJe3rtOHZL2ITcX27woE7IUAw5NMsU
ZENODO_ACCESS_TOKEN=uUwXiySNn637uWQpcsfOtifsmLfP0lgp0N8uOssppb7ajeJCq5WicHbcC2Vk
ZENODO_URL=https://sandbox.zenodo.org/api/
ZENODO_RECORD_URL=https://sandbox.zenodo.org/record/
REDIRECT_URL=http://localhost:4200/login/external/zenodo
STORAGE_PATH=/storage

View File

@ -4,15 +4,5 @@ zenodo:
domain: https://argos.openaire.eu/
logo: classpath:zenodo.jpg
depositConfiguration:
deposit-type: 2
repository-id: zenodo
access-token: ${ZENODO_ACCESS_TOKEN}
repository-url: https://sandbox.zenodo.org/api/
repository-authorization-url: https://sandbox.zenodo.org/oauth/authorize
repository-record-url: https://sandbox.zenodo.org/record/
repository-access-token-url: https://sandbox.zenodo.org/oauth/token
repository-client-id:
repository-client-secret:
redirect-uri: http://localhost:4200/login/external/zenodo
has-logo: true
useSharedStorage: false

View File

@ -9,4 +9,17 @@ zenodo:
publicationReferenceCode: "publications"
openaireGrantSourceCode: "openaire"
orcidResearcherSourceCode: "ORCID"
maxInMemorySizeInBytes: 6554000
depositConfiguration:
deposit-type: 2
repository-id: zenodo
access-token: ${ZENODO_ACCESS_TOKEN}
repository-url: ${ZENODO_URL}
repository-authorization-url: ${ZENODO_AUTHORIZATION_URL}
repository-record-url: ${ZENODO_RECORD_URL}
repository-access-token-url: ${ZENODO_ACCESS_TOKEN_URL}
repository-client-id: ${ZENODO_CLIENT_ID}
repository-client-secret: ${ZENODO_CLIENT_SECRET}
redirect-uri: ${REDIRECT_URL}
has-logo: true
useSharedStorage: false