From 41f83dd7f286a002338e5bb8f653f1d4df42fa7a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 3 Oct 2020 06:30:47 +0200 Subject: [PATCH] Improved service page. --- src/fr/devinsy/statoolinfos/core/Service.java | 100 ++++++++++++++++++ .../statoolinfos/htmlize/Htmlizer.java | 48 +++++---- .../statoolinfos/htmlize/ServicePage.java | 53 +++++++++- .../statoolinfos/htmlize/service.xhtml | 58 +++++----- .../stuff/circle-icons/color/document.png | Bin 0 -> 2192 bytes .../stuff/circle-icons/mono/document.png | Bin 0 -> 2094 bytes .../htmlize/stuff/statoolinfos.css | 26 +++++ .../properties/PathPropertyList.java | 55 ++++++++-- 8 files changed, 271 insertions(+), 69 deletions(-) create mode 100644 src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/color/document.png create mode 100644 src/fr/devinsy/statoolinfos/htmlize/stuff/circle-icons/mono/document.png 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 0000000000000000000000000000000000000000..9b120cf47db2d65e008e2c219d76d6aac544a216 GIT binary patch literal 2192 zcmV;B2ygd^P)1RCwC#T}y8hXB53NwUY)6b}&t& z6ce`~+Ep7iT~w7~R$V69bVM}(A0l+VCSfVbH^be3MyNV-qpL9o2TP&b7K|wh*j@$;aGY*2wCEq=uy=YXmDH;*szbiP|_B z+Q@53bPaX_N|jQB4w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3$L^TalH_CfC?zzJxf1)e_ZE9pxvUxDeu zmo*0{0%ZNyzrMBeX%Xm=vYLI%oW&+`0E7TIfa?yhjd5@m+f)VAgrbe0RREnpsn~fksE&!?Eb2Z#Cyr9k z!4i>0&fK;a0OK0Q%Q_@- z+DZU71a1-Aga&h(P5^;bG~fbu&3@)IwF3|q-~!gn{)JY5*-`*-0sCivCkF^!02P73 znSZ<4-%$XpoOz6+v6yc+`_ni;*cYf_ER91gsqW7#0LF}}v!s_VxeCSCo{F|VFO zEfB$mz`F)?0mc0z-TYuLJA|AN=o0FHI&&d%6##dbq$hoY=DzoaimxBd(8o&;ebwL2At%E85!hDa{z<`vut0P03ZUh z$d?uZ62bvWL;z~Q^@dF*UrD*`sXlvEZDU8!ReLuJ`cz-R!+UpE zhYlZmEM9CvwFjK0j`wt9=c?*o50115qDi>#ky%rXhH;I`NGju2Od;K9 z0VD{b!a^8jcTk-`Hh7lPe)~1kcUm`I04*G%%%T{Ggp4fW2uThteVb=_-Lx6r3C{%> Y08}KaVSo>5c>n+a07*qoM6N<$f~8E$UjP6A literal 0 HcmV?d00001 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; - } } }