diff --git a/.classpath b/.classpath index 1eb27be..fdce528 100644 --- a/.classpath +++ b/.classpath @@ -20,10 +20,10 @@ - - + + diff --git a/lib/catgenerator-0.1.2.jar b/lib/catgenerator-0.1.2.jar deleted file mode 100644 index 607856d..0000000 Binary files a/lib/catgenerator-0.1.2.jar and /dev/null differ diff --git a/lib/catgenerator-0.1.2-sources.zip b/lib/catgenerator-core-0.1.7-sources.zip similarity index 100% rename from lib/catgenerator-0.1.2-sources.zip rename to lib/catgenerator-core-0.1.7-sources.zip diff --git a/lib/catgenerator-core-0.1.7.jar b/lib/catgenerator-core-0.1.7.jar new file mode 100644 index 0000000..f3fbb21 Binary files /dev/null and b/lib/catgenerator-core-0.1.7.jar differ diff --git a/lib/xidyn-1.11.1-sources.zip b/lib/xidyn-1.11.2-sources.zip similarity index 91% rename from lib/xidyn-1.11.1-sources.zip rename to lib/xidyn-1.11.2-sources.zip index 0881f31..00d1097 100644 Binary files a/lib/xidyn-1.11.1-sources.zip and b/lib/xidyn-1.11.2-sources.zip differ diff --git a/lib/xidyn-1.11.1.jar b/lib/xidyn-1.11.2.jar similarity index 85% rename from lib/xidyn-1.11.1.jar rename to lib/xidyn-1.11.2.jar index ae39bfc..bd7e91b 100644 Binary files a/lib/xidyn-1.11.1.jar and b/lib/xidyn-1.11.2.jar differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java index 83a4fea..52464b9 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java @@ -96,7 +96,7 @@ public class FederationPage data.setEscapedContent("federationDescription", federation.getDescription()); data.setEscapedContent("federationURL", federation.getWebsite()); - data.setAttribute("federationURL", "href", federation.getWebsite()); + data.setEscapedAttribute("federationURL", "href", federation.getWebsite()); data.setContent("federationStartDate", StringUtils.defaultIfBlank(federation.getStartDate(), "n/a")); data.setAttribute("rawLink", "href", federation.getTechnicalName() + ".properties"); @@ -104,31 +104,31 @@ public class FederationPage if (StringUtils.isNotBlank(federation.getLegalWebsite())) { - data.setAttribute("legalLink", "href", federation.getLegalWebsite()); + data.setEscapedAttribute("legalLink", "href", federation.getLegalWebsite()); data.setAttribute("legalLinkImg", "class", ""); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(federation.getContactWebsite())) { - data.setAttribute("contactLink", "href", federation.getContactWebsite()); + data.setEscapedAttribute("contactLink", "href", federation.getContactWebsite()); data.setAttribute("contactLinkImg", "class", ""); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(federation.getContactEmail())) { - data.setAttribute("emailLink", "href", "mailto:" + federation.getContactEmail()); + data.setEscapedAttribute("emailLink", "href", "mailto:" + federation.getContactEmail()); data.setAttribute("emailLinkImg", "class", ""); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(federation.getUserDocWebsite())) { - data.setAttribute("userDocLink", "href", federation.getUserDocWebsite()); + data.setEscapedAttribute("userDocLink", "href", federation.getUserDocWebsite()); data.setAttribute("userDocLinkImg", "class", ""); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(federation.getTechnicalDocWebsite())) { - data.setAttribute("technicalDocLink", "href", federation.getTechnicalDocWebsite()); + data.setEscapedAttribute("technicalDocLink", "href", federation.getTechnicalDocWebsite()); data.setAttribute("technicalDocLinkImg", "class", ""); data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } @@ -145,7 +145,7 @@ public class FederationPage data.setEscapedContent("organizationListLine", index, "organizationListLineNameValue", organization.getName()); data.setEscapedContent("organizationListLine", index, "organizationListLineUrlLink", organization.getWebsite()); - data.setAttribute("organizationListLine", index, "organizationListLineUrlLink", "href", organization.getWebsite()); + data.setEscapedAttribute("organizationListLine", index, "organizationListLineUrlLink", "href", organization.getWebsite()); data.setContent("organizationListLine", index, "organizationListLineServiceCount", organization.getServiceCount()); diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index 0c5220a..2e2dcc0 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -354,7 +354,9 @@ public class Htmlizer OrganizationTurnoutStats stats = StatAgent.statsOrganizationTurnout(organizations); PieChart pie = new PieChart("Participation"); - pie.add("Active", stats.getActiveCount(), ChartColor.GREEN); + pie.add("Active 1", stats.getWithSelfFileCount(), ChartColor.GREEN); + pie.add("Active 2", stats.getWithServiceFileCount(), ChartColor.YELLOW); + pie.add("Active 3", stats.getWithServiceMetricCount(), ChartColor.ORANGE); pie.add("Passive", stats.getPassiveCount(), ChartColor.BLUE); pie.setLegendPosition(Position.RIGHT); diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java index e7896d4..1c6a9ea 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java @@ -110,7 +110,7 @@ public class OrganizationPage data.setEscapedContent("organizationName", organization.get("organization.name")); data.setEscapedContent("organizationURL", organization.getWebsite()); - data.setAttribute("organizationURL", "href", organization.getWebsite()); + data.setEscapedAttribute("organizationURL", "href", organization.getWebsite()); data.setEscapedContent("organizationDescription", organization.get("organization.description")); data.setContent("organizationStartDate", StringUtils.defaultIfBlank(organization.getStartDate(), "n/a")); @@ -122,31 +122,31 @@ public class OrganizationPage if (StringUtils.isNotBlank(organization.getLegalWebsite())) { - data.setAttribute("legalLink", "href", organization.getLegalWebsite()); + data.setEscapedAttribute("legalLink", "href", organization.getLegalWebsite()); data.setAttribute("legalLinkImg", "class", ""); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(organization.getContactWebsite())) { - data.setAttribute("contactLink", "href", organization.getContactWebsite()); + data.setEscapedAttribute("contactLink", "href", organization.getContactWebsite()); data.setAttribute("contactLinkImg", "class", ""); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(organization.getContactEmail())) { - data.setAttribute("emailLink", "href", "mailto:" + organization.getContactEmail()); + data.setEscapedAttribute("emailLink", "href", "mailto:" + organization.getContactEmail()); data.setAttribute("emailLinkImg", "class", ""); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(organization.getUserGuideWebsite())) { - data.setAttribute("userDocLink", "href", organization.getUserGuideWebsite()); + data.setEscapedAttribute("userDocLink", "href", organization.getUserGuideWebsite()); data.setAttribute("userDocLinkImg", "class", ""); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(organization.getTechnicalGuideWebsite())) { - data.setAttribute("technicalDocLink", "href", organization.getTechnicalGuideWebsite()); + data.setEscapedAttribute("technicalDocLink", "href", organization.getTechnicalGuideWebsite()); data.setAttribute("technicalDocLinkImg", "class", ""); data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java index 5196965..d62afaa 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java @@ -76,7 +76,7 @@ public class ServiceListView data.setEscapedContent("serviceListLine", index, "serviceListLineUrlLink", service.getWebsite()); data.setEscapedContent("serviceListLine", index, "serviceListLineWebsiteLink", service.getWebsite()); - data.setAttribute("serviceListLine", index, "serviceListLineWebsiteLink", "href", service.getWebsite()); + data.setEscapedAttribute("serviceListLine", index, "serviceListLineWebsiteLink", "href", service.getWebsite()); data.setEscapedContent("serviceListLine", index, "serviceListLineSoftwareLink", service.getSoftwareName()); data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + service.getSoftwareTechnicalName() + ".xhtml"); @@ -88,31 +88,31 @@ public class ServiceListView if (StringUtils.isNotBlank(service.getLegalWebsite())) { - data.setAttribute("serviceListLine", index, "legalLink", "href", service.getLegalWebsite()); + data.setEscapedAttribute("serviceListLine", index, "legalLink", "href", service.getLegalWebsite()); data.setAttribute("serviceListLine", index, "legalLinkImg", "class", ""); data.getIdData("serviceListLine", index, "legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getContactWebsite())) { - data.setAttribute("serviceListLine", index, "contactLink", "href", service.getContactWebsite()); + data.setEscapedAttribute("serviceListLine", index, "contactLink", "href", service.getContactWebsite()); data.setAttribute("serviceListLine", index, "contactLinkImg", "class", ""); data.getIdData("serviceListLine", index, "contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getContactEmail())) { - data.setAttribute("serviceListLine", index, "emailLink", "href", "mailto:" + service.getContactEmail()); + data.setEscapedAttribute("serviceListLine", index, "emailLink", "href", "mailto:" + service.getContactEmail()); data.setAttribute("serviceListLine", index, "emailLinkImg", "class", ""); data.getIdData("serviceListLine", index, "emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getUserDocWebsite())) { - data.setAttribute("serviceListLine", index, "userDocLink", "href", service.getUserDocWebsite()); + data.setEscapedAttribute("serviceListLine", index, "userDocLink", "href", service.getUserDocWebsite()); data.setAttribute("serviceListLine", index, "userDocLinkImg", "class", ""); data.getIdData("serviceListLine", index, "userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) { - data.setAttribute("serviceListLine", index, "technicalDocLink", "href", service.getTechnicalDocWebsite()); + data.setEscapedAttribute("serviceListLine", index, "technicalDocLink", "href", service.getTechnicalDocWebsite()); data.setAttribute("serviceListLine", index, "technicalDocLinkImg", "class", ""); data.getIdData("serviceListLine", index, "technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } @@ -145,19 +145,19 @@ public class ServiceListView data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a")); if (StringUtils.isNotBlank(service.getSoftwareWebsite())) { - data.setAttribute("serviceListLine", index, "softwareWebsiteLink", "href", service.getSoftwareWebsite()); + data.setEscapedAttribute("serviceListLine", index, "softwareWebsiteLink", "href", service.getSoftwareWebsite()); data.setAttribute("serviceListLine", index, "softwareWebsiteLinkImg", "class", ""); data.getIdData("serviceListLine", index, "softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) { - data.setAttribute("serviceListLine", index, "softwareLicenseLink", "href", XidynUtils.escapeXmlBlank(service.getSoftwareLicenseWebpage())); + data.setEscapedAttribute("serviceListLine", index, "softwareLicenseLink", "href", service.getSoftwareLicenseWebpage()); data.setAttribute("serviceListLine", index, "softwareLicenseLinkImg", "class", ""); data.getIdData("serviceListLine", index, "softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) { - data.setAttribute("serviceListLine", index, "softwareSourceLink", "href", service.getSoftwareSourceWebsite()); + data.setEscapedAttribute("serviceListLine", index, "softwareSourceLink", "href", service.getSoftwareSourceWebsite()); data.setAttribute("serviceListLine", index, "softwareSourceLinkImg", "class", ""); data.getIdData("serviceListLine", index, "softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java index 1598a80..6242e94 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java @@ -40,7 +40,6 @@ import fr.devinsy.xidyn.XidynException; import fr.devinsy.xidyn.data.DisplayMode; import fr.devinsy.xidyn.data.TagDataManager; import fr.devinsy.xidyn.presenters.PresenterUtils; -import fr.devinsy.xidyn.utils.XidynUtils; /** * The Class ServicePage. @@ -113,10 +112,10 @@ public class ServicePage data.setAttribute("serviceLogo", "src", service.getLogoFileName()); data.setEscapedContent("serviceName", service.getName()); - data.setAttribute("serviceName", "href", service.getWebsite()); + data.setEscapedAttribute("serviceName", "href", service.getWebsite()); data.setEscapedContent("serviceURL", service.getWebsite()); - data.setAttribute("serviceURL", "href", service.getWebsite()); + data.setEscapedAttribute("serviceURL", "href", service.getWebsite()); data.setContent("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a")); data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a")); @@ -130,31 +129,31 @@ public class ServicePage if (StringUtils.isNotBlank(service.getLegalWebsite())) { - data.setAttribute("legalLink", "href", service.getLegalWebsite()); + data.setEscapedAttribute("legalLink", "href", service.getLegalWebsite()); data.setAttribute("legalLinkImg", "class", ""); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getContactWebsite())) { - data.setAttribute("contactLink", "href", service.getContactWebsite()); + data.setEscapedAttribute("contactLink", "href", service.getContactWebsite()); data.setAttribute("contactLinkImg", "class", ""); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getContactEmail())) { - data.setAttribute("emailLink", "href", "mailto:" + service.getContactEmail()); + data.setEscapedAttribute("emailLink", "href", "mailto:" + service.getContactEmail()); data.setAttribute("emailLinkImg", "class", ""); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getUserDocWebsite())) { - data.setAttribute("userDocLink", "href", service.getUserDocWebsite()); + data.setEscapedAttribute("userDocLink", "href", service.getUserDocWebsite()); data.setAttribute("userDocLinkImg", "class", ""); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) { - data.setAttribute("technicalDocLink", "href", service.getTechnicalDocWebsite()); + data.setEscapedAttribute("technicalDocLink", "href", service.getTechnicalDocWebsite()); data.setAttribute("technicalDocLinkImg", "class", ""); data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } @@ -187,19 +186,19 @@ public class ServicePage data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a")); if (StringUtils.isNotBlank(service.getSoftwareWebsite())) { - data.setAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite()); + data.setEscapedAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite()); data.setAttribute("softwareWebsiteLinkImg", "class", ""); data.getIdData("softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) { - data.setAttribute("softwareLicenseLink", "href", XidynUtils.escapeXmlBlank(service.getSoftwareLicenseWebpage())); + data.setEscapedAttribute("softwareLicenseLink", "href", service.getSoftwareLicenseWebpage()); data.setAttribute("softwareLicenseLinkImg", "class", ""); data.getIdData("softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) { - data.setAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite()); + data.setEscapedAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite()); data.setAttribute("softwareSourceLinkImg", "class", ""); data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } diff --git a/src/fr/devinsy/statoolinfos/stats/StatAgent.java b/src/fr/devinsy/statoolinfos/stats/StatAgent.java index 4acde25..7bb3a37 100644 --- a/src/fr/devinsy/statoolinfos/stats/StatAgent.java +++ b/src/fr/devinsy/statoolinfos/stats/StatAgent.java @@ -20,6 +20,7 @@ package fr.devinsy.statoolinfos.stats; import java.io.IOException; import java.net.MalformedURLException; +import java.util.Iterator; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -366,9 +367,32 @@ public class StatAgent { result.incPassiveCount(); } + else if (organization.getServiceCount() == 0) + { + result.incWithSelfFileCount(); + } else { - result.incActiveCount(); + boolean ended = false; + Iterator iterator = organization.getServices().iterator(); + while (!ended) + { + if (iterator.hasNext()) + { + Service service = iterator.next(); + + if (!service.getByPrefix("metrics.").isEmpty()) + { + ended = true; + result.incWithServiceMetricCount(); + } + } + else + { + ended = true; + result.incWithServiceFileCount(); + } + } } } diff --git a/src/fr/devinsy/statoolinfos/stats/organizations/OrganizationTurnoutStats.java b/src/fr/devinsy/statoolinfos/stats/organizations/OrganizationTurnoutStats.java index 605bba9..a356caf 100644 --- a/src/fr/devinsy/statoolinfos/stats/organizations/OrganizationTurnoutStats.java +++ b/src/fr/devinsy/statoolinfos/stats/organizations/OrganizationTurnoutStats.java @@ -23,7 +23,9 @@ package fr.devinsy.statoolinfos.stats.organizations; */ public class OrganizationTurnoutStats { - private long activeCount; + private long withSelfFileCount; + private long withServiceFileCount; + private long withServiceMetricCount; private long passiveCount; /** @@ -31,13 +33,6 @@ public class OrganizationTurnoutStats */ public OrganizationTurnoutStats() { - this.activeCount = 0; - this.passiveCount = 0; - } - - public long getActiveCount() - { - return this.activeCount; } public long getPassiveCount() @@ -54,15 +49,25 @@ public class OrganizationTurnoutStats { long result; - result = this.activeCount + this.passiveCount; + result = this.withSelfFileCount + this.withServiceFileCount + this.withServiceMetricCount + this.passiveCount; // return result; } - public void incActiveCount() + public long getWithSelfFileCount() { - this.activeCount += 1; + return this.withSelfFileCount; + } + + public long getWithServiceFileCount() + { + return this.withServiceFileCount; + } + + public long getWithServiceMetricCount() + { + return this.withServiceMetricCount; } public void incPassiveCount() @@ -70,9 +75,19 @@ public class OrganizationTurnoutStats this.passiveCount += 1; } - public void setActiveCount(final long activeCount) + public void incWithSelfFileCount() { - this.activeCount = activeCount; + this.withSelfFileCount += 1; + } + + public void incWithServiceFileCount() + { + this.withServiceFileCount += 1; + } + + public void incWithServiceMetricCount() + { + this.withServiceMetricCount += 1; } public void setPassiveCount(final long passiveCount)