Upgraded catgenerator lib, xidyn lib. Fixed setEscapedAttribute.

This commit is contained in:
Christian P. MOMON 2020-11-20 07:07:59 +01:00
parent ba382f107c
commit f9c352c799
13 changed files with 90 additions and 50 deletions

View file

@ -20,10 +20,10 @@
<classpathentry kind="lib" path="lib/commons-cli-1.4.jar" sourcepath="lib/commons-cli-1.4-sources.jar"/> <classpathentry kind="lib" path="lib/commons-cli-1.4.jar" sourcepath="lib/commons-cli-1.4-sources.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/> <classpathentry kind="lib" path="lib/commons-io-2.7.jar" sourcepath="lib/commons-io-2.7-sources.jar"/>
<classpathentry kind="lib" path="lib/devinsy-strings-0.11.0.jar" sourcepath="lib/devinsy-strings-0.11.0-sources.zip"/> <classpathentry kind="lib" path="lib/devinsy-strings-0.11.0.jar" sourcepath="lib/devinsy-strings-0.11.0-sources.zip"/>
<classpathentry kind="lib" path="lib/xidyn-1.11.1.jar" sourcepath="lib/xidyn-1.11.1-sources.zip"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.11.jar" sourcepath="lib/commons-lang3-3.11-sources.jar"/> <classpathentry kind="lib" path="lib/commons-lang3-3.11.jar" sourcepath="lib/commons-lang3-3.11-sources.jar"/>
<classpathentry kind="lib" path="lib/commons-text-1.9.jar" sourcepath="lib/commons-text-1.9-sources.jar"/> <classpathentry kind="lib" path="lib/commons-text-1.9.jar" sourcepath="lib/commons-text-1.9-sources.jar"/>
<classpathentry kind="lib" path="lib/catgenerator-0.1.2.jar" sourcepath="lib/catgenerator-0.1.2-sources.zip"/>
<classpathentry kind="lib" path="lib/tika-core-1.24.1.jar" sourcepath="lib/tika-core-1.24.1-sources.jar"/> <classpathentry kind="lib" path="lib/tika-core-1.24.1.jar" sourcepath="lib/tika-core-1.24.1-sources.jar"/>
<classpathentry kind="lib" path="lib/catgenerator-core-0.1.7.jar" sourcepath="lib/catgenerator-core-0.1.7-sources.zip"/>
<classpathentry kind="lib" path="lib/xidyn-1.11.2.jar" sourcepath="lib/xidyn-1.11.2-sources.zip"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

Binary file not shown.

Binary file not shown.

View file

