Compare commits

..

No commits in common. "f69a43fb19cb9dbe7d6165ef2b3fb42560bcd6d0" and "633ceced4baf3e2a9155900fbc135973188f884e" have entirely different histories.

57 changed files with 930 additions and 1239 deletions

View file

@ -29,7 +29,7 @@ import fr.devinsy.strings.StringList;
*/ */
public class DateCountList extends ArrayList<DateCount> public class DateCountList extends ArrayList<DateCount>
{ {
private static final long serialVersionUID = -2586123069620428247L; private static final long serialVersionUID = -5526492552751712533L;
/** /**
* Instantiates a new date count map. * Instantiates a new date count map.

View file

@ -25,7 +25,7 @@ import java.util.HashMap;
*/ */
public class DateCountMap extends HashMap<String, DateCount> public class DateCountMap extends HashMap<String, DateCount>
{ {
private static final long serialVersionUID = 1128805109299054737L; private static final long serialVersionUID = -5526492552751712533L;
/** /**
* Instantiates a new date count map. * Instantiates a new date count map.

View file

@ -32,7 +32,7 @@ import website.charter.ErrorView;
*/ */
public class IndexXhtml extends HttpServlet public class IndexXhtml extends HttpServlet
{ {
private static final long serialVersionUID = 5475871579048385643L; private static final long serialVersionUID = 2794788000773558854L;
private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexXhtml.class); private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexXhtml.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -52,29 +52,24 @@ public class CrawlPage extends HttpServlet
{ {
try try
{ {
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,29 +54,24 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -44,7 +44,7 @@ import jakarta.servlet.http.HttpServletResponse;
@KissServlet("^/federation/logo.(jpg|png|gif|svg)$") @KissServlet("^/federation/logo.(jpg|png|gif|svg)$")
public class LogoDo extends HttpServlet public class LogoDo extends HttpServlet
{ {
private static final long serialVersionUID = -2045864664869054230L; private static final long serialVersionUID = -8274687319890495722L;
private static Logger logger = LoggerFactory.getLogger(LogoDo.class); private static Logger logger = LoggerFactory.getLogger(LogoDo.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -63,31 +63,26 @@ public class PropertiesFilesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesFiles"); logger.info("PAGE Federation > propertiesFiles");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,8 +129,7 @@ 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", data.setAttribute("fileListLine", index, "fileListLineOwnerLink", "href", "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/");
"/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());
@ -148,8 +142,7 @@ public class PropertiesFilesPage extends HttpServlet
String propertyCheckURL; String propertyCheckURL;
if (stat.getService() != null) if (stat.getService() != null)
{ {
propertyCheckURL = "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/services/" propertyCheckURL = "/federation/organizations/" + stat.getOrganization().getTechnicalName() + "/services/" + stat.getService().getTechnicalName() + "/propertyCheck.xhtml";
+ stat.getService().getTechnicalName() + "/propertyCheck.xhtml";
} }
else if (stat.getOrganization() != null) else if (stat.getOrganization() != null)
{ {
@ -195,8 +188,7 @@ 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", data.setAttribute("fileListLine", index, "fileListLineDate", "title", stat.getUpdateDate().format(DateTimeFormatter.ofPattern("HH:mm:ss")));
stat.getUpdateDate().format(DateTimeFormatter.ofPattern("HH:mm:ss")));
index += 1; index += 1;
} }

View file

@ -43,7 +43,7 @@ import website.views.PropertyAlertView.MenuOption;
*/ */
public class PropertyAlertFederationPage extends HttpServlet public class PropertyAlertFederationPage extends HttpServlet
{ {
private static final long serialVersionUID = 5145544554225024765L; private static final long serialVersionUID = 5318172674334358487L;
private static Logger logger = LoggerFactory.getLogger(PropertyAlertFederationPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyAlertFederationPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -56,31 +56,26 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,35 +57,30 @@ 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()); // Get parameters.
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())
{ {
// Get parameters. checks.addAll(organization.getInputChecks().getAlertLines());
// ===============
// 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

@ -43,7 +43,7 @@ import website.views.PropertyAlertView.MenuOption;
*/ */
public class PropertyAlertPage extends HttpServlet public class PropertyAlertPage extends HttpServlet
{ {
private static final long serialVersionUID = 6674551983811751746L; private static final long serialVersionUID = 5318172674334358487L;
private static Logger logger = LoggerFactory.getLogger(PropertyAlertPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyAlertPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -56,31 +56,26 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -44,7 +44,7 @@ import website.views.PropertyAlertView.MenuOption;
*/ */
public class PropertyAlertServicesPage extends HttpServlet public class PropertyAlertServicesPage extends HttpServlet
{ {
private static final long serialVersionUID = -1230801146098997767L; private static final long serialVersionUID = 5318172674334358487L;
private static Logger logger = LoggerFactory.getLogger(PropertyAlertServicesPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyAlertServicesPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -57,35 +57,30 @@ 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()); // Get parameters.
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())
{ {
// Get parameters. checks.addAll(service.getInputChecksAll().getAlertLines());
// ===============
// 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,29 +52,24 @@ public class PropertyCheckPage extends HttpServlet
{ {
try try
{ {
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -43,7 +43,7 @@ import website.views.PropertyStatsView;
*/ */
public class PropertyStatsFederationPage extends HttpServlet public class PropertyStatsFederationPage extends HttpServlet
{ {
private static final long serialVersionUID = 8232521281178380986L; private static final long serialVersionUID = 3895257190078166862L;
private static Logger logger = LoggerFactory.getLogger(PropertyStatsFederationPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyStatsFederationPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -56,30 +56,25 @@ public class PropertyStatsFederationPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -43,7 +43,7 @@ import website.views.PropertyStatsView;
*/ */
public class PropertyStatsOrganizationsPage extends HttpServlet public class PropertyStatsOrganizationsPage extends HttpServlet
{ {
private static final long serialVersionUID = 1359431232426181125L; private static final long serialVersionUID = 3895257190078166862L;
private static Logger logger = LoggerFactory.getLogger(PropertyStatsOrganizationsPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyStatsOrganizationsPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -56,30 +56,25 @@ public class PropertyStatsOrganizationsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -44,7 +44,7 @@ import website.views.PropertyStatsView;
*/ */
public class PropertyStatsPage extends HttpServlet public class PropertyStatsPage extends HttpServlet
{ {
private static final long serialVersionUID = -2375749701066813584L; private static final long serialVersionUID = 3895257190078166862L;
private static Logger logger = LoggerFactory.getLogger(PropertyStatsPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyStatsPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -57,31 +57,26 @@ public class PropertyStatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -43,7 +43,7 @@ import website.views.PropertyStatsView;
*/ */
public class PropertyStatsServicesPage extends HttpServlet public class PropertyStatsServicesPage extends HttpServlet
{ {
private static final long serialVersionUID = 3962143718171359732L; private static final long serialVersionUID = 3895257190078166862L;
private static Logger logger = LoggerFactory.getLogger(PropertyStatsServicesPage.class); private static Logger logger = LoggerFactory.getLogger(PropertyStatsServicesPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -56,30 +56,25 @@ public class PropertyStatsServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > propertiesStats"); logger.info("PAGE Federation > propertiesStats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,29 +54,24 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Federation > services"); logger.info("PAGE Federation > services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,31 +62,26 @@ public class SocialNetworksPage extends HttpServlet
{ {
logger.info("PAGE Federation > SocialNetworks"); logger.info("PAGE Federation > SocialNetworks");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,8 +134,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLineDiasporaImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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");
@ -149,8 +143,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLineFunkwhaleImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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");
@ -159,8 +152,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLineMastodonImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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");
@ -169,8 +161,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLineMobilizonImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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");
@ -179,8 +170,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLinePixelfedImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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");
@ -189,8 +179,7 @@ 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") data.getIdData("organizationListLine", index, "organizationListLinePeertubeImg").getAttribute("class").setMode(DisplayMode.REPLACE);
.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,30 +63,25 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Federation > Stats"); logger.info("PAGE Federation > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,29 +54,24 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,33 +64,28 @@ public class CategoryPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories > Category"); logger.info("PAGE Federation > Categories > Category");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,32 +64,27 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Categories"); logger.info("PAGE Federation > Categories");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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/");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -130,11 +125,9 @@ 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", data.setEscapedContent("categoryListLine", index, "categoryListLineSoftwares", stat.getCategory().getSoftwares().sort().toStringWithFrenchCommas());
stat.getCategory().getSoftwares().sort().toStringWithFrenchCommas());
data.setContent("categoryListLine", index, "categoryListLineOrganizationCount", stat.getOrganizationCount()); data.setContent("categoryListLine", index, "categoryListLineOrganizationCount", stat.getOrganizationCount());
data.setContent("categoryListLine", index, "categoryListLineServiceCount", data.setContent("categoryListLine", index, "categoryListLineServiceCount", StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿"));
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,29 +57,24 @@ 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()); // Get parameters.
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/");
html = WebCharterView.build(headerView, contentView, trail); String 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,32 +65,27 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -128,23 +123,19 @@ 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)", data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(federation, view, period, "service.users (ipv4 + ipv6)", "metrics.service.users.ipv4", ChartColor.YELLOW,
"metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN)); "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", data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
MetricHtmlizer.htmlize(federation, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
data.setContent("graphic.database.bytes", data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(federation, view, period, "metrics.service.database.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));
data.setContent("graphic.datafiles.bytes",
MetricHtmlizer.htmlize(federation, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN));
// //
String content = PresenterUtils String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
.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,32 +65,27 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -127,8 +122,7 @@ 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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
.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,32 +66,27 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,8 +129,7 @@ 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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
.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,32 +65,27 @@ 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()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,22 +124,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", MetricHtmlizer.htmlize(federation, view, period, "http.hits (ipv4 + ipv6)", data.setContent("http.hits-ipv4ipv6",
"metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(federation, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6",
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)", data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(federation, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN,
"metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW)); "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", MetricHtmlizer.htmlize(federation, view, period, "http.hits.humans (ipv4 + ipv6)", data.setContent("http.hits.humans-ipv4ipv6",
"metrics.http.hits.humans.ipv4", ChartColor.YELLOW, "metrics.http.hits.humans.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(federation, view, period, "http.hits.humans (ipv4 + ipv6)", "metrics.http.hits.humans.ipv4", ChartColor.YELLOW,
data.setContent("http.hits.humans.ipv4", "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW)); data.setContent("http.hits.humans.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
data.setContent("http.hits.humans.ipv6", data.setContent("http.hits.humans.ipv6", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.hits.humans.ipv6", ChartColor.GREEN));
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));
@ -155,47 +150,43 @@ 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", MetricHtmlizer.htmlize(federation, view, period, "http.ip (humans + bots)", data.setContent("http.ip-humansbots",
"metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW)); MetricHtmlizer.htmlize(federation, view, period, "http.ip (humans + bots)", "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", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6",
ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN)); 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", MetricHtmlizer.htmlize(federation, view, period, "http.requesters (humans + bots)", data.setContent("http.requesters-humansbots",
"metrics.http.requesters.humans", ChartColor.GREEN, "metrics.http.requesters.bots", ChartColor.YELLOW)); MetricHtmlizer.htmlize(federation, view, period, "http.requesters (humans + bots)", "metrics.http.requesters.humans", ChartColor.GREEN,
data.setContent("http.requesters.humans", "metrics.http.requesters.bots", ChartColor.YELLOW));
MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.humans", ChartColor.GREEN)); data.setContent("http.requesters.humans", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
data.setContent("http.requesters.bots", data.setContent("http.requesters.bots", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.bots", ChartColor.YELLOW));
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)", data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
"metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN)); "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.requesters.ipv4", data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(federation, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW));
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.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)", data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
"metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN)); "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)", data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(federation, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN)); "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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
.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

@ -41,7 +41,7 @@ import website.federation.FederationHeaderView;
*/ */
public class IndexPage extends HttpServlet public class IndexPage extends HttpServlet
{ {
private static final long serialVersionUID = 3909086518893521246L; private static final long serialVersionUID = -8274687319890495722L;
private static Logger logger = LoggerFactory.getLogger(IndexPage.class); private static Logger logger = LoggerFactory.getLogger(IndexPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -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(IndexPage.class.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(this.getClass().getCanonicalName(), html); StatoolInfosWeb.instance().getHtmlCache().put(IndexPage.class.getCanonicalName(), html);
} }
// Display page. // Display page.

View file

@ -56,31 +56,26 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Organization > Crawl"); logger.info("PAGE Organization > Crawl");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -39,7 +39,7 @@ import jakarta.servlet.http.HttpServletResponse;
@KissServlet("^/federation/organizations/[^/]+/[^./]+\\.properties$") @KissServlet("^/federation/organizations/[^/]+/[^./]+\\.properties$")
public class PropertiesDo extends HttpServlet public class PropertiesDo extends HttpServlet
{ {
private static final long serialVersionUID = -7536773873051469053L; private static final long serialVersionUID = 2011776119103724440L;
private static Logger logger = LoggerFactory.getLogger(PropertiesDo.class); private static Logger logger = LoggerFactory.getLogger(PropertiesDo.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -56,31 +56,26 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyAlert"); logger.info("PAGE Organization > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,31 +56,26 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Organization > PropertyCheck"); logger.info("PAGE Organization > PropertyCheck");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,31 +56,26 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Organization > Services"); logger.info("PAGE Organization > Services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,31 +64,26 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Organization > Stats"); logger.info("PAGE Organization > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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,31 +56,26 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Organization > Uptime"); logger.info("PAGE Organization > Uptime");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -36,7 +36,7 @@ import website.charter.ErrorView;
@KissServlet("^/federation/organizations/[^/]+/metrics/") @KissServlet("^/federation/organizations/[^/]+/metrics/")
public class IndexPage extends HttpServlet public class IndexPage extends HttpServlet
{ {
private static final long serialVersionUID = -2120869479686158841L; private static final long serialVersionUID = 2794788000773558854L;
private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class); private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -66,34 +66,29 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -121,8 +116,7 @@ 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) public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -136,23 +130,18 @@ 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)", data.setContent("graphic.users.ipv4-ipv6", MetricHtmlizer.htmlize(organization, view, period, "service.users (ipv4 + ipv6)", "metrics.service.users.ipv4", ChartColor.YELLOW,
"metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN)); "metrics.service.users.ipv6", ChartColor.GREEN));
data.setContent("graphic.users.ipv4", data.setContent("graphic.users.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.users.ipv4", ChartColor.YELLOW));
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", data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
MetricHtmlizer.htmlize(organization, view, period, "metrics.service.accounts.active", ChartColor.GREEN)); data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.database.bytes", ChartColor.GREEN));
data.setContent("graphic.database.bytes", data.setContent("graphic.datafiles.bytes", MetricHtmlizer.htmlize(organization, view, period, "metrics.service.datafiles.bytes", ChartColor.GREEN));
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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
.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,34 +64,29 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Specific"); logger.info("PAGE Organization > Metrics > Specific");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -118,8 +113,7 @@ 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) public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -133,8 +127,7 @@ 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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
.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,34 +66,29 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Summary"); logger.info("PAGE Organization > Metrics > Summary");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -121,8 +116,7 @@ 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) public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -137,8 +131,7 @@ 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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
.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,34 +65,29 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Organization > Metrics > Web"); logger.info("PAGE Organization > Metrics > Web");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -118,8 +113,7 @@ 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) public static String htmlize(final Organization organization, final ViewMenu view, final PeriodMenu period) throws StatoolInfosWebException, IOException
throws StatoolInfosWebException, IOException
{ {
String result; String result;
@ -133,22 +127,20 @@ 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", MetricHtmlizer.htmlize(organization, view, period, "http.hits (ipv4 + ipv6)", data.setContent("http.hits-ipv4ipv6",
"metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(organization, view, period, "http.hits (ipv4 + ipv6)", "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)", data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN,
"metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW)); "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)", data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(organization, 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(organization, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
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.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));
@ -159,48 +151,42 @@ 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)", data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(organization, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans", ChartColor.GREEN,
"metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW)); "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", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6",
ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN)); 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)", data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(organization, 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(organization, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
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.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)", data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.requesters(ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
"metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN)); "metrics.http.requesters.ipv6", ChartColor.GREEN));
data.setContent("http.requesters.ipv4", data.setContent("http.requesters.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.requesters.ipv4", ChartColor.YELLOW));
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.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)", data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
"metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN)); "metrics.http.visitors.ipv6", ChartColor.GREEN));
data.setContent("http.visitors.ipv4", data.setContent("http.visitors.ipv4", MetricHtmlizer.htmlize(organization, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW));
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)", data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(organization, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN)); "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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
.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,10 +34,10 @@ 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 = 3531927793016566272L; private static final long serialVersionUID = -5951233202690068343L;
private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class); private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -57,36 +57,29 @@ public class CrawlPage extends HttpServlet
{ {
logger.info("PAGE Service > Crawl"); logger.info("PAGE Service > Crawl");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Journal", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml");
trail.add("Journal",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/crawl.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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,7 +21,6 @@ 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;
@ -34,10 +33,9 @@ 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 = -1634795104224318821L; private static final long serialVersionUID = -5951233202690068343L;
private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class); private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -60,8 +58,7 @@ public class IndexPage extends HttpServlet
// Send response. // Send response.
// ============== // ==============
Redirector.redirect(response, Redirector.redirect(response, "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
} }
catch (Exception exception) catch (Exception exception)
{ {

View file

@ -39,7 +39,7 @@ import jakarta.servlet.http.HttpServletResponse;
@KissServlet("^/federation/organizations/[^/]+/services/[^/]+/[^./]+\\.properties$") @KissServlet("^/federation/organizations/[^/]+/services/[^/]+/[^./]+\\.properties$")
public class PropertiesDo extends HttpServlet public class PropertiesDo extends HttpServlet
{ {
private static final long serialVersionUID = 7374815394064791347L; private static final long serialVersionUID = 2011776119103724440L;
private static Logger logger = LoggerFactory.getLogger(PropertiesDo.class); private static Logger logger = LoggerFactory.getLogger(PropertiesDo.class);
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -57,36 +57,29 @@ public class PropertyAlertPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyAlert"); logger.info("PAGE Service > PropertyAlert");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/propertyAlert.xhtml");
trail.add("Alertes", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/propertyAlert.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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,36 +57,29 @@ public class PropertyCheckPage extends HttpServlet
{ {
logger.info("PAGE Service > PropertyCheck"); logger.info("PAGE Service > PropertyCheck");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/propertyCheck.xhtml");
trail.add("Propriétés", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/propertyCheck.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" data.setAttribute("serviceLogo", "src",
+ service.getTechnicalName() + "/" + service.getLogoFileName()); "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" + service.getTechnicalName() + "/" + service.getLogoFileName());
data.setEscapedContent("serviceName", service.getName()); data.setEscapedContent("serviceName", service.getName());
if (service.getWebsiteURL() != null) if (service.getWebsiteURL() != null)
@ -84,19 +84,16 @@ 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", data.setAttribute("serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString()));
StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString()));
data.setAttribute("organizationsLink", "href", data.setAttribute("organizationsLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services.xhtml");
"/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/" data.setAttribute("metricsLink", "href", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
+ service.getTechnicalName() + "/metrics/");
if (service.getLegalURL() != null) if (service.getLegalURL() != null)
{ {
@ -189,8 +186,7 @@ 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", "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" data.setAttribute("uptimeLink", "href", "uptime.xhtml");
+ 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))
@ -212,8 +208,7 @@ public class ServiceHeaderView
} }
// //
String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/serviceHeaderView.xhtml", data) String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/serviceHeaderView.xhtml", data).toString();
.toString();
result = XidynUtils.extractBodyContent(content); result = XidynUtils.extractBodyContent(content);
} }
catch (XidynException exception) catch (XidynException exception)

View file

@ -58,36 +58,29 @@ public class ServicesPage extends HttpServlet
{ {
logger.info("PAGE Service > Services"); logger.info("PAGE Service > Services");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/services.xhtml");
trail.add("Services", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/services.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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,36 +65,29 @@ public class StatsPage extends HttpServlet
{ {
logger.info("PAGE Service > Stats"); logger.info("PAGE Service > Stats");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Stats", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
trail.add("Stats",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/stats.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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,36 +58,29 @@ public class UptimePage extends HttpServlet
{ {
logger.info("PAGE Service > Uptime"); logger.info("PAGE Service > Uptime");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Disponibilité", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml");
trail.add("Disponibilité",
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/uptime.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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

@ -37,7 +37,7 @@ import website.charter.ErrorView;
@KissServlet("^/federation/organizations/[^/]+/services/[^/]+/metrics/") @KissServlet("^/federation/organizations/[^/]+/services/[^/]+/metrics/")
public class IndexPage extends HttpServlet public class IndexPage extends HttpServlet
{ {
private static final long serialVersionUID = -1317090585455417646L; private static final long serialVersionUID = 2794788000773558854L;
private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class); private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IndexPage.class);
/* (non-Javadoc) /* (non-Javadoc)
@ -60,8 +60,7 @@ public class IndexPage extends HttpServlet
// Send response. // Send response.
// ============== // ==============
Redirector.redirect(response, "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() Redirector.redirect(response, "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/summary.xhtml");
+ "/metrics/summary.xhtml");
} }
catch (Exception exception) catch (Exception exception)
{ {

View file

@ -67,40 +67,32 @@ public class MetricGenericPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Métriques", trail.add("Générique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/generic.xhtml");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Générique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/generic.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -142,19 +134,16 @@ 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", MetricHtmlizer.htmlize(service, view, period, "service.users (ipv4 + ipv6)", data.setContent("graphic.users.ipv4-ipv6",
"metrics.service.users.ipv4", ChartColor.YELLOW, "metrics.service.users.ipv6", ChartColor.GREEN)); MetricHtmlizer.htmlize(service, view, period, "service.users (ipv4 + ipv6)", "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", data.setContent("graphic.accounts.active", MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
MetricHtmlizer.htmlize(service, view, period, "metrics.service.accounts.active", ChartColor.GREEN));
data.setContent("graphic.database.bytes", data.setContent("graphic.database.bytes", MetricHtmlizer.htmlize(service, view, period, "metrics.service.database.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));
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.* =
@ -164,8 +153,7 @@ public class MetricGenericPage extends HttpServlet
// metrics.moderation.accounts.cancelled.* = // metrics.moderation.accounts.cancelled.* =
// //
String content = PresenterUtils String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricGenericView.xhtml", data).toString();
.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,40 +67,32 @@ public class MetricSpecificPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Métriques", trail.add("Spécifique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/specific.xhtml");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Spécifique", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/specific.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -147,8 +139,7 @@ public class MetricSpecificPage extends HttpServlet
} }
// //
String content = PresenterUtils String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSpecificView.xhtml", data).toString();
.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,40 +67,32 @@ public class MetricSummaryPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricSummaryPage"); logger.info("PAGE Service > MetricSummaryPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Métriques", trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/summary.xhtml");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Résumé", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/summary.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -144,8 +136,7 @@ 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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricSummaryView.xhtml", data).toString();
.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,40 +67,32 @@ public class MetricWebPage extends HttpServlet
{ {
logger.info("PAGE Service > MetricGenericPage"); logger.info("PAGE Service > MetricGenericPage");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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(), trail.add(service.getName(), "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/"); trail.add("Métriques", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Métriques", trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/web.xhtml");
"/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName() + "/metrics/");
trail.add("Web", "/federation/organizations/" + organization.getTechnicalName() + "/services/" + service.getTechnicalName()
+ "/metrics/web.xhtml");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -141,22 +133,21 @@ 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", data.setContent("http.hits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.hits (ipv4 + ipv6)", "metrics.http.hits.ipv4", ChartColor.YELLOW, "metrics.http.hits.ipv6",
ChartColor.YELLOW, "metrics.http.hits.ipv6", ChartColor.GREEN)); 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)", data.setContent("http.hits-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.hits (humans + bots)", "metrics.http.hits.humans", ChartColor.GREEN,
"metrics.http.hits.humans", ChartColor.GREEN, "metrics.http.hits.bots", ChartColor.YELLOW)); "metrics.http.hits.bots",
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)", data.setContent("http.hits.humans-ipv4ipv6", MetricHtmlizer.htmlize(service, 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(service, view, period, "metrics.http.hits.humans.ipv4", ChartColor.YELLOW));
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.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));
@ -167,44 +158,42 @@ 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", data.setContent("http.ip-humansbots", MetricHtmlizer.htmlize(service, view, period, "http.ip (humans + bots)", "metrics.http.ip.humans", ChartColor.GREEN, "metrics.http.ip.bots",
ChartColor.GREEN, "metrics.http.ip.bots", ChartColor.YELLOW)); 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", data.setContent("http.ip-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.ip (ipv4 + ipv6)", "metrics.http.ip.ipv4", ChartColor.YELLOW, "metrics.http.ip.ipv6",
ChartColor.YELLOW, "metrics.http.ip.ipv6", ChartColor.GREEN)); 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)", data.setContent("http.requesters-humansbots", MetricHtmlizer.htmlize(service, 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(service, view, period, "metrics.http.requesters.humans", ChartColor.GREEN));
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)", data.setContent("http.requesters-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.requesters (ipv4 + ipv6)", "metrics.http.requesters.ipv4", ChartColor.YELLOW,
"metrics.http.requesters.ipv4", ChartColor.YELLOW, "metrics.http.requesters.ipv6", ChartColor.GREEN)); "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)", data.setContent("http.visitors-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW,
"metrics.http.visitors.ipv4", ChartColor.YELLOW, "metrics.http.visitors.ipv6", ChartColor.GREEN)); "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)", data.setContent("http.visits-ipv4ipv6", MetricHtmlizer.htmlize(service, view, period, "http.visits (ipv4 + ipv6)", "metrics.http.visits.ipv4", ChartColor.YELLOW,
"metrics.http.visits.ipv4", ChartColor.YELLOW, "metrics.http.visits.ipv6", ChartColor.GREEN)); "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 String content = PresenterUtils.dynamize("/website/federation/organizations/organization/services/service/metrics/metricWebView.xhtml", data).toString();
.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,32 +66,27 @@ public class IndexPage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares"); logger.info("PAGE Federation > Softwares");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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/");
html = WebCharterView.build(headerView, contentView, trail); String 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");
@ -128,14 +123,12 @@ 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", data.setAttribute("softwareListLine", index, "softwareListLineNameLink", "href", "/federation/softwares/" + stat.getTechnicalName() + ".xhtml");
"/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", data.setContent("softwareListLine", index, "softwareListLineServiceCount", StatoolInfosUtils.defaultIfZero(stat.getServiceCount(), "😿"));
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,38 +64,33 @@ public class SoftwarePage extends HttpServlet
{ {
logger.info("PAGE Federation > Softwares > Software"); logger.info("PAGE Federation > Softwares > Software");
String html = StatoolInfosWeb.instance().getHtmlCache().get(this.getClass().getCanonicalName()); // Get parameters.
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)
{ {
// Get parameters. throw new StatoolInfosWebException("Illegal software name.");
// =============== }
else
{
Services services = federation.getServices().getBy(software);
String contentView = htmlize(software, services);
// Use parameters. BreadcrumbTrail trail = new BreadcrumbTrail();
// =============== trail.add(StatoolInfosWeb.instance().getFederation().getName(), "/federation/");
Federation federation = StatoolInfosWeb.instance().getFederation(); trail.add("Logiciels", "/federation/softwares/");
UptimeJournal uptimes = StatoolInfosWeb.instance().getUptimeJournal();
// Send response. String html = WebCharterView.build(headerView, contentView, trail);
// ==============
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");