Activated HTML cache for many pages.

This commit is contained in:
Christian P. MOMON 2024-08-13 04:05:33 +02:00
parent 633ceced4b
commit 7fc958696a
49 changed files with 1219 additions and 911 deletions

View file

@ -52,24 +52,29 @@ public class CrawlPage extends HttpServlet
{ {
try try
{ {
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = CrawlView.htmlize(federation.getCrawlJournal()); String contentView = CrawlView.htmlize(federation.getCrawlJournal());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Journal", "/federation/crawl.xhtml"); trail.add("Journal", "/federation/crawl.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -54,24 +54,29 @@ public class LastStatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > Last Stats"); logger.info("PAGE Federation > Last Stats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = LastStatsView.htmlize(federation.getServices()); String contentView = LastStatsView.htmlize(federation.getServices());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Chiffres", "/federation/servicesFigures.xhtml"); trail.add("Chiffres", "/federation/servicesFigures.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -63,26 +63,31 @@ public class PropertiesFilesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesFiles"); logger.info("PAGE Federation > propertiesFiles");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
CrawlCache cache = StatoolInfosWeb.instance().getCache(); CrawlCache cache = StatoolInfosWeb.instance().getCache();
PropertiesFileStats stats = StatAgent.statAllPropertiesFiles(federation, cache).sortByName(); PropertiesFileStats stats = StatAgent.statAllPropertiesFiles(federation, cache).sortByName();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(stats); String contentView = htmlize(stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Fichiers", "/federation/propertiesFiles.xhtml"); trail.add("Fichiers", "/federation/propertiesFiles.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -129,7 +134,8 @@ public class PropertiesFilesPage extends HttpServlet
data.setAttribute("fileListLine", index, "fileListLineNameLink", "href", stat.getURLName()); data.setAttribute("fileListLine", index, "fileListLineNameLink", "href", stat.getURLName());
data.setEscapedContent("fileListLine", index, "fileListLineNameLink", stat.getURLName()); data.setEscapedContent("fileListLine", index, "fileListLineNameLink", stat.getURLName());
data.setAttribute("fileListLine", index, "fileListLineOwnerLink", "href", "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/"); data.setAttribute("fileListLine", index, "fileListLineOwnerLink", "href",
"/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/");
data.setEscapedContent("fileListLine", index, "fileListLineNameValue", stat.getOrganization().getName()); data.setEscapedContent("fileListLine", index, "fileListLineNameValue", stat.getOrganization().getName());
data.setAttribute("fileListLine", index, "fileListLineOwnerLogo", "src", stat.getOrganization().getLogoFileName()); data.setAttribute("fileListLine", index, "fileListLineOwnerLogo", "src", stat.getOrganization().getLogoFileName());
@ -142,7 +148,8 @@ public class PropertiesFilesPage extends HttpServlet
String propertyCheckURL; String propertyCheckURL;
if (stat.getService() != null) if (stat.getService() != null)
{ {
propertyCheckURL = "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/services/" + stat.getService().getTechnicalName() + "/propertyCheck.xhtml"; propertyCheckURL = "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/services/"
+ stat.getService().getTechnicalName() + "/propertyCheck.xhtml";
} }
else if (stat.getOrganization() != null) else if (stat.getOrganization() != null)
{ {
@ -188,7 +195,8 @@ public class PropertiesFilesPage extends HttpServlet
} }
data.setContent("fileListLine", index, "fileListLineDate", stat.getUpdateDate().format(DateTimeFormatter.ofPattern("dd/MM/YYYY"))); data.setContent("fileListLine", index, "fileListLineDate", stat.getUpdateDate().format(DateTimeFormatter.ofPattern("dd/MM/YYYY")));
data.setAttribute("fileListLine", index, "fileListLineDate", "title", stat.getUpdateDate().format(DateTimeFormatter.ofPattern("HH:mm:ss"))); data.setAttribute("fileListLine", index, "fileListLineDate", "title",
stat.getUpdateDate().format(DateTimeFormatter.ofPattern("HH:mm:ss")));
index += 1; index += 1;
} }

View file

@ -56,26 +56,31 @@ public class PropertyAlertFederationPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = federation.getInputChecks().getAlertLines(); PropertyChecks checks = federation.getInputChecks().getAlertLines();
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON); String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/");
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -57,30 +57,35 @@ public class PropertyAlertOrganizationsPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
// Use parameters.
// ===============
Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = new PropertyChecks();
for (Organization organization : federation.getOrganizations())
{ {
checks.addAll(organization.getInputChecks().getAlertLines()); // Get parameters.
// ===============
// Use parameters.
// ===============
Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = new PropertyChecks();
for (Organization organization : federation.getOrganizations())
{
checks.addAll(organization.getInputChecks().getAlertLines());
}
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/");
trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
} }
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/");
trail.add("Disponibilités", "/federation/uptimes.xhtml");
String html = WebCharterView.build(headerView, contentView, trail);
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,26 +56,31 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlerts"); logger.info("PAGE Fédération > PropertyAlerts");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = federation.getInputChecksAll().getAlertLines(); PropertyChecks checks = federation.getInputChecksAll().getAlertLines();
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON); String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/");
trail.add("Alertes", "/federation/propertyAlerts.xhtml"); trail.add("Alertes", "/federation/propertyAlerts.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -57,30 +57,35 @@ public class PropertyAlertServicesPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
// Use parameters.
// ===============
Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = new PropertyChecks();
for (Service service : federation.getServicesAll())
{ {
checks.addAll(service.getInputChecksAll().getAlertLines()); // Get parameters.
// ===============
// Use parameters.
// ===============
Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
PropertyChecks checks = new PropertyChecks();
for (Service service : federation.getServicesAll())
{
checks.addAll(service.getInputChecksAll().getAlertLines());
}
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
} }
String contentView = PropertyAlertView.htmlize(checks, MenuOption.ON);
BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Disponibilités", "/federation/uptimes.xhtml");
String html = WebCharterView.build(headerView, contentView, trail);
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -52,24 +52,29 @@ public class PropertyCheckPage extends HttpServlet
{ {
try try
{ {
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PropertyCheckView.htmlize(federation.getInputChecks()); String contentView = PropertyCheckView.htmlize(federation.getInputChecks());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Propriétés", "/federation/propertyCheck.xhtml"); trail.add("Propriétés", "/federation/propertyCheck.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,25 +56,30 @@ public class PropertyStatsFederationPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
PropertyStats stats = StatAgent.statFederationProperties(federation); PropertyStats stats = StatAgent.statFederationProperties(federation);
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PropertyStatsView.htmlize("Les propriétés de la fédération", stats); String contentView = PropertyStatsView.htmlize("Les propriétés de la fédération", stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,25 +56,30 @@ public class PropertyStatsOrganizationsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
PropertyStats stats = StatAgent.statOrganizationsProperties(federation.getActiveOrganizations()); PropertyStats stats = StatAgent.statOrganizationsProperties(federation.getActiveOrganizations());
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PropertyStatsView.htmlize("Les propriétés des organisations", stats); String contentView = PropertyStatsView.htmlize("Les propriétés des organisations", stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -57,26 +57,31 @@ public class PropertyStatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
CrawlCache cache = StatoolInfosWeb.instance().getCache(); CrawlCache cache = StatoolInfosWeb.instance().getCache();
PropertyStats stats = StatAgent.statAllProperties(federation); PropertyStats stats = StatAgent.statAllProperties(federation);
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PropertyStatsView.htmlize("Toutes les propriétés", stats); String contentView = PropertyStatsView.htmlize("Toutes les propriétés", stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,25 +56,30 @@ public class PropertyStatsServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
PropertyStats stats = StatAgent.statServicesProperties(federation.getActiveServices()); PropertyStats stats = StatAgent.statServicesProperties(federation.getActiveServices());
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PropertyStatsView.htmlize("Les propriétés des services", stats); String contentView = PropertyStatsView.htmlize("Les propriétés des services", stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -54,24 +54,29 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > services"); logger.info("PAGE Federation > services");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = ServiceListView.htmlize(federation.getServices()); String contentView = ServiceListView.htmlize(federation.getServices());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Services", "/federation/services.xhtml"); trail.add("Services", "/federation/services.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -62,26 +62,31 @@ public class SocialNetworksPage extends HttpServlet
{ {
logger.info("PAGE Federation > SocialNetworks"); logger.info("PAGE Federation > SocialNetworks");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
Organizations organizations = federation.getOrganizations().filterBySocialNetworks(); Organizations organizations = federation.getOrganizations().filterBySocialNetworks();
String contentView = htmlize("Réseaux sociaux", organizations); String contentView = htmlize("Réseaux sociaux", organizations);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Réseaux sociaux", "/federation/socialNetworks.xhtml"); trail.add("Réseaux sociaux", "/federation/socialNetworks.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -134,7 +139,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getDiasporaWebpage())) if (StringUtils.isNotBlank(organization.getDiasporaWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLineDiasporaImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLineDiasporaImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLineDiasporaImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLineDiasporaImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLineDiasporaLink", "href", organization.getDiasporaWebpage()); data.setAttribute("organizationListLine", index, "organizationListLineDiasporaLink", "href", organization.getDiasporaWebpage());
data.setAttribute("organizationListLine", index, "organizationListLineDiaspora", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLineDiaspora", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLineDiaspora", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLineDiaspora", "data-order", "1");
@ -143,7 +149,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getFunkwhaleWebpage())) if (StringUtils.isNotBlank(organization.getFunkwhaleWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLineFunkwhaleImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLineFunkwhaleImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLineFunkwhaleImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLineFunkwhaleImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLineFunkwhaleLink", "href", organization.getFunkwhaleWebpage()); data.setAttribute("organizationListLine", index, "organizationListLineFunkwhaleLink", "href", organization.getFunkwhaleWebpage());
data.setAttribute("organizationListLine", index, "organizationListLineFunkwhale", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLineFunkwhale", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLineFunkwhale", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLineFunkwhale", "data-order", "1");
@ -152,7 +159,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getMastodonWebpage())) if (StringUtils.isNotBlank(organization.getMastodonWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLineMastodonImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLineMastodonImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLineMastodonImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLineMastodonImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLineMastodonLink", "href", organization.getMastodonWebpage()); data.setAttribute("organizationListLine", index, "organizationListLineMastodonLink", "href", organization.getMastodonWebpage());
data.setAttribute("organizationListLine", index, "organizationListLineMastodon", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLineMastodon", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLineMastodon", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLineMastodon", "data-order", "1");
@ -161,7 +169,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getMobilizonWebpage())) if (StringUtils.isNotBlank(organization.getMobilizonWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLineMobilizonImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLineMobilizonImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLineMobilizonImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLineMobilizonImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLineMobilizonLink", "href", organization.getMobilizonWebpage()); data.setAttribute("organizationListLine", index, "organizationListLineMobilizonLink", "href", organization.getMobilizonWebpage());
data.setAttribute("organizationListLine", index, "organizationListLineMobilizon", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLineMobilizon", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLineMobilizon", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLineMobilizon", "data-order", "1");
@ -170,7 +179,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getPixelfedWebpage())) if (StringUtils.isNotBlank(organization.getPixelfedWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLinePixelfedImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLinePixelfedImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLinePixelfedImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLinePixelfedImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLinePixelfedLink", "href", organization.getPixelfedWebpage()); data.setAttribute("organizationListLine", index, "organizationListLinePixelfedLink", "href", organization.getPixelfedWebpage());
data.setAttribute("organizationListLine", index, "organizationListLinePixelfed", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLinePixelfed", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLinePixelfed", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLinePixelfed", "data-order", "1");
@ -179,7 +189,8 @@ public class SocialNetworksPage extends HttpServlet
if (StringUtils.isNotBlank(organization.getPeertubeWebpage())) if (StringUtils.isNotBlank(organization.getPeertubeWebpage()))
{ {
data.setAttribute("organizationListLine", index, "organizationListLinePeertubeImg", "class", ""); data.setAttribute("organizationListLine", index, "organizationListLinePeertubeImg", "class", "");
data.getIdData("organizationListLine", index, "organizationListLinePeertubeImg").getAttribute("class").setMode(DisplayMode.REPLACE); data.getIdData("organizationListLine", index, "organizationListLinePeertubeImg").getAttribute("class")
.setMode(DisplayMode.REPLACE);
data.setAttribute("organizationListLine", index, "organizationListLinePeertubeLink", "href", organization.getPeertubeWebpage()); data.setAttribute("organizationListLine", index, "organizationListLinePeertubeLink", "href", organization.getPeertubeWebpage());
data.setAttribute("organizationListLine", index, "organizationListLinePeertube", "data-search", "1"); data.setAttribute("organizationListLine", index, "organizationListLinePeertube", "data-search", "1");
data.setAttribute("organizationListLine", index, "organizationListLinePeertube", "data-order", "1"); data.setAttribute("organizationListLine", index, "organizationListLinePeertube", "data-order", "1");

View file

@ -63,25 +63,30 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > Stats"); logger.info("PAGE Federation > Stats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
Categories categories = StatoolInfosWeb.instance().getCategories(); Categories categories = StatoolInfosWeb.instance().getCategories();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(federation, categories); String contentView = htmlize(federation, categories);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Stats", "/federation/stats.xhtml"); trail.add("Stats", "/federation/stats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -54,24 +54,29 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Fédération > Uptimes"); logger.info("PAGE Fédération > Uptimes");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = UptimeView.htmlize(federation.getActiveServices(), uptimes); String contentView = UptimeView.htmlize(federation.getActiveServices(), uptimes);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -64,28 +64,33 @@ public class CategoryPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories > Category"); logger.info("PAGE Federation > Categories > Category");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
Category category = StatoolInfosWeb.instance().getCategoryFromPathinfo(request.getPathInfo()); Category category = StatoolInfosWeb.instance().getCategoryFromPathinfo(request.getPathInfo());
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
Services services = federation.getServices().getBy(category); Services services = federation.getServices().getBy(category);
String contentView = htmlize(category, services); String contentView = htmlize(category, services);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Catégories", "/federation/categories/"); trail.add("Catégories", "/federation/categories/");
trail.add(category.getName(), "/federation/categories/" + category.getTechnicalName() + ".xhtml"); trail.add(category.getName(), "/federation/categories/" + category.getTechnicalName() + ".xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -64,27 +64,32 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories"); logger.info("PAGE Federation > Categories");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
Categories categories = StatoolInfosWeb.instance().getCategories(); Categories categories = StatoolInfosWeb.instance().getCategories();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
CategoryStats stats = StatAgent.statAllCategories(federation, categories); CategoryStats stats = StatAgent.statAllCategories(federation, categories);
String contentView = htmlize(stats); String contentView = htmlize(stats);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Catégories", "/federation/categories/"); trail.add("Catégories", "/federation/categories/");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -125,9 +130,11 @@ public class IndexPage extends HttpServlet
data.setAttribute("categoryListLine", index, "categoryListLineNameLink", "title", stat.getCategory().getDescription()); data.setAttribute("categoryListLine", index, "categoryListLineNameLink", "title", stat.getCategory().getDescription());
data.setAttribute("categoryListLine", index, "categoryListLineNameLogo", "src", stat.getCategory().getLogoPath()); data.setAttribute("categoryListLine", index, "categoryListLineNameLogo", "src", stat.getCategory().getLogoPath());
data.setEscapedContent("categoryListLine", index, "categoryListLineSoftwares", stat.getCategory().getSoftwares().sort().toStringWithFrenchCommas()); data.setEscapedContent("categoryListLine", index, "categoryListLineSoftwares",
stat.getCategory().getSoftwares().sort().toStringWithFrenchCommas());
data.setContent("categoryListLine", index, "categoryListLineOrganizationCount", stat.getOrganizationCount()); data.setContent("categoryListLine", index, "categoryListLineOrganizationCount", stat.getOrganizationCount());
data.setContent("categoryListLine", index, "categoryListLineServiceCount", StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿")); data.setContent("categoryListLine", index, "categoryListLineServiceCount",
StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿"));
data.setContent("categoryListLine", index, "categoryListLineUserCount", StatoolInfosUtils.defaultIfZero(stat.getUserCount(), "😢")); data.setContent("categoryListLine", index, "categoryListLineUserCount", StatoolInfosUtils.defaultIfZero(stat.getUserCount(), "😢"));
data.setContent("categoryListLine", index, "categoryListLineVisitCount", StatoolInfosUtils.defaultIfZero(stat.getVisitCount(), "😞")); data.setContent("categoryListLine", index, "categoryListLineVisitCount", StatoolInfosUtils.defaultIfZero(stat.getVisitCount(), "😞"));

View file

@ -57,24 +57,29 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Fédération > Exports"); logger.info("PAGE Fédération > Exports");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = PresenterUtils.dynamize("/website/federation/exports/index.xhtml", null).toString(); String contentView = PresenterUtils.dynamize("/website/federation/exports/index.xhtml", null).toString();
contentView = XidynUtils.extractBodyContent(contentView); contentView = XidynUtils.extractBodyContent(contentView);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/organizations/");
trail.add("Exports", "/federation/exports/"); trail.add("Exports", "/federation/exports/");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -65,27 +65,32 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Generic"); logger.info("PAGE Federation > Metrics > Generic");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(federation, viewMenu, periodMenu); String contentView = htmlize(federation, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Métriques", "/federation/metrics/"); trail.add("Métriques", "/federation/metrics/");
trail.add("Génériques", "/federation/metrics/generic.xhtml"); trail.add("Génériques", "/federation/metrics/generic.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -123,19 +128,23 @@ public class MetricGenericPage extends HttpServlet
// //
data.setContent("graphic.users", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users", ChartColor.GREEN)); data.setContent("graphic.users", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users", ChartColor.GREEN));
data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(federation, view, period, "service.users (ipv4 + ipv6)", "metrics.service.users.ipv4", ChartColor.YELLOW, data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(federation, view, period, "service.users (ipv4 + ipv6)",
"metrics.service.users.ipv6", ChartColor.GREEN)); "metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW)); data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW));
data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users.ipv6", ChartColor.GREEN)); data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.accounts", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts", ChartColor.GREEN)); data.setContent("graphic.accounts", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts", ChartColor.GREEN));
data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts.active", ChartColor.GREEN)); data.setContent("graphic.accounts.active",
MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.database.bytes", ChartColor.GREEN)); data.setContent("graphic.database.bytes",
data.setContent("graphic.datafiles.bytes", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN)); MetricHtmlizer.htmlize(federation, view, period, "metrics.service.database.bytes", ChartColor.GREEN));
data.setContent("graphic.datafiles.bytes",
MetricHtmlizer.htmlize(federation, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -65,27 +65,32 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Specific"); logger.info("PAGE Federation > Metrics > Specific");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(federation, viewMenu, periodMenu); String contentView = htmlize(federation, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Métriques", "/federation/metrics/"); trail.add("Métriques", "/federation/metrics/");
trail.add("Spécifiques", "/federation/metrics/specific.xhtml"); trail.add("Spécifiques", "/federation/metrics/specific.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -122,7 +127,8 @@ public class MetricSpecificPage extends HttpServlet
data.setContent("metricMenuView", MetricMenuView.htmlize(TypeMenu.SPECIFIC, view, period)); data.setContent("metricMenuView", MetricMenuView.htmlize(TypeMenu.SPECIFIC, view, period));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -66,27 +66,32 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Summary"); logger.info("PAGE Federation > Metrics > Summary");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(federation, viewMenu, periodMenu); String contentView = htmlize(federation, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Métriques", "/federation/metrics/"); trail.add("Métriques", "/federation/metrics/");
trail.add("Résumé", "/federation/metrics/summary.xhtml"); trail.add("Résumé", "/federation/metrics/summary.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -129,7 +134,8 @@ public class MetricSummaryPage extends HttpServlet
data.setContent("http.visits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits", ChartColor.GREEN)); data.setContent("http.visits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -65,27 +65,32 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Web"); logger.info("PAGE Federation > Metrics > Web");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(federation, viewMenu, periodMenu); String contentView = htmlize(federation, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Métriques", "/federation/metrics/"); trail.add("Métriques", "/federation/metrics/");
trail.add("Web", "/federation/metrics/web.xhtml"); trail.add("Web", "/federation/metrics/web.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -124,22 +129,22 @@ public class MetricWebPage extends HttpServlet
// //
data.setContent("http.hits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits", ChartColor.BLUE)); data.setContent("http.hits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits", ChartColor.BLUE));
data.setContent("http.hits-ipv4ipv6", data.setContent("http.hits-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.hits (ipv4 + ipv6)",
MetricHtmlizer.htmlize(federation, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN));
ChartColor.GREEN));
data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN)); data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN));
data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(federation, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN, data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(federation, view, period, "http.hits (humans + bots)",
"metrics.http.hits.bots", ChartColor.YELLOW)); "metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW));
data.setContent("http.hits.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans", ChartColor.GREEN)); data.setContent("http.hits.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans", ChartColor.GREEN));
data.setContent("http.hits.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.bots", ChartColor.YELLOW)); data.setContent("http.hits.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.bots", ChartColor.YELLOW));
data.setContent("http.hits.humans-ipv4ipv6", data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.hits.humans (ipv4 + ipv6)",
MetricHtmlizer.htmlize(federation, view, period, "http.hits.humans (ipv4 + ipv6)", "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
"metrics.http.hits.humans.ipv6", ChartColor.GREEN)); data.setContent("http.hits.humans.ipv4",
data.setContent("http.hits.humans.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW)); MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.humans.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN)); data.setContent("http.hits.humans.ipv6",
MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
data.setContent("http.errors", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.errors", ChartColor.RED)); data.setContent("http.errors", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.errors", ChartColor.RED));
data.setContent("http.errors.php", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.errors.php", ChartColor.RED)); data.setContent("http.errors.php", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.errors.php", ChartColor.RED));
@ -150,43 +155,47 @@ public class MetricWebPage extends HttpServlet
data.setContent("http.ip", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip", ChartColor.BLUE)); data.setContent("http.ip", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip", ChartColor.BLUE));
data.setContent("http.ip-humansbots", data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(federation, view, period, "http.ip (humans + bots)",
MetricHtmlizer.htmlize(federation, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW)); "metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.humans", ChartColor.GREEN)); data.setContent("http.ip.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.humans", ChartColor.GREEN));
data.setContent("http.ip.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.bots", ChartColor.YELLOW)); data.setContent("http.ip.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4",
ChartColor.GREEN)); ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW)); data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW));
data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN)); data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.requesters", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters", ChartColor.BLUE)); data.setContent("http.requesters", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters", ChartColor.BLUE));
data.setContent("http.requesters-humansbots", data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(federation, view, period, "http.requesters (humans + bots)",
MetricHtmlizer.htmlize(federation, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN, "metrics.http.requesters.humans", ChartColor.GREEN, "metrics.http.requesters.bots", ChartColor.YELLOW));
"metrics.http.requesters.bots", ChartColor.YELLOW)); data.setContent("http.requesters.humans",
data.setContent("http.requesters.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.humans", ChartColor.GREEN)); MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
data.setContent("http.requesters.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW)); data.setContent("http.requesters.bots",
MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW));
data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW, data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.requesters (ipv4 + ipv6)",
"metrics.http.requesters.ipv6", ChartColor.GREEN)); "metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW)); data.setContent("http.requesters.ipv4",
data.setContent("http.requesters.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW));
data.setContent("http.requesters.ipv6",
MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.visitors", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors", ChartColor.BLUE)); data.setContent("http.visitors", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors", ChartColor.BLUE));
data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visitors (ipv4 + ipv6)",
"metrics.http.visitors.ipv6", ChartColor.GREEN)); "metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW)); data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW));
data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN)); data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits", ChartColor.BLUE)); data.setContent("http.visits", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits", ChartColor.BLUE));
data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW, data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visits (ipv4 + ipv6)",
"metrics.http.visits.ipv6", ChartColor.GREEN)); "metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN));
data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW)); data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW));
data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN)); data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -52,7 +52,7 @@ public class IndexPage extends HttpServlet
{ {
try try
{ {
String html = StatoolInfosWeb.instance().getHtmlCache().get(IndexPage.class.getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -73,7 +73,7 @@ public class IndexPage extends HttpServlet
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(IndexPage.class.getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
} }
// Display page. // Display page.

View file

@ -56,26 +56,31 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Organization > Crawl"); logger.info("PAGE Organization > Crawl");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = CrawlView.htmlize(organization.getCrawlJournal()); String contentView = CrawlView.htmlize(organization.getCrawlJournal());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/crawl.xhtml"); trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/crawl.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,26 +56,31 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyAlert"); logger.info("PAGE Organization > PropertyAlert");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = PropertyAlertView.htmlize(organization.getInputChecksAll().getAlertLines()); String contentView = PropertyAlertView.htmlize(organization.getInputChecksAll().getAlertLines());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/propertyAlert.xhtml"); trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/propertyAlert.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,26 +56,31 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyCheck"); logger.info("PAGE Organization > PropertyCheck");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = PropertyCheckView.htmlize(organization.getInputChecks()); String contentView = PropertyCheckView.htmlize(organization.getInputChecks());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/propertyCheck.xhtml"); trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/propertyCheck.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,26 +56,31 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Organization > Services"); logger.info("PAGE Organization > Services");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = ServiceListView.htmlize(organization.getServices()); String contentView = ServiceListView.htmlize(organization.getServices());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -64,26 +64,31 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Organization > Stats"); logger.info("PAGE Organization > Stats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization); String contentView = htmlize(organization);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/stats.xhtml"); trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/stats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -56,26 +56,31 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Organization > Uptime"); logger.info("PAGE Organization > Uptime");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = UptimeView.htmlize(organization.getServices(), uptimes); String contentView = UptimeView.htmlize(organization.getServices(), uptimes);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/uptime.xhtml"); trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/uptime.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -66,29 +66,34 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/");
trail.add("Génériques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/generic.xhtml"); trail.add("Génériques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/generic.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -116,7 +121,8 @@ public class MetricGenericPage extends HttpServlet
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period)
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -130,18 +136,23 @@ public class MetricGenericPage extends HttpServlet
// //
data.setContent("graphic.users", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users", ChartColor.GREEN)); data.setContent("graphic.users", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users", ChartColor.GREEN));
data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(organization, view, period, "service.users (ipv4 + ipv6)", "metrics.service.users.ipv4", ChartColor.YELLOW, data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(organization, view, period, "service.users (ipv4 + ipv6)",
"metrics.service.users.ipv6", ChartColor.GREEN)); "metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW)); data.setContent("graphic.users.ipv4",
MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW));
data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users.ipv6", ChartColor.GREEN)); data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.accounts", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts", ChartColor.GREEN)); data.setContent("graphic.accounts", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts", ChartColor.GREEN));
data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts.active", ChartColor.GREEN)); data.setContent("graphic.accounts.active",
data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.database.bytes", ChartColor.GREEN)); MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
data.setContent("graphic.datafiles.bytes", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN)); data.setContent("graphic.database.bytes",
MetricHtmlizer.htmlize(organization, view, period, "metrics.service.database.bytes", ChartColor.GREEN));
data.setContent("graphic.datafiles.bytes",
MetricHtmlizer.htmlize(organization, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -64,29 +64,34 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Specific"); logger.info("PAGE Organization > Metrics > Specific");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/");
trail.add("Spécifiques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/specific.xhtml"); trail.add("Spécifiques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/specific.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -113,7 +118,8 @@ public class MetricSpecificPage extends HttpServlet
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period)
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -127,7 +133,8 @@ public class MetricSpecificPage extends HttpServlet
data.setContent("metricMenuView", MetricMenuView.htmlize(TypeMenu.SPECIFIC, view, period)); data.setContent("metricMenuView", MetricMenuView.htmlize(TypeMenu.SPECIFIC, view, period));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -66,29 +66,34 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/");
trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/summary.xhtml"); trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/summary.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -116,7 +121,8 @@ public class MetricSummaryPage extends HttpServlet
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period)
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -131,7 +137,8 @@ public class MetricSummaryPage extends HttpServlet
data.setContent("http.visits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits", ChartColor.GREEN)); data.setContent("http.visits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -65,29 +65,34 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Web"); logger.info("PAGE Organization > Metrics > Web");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo()); Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/");
trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/web.xhtml"); trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/web.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -113,7 +118,8 @@ public class MetricWebPage extends HttpServlet
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period)
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -127,20 +133,22 @@ public class MetricWebPage extends HttpServlet
// //
data.setContent("http.hits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits", ChartColor.BLUE)); data.setContent("http.hits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits", ChartColor.BLUE));
data.setContent("http.hits-ipv4ipv6", data.setContent("http.hits-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.hits (ipv4 + ipv6)",
MetricHtmlizer.htmlize(organization, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN)); "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN));
data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN)); data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN));
data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN, data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.hits (humans + bots)",
"metrics.http.hits.bots", ChartColor.YELLOW)); "metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW));
data.setContent("http.hits.humans", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans", ChartColor.GREEN)); data.setContent("http.hits.humans", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans", ChartColor.GREEN));
data.setContent("http.hits.bots", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.bots", ChartColor.YELLOW)); data.setContent("http.hits.bots", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.bots", ChartColor.YELLOW));
data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.hits.humans (ipv4 + ipv6)", "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.hits.humans (ipv4 + ipv6)",
"metrics.http.hits.humans.ipv6", ChartColor.GREEN)); "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
data.setContent("http.hits.humans.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.humans.ipv4",
data.setContent("http.hits.humans.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.humans.ipv6",
MetricHtmlizer.htmlize(organization, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
data.setContent("http.errors", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.errors", ChartColor.RED)); data.setContent("http.errors", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.errors", ChartColor.RED));
data.setContent("http.errors.php", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.errors.php", ChartColor.RED)); data.setContent("http.errors.php", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.errors.php", ChartColor.RED));
@ -151,42 +159,48 @@ public class MetricWebPage extends HttpServlet
data.setContent("http.ip", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip", ChartColor.BLUE)); data.setContent("http.ip", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip", ChartColor.BLUE));
data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans", ChartColor.GREEN, data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.ip (humans + bots)",
"metrics.http.ip.bots", ChartColor.YELLOW)); "metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip.humans", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.humans", ChartColor.GREEN)); data.setContent("http.ip.humans", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.humans", ChartColor.GREEN));
data.setContent("http.ip.bots", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.bots", ChartColor.YELLOW)); data.setContent("http.ip.bots", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4",
ChartColor.GREEN)); ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW)); data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW));
data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN)); data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.requesters", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters", ChartColor.BLUE)); data.setContent("http.requesters", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters", ChartColor.BLUE));
data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN, data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.requesters (humans + bots)",
"metrics.http.requesters.bots", ChartColor.YELLOW)); "metrics.http.requesters.humans", ChartColor.GREEN, "metrics.http.requesters.bots", ChartColor.YELLOW));
data.setContent("http.requesters.humans", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.humans", ChartColor.GREEN)); data.setContent("http.requesters.humans",
data.setContent("http.requesters.bots", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW)); MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
data.setContent("http.requesters.bots",
MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW));
data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.requesters(ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW, data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.requesters(ipv4 + ipv6)",
"metrics.http.requesters.ipv6", ChartColor.GREEN)); "metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW)); data.setContent("http.requesters.ipv4",
data.setContent("http.requesters.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW));
data.setContent("http.requesters.ipv6",
MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.visitors", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors", ChartColor.BLUE)); data.setContent("http.visitors", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors", ChartColor.BLUE));
data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visitors (ipv4 + ipv6)",
"metrics.http.visitors.ipv6", ChartColor.GREEN)); "metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW)); data.setContent("http.visitors.ipv4",
MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW));
data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN)); data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits", ChartColor.BLUE)); data.setContent("http.visits", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits", ChartColor.BLUE));
data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW, data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visits (ipv4 + ipv6)",
"metrics.http.visits.ipv6", ChartColor.GREEN)); "metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN));
data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW)); data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW));
data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN)); data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -34,7 +34,7 @@ import website.charter.ErrorView;
/** /**
* The Class IndexPage. * The Class IndexPage.
*/ */
@KissServlet("^/federation/organizations/[^/]+/services/[^/]+/$") @KissServlet("^/federation/organizations/[^/]+/services/$")
public class IndexPage extends HttpServlet public class IndexPage extends HttpServlet
{ {
private static final long serialVersionUID = -5951233202690068343L; private static final long serialVersionUID = -5951233202690068343L;

View file

@ -57,29 +57,36 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Service > Crawl"); logger.info("PAGE Service > Crawl");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = CrawlView.htmlize(service.getCrawlJournal()); String contentView = CrawlView.htmlize(service.getCrawlJournal());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Journal",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -21,6 +21,7 @@ package website.federation.organizations.organization.services.service;
import java.io.IOException; import java.io.IOException;
import fr.devinsy.kiss4web.Redirector; import fr.devinsy.kiss4web.Redirector;
import fr.devinsy.kiss4web.dispatcher.annotation.KissServlet;
import fr.devinsy.statoolinfos.core.Organization; import fr.devinsy.statoolinfos.core.Organization;
import fr.devinsy.statoolinfos.core.Service; import fr.devinsy.statoolinfos.core.Service;
import fr.devinsy.statoolinfosweb.StatoolInfosWeb; import fr.devinsy.statoolinfosweb.StatoolInfosWeb;
@ -33,6 +34,7 @@ import website.charter.ErrorView;
/** /**
* The Class IndexPage. * The Class IndexPage.
*/ */
@KissServlet("^/federation/organizations/[^/]+/services/[^/]+/$")
public class IndexPage extends HttpServlet public class IndexPage extends HttpServlet
{ {
private static final long serialVersionUID = -5951233202690068343L; private static final long serialVersionUID = -5951233202690068343L;
@ -58,7 +60,8 @@ public class IndexPage extends HttpServlet
// Send response. // Send response.
// ============== // ==============
Redirector.redirect(response, "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml"); Redirector.redirect(response,
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
} }
catch (Exception exception) catch (Exception exception)
{ {

View file

@ -57,29 +57,36 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyAlert"); logger.info("PAGE Service > PropertyAlert");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = PropertyAlertView.htmlize(service.getInputChecksAll().getAlertLines()); String contentView = PropertyAlertView.htmlize(service.getInputChecksAll().getAlertLines());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/propertyAlert.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/propertyAlert.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -57,29 +57,36 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyCheck"); logger.info("PAGE Service > PropertyCheck");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = PropertyCheckView.htmlize(service.getInputChecks()); String contentView = PropertyCheckView.htmlize(service.getInputChecks());
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/propertyCheck.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/propertyCheck.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -58,8 +58,8 @@ public class ServiceHeaderView
{ {
TagDataManager data = new TagDataManager(); TagDataManager data = new TagDataManager();
data.setAttribute("serviceLogo", "src", data.setAttribute("serviceLogo", "src", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/"
"/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" + service.getTechnicalName() + "/" + service.getLogoFileName()); + service.getTechnicalName() + "/" + service.getLogoFileName());
data.setEscapedContent("serviceName", service.getName()); data.setEscapedContent("serviceName", service.getName());
if (service.getWebsiteURL() != null) if (service.getWebsiteURL() != null)
@ -84,16 +84,19 @@ public class ServiceHeaderView
} }
data.setAttribute("serviceStatusImg", "src", "/commons/status-" + service.getStatus().toString().toLowerCase() + ".png"); data.setAttribute("serviceStatusImg", "src", "/commons/status-" + service.getStatus().toString().toLowerCase() + ".png");
data.setAttribute("serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString())); data.setAttribute("serviceStatusImg", "title",
StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString()));
data.setAttribute("organizationsLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services.xhtml"); data.setAttribute("organizationsLink", "href",
"/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services.xhtml");
data.setAttribute("servicesLink", "href", "services.xhtml"); data.setAttribute("servicesLink", "href", "services.xhtml");
data.setAttribute("rawLink", "href", service.getTechnicalName() + ".properties"); data.setAttribute("rawLink", "href", service.getTechnicalName() + ".properties");
data.setAttribute("rawCheckLink", "href", "propertyCheck.xhtml"); data.setAttribute("rawCheckLink", "href", "propertyCheck.xhtml");
data.setAttribute("statsLink", "href", "stats.xhtml"); data.setAttribute("statsLink", "href", "stats.xhtml");
data.setAttribute("metricsLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/"); data.setAttribute("metricsLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/"
+ service.getTechnicalName() + "/metrics/");
if (service.getLegalURL() != null) if (service.getLegalURL() != null)
{ {
@ -186,7 +189,8 @@ public class ServiceHeaderView
data.setAttribute("crawlLinkImg", "src", "/commons/circle-icons/download.svg"); data.setAttribute("crawlLinkImg", "src", "/commons/circle-icons/download.svg");
} }
data.setAttribute("uptimeLink", "href", "uptime.xhtml"); data.setAttribute("uptimeLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/"
+ service.getTechnicalName() + "/uptime.xhtml");
Services services = new Services(); Services services = new Services();
services.add(service); services.add(service);
if (uptimeJournal.hasRecentError(services)) if (uptimeJournal.hasRecentError(services))
@ -208,7 +212,8 @@ public class ServiceHeaderView
} }
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/serviceHeaderView.xhtml", data).toString(); String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/serviceHeaderView.xhtml", data)
.toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -58,29 +58,36 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Service > Services"); logger.info("PAGE Service > Services");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = ServiceListView.htmlize(new Services(service)); String contentView = ServiceListView.htmlize(new Services(service));
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/services.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/services.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -65,29 +65,36 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Service > Stats"); logger.info("PAGE Service > Stats");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service); String contentView = htmlize(service);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Stats",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -58,29 +58,36 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Service > Uptime"); logger.info("PAGE Service > Uptime");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = UptimeView.htmlize(new Services(service), uptimeJournal); String contentView = UptimeView.htmlize(new Services(service), uptimeJournal);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Disponibilité",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");

