Fixed and refactored HTML cache usage.

This commit is contained in:
Christian P. MOMON 2024-08-18 03:43:52 +02:00
parent f7eafcf23f
commit cd3ccaf557
46 changed files with 356 additions and 389 deletions

View file

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

View file

@ -54,7 +54,7 @@ public class LastStatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > Last Stats"); logger.info("PAGE Federation > Last Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -75,7 +75,7 @@ public class LastStatsPage extends HttpServlet
trail.add("Chiffres", "/federation/servicesFigures.xhtml"); trail.add("Chiffres", "/federation/servicesFigures.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -63,7 +63,7 @@ public class PropertiesFilesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesFiles"); logger.info("PAGE Federation > propertiesFiles");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -86,7 +86,7 @@ public class PropertiesFilesPage extends HttpServlet
trail.add("Fichiers", "/federation/propertiesFiles.xhtml"); trail.add("Fichiers", "/federation/propertiesFiles.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,7 +56,7 @@ public class PropertyAlertFederationPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -79,7 +79,7 @@ public class PropertyAlertFederationPage extends HttpServlet
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,7 +57,7 @@ public class PropertyAlertOrganizationsPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -84,7 +84,7 @@ public class PropertyAlertOrganizationsPage extends HttpServlet
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,7 +56,7 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlerts"); logger.info("PAGE Fédération > PropertyAlerts");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -79,7 +79,7 @@ public class PropertyAlertPage extends HttpServlet
trail.add("Alertes", "/federation/propertyAlerts.xhtml"); trail.add("Alertes", "/federation/propertyAlerts.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,7 +57,7 @@ public class PropertyAlertServicesPage extends HttpServlet
{ {
logger.info("PAGE Fédération > PropertyAlert"); logger.info("PAGE Fédération > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -84,7 +84,7 @@ public class PropertyAlertServicesPage extends HttpServlet
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

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

View file

@ -56,7 +56,7 @@ public class PropertyStatsFederationPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -78,7 +78,7 @@ public class PropertyStatsFederationPage extends HttpServlet
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,7 +56,7 @@ public class PropertyStatsOrganizationsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -78,7 +78,7 @@ public class PropertyStatsOrganizationsPage extends HttpServlet
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,7 +57,7 @@ public class PropertyStatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -80,7 +80,7 @@ public class PropertyStatsPage extends HttpServlet
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,7 +56,7 @@ public class PropertyStatsServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -78,7 +78,7 @@ public class PropertyStatsServicesPage extends HttpServlet
trail.add("Propriétés", "/federation/propertiesStats.xhtml"); trail.add("Propriétés", "/federation/propertiesStats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -54,7 +54,7 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > services"); logger.info("PAGE Federation > services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -75,7 +75,7 @@ public class ServicesPage extends HttpServlet
trail.add("Services", "/federation/services.xhtml"); trail.add("Services", "/federation/services.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -62,7 +62,7 @@ public class SocialNetworksPage extends HttpServlet
{ {
logger.info("PAGE Federation > SocialNetworks"); logger.info("PAGE Federation > SocialNetworks");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -85,7 +85,7 @@ public class SocialNetworksPage extends HttpServlet
trail.add("Réseaux sociaux", "/federation/socialNetworks.xhtml"); trail.add("Réseaux sociaux", "/federation/socialNetworks.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -63,7 +63,7 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > Stats"); logger.info("PAGE Federation > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -85,7 +85,7 @@ public class StatsPage extends HttpServlet
trail.add("Stats", "/federation/stats.xhtml"); trail.add("Stats", "/federation/stats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -54,7 +54,7 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Fédération > Uptimes"); logger.info("PAGE Fédération > Uptimes");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -75,7 +75,7 @@ public class UptimePage extends HttpServlet
trail.add("Disponibilités", "/federation/uptimes.xhtml"); trail.add("Disponibilités", "/federation/uptimes.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -64,19 +64,18 @@ public class CategoryPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories > Category"); logger.info("PAGE Federation > Categories > Category");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Category category = StatoolInfosWeb.instance().getCategoryFromPathinfo(request.getPathInfo());
// 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());
String key = this.getClass().getCanonicalName() + "?category=" + category.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
// Send response. // Send response.
// ============== // ==============
String headerView = FederationHeaderView.htmlize(federation, uptimes); String headerView = FederationHeaderView.htmlize(federation, uptimes);
@ -90,7 +89,7 @@ public class CategoryPage extends HttpServlet
trail.add(category.getName(), "/federation/categories/" + category.getTechnicalName() + ".xhtml"); trail.add(category.getName(), "/federation/categories/" + category.getTechnicalName() + ".xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(key, html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -64,7 +64,7 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories"); logger.info("PAGE Federation > Categories");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -88,7 +88,7 @@ public class IndexPage extends HttpServlet
trail.add("Catégories", "/federation/categories/"); trail.add("Catégories", "/federation/categories/");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,7 +57,7 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Fédération > Exports"); logger.info("PAGE Fédération > Exports");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -78,7 +78,7 @@ public class IndexPage extends HttpServlet
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/");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -65,18 +65,18 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Generic"); logger.info("PAGE Federation > Metrics > Generic");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
@ -89,7 +89,7 @@ public class MetricGenericPage extends HttpServlet
trail.add("Génériques", "/federation/metrics/generic.xhtml"); trail.add("Génériques", "/federation/metrics/generic.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -65,18 +65,18 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Specific"); logger.info("PAGE Federation > Metrics > Specific");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
@ -89,7 +89,7 @@ public class MetricSpecificPage extends HttpServlet
trail.add("Spécifiques", "/federation/metrics/specific.xhtml"); trail.add("Spécifiques", "/federation/metrics/specific.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -66,18 +66,18 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Summary"); logger.info("PAGE Federation > Metrics > Summary");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
@ -90,7 +90,7 @@ public class MetricSummaryPage extends HttpServlet
trail.add("Résumé", "/federation/metrics/summary.xhtml"); trail.add("Résumé", "/federation/metrics/summary.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -65,18 +65,18 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Federation > Metrics > Web"); logger.info("PAGE Federation > Metrics > Web");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
@ -89,7 +89,7 @@ public class MetricWebPage extends HttpServlet
trail.add("Web", "/federation/metrics/web.xhtml"); trail.add("Web", "/federation/metrics/web.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -52,7 +52,7 @@ public class IndexPage extends HttpServlet
{ {
try try
{ {
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
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(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,20 +56,19 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Organization > Crawl"); logger.info("PAGE Organization > Crawl");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = CrawlView.htmlize(organization.getCrawlJournal()); String contentView = CrawlView.htmlize(organization.getCrawlJournal());
@ -80,7 +79,7 @@ public class CrawlPage extends HttpServlet
trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/crawl.xhtml"); trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/crawl.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(key, html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,20 +56,19 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyAlert"); logger.info("PAGE Organization > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
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());
@ -80,7 +79,7 @@ public class PropertyAlertPage extends HttpServlet
trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/propertyAlert.xhtml"); trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/propertyAlert.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(key, html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,20 +56,19 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyCheck"); logger.info("PAGE Organization > PropertyCheck");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = PropertyCheckView.htmlize(organization.getInputChecks()); String contentView = PropertyCheckView.htmlize(organization.getInputChecks());
@ -80,7 +79,7 @@ public class PropertyCheckPage extends HttpServlet
trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/propertyCheck.xhtml"); trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/propertyCheck.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,6 +56,9 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Organization > Services"); logger.info("PAGE Organization > Services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
@ -65,10 +68,6 @@ public class ServicesPage extends HttpServlet
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = ServiceListView.htmlize(organization.getServices()); String contentView = ServiceListView.htmlize(organization.getServices());
@ -80,7 +79,7 @@ public class ServicesPage extends HttpServlet
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -64,20 +64,19 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Organization > Stats"); logger.info("PAGE Organization > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
Organization organization = StatoolInfosWeb.instance().getOrganizationFromPathinfo(request.getPathInfo());
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization); String contentView = htmlize(organization);
@ -88,7 +87,7 @@ public class StatsPage extends HttpServlet
trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/stats.xhtml"); trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/stats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -56,6 +56,9 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Organization > Uptime"); logger.info("PAGE Organization > Uptime");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
@ -66,10 +69,6 @@ public class UptimePage extends HttpServlet
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
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);
@ -80,7 +79,7 @@ public class UptimePage extends HttpServlet
trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/uptime.xhtml"); trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/uptime.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -66,22 +66,21 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
@ -93,7 +92,7 @@ public class MetricGenericPage extends HttpServlet
trail.add("Génériques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/generic.xhtml"); trail.add("Génériques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/generic.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -64,22 +64,21 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Specific"); logger.info("PAGE Organization > Metrics > Specific");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
@ -91,7 +90,7 @@ public class MetricSpecificPage extends HttpServlet
trail.add("Spécifiques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/specific.xhtml"); trail.add("Spécifiques", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/specific.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -66,22 +66,21 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
@ -93,7 +92,7 @@ public class MetricSummaryPage extends HttpServlet
trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/summary.xhtml"); trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/summary.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -65,22 +65,21 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Web"); logger.info("PAGE Organization > Metrics > Web");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = OrganizationHeaderView.htmlize(organization, uptimes); String headerView = OrganizationHeaderView.htmlize(organization, uptimes);
String contentView = htmlize(organization, viewMenu, periodMenu); String contentView = htmlize(organization, viewMenu, periodMenu);
@ -92,7 +91,7 @@ public class MetricWebPage extends HttpServlet
trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/web.xhtml"); trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/metrics/web.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,22 +57,20 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Service > Crawl"); logger.info("PAGE Service > Crawl");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = CrawlView.htmlize(service.getCrawlJournal()); String contentView = CrawlView.htmlize(service.getCrawlJournal());
@ -87,7 +85,7 @@ public class CrawlPage extends HttpServlet
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,22 +57,20 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyAlert"); logger.info("PAGE Service > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
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());
@ -87,7 +85,7 @@ public class PropertyAlertPage extends HttpServlet
+ "/propertyAlert.xhtml"); + "/propertyAlert.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -57,22 +57,20 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyCheck"); logger.info("PAGE Service > PropertyCheck");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = PropertyCheckView.htmlize(service.getInputChecks()); String contentView = PropertyCheckView.htmlize(service.getInputChecks());
@ -87,7 +85,7 @@ public class PropertyCheckPage extends HttpServlet
+ "/propertyCheck.xhtml"); + "/propertyCheck.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -58,22 +58,20 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Service > Services"); logger.info("PAGE Service > Services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
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));
@ -88,7 +86,7 @@ public class ServicesPage extends HttpServlet
+ "/services.xhtml"); + "/services.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -65,22 +65,20 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Service > Stats"); logger.info("PAGE Service > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service); String contentView = htmlize(service);
@ -95,7 +93,7 @@ public class StatsPage extends HttpServlet
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -58,22 +58,20 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Service > Uptime"); logger.info("PAGE Service > Uptime");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
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 key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
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);
@ -88,7 +86,7 @@ public class UptimePage extends HttpServlet
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml"); "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -67,24 +67,22 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
@ -101,7 +99,7 @@ public class MetricGenericPage extends HttpServlet
+ "/metrics/generic.xhtml"); + "/metrics/generic.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -67,24 +67,22 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo() + "?" + request.getQueryString());
// Use parameters.
// ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization();
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"));
// Use parameters.
// ===============
Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
@ -101,7 +99,7 @@ public class MetricSpecificPage extends HttpServlet
+ "/metrics/specific.xhtml"); + "/metrics/specific.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -67,24 +67,22 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricSummaryPage"); logger.info("PAGE Service > MetricSummaryPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
ViewMenu viewMenu = ViewMenu.valueFrom(request.getParameter("view"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// 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"));
PeriodMenu periodMenu = PeriodMenu.valueFrom(request.getParameter("period"));
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
@ -101,7 +99,7 @@ public class MetricSummaryPage extends HttpServlet
+ "/metrics/summary.xhtml"); + "/metrics/summary.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -67,24 +67,22 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
// Use parameters.
// ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo());
Organization organization = service.getOrganization();
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"));
// Use parameters.
// ===============
Service service = StatoolInfosWeb.instance().getServiceFromPathinfo(request.getPathInfo() + "?" + request.getQueryString());
Organization organization = service.getOrganization();
UptimeJournal uptimeJournal = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. // Send response.
// ============== // ==============
String key = this.getClass().getCanonicalName() + "?organization=" + organization.getTechnicalName() + "&service="
+ service.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{
String headerView = ServiceHeaderView.htmlize(service, uptimeJournal); String headerView = ServiceHeaderView.htmlize(service, uptimeJournal);
String contentView = htmlize(service, viewMenu, periodMenu); String contentView = htmlize(service, viewMenu, periodMenu);
@ -101,7 +99,7 @@ public class MetricWebPage extends HttpServlet
+ "/metrics/web.xhtml"); + "/metrics/web.xhtml");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -66,7 +66,7 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares"); logger.info("PAGE Federation > Softwares");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null) if (html == null)
{ {
// Get parameters. // Get parameters.
@ -90,7 +90,7 @@ public class IndexPage extends HttpServlet
trail.add("Logiciels", "/federation/softwares/"); trail.add("Logiciels", "/federation/softwares/");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
} }
// Display page. // Display page.

View file

@ -64,14 +64,17 @@ public class SoftwarePage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares > Software"); logger.info("PAGE Federation > Softwares > Software");
String html = StatoolInfosWeb.instance().getHtmlCache().get(request);
if (html == null)
{
// Get parameters. // Get parameters.
// =============== // ===============
Software software = StatoolInfosWeb.instance().getSoftwareFromPathinfo(request.getPathInfo());
// Use parameters. // Use parameters.
// =============== // ===============
Federation federation = StatoolInfosWeb.instance().getFederation(); Federation federation = StatoolInfosWeb.instance().getFederation();
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal(); UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
Software software = StatoolInfosWeb.instance().getSoftwareFromPathinfo(request.getPathInfo());
// Send response. // Send response.
// ============== // ==============
@ -82,10 +85,6 @@ public class SoftwarePage extends HttpServlet
throw new StatoolInfosWebException("Illegal software name."); throw new StatoolInfosWebException("Illegal software name.");
} }
else else
{
String key = this.getClass().getCanonicalName() + "?software=" + software.getTechnicalName();
String html = StatoolInfosWeb.instance().getHtmlCache().get(key);
if (html == null)
{ {
Services services = federation.getServices().getBy(software); Services services = federation.getServices().getBy(software);
String contentView = htmlize(software, services); String contentView = htmlize(software, services);
@ -95,14 +94,13 @@ public class SoftwarePage extends HttpServlet
trail.add("Logiciels", "/federation/softwares/"); trail.add("Logiciels", "/federation/softwares/");
html = WebCharterView.build(headerView, contentView, trail); html = WebCharterView.build(headerView, contentView, trail);
StatoolInfosWeb.instance().getHtmlCache().put(key, html); StatoolInfosWeb.instance().getHtmlCache().put(request, html);
}
} }
// Display page. // Display page.
response.setContentType("application/xhtml+xml; charset=UTF-8"); response.setContentType("application/xhtml+xml; charset=UTF-8");
response.getWriter().println(html); response.getWriter().println(html);
} }
}
catch (StatoolInfosWebException exception) catch (StatoolInfosWebException exception)
{ {
ErrorView.show(request, response, "Error building Federation > Softwares > Software", exception.getMessage(), null); ErrorView.show(request, response, "Error building Federation > Softwares > Software", exception.getMessage(), null);