diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 0355119..6d4aa54 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -42,7 +42,7 @@ public class Service extends PathPropertyList ALERT, ERROR, OVER, - UNKNOWN + VOID } private Organization organization; @@ -340,9 +340,9 @@ public class Service extends PathPropertyList String value = get("service.status", "service.status.level"); - if ((StringUtils.isBlank(value)) || (StringUtils.equals(value, "unknonw"))) + if ((StringUtils.isBlank(value)) || (StringUtils.equalsAnyIgnoreCase(value, "unknown", "void"))) { - result = Status.UNKNOWN; + result = Status.VOID; } else if (StringUtils.equalsAnyIgnoreCase(value, "ON", "OK")) { @@ -352,17 +352,17 @@ public class Service extends PathPropertyList { result = Status.ALERT; } - else if (StringUtils.equalsAnyIgnoreCase(value, "error", "KO", "broken")) + else if (StringUtils.equalsAnyIgnoreCase(value, "error", "ko", "broken", "off")) { result = Status.ERROR; } - else if (StringUtils.equalsAnyIgnoreCase(value, "over", "terminated", "closed")) + else if (StringUtils.equalsAnyIgnoreCase(value, "over", "terminated", "closed", "ended")) { result = Status.OVER; } else { - result = Status.UNKNOWN; + result = Status.VOID; } // @@ -384,11 +384,14 @@ public class Service extends PathPropertyList return result; } + /** + * @return + */ public String getTechnicalDocWebsite() { String result; - result = get("service.documentation.technical", "service.documentation.technical.url"); + result = get("service.documentation.technical", "service.documentationtechnical.url", "service.technical", "service.technical.url", "service.guide.technical", "service.guide.technical.url"); // return result; @@ -433,7 +436,10 @@ public class Service extends PathPropertyList { String result; - result = get("service.documentation.user", "service.documentation.user.url", "service.documentation.tutorial", "service.documentation.tutorial.url"); + result = get("service.documentation", "service.documentation.url", "service.documentation.user", "service.documentation.user.url", "service.documentation.tutorial", + "service.documentation.tutorial.url", + "service.guide.user", + "service.guide.user.url"); // return result; diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java index 31ce855..a5ec22f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceListView.java @@ -18,6 +18,7 @@ */ package fr.devinsy.statoolinfos.htmlize; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,6 +74,41 @@ public class ServiceListView data.setEscapedContent("serviceListLine", index, "serviceListLineSoftware", service.getSoftwareName()); data.setEscapedContent("serviceListLine", index, "serviceListLineDate", service.getCrawledDate().toString()); + data.setAttribute("serviceListLine", index, "serviceStatusImg", "src", "status-" + service.getStatus().toString().toLowerCase() + ".png"); + data.setAttribute("serviceListLine", index, "serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString())); + + if (StringUtils.isNotBlank(service.getLegalWebsite())) + { + data.setAttribute("serviceListLine", index, "legalLink", "href", service.getLegalWebsite()); + data.setAttribute("serviceListLine", index, "legalLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getContactWebsite())) + { + data.setAttribute("serviceListLine", index, "contactLink", "href", service.getContactWebsite()); + data.setAttribute("serviceListLine", index, "contactLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getContactEmail())) + { + data.setAttribute("serviceListLine", index, "emailLink", "href", "mailto:" + service.getContactEmail()); + data.setAttribute("serviceListLine", index, "emailLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getUserDocWebsite())) + { + data.setAttribute("serviceListLine", index, "userDocLink", "href", service.getUserDocWebsite()); + data.setAttribute("serviceListLine", index, "userDocLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) + { + data.setAttribute("serviceListLine", index, "technicalDocLink", "href", service.getTechnicalDocWebsite()); + data.setAttribute("serviceListLine", index, "technicalDocLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + + // if (service.isRegistrationNone()) { data.setAttribute("serviceListLine", index, "serviceListLineRegistrationNoneImg", "class", "toto"); @@ -94,6 +130,29 @@ public class ServiceListView data.getIdData("serviceListLine", index, "serviceListLineRegistrationClientImg").getAttribute("class").setMode(DisplayMode.REPLACE); } + // + data.setContent("softwareName", StringUtils.defaultIfBlank(service.getSoftwareName(), "n/a")); + data.setContent("softwareVersion", StringUtils.defaultIfBlank(service.getSoftwareVersion(), "n/a")); + data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a")); + if (StringUtils.isNotBlank(service.getSoftwareWebsite())) + { + data.setAttribute("serviceListLine", index, "softwareWebsiteLink", "href", service.getSoftwareWebsite()); + data.setAttribute("serviceListLine", index, "softwareWebsiteLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) + { + data.setAttribute("serviceListLine", index, "softwareLicenseLink", "href", service.getSoftwareLicenseWebpage()); + data.setAttribute("serviceListLine", index, "softwareLicenseLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) + { + data.setAttribute("serviceListLine", index, "softwareSourceLink", "href", service.getSoftwareSourceWebsite()); + data.setAttribute("serviceListLine", index, "softwareSourceLinkImg", "class", ""); + data.getIdData("serviceListLine", index, "softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + index += 1; } diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java index d25b01e..6a310e7 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java @@ -91,12 +91,6 @@ public class ServicePage data.setAttribute("emailLinkImg", "class", ""); data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); } - if (StringUtils.isNotBlank(service.getContactEmail())) - { - data.setAttribute("contactDocLink", "href", service.getContactWebsite()); - data.setAttribute("contactDocLinkImg", "class", ""); - data.getIdData("contactDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); - } if (StringUtils.isNotBlank(service.getUserDocWebsite())) { data.setAttribute("userDocLink", "href", service.getUserDocWebsite()); diff --git a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml index b455054..99bc951 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml @@ -11,15 +11,13 @@
-Bla bla description
-n/a
+