@ -96,7 +96,7 @@ public class FederationPage
data.setEscapedContent("federationDescription", federation.getDescription()); data.setEscapedContent("federationDescription", federation.getDescription());
data.setEscapedContent("federationURL", federation.getWebsite()); 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.setContent("federationStartDate", StringUtils.defaultIfBlank(federation.getStartDate(), "n/a"));
data.setAttribute("rawLink", "href", federation.getTechnicalName() + ".properties"); data.setAttribute("rawLink", "href", federation.getTechnicalName() + ".properties");
@ -104,31 +104,31 @@ public class FederationPage
if (StringUtils.isNotBlank(federation.getLegalWebsite())) if (StringUtils.isNotBlank(federation.getLegalWebsite()))
{ {
data.setAttribute("legalLink", "href", federation.getLegalWebsite()); data.setEscapedAttribute("legalLink", "href", federation.getLegalWebsite());
data.setAttribute("legalLinkImg", "class", ""); data.setAttribute("legalLinkImg", "class", "");
data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(federation.getContactWebsite())) if (StringUtils.isNotBlank(federation.getContactWebsite()))
{ {
data.setAttribute("contactLink", "href", federation.getContactWebsite()); data.setEscapedAttribute("contactLink", "href", federation.getContactWebsite());
data.setAttribute("contactLinkImg", "class", ""); data.setAttribute("contactLinkImg", "class", "");
data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(federation.getContactEmail())) if (StringUtils.isNotBlank(federation.getContactEmail()))
{ {
data.setAttribute("emailLink", "href", "mailto:" + federation.getContactEmail()); data.setEscapedAttribute("emailLink", "href", "mailto:" + federation.getContactEmail());
data.setAttribute("emailLinkImg", "class", ""); data.setAttribute("emailLinkImg", "class", "");
data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(federation.getUserDocWebsite())) if (StringUtils.isNotBlank(federation.getUserDocWebsite()))
{ {
data.setAttribute("userDocLink", "href", federation.getUserDocWebsite()); data.setEscapedAttribute("userDocLink", "href", federation.getUserDocWebsite());
data.setAttribute("userDocLinkImg", "class", ""); data.setAttribute("userDocLinkImg", "class", "");
data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(federation.getTechnicalDocWebsite())) if (StringUtils.isNotBlank(federation.getTechnicalDocWebsite()))
{ {
data.setAttribute("technicalDocLink", "href", federation.getTechnicalDocWebsite()); data.setEscapedAttribute("technicalDocLink", "href", federation.getTechnicalDocWebsite());
data.setAttribute("technicalDocLinkImg", "class", ""); data.setAttribute("technicalDocLinkImg", "class", "");
data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); 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, "organizationListLineNameValue", organization.getName());
data.setEscapedContent("organizationListLine", index, "organizationListLineUrlLink", organization.getWebsite()); 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()); data.setContent("organizationListLine", index, "organizationListLineServiceCount", organization.getServiceCount());

View file

@ -354,7 +354,9 @@ public class Htmlizer
OrganizationTurnoutStats stats = StatAgent.statsOrganizationTurnout(organizations); OrganizationTurnoutStats stats = StatAgent.statsOrganizationTurnout(organizations);
PieChart pie = new PieChart("Participation"); 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.add("Passive", stats.getPassiveCount(), ChartColor.BLUE);
pie.setLegendPosition(Position.RIGHT); pie.setLegendPosition(Position.RIGHT);

View file

@ -110,7 +110,7 @@ public class OrganizationPage
data.setEscapedContent("organizationName", organization.get("organization.name")); data.setEscapedContent("organizationName", organization.get("organization.name"));
data.setEscapedContent("organizationURL", organization.getWebsite()); 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.setEscapedContent("organizationDescription", organization.get("organization.description"));
data.setContent("organizationStartDate", StringUtils.defaultIfBlank(organization.getStartDate(), "n/a")); data.setContent("organizationStartDate", StringUtils.defaultIfBlank(organization.getStartDate(), "n/a"));
@ -122,31 +122,31 @@ public class OrganizationPage
if (StringUtils.isNotBlank(organization.getLegalWebsite())) if (StringUtils.isNotBlank(organization.getLegalWebsite()))
{ {
data.setAttribute("legalLink", "href", organization.getLegalWebsite()); data.setEscapedAttribute("legalLink", "href", organization.getLegalWebsite());
data.setAttribute("legalLinkImg", "class", ""); data.setAttribute("legalLinkImg", "class", "");
data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(organization.getContactWebsite())) if (StringUtils.isNotBlank(organization.getContactWebsite()))
{ {
data.setAttribute("contactLink", "href", organization.getContactWebsite()); data.setEscapedAttribute("contactLink", "href", organization.getContactWebsite());
data.setAttribute("contactLinkImg", "class", ""); data.setAttribute("contactLinkImg", "class", "");
data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(organization.getContactEmail())) if (StringUtils.isNotBlank(organization.getContactEmail()))
{ {
data.setAttribute("emailLink", "href", "mailto:" + organization.getContactEmail()); data.setEscapedAttribute("emailLink", "href", "mailto:" + organization.getContactEmail());
data.setAttribute("emailLinkImg", "class", ""); data.setAttribute("emailLinkImg", "class", "");
data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(organization.getUserGuideWebsite())) if (StringUtils.isNotBlank(organization.getUserGuideWebsite()))
{ {
data.setAttribute("userDocLink", "href", organization.getUserGuideWebsite()); data.setEscapedAttribute("userDocLink", "href", organization.getUserGuideWebsite());
data.setAttribute("userDocLinkImg", "class", ""); data.setAttribute("userDocLinkImg", "class", "");
data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(organization.getTechnicalGuideWebsite())) if (StringUtils.isNotBlank(organization.getTechnicalGuideWebsite()))
{ {
data.setAttribute("technicalDocLink", "href", organization.getTechnicalGuideWebsite()); data.setEscapedAttribute("technicalDocLink", "href", organization.getTechnicalGuideWebsite());
data.setAttribute("technicalDocLinkImg", "class", ""); data.setAttribute("technicalDocLinkImg", "class", "");
data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }

View file

@ -76,7 +76,7 @@ public class ServiceListView
data.setEscapedContent("serviceListLine", index, "serviceListLineUrlLink", service.getWebsite()); data.setEscapedContent("serviceListLine", index, "serviceListLineUrlLink", service.getWebsite());
data.setEscapedContent("serviceListLine", index, "serviceListLineWebsiteLink", 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.setEscapedContent("serviceListLine", index, "serviceListLineSoftwareLink", service.getSoftwareName());
data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + service.getSoftwareTechnicalName() + ".xhtml"); data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + service.getSoftwareTechnicalName() + ".xhtml");
@ -88,31 +88,31 @@ public class ServiceListView
if (StringUtils.isNotBlank(service.getLegalWebsite())) 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.setAttribute("serviceListLine", index, "legalLinkImg", "class", "");
data.getIdData("serviceListLine", index, "legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getContactWebsite())) 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.setAttribute("serviceListLine", index, "contactLinkImg", "class", "");
data.getIdData("serviceListLine", index, "contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getContactEmail())) 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.setAttribute("serviceListLine", index, "emailLinkImg", "class", "");
data.getIdData("serviceListLine", index, "emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getUserDocWebsite())) 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.setAttribute("serviceListLine", index, "userDocLinkImg", "class", "");
data.getIdData("serviceListLine", index, "userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) 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.setAttribute("serviceListLine", index, "technicalDocLinkImg", "class", "");
data.getIdData("serviceListLine", index, "technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); 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")); data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a"));
if (StringUtils.isNotBlank(service.getSoftwareWebsite())) 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.setAttribute("serviceListLine", index, "softwareWebsiteLinkImg", "class", "");
data.getIdData("serviceListLine", index, "softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) 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.setAttribute("serviceListLine", index, "softwareLicenseLinkImg", "class", "");
data.getIdData("serviceListLine", index, "softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) 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.setAttribute("serviceListLine", index, "softwareSourceLinkImg", "class", "");
data.getIdData("serviceListLine", index, "softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("serviceListLine", index, "softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }

View file

@ -40,7 +40,6 @@ import fr.devinsy.xidyn.XidynException;
import fr.devinsy.xidyn.data.DisplayMode; import fr.devinsy.xidyn.data.DisplayMode;
import fr.devinsy.xidyn.data.TagDataManager; import fr.devinsy.xidyn.data.TagDataManager;
import fr.devinsy.xidyn.presenters.PresenterUtils; import fr.devinsy.xidyn.presenters.PresenterUtils;
import fr.devinsy.xidyn.utils.XidynUtils;
/** /**
* The Class ServicePage. * The Class ServicePage.
@ -113,10 +112,10 @@ public class ServicePage
data.setAttribute("serviceLogo", "src", service.getLogoFileName()); data.setAttribute("serviceLogo", "src", service.getLogoFileName());
data.setEscapedContent("serviceName", service.getName()); data.setEscapedContent("serviceName", service.getName());
data.setAttribute("serviceName", "href", service.getWebsite()); data.setEscapedAttribute("serviceName", "href", service.getWebsite());
data.setEscapedContent("serviceURL", 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("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a"));
data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a")); data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a"));
@ -130,31 +129,31 @@ public class ServicePage
if (StringUtils.isNotBlank(service.getLegalWebsite())) if (StringUtils.isNotBlank(service.getLegalWebsite()))
{ {
data.setAttribute("legalLink", "href", service.getLegalWebsite()); data.setEscapedAttribute("legalLink", "href", service.getLegalWebsite());
data.setAttribute("legalLinkImg", "class", ""); data.setAttribute("legalLinkImg", "class", "");
data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getContactWebsite())) if (StringUtils.isNotBlank(service.getContactWebsite()))
{ {
data.setAttribute("contactLink", "href", service.getContactWebsite()); data.setEscapedAttribute("contactLink", "href", service.getContactWebsite());
data.setAttribute("contactLinkImg", "class", ""); data.setAttribute("contactLinkImg", "class", "");
data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getContactEmail())) if (StringUtils.isNotBlank(service.getContactEmail()))
{ {
data.setAttribute("emailLink", "href", "mailto:" + service.getContactEmail()); data.setEscapedAttribute("emailLink", "href", "mailto:" + service.getContactEmail());
data.setAttribute("emailLinkImg", "class", ""); data.setAttribute("emailLinkImg", "class", "");
data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getUserDocWebsite())) if (StringUtils.isNotBlank(service.getUserDocWebsite()))
{ {
data.setAttribute("userDocLink", "href", service.getUserDocWebsite()); data.setEscapedAttribute("userDocLink", "href", service.getUserDocWebsite());
data.setAttribute("userDocLinkImg", "class", ""); data.setAttribute("userDocLinkImg", "class", "");
data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) if (StringUtils.isNotBlank(service.getTechnicalDocWebsite()))
{ {
data.setAttribute("technicalDocLink", "href", service.getTechnicalDocWebsite()); data.setEscapedAttribute("technicalDocLink", "href", service.getTechnicalDocWebsite());
data.setAttribute("technicalDocLinkImg", "class", ""); data.setAttribute("technicalDocLinkImg", "class", "");
data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
@ -187,19 +186,19 @@ public class ServicePage
data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a")); data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a"));
if (StringUtils.isNotBlank(service.getSoftwareWebsite())) if (StringUtils.isNotBlank(service.getSoftwareWebsite()))
{ {
data.setAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite()); data.setEscapedAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite());
data.setAttribute("softwareWebsiteLinkImg", "class", ""); data.setAttribute("softwareWebsiteLinkImg", "class", "");
data.getIdData("softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage()))
{ {
data.setAttribute("softwareLicenseLink", "href", XidynUtils.escapeXmlBlank(service.getSoftwareLicenseWebpage())); data.setEscapedAttribute("softwareLicenseLink", "href", service.getSoftwareLicenseWebpage());
data.setAttribute("softwareLicenseLinkImg", "class", ""); data.setAttribute("softwareLicenseLinkImg", "class", "");
data.getIdData("softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }
if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite()))
{ {
data.setAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite()); data.setEscapedAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite());
data.setAttribute("softwareSourceLinkImg", "class", ""); data.setAttribute("softwareSourceLinkImg", "class", "");
data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
} }

View file

@ -20,6 +20,7 @@ package fr.devinsy.statoolinfos.stats;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.util.Iterator;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -366,9 +367,32 @@ public class StatAgent
{ {
result.incPassiveCount(); result.incPassiveCount();
} }
else if (organization.getServiceCount() == 0)
{
result.incWithSelfFileCount();
}
else else
{ {
result.incActiveCount(); boolean ended = false;
Iterator<Service> 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();
}
}
} }
} }

View file

@ -23,7 +23,9 @@ package fr.devinsy.statoolinfos.stats.organizations;
*/ */
public class OrganizationTurnoutStats public class OrganizationTurnoutStats
{ {
private long activeCount; private long withSelfFileCount;
private long withServiceFileCount;
private long withServiceMetricCount;
private long passiveCount; private long passiveCount;
/** /**
@ -31,13 +33,6 @@ public class OrganizationTurnoutStats
*/ */
public OrganizationTurnoutStats() public OrganizationTurnoutStats()
{ {
this.activeCount = 0;
this.passiveCount = 0;
}
public long getActiveCount()
{
return this.activeCount;
} }
public long getPassiveCount() public long getPassiveCount()
@ -54,15 +49,25 @@ public class OrganizationTurnoutStats
{ {
long result; long result;
result = this.activeCount + this.passiveCount; result = this.withSelfFileCount + this.withServiceFileCount + this.withServiceMetricCount + this.passiveCount;
// //
return result; 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() public void incPassiveCount()
@ -70,9 +75,19 @@ public class OrganizationTurnoutStats
this.passiveCount += 1; 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) public void setPassiveCount(final long passiveCount)