From e4d122bbe4b288e9e07f4711aaae8ae747d9d082 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Fri, 5 Feb 2021 03:43:01 +0100 Subject: [PATCH] Added counter check button in service page. Improved organization one. --- .../statoolinfos/htmlize/ServicePage.java | 21 ++++++++++++++++++- .../statoolinfos/htmlize/organization.xhtml | 8 +++---- .../htmlize/propertyFileCheck.xhtml | 6 ++++++ .../statoolinfos/htmlize/service.xhtml | 7 +++++++ 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java index af422a2..8ba29f4 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Christian Pierre MOMON + * Copyright (C) 2020-2021 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -29,6 +29,8 @@ import org.slf4j.LoggerFactory; import fr.devinsy.catgenerator.core.BirdGenerator; import fr.devinsy.statoolinfos.HtmlizerContext; +import fr.devinsy.statoolinfos.checker.PropertyChecker; +import fr.devinsy.statoolinfos.checker.PropertyChecks; import fr.devinsy.statoolinfos.core.Metric; import fr.devinsy.statoolinfos.core.Organization; import fr.devinsy.statoolinfos.core.Service; @@ -205,6 +207,23 @@ public class ServicePage data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } + { + try + { + PropertyChecker checker = new PropertyChecker(); + PropertyChecks checks = checker.checkService(service.getInputFile()); + data.setContent("errorCount", checks.getErrorCount()); + data.setContent("warningCount", checks.getWarningCount()); + data.setContent("voidCount", checks.getVoidCount()); + + data.setAttribute("alertLink", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + "-check.xhtml#alerts"); + } + catch (IOException exception) + { + exception.printStackTrace(); + } + } + // int graphicIndex = 0; // data.setContent("fooChart", graphicIndex++, diff --git a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml index 3da2113..b00678d 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml @@ -34,11 +34,11 @@ -
+
- n/a
- n/a
- n/a +
n/a
+
n/a
+
n/a
diff --git a/src/fr/devinsy/statoolinfos/htmlize/propertyFileCheck.xhtml b/src/fr/devinsy/statoolinfos/htmlize/propertyFileCheck.xhtml index 7722fbb..b8e46bd 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/propertyFileCheck.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/propertyFileCheck.xhtml @@ -87,6 +87,12 @@ document.getElementById ('alertBlock').style.display = 'block'; } } + + document.body.onload = function() + { + if (window.location.href.endsWith("#alerts")) + setView('ALERTS'); + } diff --git a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml index e2fa72f..701fb9e 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml @@ -41,6 +41,13 @@ +
+ +
n/a
+
n/a
+
n/a
+
+