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 @@ -
-
-

Service name

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

Description absente…

+
Ouverture n/a
- -

Bla bla description

-
 
- - - - - - - - - - - - - - - - - - - -
Nom du serviceURLLogicielUtilisateurs mensuelsDate
n/an/an/an/an/a
+
+ + + + +
+
+ + + + + + +
+
diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/document.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/document.png new file mode 100644 index 0000000..9b120cf Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/document.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/document.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/document.png new file mode 100644 index 0000000..0838606 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/document.png differ diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css index 57d0a0b..f0ee410 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/statoolinfos.css @@ -721,3 +721,29 @@ table > tfoot > tr > th.danger border-collapse: collapse; color: #6f6e60; /* #2e2d30; */ } + +/************************************************/ +.content_title, +.content_title a, +.content_title span +{ + font-family: ITCAvantGardeStd-Md, Arial, Helvetica, sans-serif; + font-weight:normal; + color:#0084FF; + font-size:20px; + margin-top:20px; + margin-bottom:10px; + text-decoration: none; +} + +.content_subtitle, +.content_subtitle a, +.content_subtitle span +{ + color:#0084FF; + font-weight:normal; + font-size:15px; + margin-top:5x; + font-family: ITCAvantGardeStd-Md, Arial, Helvetica, sans-serif; + text-decoration: none; +} diff --git a/src/fr/devinsy/statoolinfos/properties/PathPropertyList.java b/src/fr/devinsy/statoolinfos/properties/PathPropertyList.java index 143b4ce..2df9c10 100644 --- a/src/fr/devinsy/statoolinfos/properties/PathPropertyList.java +++ b/src/fr/devinsy/statoolinfos/properties/PathPropertyList.java @@ -119,6 +119,47 @@ public class PathPropertyList extends ArrayList implements PathPro return result; } + /** + * Gets the. + * + * @param paths + * the paths + * @return the string + */ + public String get(final String... paths) + { + String result; + + boolean ended = false; + result = null; + int index = 0; + while (!ended) + { + if (index < paths.length) + { + String path = paths[index]; + PathProperty property = getProperty(path); + if (property == null) + { + index += 1; + } + else + { + ended = true; + result = property.getValue(); + } + } + else + { + ended = true; + result = null; + } + } + + // + return result; + } + /** * Gets the by prefix. * @@ -188,7 +229,7 @@ public class PathPropertyList extends ArrayList implements PathPro { PathProperty current = this.get(index); - if (StringUtils.equals(current.getPath(), path)) + if (StringUtils.equalsIgnoreCase(current.getPath(), path)) { ended = true; result = index; @@ -298,7 +339,7 @@ public class PathPropertyList extends ArrayList implements PathPro { PathProperty current = iterator.next(); - if (StringUtils.equals(current.getPath(), path)) + if (StringUtils.equalsIgnoreCase(current.getPath(), path)) { ended = true; result = current; @@ -403,28 +444,20 @@ public class PathPropertyList extends ArrayList implements PathPro @Override public void removePath(final String path) { - String result; - boolean ended = false; Iterator iterator = this.iterator(); - result = null; while (!ended) { if (iterator.hasNext()) { PathProperty current = iterator.next(); - if (StringUtils.equals(current.getPath(), path)) + if (StringUtils.equalsIgnoreCase(current.getPath(), path)) { ended = true; iterator.remove(); } } - else - { - ended = true; - result = null; - } } }