diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index b2b6ad2..0355119 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -34,8 +34,20 @@ import fr.devinsy.statoolinfos.properties.PathPropertyList; public class Service extends PathPropertyList { private static final long serialVersionUID = 3629841771102288863L; + + public enum Status + { + OK, + WARNING, + ALERT, + ERROR, + OVER, + UNKNOWN + } + private Organization organization; private File inputFile; + private URL inputURL; /** @@ -152,6 +164,21 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the license name. + * + * @return the license name + */ + public String getLicenseName() + { + String result; + + result = get("software.license.name"); + + // + return result; + } + /** * Gets the logo URL. * @@ -197,6 +224,36 @@ public class Service extends PathPropertyList return this.organization; } + /** + * Gets the software license name. + * + * @return the software license name + */ + public String getSoftwareLicenseName() + { + String result; + + result = get("software.license.name"); + + // + return result; + } + + /** + * Gets the software license webpage. + * + * @return the software license webpage + */ + public String getSoftwareLicenseWebpage() + { + String result; + + result = get("software.license.url"); + + // + return result; + } + /** * Gets the software name. * @@ -212,6 +269,51 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the software source website. + * + * @return the software source website + */ + public String getSoftwareSourceWebsite() + { + String result; + + result = get("software.source.url"); + + // + return result; + } + + /** + * Gets the software version. + * + * @return the software version + */ + public String getSoftwareVersion() + { + String result; + + result = get("software.version"); + + // + return result; + } + + /** + * Gets the software website. + * + * @return the software website + */ + public String getSoftwareWebsite() + { + String result; + + result = get("software.website"); + + // + return result; + } + /** * Gets the start date. * @@ -227,6 +329,61 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the status. + * + * @return the status + */ + public Status getStatus() + { + Status result; + + String value = get("service.status", "service.status.level"); + + if ((StringUtils.isBlank(value)) || (StringUtils.equals(value, "unknonw"))) + { + result = Status.UNKNOWN; + } + else if (StringUtils.equalsAnyIgnoreCase(value, "ON", "OK")) + { + result = Status.OK; + } + else if (StringUtils.equalsAnyIgnoreCase(value, "alert")) + { + result = Status.ALERT; + } + else if (StringUtils.equalsAnyIgnoreCase(value, "error", "KO", "broken")) + { + result = Status.ERROR; + } + else if (StringUtils.equalsAnyIgnoreCase(value, "over", "terminated", "closed")) + { + result = Status.OVER; + } + else + { + result = Status.UNKNOWN; + } + + // + return result; + } + + /** + * Gets the status description. + * + * @return the status description + */ + public String getStatusDescription() + { + String result; + + result = get("service.status.description"); + + // + return result; + } + public String getTechnicalDocWebsite() { String result; diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index 3b47959..0b9bb98 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -121,6 +121,14 @@ public class Htmlizer StatoolInfosUtils.copyRessource(source + "statoolinfos-logo.jpg", new File(targetDirectory, "logo.jpg")); StatoolInfosUtils.copyRessource(source + "statoolinfos-logo.ico", new File(targetDirectory, "favicon.ico")); + // + StatoolInfosUtils.copyRessource(source + "status-ok.png", targetDirectory); + StatoolInfosUtils.copyRessource(source + "status-warning.png", targetDirectory); + StatoolInfosUtils.copyRessource(source + "status-alert.png", targetDirectory); + StatoolInfosUtils.copyRessource(source + "status-error.png", targetDirectory); + StatoolInfosUtils.copyRessource(source + "status-over.png", targetDirectory); + StatoolInfosUtils.copyRessource(source + "status-void.png", targetDirectory); + // File color = new File(targetDirectory, "circle-icons/color"); color.mkdirs(); @@ -136,6 +144,12 @@ public class Htmlizer StatoolInfosUtils.copyRessource(source + "circle-icons/color/contacts.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/contacts.png", mono); + StatoolInfosUtils.copyRessource(source + "circle-icons/color/cruise.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/cruise.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/dev.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/dev.png", mono); + StatoolInfosUtils.copyRessource(source + "circle-icons/color/document.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/document.png", mono); diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java index d1b0ed9..d25b01e 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java @@ -64,9 +64,12 @@ public class ServicePage data.setEscapedContent("serviceURL", service.getWebsite()); data.setAttribute("serviceURL", "href", service.getWebsite()); - data.setContent("serviceStartDate", service.getStartDate()); - data.setContent("serviceEndDate", service.getEndDate()); - data.setEscapedContent("serviceDescription", service.getDescription()); + data.setContent("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a")); + data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a")); + data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a")); + + data.setAttribute("serviceStatusImg", "src", "status-" + service.getStatus().toString().toLowerCase() + ".png"); + data.setAttribute("serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString())); data.setAttribute("rawLink", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + ".properties"); @@ -129,6 +132,30 @@ public class ServicePage data.getIdData("registrationClientImg").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("softwareWebsiteLink", "href", service.getSoftwareWebsite()); + data.setAttribute("softwareWebsiteLinkImg", "class", ""); + data.getIdData("softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage())) + { + data.setAttribute("softwareLicenseLink", "href", service.getSoftwareLicenseWebpage()); + data.setAttribute("softwareLicenseLinkImg", "class", ""); + data.getIdData("softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite())) + { + data.setAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite()); + data.setAttribute("softwareSourceLinkImg", "class", ""); + data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + + // String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/service.xhtml", data).toString(); BreadcrumbTrail trail = new BreadcrumbTrail(); diff --git a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml index 4ffd74f..069abc7 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml @@ -11,33 +11,42 @@ -
-
+
+
- +
-
+

Description absente…

-
Ouverture n/a
-
+ +
Date ouverture : n/a – Date fermeture : n/a – Statut :
+
+ Inscription :
-
+
+ Service : - +
- +
+ Logiciel : + n/a, version n/a, licence n/a   + + + +
diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/cruise.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/cruise.png new file mode 100644 index 0000000..8bdab3d Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/cruise.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/dev.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/dev.png new file mode 100644 index 0000000..fd92d66 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/dev.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/cruise.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/cruise.png new file mode 100644 index 0000000..2b6b429 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/cruise.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/dev.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/dev.png new file mode 100644 index 0000000..ca4826e Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/dev.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css index f0ee410..51708a1 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css @@ -136,6 +136,12 @@ h3 span text-align: center; } +.center_block +{ + display: flex; + justify-content: center; +} + .right { text-align: right; @@ -217,18 +223,9 @@ h3 span display: block; } -.row:after -{ - clear: both; - content: "."; - display: block; - height: 0; - visibility: hidden; -} - .column { - display: inline; - float: left; + display: inline-block; + vertical-align: top; } /***** GENERIC BUTTONS *****/ @@ -731,7 +728,7 @@ table > tfoot > tr > th.danger font-weight:normal; color:#0084FF; font-size:20px; - margin-top:20px; + padding-top:20px; margin-bottom:10px; text-decoration: none; } diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-alert.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-alert.png new file mode 100644 index 0000000..59cd006 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-alert.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-error.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-error.png new file mode 100644 index 0000000..af4925f Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-error.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-ok.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-ok.png new file mode 100644 index 0000000..ff60031 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-ok.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-over.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-over.png new file mode 100644 index 0000000..9669f66 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-over.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-void.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-void.png new file mode 100644 index 0000000..5d70c23 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-void.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/status-warning.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-warning.png new file mode 100644 index 0000000..86a7244 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/status-warning.png differ