Improved service page design.
|
@ -34,8 +34,20 @@ import fr.devinsy.statoolinfos.properties.PathPropertyList;
|
|||
public class Service extends PathPropertyList
|
||||
{
|
||||
private static final long serialVersionUID = 3629841771102288863L;
|
||||
|
||||
public enum Status
|
||||
{
|
||||
OK,
|
||||
WARNING,
|
||||
ALERT,
|
||||
ERROR,
|
||||
OVER,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
private Organization organization;
|
||||
private File inputFile;
|
||||
|
||||
private URL inputURL;
|
||||
|
||||
/**
|
||||
|
@ -152,6 +164,21 @@ public class Service extends PathPropertyList
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the license name.
|
||||
*
|
||||
* @return the license name
|
||||
*/
|
||||
public String getLicenseName()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.license.name");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the logo URL.
|
||||
*
|
||||
|
@ -197,6 +224,36 @@ public class Service extends PathPropertyList
|
|||
return this.organization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software license name.
|
||||
*
|
||||
* @return the software license name
|
||||
*/
|
||||
public String getSoftwareLicenseName()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.license.name");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software license webpage.
|
||||
*
|
||||
* @return the software license webpage
|
||||
*/
|
||||
public String getSoftwareLicenseWebpage()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.license.url");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software name.
|
||||
*
|
||||
|
@ -212,6 +269,51 @@ public class Service extends PathPropertyList
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software source website.
|
||||
*
|
||||
* @return the software source website
|
||||
*/
|
||||
public String getSoftwareSourceWebsite()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.source.url");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software version.
|
||||
*
|
||||
* @return the software version
|
||||
*/
|
||||
public String getSoftwareVersion()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.version");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software website.
|
||||
*
|
||||
* @return the software website
|
||||
*/
|
||||
public String getSoftwareWebsite()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("software.website");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start date.
|
||||
*
|
||||
|
@ -227,6 +329,61 @@ public class Service extends PathPropertyList
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status.
|
||||
*
|
||||
* @return the status
|
||||
*/
|
||||
public Status getStatus()
|
||||
{
|
||||
Status result;
|
||||
|
||||
String value = get("service.status", "service.status.level");
|
||||
|
||||
if ((StringUtils.isBlank(value)) || (StringUtils.equals(value, "unknonw")))
|
||||
{
|
||||
result = Status.UNKNOWN;
|
||||
}
|
||||
else if (StringUtils.equalsAnyIgnoreCase(value, "ON", "OK"))
|
||||
{
|
||||
result = Status.OK;
|
||||
}
|
||||
else if (StringUtils.equalsAnyIgnoreCase(value, "alert"))
|
||||
{
|
||||
result = Status.ALERT;
|
||||
}
|
||||
else if (StringUtils.equalsAnyIgnoreCase(value, "error", "KO", "broken"))
|
||||
{
|
||||
result = Status.ERROR;
|
||||
}
|
||||
else if (StringUtils.equalsAnyIgnoreCase(value, "over", "terminated", "closed"))
|
||||
{
|
||||
result = Status.OVER;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Status.UNKNOWN;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status description.
|
||||
*
|
||||
* @return the status description
|
||||
*/
|
||||
public String getStatusDescription()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = get("service.status.description");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getTechnicalDocWebsite()
|
||||
{
|
||||
String result;
|
||||
|
|
|
@ -121,6 +121,14 @@ public class Htmlizer
|
|||
StatoolInfosUtils.copyRessource(source + "statoolinfos-logo.jpg", new File(targetDirectory, "logo.jpg"));
|
||||
StatoolInfosUtils.copyRessource(source + "statoolinfos-logo.ico", new File(targetDirectory, "favicon.ico"));
|
||||
|
||||
//
|
||||
StatoolInfosUtils.copyRessource(source + "status-ok.png", targetDirectory);
|
||||
StatoolInfosUtils.copyRessource(source + "status-warning.png", targetDirectory);
|
||||
StatoolInfosUtils.copyRessource(source + "status-alert.png", targetDirectory);
|
||||
StatoolInfosUtils.copyRessource(source + "status-error.png", targetDirectory);
|
||||
StatoolInfosUtils.copyRessource(source + "status-over.png", targetDirectory);
|
||||
StatoolInfosUtils.copyRessource(source + "status-void.png", targetDirectory);
|
||||
|
||||
//
|
||||
File color = new File(targetDirectory, "circle-icons/color");
|
||||
color.mkdirs();
|
||||
|
@ -136,6 +144,12 @@ public class Htmlizer
|
|||
StatoolInfosUtils.copyRessource(source + "circle-icons/color/contacts.png", color);
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/mono/contacts.png", mono);
|
||||
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/color/cruise.png", color);
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/mono/cruise.png", mono);
|
||||
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/color/dev.png", color);
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/mono/dev.png", mono);
|
||||
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/color/document.png", color);
|
||||
StatoolInfosUtils.copyRessource(source + "circle-icons/mono/document.png", mono);
|
||||
|
||||
|
|
|
@ -64,9 +64,12 @@ public class ServicePage
|
|||
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.setContent("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a"));
|
||||
data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a"));
|
||||
data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a"));
|
||||
|
||||
data.setAttribute("serviceStatusImg", "src", "status-" + service.getStatus().toString().toLowerCase() + ".png");
|
||||
data.setAttribute("serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString()));
|
||||
|
||||
data.setAttribute("rawLink", "href", organization.getTechnicalName() + "-" + service.getTechnicalName() + ".properties");
|
||||
|
||||
|
@ -129,6 +132,30 @@ public class ServicePage
|
|||
data.getIdData("registrationClientImg").getAttribute("class").setMode(DisplayMode.REPLACE);
|
||||
}
|
||||
|
||||
//
|
||||
data.setContent("softwareName", StringUtils.defaultIfBlank(service.getSoftwareName(), "n/a"));
|
||||
data.setContent("softwareVersion", StringUtils.defaultIfBlank(service.getSoftwareVersion(), "n/a"));
|
||||
data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a"));
|
||||
if (StringUtils.isNotBlank(service.getSoftwareWebsite()))
|
||||
{
|
||||
data.setAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite());
|
||||
data.setAttribute("softwareWebsiteLinkImg", "class", "");
|
||||
data.getIdData("softwareWebsiteLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
|
||||
}
|
||||
if (StringUtils.isNotBlank(service.getSoftwareLicenseWebpage()))
|
||||
{
|
||||
data.setAttribute("softwareLicenseLink", "href", service.getSoftwareLicenseWebpage());
|
||||
data.setAttribute("softwareLicenseLinkImg", "class", "");
|
||||
data.getIdData("softwareLicenseLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
|
||||
}
|
||||
if (StringUtils.isNotBlank(service.getSoftwareSourceWebsite()))
|
||||
{
|
||||
data.setAttribute("softwareSourceLink", "href", service.getSoftwareSourceWebsite());
|
||||
data.setAttribute("softwareSourceLinkImg", "class", "");
|
||||
data.getIdData("softwareSourceLinkImg").getAttribute("class").setMode(DisplayMode.REPLACE);
|
||||
}
|
||||
|
||||
//
|
||||
String content = PresenterUtils.dynamize("/fr/devinsy/statoolinfos/htmlize/service.xhtml", data).toString();
|
||||
|
||||
BreadcrumbTrail trail = new BreadcrumbTrail();
|
||||
|
|
|
@ -11,33 +11,42 @@
|
|||
<script src="Chart.bundle.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<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="center" style="">
|
||||
<div class="row center" style="border: 0px solid yellow;">
|
||||
<div class="column" style="border: 0px solid red;">
|
||||
<img id="serviceLogo" src="#" style="width: 100px; heigth: 100px; vertical-align: middle;"/>
|
||||
<img id="serviceLogo" src="#" style="width: 100px; height: 100px;"/>
|
||||
</div>
|
||||
<div class="column" style="border: 0px solid red;">
|
||||
<div class="column" style="border: 0px solid red; max-width: 400px;">
|
||||
<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;">
|
||||
|
||||
<div>Date ouverture : <span id="serviceStartDate">n/a</span> – Date fermeture : <span id="serviceEndDate">n/a</span> – Statut : <img id="serviceStatusImg" src="status-void.png" style="width: 25px; vertical-align: bottom;" /></div>
|
||||
<div style="border: 0px solid blue; border-radius: 8px; margin: 5px;">
|
||||
Inscription :
|
||||
<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>
|
||||
<div>
|
||||
<div style="margin: 5px;">
|
||||
Service :
|
||||
<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="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="Documentation"/></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 style="margin: 5px;">
|
||||
Logiciel :
|
||||
<span id="softwareName">n/a</span>, version <span id="softwareVersion">n/a</span>, licence <span id="softwareLicenseName">n/a</span>  
|
||||
<a id="softwareWebsiteLink" href="#"><img id="softwareWebsiteLinkImg" src="circle-icons/color/cruise.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Site web"/></a>
|
||||
<a id="softwareLicenseLink" href="#"><img id="softwareLicenseLinkImg" src="circle-icons/color/booklet.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Licence"/></a>
|
||||
<a id="softwareSourceLink" href="#"><img id="softwareSourceLinkImg" src="circle-icons/color/dev.png" class="disabled" style="width: 50px; height: 50px; padding-top:0; padding-bottom: 0; vertical-align: middle;" title="Sources"/></a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.5 KiB |
|
@ -136,6 +136,12 @@ h3 span
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.center_block
|
||||
{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.right
|
||||
{
|
||||
text-align: right;
|
||||
|
@ -217,18 +223,9 @@ h3 span
|
|||
display: block;
|
||||
}
|
||||
|
||||
.row:after
|
||||
{
|
||||
clear: both;
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.column {
|
||||
display: inline;
|
||||
float: left;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/***** GENERIC BUTTONS *****/
|
||||
|
@ -731,7 +728,7 @@ table > tfoot > tr > th.danger
|
|||
font-weight:normal;
|
||||
color:#0084FF;
|
||||
font-size:20px;
|
||||
margin-top:20px;
|
||||
padding-top:20px;
|
||||
margin-bottom:10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
|
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-alert.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-error.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-ok.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-over.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-void.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
src/fr/devinsy/statoolinfos/htmlize/stuff/status-warning.png
Normal file
After Width: | Height: | Size: 11 KiB |