From 04743534635962f9cd85ca29e24e849839da749a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 26 Sep 2020 03:18:11 +0200 Subject: [PATCH] Fixes somes. --- src/fr/devinsy/statoolinfos/core/Organizations.java | 2 +- src/fr/devinsy/statoolinfos/crawl/Crawler.java | 7 +++++-- src/fr/devinsy/statoolinfos/htmlize/FederationPage.java | 4 +++- src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java | 7 +++++-- src/fr/devinsy/statoolinfos/htmlize/organization.xhtml | 7 +++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/core/Organizations.java b/src/fr/devinsy/statoolinfos/core/Organizations.java index 75bc4a0..671cddc 100644 --- a/src/fr/devinsy/statoolinfos/core/Organizations.java +++ b/src/fr/devinsy/statoolinfos/core/Organizations.java @@ -96,7 +96,7 @@ public class Organizations extends ArrayList { Organizations result; - result = sort(OrganizationComparator.Sorting.USER_COUNT); + result = sort(OrganizationComparator.Sorting.SERVICE_COUNT); // return result; diff --git a/src/fr/devinsy/statoolinfos/crawl/Crawler.java b/src/fr/devinsy/statoolinfos/crawl/Crawler.java index 6790e67..fe35a31 100644 --- a/src/fr/devinsy/statoolinfos/crawl/Crawler.java +++ b/src/fr/devinsy/statoolinfos/crawl/Crawler.java @@ -175,8 +175,11 @@ public class Crawler PathProperties subs = properties.getByPrefix("subs"); for (PathProperty property : subs) { - URL subUrl = new URL(property.getValue()); - crawl(subUrl, cache); + if (StringUtils.isNotBlank(property.getValue())) + { + URL subUrl = new URL(property.getValue()); + crawl(subUrl, cache); + } } } } diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java index 0ca72e3..0e04d94 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java @@ -62,13 +62,15 @@ public class FederationPage data.setContent("serviceCount", federation.getServiceCount()); int index = 0; - for (Organization organization : federation.getOrganizations().sortByServiceCount()) + for (Organization organization : federation.getOrganizations().sortByServiceCount().reverse()) { data.setAttribute("organizationListLine", index, "organizationListLineNameLink", "href", organization.getTechnicalName() + ".xhtml"); data.setAttribute("organizationListLine", index, "organizationListLineLogo", "src", organization.getTechnicalName() + "-logo.png"); data.setEscapedContent("organizationListLine", index, "organizationListLineNameValue", organization.getName()); + data.setEscapedContent("organizationListLine", index, "organizationListLineUrlLink", organization.getWebsite()); data.setAttribute("organizationListLine", index, "organizationListLineUrlLink", "href", organization.getWebsite()); + data.setContent("organizationListLine", index, "organizationListLineServiceCount", organization.getServiceCount()); index += 1; diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java index c8475a1..fb3115a 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java @@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.Organization; import fr.devinsy.statoolinfos.core.Service; import fr.devinsy.statoolinfos.core.StatoolInfosException; +import fr.devinsy.statoolinfos.core.StatoolInfosUtils; import fr.devinsy.xidyn.XidynException; import fr.devinsy.xidyn.data.TagDataManager; import fr.devinsy.xidyn.presenters.PresenterUtils; @@ -67,10 +68,12 @@ public class OrganizationPage data.setAttribute("serviceListLine", index, "serviceListLineNameLink", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + ".xhtml"); data.setAttribute("serviceListLine", index, "serviceListLineLogo", "src", organization.getTechnicalName() + "-" + service.getTechnicalName() + "-logo.png"); data.setEscapedContent("serviceListLine", index, "serviceListLineNameValue", service.getName()); - data.setEscapedContent("serviceListLine", index, "serviceListLineUrlLink", service.getWebsite()); + data.setEscapedContent("serviceListLine", index, "serviceListLineWebsiteLink", service.getWebsite()); data.setAttribute("serviceListLine", index, "serviceListLineWebsiteLink", "href", service.getWebsite()); - data.setEscapedContent("serviceListLine", index, "serviceListLineSoftware", service.getSoftwareName()); + + data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + StatoolInfosUtils.toTechnicalName(service.getSoftwareName()) + ".xhtml"); + data.setEscapedContent("serviceListLine", index, "serviceListLineSoftwareValue", service.getSoftwareName()); index += 1; } diff --git a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml index f0d0035..f4045f7 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml @@ -17,7 +17,6 @@
Raw
-

Bla bla description

Nombre de services : n/a
@@ -39,7 +38,11 @@ n/a - n/a + + + n/a + + n/a