Compare commits
No commits in common. "e4236d26c374cd871224bb94d34ae557bcd67272" and "05286c26ffc31ae2eb8dd95494e95c4894ea01ec" have entirely different histories.
e4236d26c3
...
05286c26ff
15 changed files with 12 additions and 152 deletions
|
@ -4,7 +4,7 @@
|
||||||
javaCheck=`which java`
|
javaCheck=`which java`
|
||||||
if [[ "$javaCheck" =~ ^/.* ]]; then
|
if [[ "$javaCheck" =~ ^/.* ]]; then
|
||||||
#echo "Java requirement............... OK"
|
#echo "Java requirement............... OK"
|
||||||
java -Djava.awt.headless=true -jar "$(dirname "$0")"/statoolinfos.jar $@
|
java -jar "$(dirname "$0")"/statoolinfos.jar $@
|
||||||
else
|
else
|
||||||
echo "Java requirement............... MISSING"
|
echo "Java requirement............... MISSING"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -36,12 +36,10 @@ import fr.devinsy.strings.StringsUtils;
|
||||||
public class PropertyChecker
|
public class PropertyChecker
|
||||||
{
|
{
|
||||||
public static final String ALL = "^.*$";
|
public static final String ALL = "^.*$";
|
||||||
public static final String BOM = "\ufeff";
|
|
||||||
public static final String COMMENT = "^#.*$";
|
|
||||||
public static final String STRING = "^.+$";
|
public static final String STRING = "^.+$";
|
||||||
public static final String DATETIME = "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}([\\.,]\\d+)?)?([+-]\\d\\d:\\d\\d)?";
|
public static final String DATETIME = "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}([\\.,]\\d+)?)?([+-]\\d\\d:\\d\\d)?";
|
||||||
public static final String DATE = "^(\\d{4}-\\d{2}-\\d{2}|\\d{2}/\\d{2}/\\d{4}|\\d{2}/\\d{4})";
|
public static final String DATE = "^(\\d{4}-\\d{2}-\\d{2}|\\d{2}/\\d{2}/\\d{4}|\\d{2}/\\d{4})";
|
||||||
public static final String URL = "^(http(s)?://)?[\\w-_\\.]+(\\.\\w+)+(:\\d+)?(/.*)?$";
|
public static final String URL = "^(http(s)?://)?[\\w-_\\.]+(\\.\\w+)+(/.*)?$";
|
||||||
public static final String EMAIL = "^.*@.*$";
|
public static final String EMAIL = "^.*@.*$";
|
||||||
public static final String NUMERIC = "^\\d+$";
|
public static final String NUMERIC = "^\\d+$";
|
||||||
public static final String NUMERICS = "^\\d*(,\\d*)*$";
|
public static final String NUMERICS = "^\\d*(,\\d*)*$";
|
||||||
|
@ -229,13 +227,6 @@ public class PropertyChecker
|
||||||
|
|
||||||
result = new PropertyChecks();
|
result = new PropertyChecks();
|
||||||
|
|
||||||
//
|
|
||||||
if ((lines != null) && (!lines.isEmpty()) && (lines.get(0).startsWith(BOM)))
|
|
||||||
{
|
|
||||||
String line = lines.get(0).substring(1);
|
|
||||||
lines.set(0, line);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
PropertyRules requiredRules = rules.getMandatories();
|
PropertyRules requiredRules = rules.getMandatories();
|
||||||
requiredRules.addAll(rules.getWished());
|
requiredRules.addAll(rules.getWished());
|
||||||
|
@ -290,7 +281,7 @@ public class PropertyChecker
|
||||||
check = new PropertyCheck(lineIndex, "", Status.OK);
|
check = new PropertyCheck(lineIndex, "", Status.OK);
|
||||||
check.setComment("OK");
|
check.setComment("OK");
|
||||||
}
|
}
|
||||||
else if ((StringUtils.isEmpty(line)) || (line.matches(COMMENT)))
|
else if ((StringUtils.isEmpty(line)) || (line.matches("^#.*$")))
|
||||||
{
|
{
|
||||||
check = new PropertyCheck(lineIndex, line, Status.OK);
|
check = new PropertyCheck(lineIndex, line, Status.OK);
|
||||||
check.setComment("OK");
|
check.setComment("OK");
|
||||||
|
|
|
@ -501,35 +501,6 @@ public class Federation extends PathPropertyList
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the URL active all.
|
|
||||||
*
|
|
||||||
* @return the URL active all
|
|
||||||
*/
|
|
||||||
public URLSet getURLActiveAll()
|
|
||||||
{
|
|
||||||
URLSet result;
|
|
||||||
|
|
||||||
result = new URLSet();
|
|
||||||
|
|
||||||
//
|
|
||||||
result.add(getContactURL());
|
|
||||||
result.add(getLegalURL());
|
|
||||||
result.add(getLogoURL());
|
|
||||||
result.add(getTechnicalGuideURL());
|
|
||||||
result.add(getUserGuideURL());
|
|
||||||
result.add(getWebsiteURL());
|
|
||||||
|
|
||||||
//
|
|
||||||
for (Organization organization : getOrganizations())
|
|
||||||
{
|
|
||||||
result.addAll(organization.getURLActiveAll());
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the URL all.
|
* Gets the URL all.
|
||||||
*
|
*
|
||||||
|
|
|
@ -616,21 +616,6 @@ public class Organization extends PathPropertyList
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the service active count.
|
|
||||||
*
|
|
||||||
* @return the service active count
|
|
||||||
*/
|
|
||||||
public int getServiceActiveCount()
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
|
|
||||||
result = this.services.getBy(Service.Status.OK).size();
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the service count.
|
* Gets the service count.
|
||||||
*
|
*
|
||||||
|
@ -698,34 +683,6 @@ public class Organization extends PathPropertyList
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the URL all.
|
|
||||||
*
|
|
||||||
* @return the URL all
|
|
||||||
*/
|
|
||||||
public URLSet getURLActiveAll()
|
|
||||||
{
|
|
||||||
URLSet result;
|
|
||||||
|
|
||||||
result = new URLSet();
|
|
||||||
|
|
||||||
result.add(getContactURL());
|
|
||||||
result.add(getLegalURL());
|
|
||||||
result.add(getLogoURL());
|
|
||||||
result.add(getTechnicalGuideURL());
|
|
||||||
result.add(getUserGuideURL());
|
|
||||||
result.add(getWebsiteURL());
|
|
||||||
|
|
||||||
//
|
|
||||||
for (Service service : getServices().getBy(Service.Status.OK))
|
|
||||||
{
|
|
||||||
result.addAll(service.getURLAll());
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the URL all.
|
* Gets the URL all.
|
||||||
*
|
*
|
||||||
|
|
|
@ -84,25 +84,6 @@ public class Organizations extends ArrayList<Organization>
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the service active count.
|
|
||||||
*
|
|
||||||
* @return the service active count
|
|
||||||
*/
|
|
||||||
public int getServiceActiveCount()
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
|
|
||||||
result = 0;
|
|
||||||
for (Organization organization : this)
|
|
||||||
{
|
|
||||||
result += organization.getServiceCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the service count.
|
* Gets the service count.
|
||||||
*
|
*
|
||||||
|
|
|
@ -23,8 +23,6 @@ import java.util.Collections;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import fr.devinsy.statoolinfos.core.Service.Status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Services.
|
* The Class Services.
|
||||||
*/
|
*/
|
||||||
|
@ -92,31 +90,6 @@ public class Services extends ArrayList<Service>
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the by.
|
|
||||||
*
|
|
||||||
* @param status
|
|
||||||
* the category
|
|
||||||
* @return the by
|
|
||||||
*/
|
|
||||||
public Services getBy(final Status status)
|
|
||||||
{
|
|
||||||
Services result;
|
|
||||||
|
|
||||||
result = new Services();
|
|
||||||
|
|
||||||
for (Service service : this)
|
|
||||||
{
|
|
||||||
if (service.getStatus() == status)
|
|
||||||
{
|
|
||||||
result.add(service);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse.
|
* Reverse.
|
||||||
*
|
*
|
||||||
|
|
|
@ -547,7 +547,7 @@ public class StatoolInfos
|
||||||
|
|
||||||
UptimeJournal journal = HtmlizerContext.instance().getUptimeJournal();
|
UptimeJournal journal = HtmlizerContext.instance().getUptimeJournal();
|
||||||
Federation federation = HtmlizerContext.instance().getFederation();
|
Federation federation = HtmlizerContext.instance().getFederation();
|
||||||
UptimeSurveyor.survey(journal, federation.getURLActiveAll());
|
UptimeSurveyor.survey(journal, federation.getURLAll());
|
||||||
HtmlizerContext.instance().getCache().storeUptimeJournal(journal);
|
HtmlizerContext.instance().getCache().storeUptimeJournal(journal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class ExportsPage
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
logger.error("Error during ODS export: " + exception.getMessage(), exception);
|
logger.error("Error during JSON export: " + exception.getMessage(), exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -104,7 +104,7 @@ public class ExportsPage
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
logger.error("Error during Uptime export: " + exception.getMessage(), exception);
|
logger.error("Error during JSON export: " + exception.getMessage(), exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class OrganizationListView
|
||||||
data.setEscapedContent("organizationListLine", index, "organizationListLineUrlLink", organization.getWebsiteURL().toString());
|
data.setEscapedContent("organizationListLine", index, "organizationListLineUrlLink", organization.getWebsiteURL().toString());
|
||||||
data.setEscapedAttribute("organizationListLine", index, "organizationListLineUrlLink", "href", organization.getWebsiteURL().toString());
|
data.setEscapedAttribute("organizationListLine", index, "organizationListLineUrlLink", "href", organization.getWebsiteURL().toString());
|
||||||
}
|
}
|
||||||
data.setContent("organizationListLine", index, "organizationListLineServiceCount", organization.getServiceActiveCount());
|
data.setContent("organizationListLine", index, "organizationListLineServiceCount", organization.getServiceCount());
|
||||||
data.setContent("organizationListLine", index, "organizationListLineUserCount", organization.getPreviousMonthUserCount());
|
data.setContent("organizationListLine", index, "organizationListLineUserCount", organization.getPreviousMonthUserCount());
|
||||||
data.setContent("organizationListLine", index, "organizationListLineVisitCount", organization.getPreviousMonthVisitCount());
|
data.setContent("organizationListLine", index, "organizationListLineVisitCount", organization.getPreviousMonthVisitCount());
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class UptimeView
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (Service service : services.getBy(Service.Status.OK).sortByName())
|
for (Service service : services.sortByName())
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
data.setAttribute("line", index, "lineLogo", "src", service.getLogoFileName());
|
data.setAttribute("line", index, "lineLogo", "src", service.getLogoFileName());
|
||||||
|
|
|
@ -29,10 +29,8 @@
|
||||||
<li>Fabrice61</li>
|
<li>Fabrice61</li>
|
||||||
<li>Thomas @TConstans</li>
|
<li>Thomas @TConstans</li>
|
||||||
<li>@labecasse</li>
|
<li>@labecasse</li>
|
||||||
<li>Antoine Jaba</li>
|
|
||||||
<li>@setop</li>
|
<li>@setop</li>
|
||||||
<li>Jérémy Collot</li>
|
<li>Jérémy Collot</li>
|
||||||
<li>Pilou</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
<div class="uptimeCounts">
|
<div class="uptimeCounts">
|
||||||
<ul>
|
<ul>
|
||||||
<li>Actuellement : </li>
|
|
||||||
<li><img src="status-ok.png" title="" /><span id="okCount">n/a</span></li>
|
<li><img src="status-ok.png" title="" /><span id="okCount">n/a</span></li>
|
||||||
<li><img src="status-warning.png" title="" /><span id="warningCount">n/a</span></li>
|
<li><img src="status-warning.png" title="" /><span id="warningCount">n/a</span></li>
|
||||||
<li><img src="status-alert.png" title="" /><span id="alertCount">n/a</span></li>
|
<li><img src="status-alert.png" title="" /><span id="alertCount">n/a</span></li>
|
||||||
|
|
|
@ -59,13 +59,10 @@ public class ODSFile
|
||||||
CSVFile.write(out, source);
|
CSVFile.write(out, source);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
|
||||||
if (out != null)
|
|
||||||
{
|
{
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save.
|
* Save.
|
||||||
|
@ -84,11 +81,8 @@ public class ODSFile
|
||||||
CSVFile.write(out, source);
|
CSVFile.write(out, source);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
|
||||||
if (out != null)
|
|
||||||
{
|
{
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -206,15 +206,11 @@ public class UptimeJournal
|
||||||
|
|
||||||
if (url == null)
|
if (url == null)
|
||||||
{
|
{
|
||||||
result = new Uptimes();
|
result = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = this.map.get(url.toString());
|
result = this.map.get(url.toString());
|
||||||
if (result == null)
|
|
||||||
{
|
|
||||||
result = new Uptimes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue