From 87b44605c5b1363152fa7582b24df928e1558a0d Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 22 Jan 2022 19:28:52 +0100 Subject: [PATCH] Restricted federation stats to active organizations only. --- .../htmlize/FederationStatsPage.java | 18 +++++++++--------- .../devinsy/statoolinfos/stats/StatAgent.java | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationStatsPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationStatsPage.java index 680efdc..ba2ae73 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationStatsPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationStatsPage.java @@ -64,19 +64,19 @@ public class FederationStatsPage data.setContent("federationHeaderView", FederationHeaderView.htmlize(federation)); - data.setContent("turnoutChart", ChartHtmlizer.htmlizeOrganizationTurnoutChart(federation.getOrganizations())); - data.setContent("organizationCountryChart", ChartHtmlizer.htmlizeOrganizationCountryChart(federation.getOrganizations())); + data.setContent("turnoutChart", ChartHtmlizer.htmlizeOrganizationTurnoutChart(federation.getActiveOrganizations())); + data.setContent("organizationCountryChart", ChartHtmlizer.htmlizeOrganizationCountryChart(federation.getActiveOrganizations())); data.setContent("organizationCountChart", ChartHtmlizer.htmlizeOrganizationCountChart(federation)); data.setContent("organizationInOutChart", ChartHtmlizer.htmlizeOrganizationInOutChart(federation)); - data.setContent("hostServerTypeChart", ChartHtmlizer.htmlizeHostServerTypeChart(federation.getServicesAll())); - data.setContent("hostProviderTypeChart", ChartHtmlizer.htmlizeHostProviderTypeChart(federation.getServicesAll())); - data.setContent("serviceInstallTypeChart", ChartHtmlizer.htmlizeServiceInstallTypeChart(federation.getServicesAll())); - data.setContent("serviceCountryChart", ChartHtmlizer.htmlizeServiceCountryChart(federation.getServicesAll())); + data.setContent("hostServerTypeChart", ChartHtmlizer.htmlizeHostServerTypeChart(federation.getServices())); + data.setContent("hostProviderTypeChart", ChartHtmlizer.htmlizeHostProviderTypeChart(federation.getServices())); + data.setContent("serviceInstallTypeChart", ChartHtmlizer.htmlizeServiceInstallTypeChart(federation.getServices())); + data.setContent("serviceCountryChart", ChartHtmlizer.htmlizeServiceCountryChart(federation.getServices())); // { - RegistrationStats stats = StatAgent.statRegistrationTypes(federation.getServicesAll()); + RegistrationStats stats = StatAgent.statRegistrationTypes(federation.getServices()); data.setContent("registrationTypeChart", ChartHtmlizer.htmlizeRegistrationBarChart(stats)); data.setContent("registrationNoneTypeChart", ChartHtmlizer.htmlizeRegistrationNonePieChart(stats)); @@ -86,14 +86,14 @@ public class FederationStatsPage } data.setContent("serviceCountYearChart", ChartHtmlizer.htmlizeServiceCountYearChart(federation)); - data.setContent("serviceDateStatusChart", ChartHtmlizer.htmlizeServiceDateStatusChart(federation.getServicesAll())); + data.setContent("serviceDateStatusChart", ChartHtmlizer.htmlizeServiceDateStatusChart(federation.getServices())); data.setContent("softwareDistributionChart", ChartHtmlizer.htmlizeSoftwareDistributionChart()); data.setContent("softwareDistributionPieChart", ChartHtmlizer.htmlizeSoftwareDistributionPieChart(federation.getServicesAll())); data.setContent("categoryDistributionChart", ChartHtmlizer.htmlizeCategoryDistributionChart()); data.setContent("categoryDistributionPieChart", ChartHtmlizer.htmlizeCatergoryDistributionPieChart(federation.getServicesAll())); - data.setContent("hostNameChart", ChartHtmlizer.htmlizeHostNamePieChart(federation.getServicesAll())); + data.setContent("hostNameChart", ChartHtmlizer.htmlizeHostNamePieChart(federation.getServices())); // String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/federationStats.xhtml", data).toString(); diff --git a/src/fr/devinsy/statoolinfos/stats/StatAgent.java b/src/fr/devinsy/statoolinfos/stats/StatAgent.java index 0956598..f2d7f28 100644 --- a/src/fr/devinsy/statoolinfos/stats/StatAgent.java +++ b/src/fr/devinsy/statoolinfos/stats/StatAgent.java @@ -87,7 +87,7 @@ public class StatAgent CategoryStat stat = new CategoryStat(category); StringSet organizations = new StringSet(); - for (Service service : federation.getServicesAll()) + for (Service service : federation.getServices()) { String softwareName = service.getSoftwareName(); if (category.getSoftwares().containsIgnoreCase(softwareName)) @@ -195,7 +195,7 @@ public class StatAgent SoftwareStat stat = new SoftwareStat(software.getName()); stat.getCategories().addAll(categories.findBySoftware(software.getName())); StringSet organizations = new StringSet(); - for (Service service : federation.getServicesAll()) + for (Service service : federation.getServices()) { Software current = catalog.get(service.getSoftwareName()); if (current == software)