Skip to content

Commit

Permalink
Microsoft: Càrrega inicial des de les sincronitzacions existents (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mollerentornos authored Aug 30, 2024
1 parent 3329d4c commit e5d281f
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,21 @@ public List<SiteSynchronization> getLinkedSiteSynchronizations(boolean fillSite)

@Override
public List<SiteSynchronization> getFilteredSiteSynchronizations(boolean fillSite, SakaiSiteFilter filter, ZonedDateTime fromDate, ZonedDateTime toDate) {
List<SiteSynchronization> result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate);

if(filter.getSiteProperty().isEmpty()){
return result.stream().map(ss -> {
if (fillSite) {
ss.setSite(sakaiProxy.getSite(ss.getSiteId()));
}
return ss;
})
.collect(Collectors.toList());
}

final List<Site> sites = sakaiProxy.getSakaiSites(filter);

List<SiteSynchronization> result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate).stream().map(ss -> {
return result.stream().map(ss -> {
Site site = null;
if (fillSite) {
site = sites.stream().filter(s -> s.getId().equals(ss.getSiteId())).findFirst().orElse(null);
Expand All @@ -237,7 +249,6 @@ public List<SiteSynchronization> getFilteredSiteSynchronizations(boolean fillSit
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
return result;
}

@Override
Expand Down

0 comments on commit e5d281f

Please sign in to comment.