From d8bfb9e3b8fa734173034915b72d64943715d17c Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 4 Oct 2020 05:58:01 +0200 Subject: [PATCH] Improved federation page design. --- build.num | 4 +- .../devinsy/statoolinfos/core/Federation.java | 109 ++++++++++++++++++ .../statoolinfos/core/Organization.java | 5 + .../statoolinfos/htmlize/FederationPage.java | 38 ++++++ .../statoolinfos/htmlize/federation.xhtml | 31 ++++- .../statoolinfos/htmlize/organization.xhtml | 2 +- .../statoolinfos/htmlize/service.xhtml | 2 +- 7 files changed, 181 insertions(+), 10 deletions(-) diff --git a/build.num b/build.num index bc60b01..281cbc0 100644 --- a/build.num +++ b/build.num @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Oct 04 03:50:10 CEST 2020 -build.number=2 +#Sun Sep 13 02:31:30 CEST 2020 +build.number=1 diff --git a/src/fr/devinsy/statoolinfos/core/Federation.java b/src/fr/devinsy/statoolinfos/core/Federation.java index 849d9d5..378d0cb 100644 --- a/src/fr/devinsy/statoolinfos/core/Federation.java +++ b/src/fr/devinsy/statoolinfos/core/Federation.java @@ -86,6 +86,36 @@ public class Federation extends PathPropertyList return result; } + /** + * Gets the contact email. + * + * @return the contact email + */ + public String getContactEmail() + { + String result; + + result = get("federation.contact.email"); + + // + return result; + } + + /** + * Gets the contact website. + * + * @return the contact website + */ + public String getContactWebsite() + { + String result; + + result = get("federation.contact.url"); + + // + return result; + } + /** * Gets the crawled date. * @@ -121,6 +151,21 @@ public class Federation extends PathPropertyList return this.inputFile; } + /** + * Gets the legal website. + * + * @return the legal website + */ + public String getLegalWebsite() + { + String result; + + result = get("federation.legal.url", "federation.legal"); + + // + return result; + } + /** * Gets the logo URL. * @@ -228,6 +273,37 @@ public class Federation extends PathPropertyList return result; } + /** + * Gets the start date. + * + * @return the start date + */ + public String getStartDate() + { + String result; + + result = get("federation.startdate", "federation.birthdate"); + + // + return result; + } + + /** + * Gets the technical doc website. + * + * @return the technical doc website + */ + public String getTechnicalDocWebsite() + { + String result; + + result = get("federation.documentation.technical", "federation.documentationtechnical.url", "federation.technical", "federation.technical.url", "service.guide.technical", + "federation.guide.technical.url"); + + // + return result; + } + /** * Gets the technical name. * @@ -243,6 +319,39 @@ public class Federation extends PathPropertyList return result; } + /** + * Gets the user doc website. + * + * @return the user doc website + */ + public String getUserDocWebsite() + { + String result; + + result = get("federation.documentation", "federation.documentation.url", "federation.documentation.user", "federation.documentation.user.url", "service.documentation.tutorial", + "federation.documentation.tutorial.url", + "federation.guide.user", + "federation.guide.user.url"); + + // + return result; + } + + /** + * Gets the website. + * + * @return the website + */ + public String getWebsite() + { + String result; + + result = get("federation.website"); + + // + return result; + } + public void setInputFile(final File inputFile) { this.inputFile = inputFile; diff --git a/src/fr/devinsy/statoolinfos/core/Organization.java b/src/fr/devinsy/statoolinfos/core/Organization.java index 9f6511e..ac79356 100644 --- a/src/fr/devinsy/statoolinfos/core/Organization.java +++ b/src/fr/devinsy/statoolinfos/core/Organization.java @@ -68,6 +68,11 @@ public class Organization extends PathPropertyList } } + /** + * Gets the contact email. + * + * @return the contact email + */ public String getContactEmail() { String result; diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java index 5eaabae..d096bf5 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationPage.java @@ -18,6 +18,7 @@ */ package fr.devinsy.statoolinfos.htmlize; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,6 +26,7 @@ import fr.devinsy.statoolinfos.core.Federation; import fr.devinsy.statoolinfos.core.Organization; import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.xidyn.XidynException; +import fr.devinsy.xidyn.data.DisplayMode; import fr.devinsy.xidyn.data.TagDataManager; import fr.devinsy.xidyn.presenters.PresenterUtils; @@ -58,6 +60,42 @@ public class FederationPage data.setAttribute("federationLogo", "src", federation.getTechnicalName() + "-logo.png"); data.setEscapedContent("federationName", federation.getName()); data.setEscapedContent("federationDescription", federation.getDescription()); + + data.setEscapedContent("federationURL", federation.getWebsite()); + data.setAttribute("federationURL", "href", federation.getWebsite()); + data.setContent("federationStartDate", StringUtils.defaultIfBlank(federation.getStartDate(), "n/a")); + + if (StringUtils.isNotBlank(federation.getLegalWebsite())) + { + data.setAttribute("legalLink", "href", federation.getLegalWebsite()); + data.setAttribute("legalLinkImg", "class", ""); + data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(federation.getContactWebsite())) + { + data.setAttribute("contactLink", "href", federation.getContactWebsite()); + data.setAttribute("contactLinkImg", "class", ""); + data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(federation.getContactEmail())) + { + data.setAttribute("emailLink", "href", "mailto:" + federation.getContactEmail()); + data.setAttribute("emailLinkImg", "class", ""); + data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(federation.getUserDocWebsite())) + { + data.setAttribute("userDocLink", "href", federation.getUserDocWebsite()); + data.setAttribute("userDocLinkImg", "class", ""); + data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(federation.getTechnicalDocWebsite())) + { + data.setAttribute("technicalDocLink", "href", federation.getTechnicalDocWebsite()); + data.setAttribute("technicalDocLinkImg", "class", ""); + data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + data.setContent("organizationCount", federation.getOrganizations().size()); data.setContent("serviceCount", federation.getServiceCount()); diff --git a/src/fr/devinsy/statoolinfos/htmlize/federation.xhtml b/src/fr/devinsy/statoolinfos/htmlize/federation.xhtml index 93b1e9f..1a6a80c 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/federation.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/federation.xhtml @@ -11,13 +11,32 @@ -
-
-

Federation name

-

Bla bla description

-
Nombre de membres : n/a
-
Nombre de services : n/a
+
+
+
+ +
+
+ + +
+

Description absente…

+
Depuis n/a
+ +
+
+
Nombre de membres : n/a
+
Nombre de services : n/a
+
+
diff --git a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml index c7143e5..a6586d3 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml @@ -19,8 +19,8 @@
-

Description absente…

+

Description absente…

Date d'entrée : n/a – Date de sortie : n/a
Date ouverture : n/a – Date fermeture : n/a – Statut :