Resolve tickets 9114 and 9031 #12

Merged
lsmyrnaios merged 10 commits from develop into master 2024-04-04 15:33:10 +02:00
9 changed files with 16 additions and 47 deletions
Showing only changes of commit c836de5761 - Show all commits

View File

@ -96,7 +96,7 @@
<dependency> <dependency>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-exporter-model</artifactId> <artifactId>dnet-exporter-model</artifactId>
<version>[3.5.0, )</version> <version>[3.5.1, )</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.springdoc</groupId> <groupId>org.springdoc</groupId>

View File

@ -1,6 +1,10 @@
package eu.dnetlib.repo.manager.controllers; package eu.dnetlib.repo.manager.controllers;
import eu.dnetlib.repo.manager.domain.*; import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import eu.dnetlib.repo.manager.domain.BrokerSummary;
import eu.dnetlib.repo.manager.domain.CollectionMonitorSummary;
import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo;
import eu.dnetlib.repo.manager.domain.UsageSummary;
import eu.dnetlib.repo.manager.exception.BrokerException; import eu.dnetlib.repo.manager.exception.BrokerException;
import eu.dnetlib.repo.manager.exception.RepositoryServiceException; import eu.dnetlib.repo.manager.exception.RepositoryServiceException;
import eu.dnetlib.repo.manager.service.*; import eu.dnetlib.repo.manager.service.*;

View File

@ -1,6 +1,7 @@
package eu.dnetlib.repo.manager.controllers; package eu.dnetlib.repo.manager.controllers;
import eu.dnetlib.domain.data.PiwikInfo; import eu.dnetlib.domain.data.PiwikInfo;
import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import eu.dnetlib.repo.manager.domain.*; import eu.dnetlib.repo.manager.domain.*;
import eu.dnetlib.repo.manager.domain.dto.RepositoryTerms; import eu.dnetlib.repo.manager.domain.dto.RepositoryTerms;
import eu.dnetlib.repo.manager.domain.dto.User; import eu.dnetlib.repo.manager.domain.dto.User;

View File

@ -1,29 +0,0 @@
package eu.dnetlib.repo.manager.domain;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import java.util.List;
@JsonAutoDetect
public class AggregationHistoryResponse extends Response {
private List<AggregationInfo> aggregationInfo;
public AggregationHistoryResponse() {
// no-arg constructor
}
public AggregationHistoryResponse(final List<AggregationInfo> aggregationInfo) {
super();
this.aggregationInfo = aggregationInfo;
}
public List<AggregationInfo> getAggregationInfo() {
return aggregationInfo;
}
public void setAggregationInfo(final List<AggregationInfo> aggregationInfo) {
this.aggregationInfo = aggregationInfo;
}
}

View File

@ -1,9 +0,0 @@
package eu.dnetlib.repo.manager.domain;
import eu.dnetlib.openaire.exporter.model.dsm.CollectionInfoV2;
public class AggregationInfo extends CollectionInfoV2 {
public AggregationInfo() {
}
}

View File

@ -1,5 +1,7 @@
package eu.dnetlib.repo.manager.domain; package eu.dnetlib.repo.manager.domain;
import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import java.util.List; import java.util.List;
public class CollectionMonitorSummary { public class CollectionMonitorSummary {

View File

@ -1,6 +1,6 @@
package eu.dnetlib.repo.manager.service; package eu.dnetlib.repo.manager.service;
import eu.dnetlib.repo.manager.domain.AggregationInfo; import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import org.json.JSONException; import org.json.JSONException;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package eu.dnetlib.repo.manager.service; package eu.dnetlib.repo.manager.service;
import eu.dnetlib.repo.manager.domain.AggregationHistoryResponse; import eu.dnetlib.openaire.exporter.model.dsm.AggregationHistoryResponseV2;
import eu.dnetlib.repo.manager.domain.AggregationInfo; import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -41,7 +41,7 @@ public class AggregationServiceImpl implements AggregationService {
logger.debug("Retrieving aggregations for repository with id : " + id); logger.debug("Retrieving aggregations for repository with id : " + id);
UriComponents uriComponents = getAggregationHistory(id); UriComponents uriComponents = getAggregationHistory(id);
AggregationHistoryResponse rs = restTemplate.getForObject(uriComponents.toUri(), AggregationHistoryResponse.class); AggregationHistoryResponseV2 rs = restTemplate.getForObject(uriComponents.toUri(), AggregationHistoryResponseV2.class);
return rs != null ? (List<T>) rs.getAggregationInfo() : null; return rs != null ? (List<T>) rs.getAggregationInfo() : null;
} }
@ -73,7 +73,7 @@ public class AggregationServiceImpl implements AggregationService {
private UriComponents getAggregationHistory(String repoId) { private UriComponents getAggregationHistory(String repoId) {
return UriComponentsBuilder return UriComponentsBuilder
.fromHttpUrl(baseAddress + "/ds/aggregationhistory/") .fromHttpUrl(baseAddress + "/dsm/2.0/aggregationhistory/")
.path(repoId) .path(repoId)
.build().expand(repoId).encode(); .build().expand(repoId).encode();
} }

View File

@ -1,6 +1,6 @@
package eu.dnetlib.repo.manager.service; package eu.dnetlib.repo.manager.service;
import eu.dnetlib.repo.manager.domain.AggregationInfo; import eu.dnetlib.openaire.exporter.model.dsm.AggregationInfo;
import eu.dnetlib.repo.manager.domain.MetricsNumbers; import eu.dnetlib.repo.manager.domain.MetricsNumbers;
import eu.dnetlib.repo.manager.domain.RepositorySnippet; import eu.dnetlib.repo.manager.domain.RepositorySnippet;
import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo; import eu.dnetlib.repo.manager.domain.RepositorySummaryInfo;
@ -49,7 +49,7 @@ public class DashboardServiceImpl implements DashboardService {
repositorySummaryInfo.setRepositoryName(repoOfficialName); repositorySummaryInfo.setRepositoryName(repoOfficialName);
repositorySummaryInfo.setLogoURL(repository.getLogoUrl()); repositorySummaryInfo.setLogoURL(repository.getLogoUrl());
//TODO getRepositoryAggregations returns only the 20 more recent items. Is it positive that we will find an indexed version there? //TODO getRepositoryAggregations returns only the 20 more recent items. Is it possible that we will find an indexed version there?
boolean isIndexedVersionFound = false; boolean isIndexedVersionFound = false;
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<AggregationInfo> aggregationInfoList = aggregationService.getRepositoryAggregations(repoId, 0, 20); List<AggregationInfo> aggregationInfoList = aggregationService.getRepositoryAggregations(repoId, 0, 20);