View file

@ -67,32 +67,40 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Générique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/generic.xhtml"); trail.add("Métriques",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Générique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/generic.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -134,16 +142,19 @@ public class MetricGenericPage extends HttpServlet
// //
data.setContent("graphic.users", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users", ChartColor.GREEN)); data.setContent("graphic.users", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users", ChartColor.GREEN));
data.setContent("graphic.users.ipv4-ipv6", data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(service, view, period, "service.users (ipv4 + ipv6)",
MetricHtmlizer.htmlize(service, view, period, "service.users (ipv4 + ipv6)", "metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN)); "metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW)); data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW));
data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users.ipv6", ChartColor.GREEN)); data.setContent("graphic.users.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.accounts", MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts", ChartColor.GREEN)); data.setContent("graphic.accounts", MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts", ChartColor.GREEN));
data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts.active", ChartColor.GREEN)); data.setContent("graphic.accounts.active",
MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(service, view, period, "metrics.service.database.bytes", ChartColor.GREEN)); data.setContent("graphic.database.bytes",
data.setContent("graphic.datafiles.bytes", MetricHtmlizer.htmlize(service, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN)); MetricHtmlizer.htmlize(service, view, period, "metrics.service.database.bytes", ChartColor.GREEN));
data.setContent("graphic.datafiles.bytes",
MetricHtmlizer.htmlize(service, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN));
// TODO // TODO
// metrics.moderation.accounts.reported.* = // metrics.moderation.accounts.reported.* =
@ -153,7 +164,8 @@ public class MetricGenericPage extends HttpServlet
// metrics.moderation.accounts.cancelled.* = // metrics.moderation.accounts.cancelled.* =
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -67,32 +67,40 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Spécifique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/specific.xhtml"); trail.add("Métriques",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Spécifique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/specific.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -139,7 +147,8 @@ public class MetricSpecificPage extends HttpServlet
} }
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -67,32 +67,40 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricSummaryPage"); logger.info("PAGE Service > MetricSummaryPage");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/summary.xhtml"); trail.add("Métriques",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/summary.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -136,7 +144,8 @@ public class MetricSummaryPage extends HttpServlet
data.setContent("http.visits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits", ChartColor.GREEN)); data.setContent("http.visits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -67,32 +67,40 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo()); Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization(); Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view")); ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period")); PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Organisations", "/federation/organizations/"); trail.add("Organisations", "/federation/organizations/");
trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/"); trail.add(organization.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add(service.getName(),
trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/web.xhtml"); trail.add("Métriques",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/web.xhtml");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -133,21 +141,22 @@ public class MetricWebPage extends HttpServlet
data.setContent("http.hits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits", ChartColor.BLUE)); data.setContent("http.hits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits", ChartColor.BLUE));
data.setContent("http.hits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", data.setContent("http.hits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4",
ChartColor.GREEN)); ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN));
data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN)); data.setContent("http.hits.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.ipv6", ChartColor.GREEN));
data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN, data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.hits (humans + bots)",
"metrics.http.hits.bots", "metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW));
ChartColor.YELLOW));
data.setContent("http.hits.humans", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans", ChartColor.GREEN)); data.setContent("http.hits.humans", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans", ChartColor.GREEN));
data.setContent("http.hits.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.bots", ChartColor.YELLOW)); data.setContent("http.hits.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.bots", ChartColor.YELLOW));
data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.hits.humans (ipv4 + ipv6)", "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.hits.humans (ipv4 + ipv6)",
"metrics.http.hits.humans.ipv6", ChartColor.GREEN)); "metrics.http.hits.humans.ipv4", ChartColor.YELLOW, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
data.setContent("http.hits.humans.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.humans.ipv4",
data.setContent("http.hits.humans.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.humans.ipv6",
MetricHtmlizer.htmlize(service, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
data.setContent("http.errors", MetricHtmlizer.htmlize(service, view, period, "metrics.http.errors", ChartColor.RED)); data.setContent("http.errors", MetricHtmlizer.htmlize(service, view, period, "metrics.http.errors", ChartColor.RED));
data.setContent("http.errors.php", MetricHtmlizer.htmlize(service, view, period, "metrics.http.errors.php", ChartColor.RED)); data.setContent("http.errors.php", MetricHtmlizer.htmlize(service, view, period, "metrics.http.errors.php", ChartColor.RED));
@ -158,42 +167,44 @@ public class MetricWebPage extends HttpServlet
data.setContent("http.ip", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip", ChartColor.BLUE)); data.setContent("http.ip", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip", ChartColor.BLUE));
data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans",
ChartColor.YELLOW)); ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip.humans", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.humans", ChartColor.GREEN)); data.setContent("http.ip.humans", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.humans", ChartColor.GREEN));
data.setContent("http.ip.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.bots", ChartColor.YELLOW)); data.setContent("http.ip.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.bots", ChartColor.YELLOW));
data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4",
ChartColor.GREEN)); ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW)); data.setContent("http.ip.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW));
data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN)); data.setContent("http.ip.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN));
data.setContent("http.requesters", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters", ChartColor.BLUE)); data.setContent("http.requesters", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters", ChartColor.BLUE));
data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN, data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.requesters (humans + bots)",
"metrics.http.requesters.bots", ChartColor.YELLOW)); "metrics.http.requesters.humans", ChartColor.GREEN, "metrics.http.requesters.bots", ChartColor.YELLOW));
data.setContent("http.requesters.humans", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.humans", ChartColor.GREEN)); data.setContent("http.requesters.humans",
MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
data.setContent("http.requesters.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW)); data.setContent("http.requesters.bots", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW));
data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW, data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.requesters (ipv4 + ipv6)",
"metrics.http.requesters.ipv6", ChartColor.GREEN)); "metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW)); data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW));
data.setContent("http.requesters.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN)); data.setContent("http.requesters.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.visitors", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors", ChartColor.BLUE)); data.setContent("http.visitors", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors", ChartColor.BLUE));
data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visitors (ipv4 + ipv6)",
"metrics.http.visitors.ipv6", ChartColor.GREEN)); "metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW)); data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW));
data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN)); data.setContent("http.visitors.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits", ChartColor.BLUE)); data.setContent("http.visits", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits", ChartColor.BLUE));
data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW, data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visits (ipv4 + ipv6)",
"metrics.http.visits.ipv6", ChartColor.GREEN)); "metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN));
data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW)); data.setContent("http.visits.ipv4", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits.ipv4", ChartColor.YELLOW));
data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN)); data.setContent("http.visits.ipv6", MetricHtmlizer.htmlize(service, view, period, "metrics.http.visits.ipv6", ChartColor.GREEN));
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString(); String content = PresenterUtils
.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -66,27 +66,32 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares"); logger.info("PAGE Federation > Softwares");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
{
// Get parameters.
// ===============
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
Categories categories = StatoolInfosWeb.instance().getCategories(); Categories categories = StatoolInfosWeb.instance().getCategories();
// Send response. // Send response.
// ============== // ==============
TagDataManager data = new TagDataManager(); TagDataManager data = new TagDataManager();
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
String contentView = htmlize(StatAgent.statAllSoftwares(federation, categories)); String contentView = htmlize(StatAgent.statAllSoftwares(federation, categories));
BreadcrumbTrail trail = new BreadcrumbTrail(); BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Logiciels", "/federation/softwares/"); trail.add("Logiciels", "/federation/softwares/");
String html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
@ -123,12 +128,14 @@ public class IndexPage extends HttpServlet
for (SoftwareStat stat : stats.sortByName()) for (SoftwareStat stat : stats.sortByName())
{ {
data.setEscapedContent("softwareListLine", index, "softwareListLineNameLink", stat.getName()); data.setEscapedContent("softwareListLine", index, "softwareListLineNameLink", stat.getName());
data.setAttribute("softwareListLine", index, "softwareListLineNameLink", "href", "/federation/softwares/" + stat.getTechnicalName() + ".xhtml"); data.setAttribute("softwareListLine", index, "softwareListLineNameLink", "href",
"/federation/softwares/" + stat.getTechnicalName() + ".xhtml");
data.setContent("softwareListLine", index, "softwareListLineCategory", CategoriesView.build(stat.getCategories(), Mode.ALL)); data.setContent("softwareListLine", index, "softwareListLineCategory", CategoriesView.build(stat.getCategories(), Mode.ALL));
data.setContent("softwareListLine", index, "softwareListLineOrganizationCount", stat.getOrganizationCount()); data.setContent("softwareListLine", index, "softwareListLineOrganizationCount", stat.getOrganizationCount());
data.setContent("softwareListLine", index, "softwareListLineServiceCount", StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿")); data.setContent("softwareListLine", index, "softwareListLineServiceCount",
StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿"));
data.setContent("softwareListLine", index, "softwareListLineUserCount", StatoolInfosUtils.defaultIfZero(stat.getUserCount(), "😢")); data.setContent("softwareListLine", index, "softwareListLineUserCount", StatoolInfosUtils.defaultIfZero(stat.getUserCount(), "😢"));
data.setContent("softwareListLine", index, "softwareListLineVisitCount", StatoolInfosUtils.defaultIfZero(stat.getVisitCount(), "😞")); data.setContent("softwareListLine", index, "softwareListLineVisitCount", StatoolInfosUtils.defaultIfZero(stat.getVisitCount(), "😞"));

View file

@ -64,33 +64,38 @@ public class SoftwarePage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares > Software"); logger.info("PAGE Federation > Softwares > Software");
// Get parameters. String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName());
// =============== if (html == null)
// Use parameters.
// ===============
Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
Software software = StatoolInfosWeb.instance().getSoftwareFromPathinfo(request.getPathInfo());
if (software == null)
{ {
throw new StatoolInfosWebException("Illegal software name."); // Get parameters.
} // ===============
else
{
Services services = federation.getServices().getBy(software);
String contentView = htmlize(software, services);
BreadcrumbTrail trail = new BreadcrumbTrail(); // Use parameters.
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/"); // ===============
trail.add("Logiciels", "/federation/softwares/"); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
String html = WebCharterView.build(headerView, contentView, trail); // Send response.
// ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes);
Software software = StatoolInfosWeb.instance().getSoftwareFromPathinfo(request.getPathInfo());
if (software == null)
{
throw new StatoolInfosWebException("Illegal software name.");
}
else
{
Services services = federation.getServices().getBy(software);
String contentView = htmlize(software, services);
BreadcrumbTrail trail = new BreadcrumbTrail();
trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
trail.add("Logiciels", "/federation/softwares/");
html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html);
}
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");