diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 8699311..b2b6ad2 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -57,6 +57,36 @@ public class Service extends PathPropertyList super(properties); } + /** + * Gets the contact email. + * + * @return the contact email + */ + public String getContactEmail() + { + String result; + + result = get("service.contact.email"); + + // + return result; + } + + /** + * Gets the contact website. + * + * @return the contact website + */ + public String getContactWebsite() + { + String result; + + result = get("service.contact.url"); + + // + return result; + } + public LocalDateTime getCrawledDate() { LocalDateTime result; @@ -82,6 +112,21 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the end date. + * + * @return the end date + */ + public String getEndDate() + { + String result; + + result = get("service.enddate", "service.deathdate"); + + // + return result; + } + public File getInputFile() { return this.inputFile; @@ -92,6 +137,21 @@ public class Service extends PathPropertyList return this.inputURL; } + /** + * Gets the legal website. + * + * @return the legal website + */ + public String getLegalWebsite() + { + String result; + + result = get("service.legal.url", "service.legal"); + + // + return result; + } + /** * Gets the logo URL. * @@ -152,6 +212,31 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the start date. + * + * @return the start date + */ + public String getStartDate() + { + String result; + + result = get("service.startdate", "service.birthdate"); + + // + return result; + } + + public String getTechnicalDocWebsite() + { + String result; + + result = get("service.documentation.technical", "service.documentation.technical.url"); + + // + return result; + } + /** * Gets the technical name. * @@ -182,6 +267,21 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the user doc. + * + * @return the user doc + */ + public String getUserDocWebsite() + { + String result; + + result = get("service.documentation.user", "service.documentation.user.url", "service.documentation.tutorial", "service.documentation.tutorial.url"); + + // + return result; + } + /** * Gets the website. * diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index 26dc5f4..3b47959 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -127,33 +127,39 @@ public class Htmlizer File mono = new File(targetDirectory, "circle-icons/mono"); mono.mkdirs(); - StatoolInfosUtils.copyRessource(source + "circle-icons/color/global.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/global.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/email.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/email.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/profile.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/profile.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/money.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/money.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/creditcard.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/creditcard.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/mail.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/mail.png", mono); - - StatoolInfosUtils.copyRessource(source + "circle-icons/color/ribbon.png", color); - StatoolInfosUtils.copyRessource(source + "circle-icons/mono/ribbon.png", mono); - StatoolInfosUtils.copyRessource(source + "circle-icons/color/booklet.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/booklet.png", mono); StatoolInfosUtils.copyRessource(source + "circle-icons/color/bookshelf.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/bookshelf.png", mono); + StatoolInfosUtils.copyRessource(source + "circle-icons/color/contacts.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/contacts.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/document.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/document.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/creditcard.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/creditcard.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/email.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/email.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/global.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/global.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/mail.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/mail.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/money.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/money.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/profile.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/profile.png", mono); + + StatoolInfosUtils.copyRessource(source + "circle-icons/color/ribbon.png", color); + StatoolInfosUtils.copyRessource(source + "circle-icons/mono/ribbon.png", mono); + StatoolInfosUtils.copyRessource(source + "circle-icons/color/toolbox.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/toolbox.png", mono); diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java index ccce023..d1b0ed9 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServicePage.java @@ -18,6 +18,7 @@ */ package fr.devinsy.statoolinfos.htmlize; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,15 +56,61 @@ public class ServicePage TagDataManager data = new TagDataManager(); - data.setAttribute("serviceRawButton", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + ".properties"); - data.setAttribute("serviceLogo", "src", organization.getTechnicalName() + "-" + service.getTechnicalName() + "-logo.png"); + data.setEscapedContent("serviceName", service.getName()); + data.setAttribute("serviceName", "href", service.getWebsite()); + + 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.setAttribute("rawLink", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + ".properties"); + + if (StringUtils.isNotBlank(service.getLegalWebsite())) + { + data.setAttribute("legalLink", "href", service.getLegalWebsite()); + data.setAttribute("legalLinkImg", "class", ""); + data.getIdData("legalLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getContactWebsite())) + { + data.setAttribute("contactLink", "href", service.getContactWebsite()); + data.setAttribute("contactLinkImg", "class", ""); + data.getIdData("contactLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getContactEmail())) + { + data.setAttribute("emailLink", "href", "mailto:" + service.getContactEmail()); + 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()); + data.setAttribute("userDocLinkImg", "class", ""); + data.getIdData("userDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + if (StringUtils.isNotBlank(service.getTechnicalDocWebsite())) + { + data.setAttribute("technicalDocLink", "href", service.getTechnicalDocWebsite()); + data.setAttribute("technicalDocLinkImg", "class", ""); + data.getIdData("technicalDocLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE); + } + + // if (service.isRegistrationNone()) { - data.setAttribute("registrationNoneImg", "class", "toto"); + data.setAttribute("registrationNoneImg", "class", ""); data.getIdData("registrationNoneImg").getAttribute("class").setMode(DisplayMode.REPLACE); } if (service.isRegistrationFree()) diff --git a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml index a975858..4ffd74f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/service.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/service.xhtml @@ -11,43 +11,33 @@
-