Improved service page.

This commit is contained in:
Christian P. MOMON 2020-10-03 06:30:47 +02:00
parent fa536d30c0
commit 41f83dd7f2
8 changed files with 271 additions and 69 deletions

View file

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

View file

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

View file

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

View file

@ -11,43 +11,33 @@
<script src="Chart.bundle.min.js"></script>
</head>
<body>
<div class="center_table" style="width: 900px;">
<div class="center" >
<h2><img id="serviceLogo" src="#" style="width: 100px; heigth: 100px;"/> <span id="serviceName">Service name</span></h2>
<div style="margin: 5px;">
<a id="serviceRawButton" href="#" class="button">Raw</a>
<div class="center_table center" style="width: 900px;">
<div class="row center_table" style="border: 0px solid yellow; display: flex; justify-content: center;">
<div class="column" style="border: 0px solid red;">
<img id="serviceLogo" src="#" style="width: 100px; heigth: 100px; vertical-align: middle;"/>
</div>
<div>
<div class="column" style="border: 0px solid red;">
<div class="content_title"><a id="serviceName" href="#">Service name</a></div>
<div class="content_subtitle"><a id="serviceURL" href="#" style="text-decoration: none;">URL n/a</a></div>
<p id="serviceDescription">Description absente…</p>
<div>Ouverture <span id="serviceStartDate">n/a</span></div>
</div>
</div>
<div style="border: 1px solid blue; border-radius: 8px;">
<img id="registrationNoneImg" src="circle-icons/mono/global.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Sans compte"/>
<img id="registrationFreeImg" src="circle-icons/mono/profile.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Compte libre"/>
<img id="registrationMemberImg" src="circle-icons/mono/money.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Réservé aux adhérents"/>
<img id="registrationClientImg" src="circle-icons/mono/creditcard.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Réservé aux clients"/>
</div>
<p id="serviceDescription">Bla bla description</p>
<div>
<a id="legalLink" href="#"><img id="legalLinkImg" src="circle-icons/color/ribbon.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Mentions légales"/></a>
<a id="contactLink" href="#"><img id="contactLinkImg" src="circle-icons/color/contacts.png" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Page web de contact"/></a>
<a id="emailLink" href="#"><img id="emailLinkImg" src="circle-icons/color/mail.png" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Courriel de contact/support"/></a>
<a id="userDocLink" href="#"><img id="userDocLinkImg" src="circle-icons/color/bookshelf.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Tutoriels"/></a>
<a id="technicalDocLink" href="#"><img id="technicalDocLinkImg" src="circle-icons/color/tools.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Documentation technique"/></a>
<a id="rawLink" href="#"><img id="rawLinkImg" src="circle-icons/mono/document.png" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Fichier propriétés"/></a>
</div>
<div>&#160;</div>
<table class="table_classic left">
<thead>
<tr>
<th class="">Nom du service</th>
<th class="">URL</th>
<th class="">Logiciel</th>
<th class="">Utilisateurs mensuels</th>
<th style="width: 10px;">Date</th>
</tr>
</thead>
<tbody>
<tr id="serviceListLine">
<td id="serviceListLineName"><a href="#" id="serviceListLineNameLink">n/a</a></td>
<td id="serviceListLineUrl"><a href="#" id="serviceListLineUrlLink">n/a</a></td>
<td id="serviceListLineSoftware">n/a</td>
<td id="serviceListLineUserCount">n/a</td>
<td id="serviceListLineDate" class="center">n/a</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

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

View file

@ -119,6 +119,47 @@ public class PathPropertyList extends ArrayList<PathProperty> 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<PathProperty> 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<PathProperty> 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<PathProperty> implements PathPro
@Override
public void removePath(final String path)
{
String result;
boolean ended = false;
Iterator<PathProperty> 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;
}
}
}