diff --git a/build.num b/build.num index 281cbc0..bc60b01 100644 --- a/build.num +++ b/build.num @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Sep 13 02:31:30 CEST 2020 -build.number=1 +#Sun Oct 04 03:50:10 CEST 2020 +build.number=2 diff --git a/src/fr/devinsy/statoolinfos/core/Organization.java b/src/fr/devinsy/statoolinfos/core/Organization.java index 3831f5c..9f6511e 100644 --- a/src/fr/devinsy/statoolinfos/core/Organization.java +++ b/src/fr/devinsy/statoolinfos/core/Organization.java @@ -68,6 +68,31 @@ public class Organization extends PathPropertyList } } + public String getContactEmail() + { + String result; + + result = get("organization.contact.email"); + + // + return result; + } + + /** + * Gets the contact website. + * + * @return the contact website + */ + public String getContactWebsite() + { + String result; + + result = get("organization.contact.url"); + + // + return result; + } + /** * Gets the crawled date. * @@ -93,6 +118,21 @@ public class Organization extends PathPropertyList return result; } + /** + * Gets the end date. + * + * @return the end date + */ + public String getEndDate() + { + String result; + + result = get("organization.enddate", "organization.deathdate"); + + // + return result; + } + public Federation getFederation() { return this.federation; @@ -118,6 +158,21 @@ public class Organization extends PathPropertyList return result; } + /** + * Gets the legal website. + * + * @return the legal website + */ + public String getLegalWebsite() + { + String result; + + result = get("organization.legal.url", "organization.legal"); + + // + return result; + } + /** * Gets the logo URL. * @@ -178,6 +233,37 @@ public class Organization extends PathPropertyList return this.services; } + /** + * Gets the start date. + * + * @return the start date + */ + public String getStartDate() + { + String result; + + result = get("organization.startdate", "organization.birthdate"); + + // + return result; + } + + /** + * Gets the technical doc website. + * + * @return the technical doc website + */ + public String getTechnicalDocWebsite() + { + String result; + + result = get("organization.documentation.technical", "organization.documentationtechnical.url", "organization.technical", "organization.technical.url", "service.guide.technical", + "organization.guide.technical.url"); + + // + return result; + } + /** * Gets the technical name. * @@ -208,6 +294,24 @@ public class Organization extends PathPropertyList return result; } + /** + * Gets the user doc website. + * + * @return the user doc website + */ + public String getUserDocWebsite() + { + String result; + + result = get("organization.documentation", "organization.documentation.url", "organization.documentation.user", "organization.documentation.user.url", "service.documentation.tutorial", + "organization.documentation.tutorial.url", + "organization.guide.user", + "organization.guide.user.url"); + + // + return result; + } + /** * Gets the website. * diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java index 9ae6115..9d20bba 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationPage.java @@ -18,12 +18,14 @@ */ package fr.devinsy.statoolinfos.htmlize; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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; @@ -57,8 +59,48 @@ public class OrganizationPage data.setAttribute("organizationLogo", "src", organization.getTechnicalName() + "-logo.png"); data.setEscapedContent("organizationName", organization.get("organization.name")); + + data.setEscapedContent("organizationURL", organization.getWebsite()); + data.setAttribute("organizationURL", "href", organization.getWebsite()); + data.setEscapedContent("organizationDescription", organization.get("organization.description")); + data.setContent("organizationStartDate", StringUtils.defaultIfBlank(organization.getStartDate(), "n/a")); + data.setContent("organizationEndDate", StringUtils.defaultIfBlank(organization.getEndDate(), "n/a")); data.setContent("serviceCount", organization.getServices().size()); + + data.setAttribute("rawLink", "href", organization.getTechnicalName() + ".properties"); + + if (StringUtils.isNotBlank(organization.getLegalWebsite())) + { + data.setAttribute("legalLink", "href", organization.getLegalWebsite()); + data.setAttribute("legalLinkImg", "class", ""); + data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(organization.getContactWebsite())) + { + data.setAttribute("contactLink", "href", organization.getContactWebsite()); + data.setAttribute("contactLinkImg", "class", ""); + data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(organization.getContactEmail())) + { + data.setAttribute("emailLink", "href", "mailto:" + organization.getContactEmail()); + data.setAttribute("emailLinkImg", "class", ""); + data.getIdData("emailLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(organization.getUserDocWebsite())) + { + data.setAttribute("userDocLink", "href", organization.getUserDocWebsite()); + data.setAttribute("userDocLinkImg", "class", ""); + data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(organization.getTechnicalDocWebsite())) + { + data.setAttribute("technicalDocLink", "href", organization.getTechnicalDocWebsite()); + data.setAttribute("technicalDocLinkImg", "class", ""); + data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + data.setContent("serviceListView", ServiceListView.build(organization.getServices().sortByName())); String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/organization.xhtml", data).toString(); diff --git a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml index 9503495..c7143e5 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/organization.xhtml @@ -12,12 +12,27 @@
-

Organization name

- -
- Raw +
+
+ +
+
+ + +

Description absente…

+
-

n/a

+
Date d'entrée : n/a – Date de sortie : n/a
+ +
Nombre de services : n/a
diff --git a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml index 30c2111..b942920 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml @@ -34,8 +34,8 @@