Add alert check page for organization.

This commit is contained in:
Christian P. MOMON 2021-01-25 04:51:07 +01:00
parent 560fe0f861
commit 1e0b2e3ac3
7 changed files with 40 additions and 9 deletions

View file

@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
import fr.devinsy.catgenerator.core.CatGenerator;
import fr.devinsy.statoolinfos.HtmlizerContext;
import fr.devinsy.statoolinfos.checker.PropertyCheck;
import fr.devinsy.statoolinfos.checker.PropertyChecker;
import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.core.Organization;
@ -72,6 +73,35 @@ public class OrganizationPage
logger.info("Htmlize organization page: {}.", organization.getName());
String page = OrganizationPage.htmlize(organization);
FileUtils.write(new File(htmlizeDirectory, organization.getTechnicalName() + ".xhtml"), page, StandardCharsets.UTF_8);
{
try
{
PropertyChecker checker = new PropertyChecker();
PropertyChecks checks = checker.checkOrganization(organization.getInputFile());
for (PropertyCheck check : checks)
{
check.setFileName(organization.getLocalFileName());
}
for (Service service : organization.getServices())
{
PropertyChecks subChecks = checker.checkService(service.getInputFile());
for (PropertyCheck check : subChecks)
{
check.setFileName(service.getLocalFileName());
}
checks.addAll(subChecks);
}
page = PropertyFilesCheckPage.htmlize(organization.getName(), checks.getAlertLines());
FileUtils.write(new File(htmlizeDirectory, "alertChecks-" + organization.getTechnicalName() + ".xhtml"), page, StandardCharsets.UTF_8);
}
catch (IOException exception)
{
exception.printStackTrace();
}
}
}
/**
@ -147,6 +177,8 @@ public class OrganizationPage
data.setContent("errorCount", checks.getErrorCount());
data.setContent("warningCount", checks.getWarningCount());
data.setContent("voidCount", checks.getVoidCount());
data.setAttribute("alertLink", "href", "alertChecks-" + organization.getTechnicalName() + ".xhtml");
}
catch (IOException exception)
{

View file

@ -155,7 +155,6 @@ public class PropertyFileCheckPage
{
for (PropertyCheck check : checks)
{
//
data.setContent("line", index, "lineIndex", check.getIndex());
data.setEscapedContent("line", index, "lineComment", check.getComment());
data.setEscapedContent("line", index, "lineContent", check.getLine());
@ -176,7 +175,6 @@ public class PropertyFileCheckPage
{
for (PropertyCheck check : subchecks)
{
//
data.setContent("shrunkLine", index, "shrunkLineIndex", check.getIndex());
data.setEscapedContent("shrunkLine", index, "shrunkLineContent", check.getLine());
data.setEscapedContent("shrunkLine", index, "shrunkLineComment", check.getComment());
@ -197,7 +195,6 @@ public class PropertyFileCheckPage
{
for (PropertyCheck check : subchecks)
{
//
data.setContent("alertLine", index, "alertLineIndex", check.getIndex());
data.setEscapedContent("alertLine", index, "alertLineContent", check.getLine());
data.setEscapedContent("alertLine", index, "alertLineComment", check.getComment());

View file

@ -58,8 +58,8 @@ public class PropertyFilesCheckPage
TagDataManager data = new TagDataManager();
data.setContent("lineCount", checks.size());
data.setContent("warningCount", checks.getWarningCount());
data.setContent("errorCount", checks.getErrorCount());
data.setContent("warningCount", checks.getWarningCount());
data.setContent("voidCount", checks.getVoidCount());
//

View file

@ -35,9 +35,11 @@
<a id="rawLink" href="#"><img id="rawLinkImg" src="circle-icons/document-mono.svg" title="Fichier propriétés"/></a>
<a id="statsLink" href="#"><img id="statsLinkImg" src="circle-icons/barchart-mono.svg" title="Statistiques"/></a>
<div style="display: inline-block; vertical-align: middle; font-size: smaller; margin-left: 2px;">
<a id="alertLink" href="#" style="text-decoration: none;">
<span id="errorCount" class="bg_error" style="padding: 0 10px;" title="Propriétés en erreurs">n/a</span><br/>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Propriétés attendues">n/a</span><br/>
<span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Propriétés Inconnues">n/a</span>
</a>
</div>
</div>
<br/>

View file

@ -42,8 +42,8 @@
<tr>
<td>Alertes :</td>
<td class="right">
<span id="warningCount" class="bg_warning" title="Attendus">n/a</span>
<span id="errorCount" class="bg_error" title="Erreurs">n/a</span>
<span id="warningCount" class="bg_warning" title="Attendus">n/a</span>
<span id="voidCount" class="bg_void" title="Inconnus">n/a</span>
</td>
</tr>
@ -60,8 +60,8 @@
<th style="width: 100px;">Propriétés</th>
<th style="width: 100px;">Remplies</th>
<th style="width: 100px;">Vides</th>
<th style="width: 50px;">Attendues</th>
<th style="width: 50px;">Erreurs</th>
<th style="width: 50px;">Attendues</th>
<th style="width: 50px;">Inconnues</th>
<th style="width: 100px;">Date</th>
</tr>
@ -81,8 +81,8 @@
<td id="fileListLineActiveCount" class="td_number">n/a</td>
<td id="fileListLineFilledPropertyCount" class="td_number">n/a</td>
<td id="fileListLineBlankPropertyCount" class="td_number">n/a</td>
<td id="fileListLineWarningCount" class="td_number"><a id="fileListLineWarningCountLink" href="#">n/a</a></td>
<td id="fileListLineErrorCount" class="td_number"><a id="fileListLineErrorCountLink" href="#">n/a</a></td>
<td id="fileListLineWarningCount" class="td_number"><a id="fileListLineWarningCountLink" href="#">n/a</a></td>
<td id="fileListLineVoidCount" class="td_number"><a id="fileListLineVoidCountLink" href="#">n/a</a></td>
<td id="fileListLineDate" class="td_number">n/a</td>
</tr>

View file

@ -22,8 +22,8 @@
<span style="margin-left: 150px;">Statistiques : </span>
<span id="lineCount" style="padding: 0 10px; background-color: #d5d5d5" title="Nombre de lignes">n/a</span>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Attendus">n/a</span>
<span id="errorCount" class="bg_error" style="padding: 0 10px;" title="Erreurs">n/a</span>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Attendus">n/a</span>
<span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Inconnus">n/a</span>
</div>
<div id="fullBlock" style="width: 100%;">

View file

@ -25,8 +25,8 @@
<div style="margin-left: 0px; margin-bottom: 10px;">
<span style="margin-left: 150px;">Statistiques : </span>
<span id="lineCount" style="padding: 0 10px;" title="Nombre de lignes">n/a</span>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Attendus">n/a</span>
<span id="errorCount" class="bg_error" style="padding: 0 10px;" title="Erreurs">n/a</span>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Attendus">n/a</span>
<span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Inconnus">n/a</span>
</div>
<div id="block" style="width: 100%;">