diff --git a/src/main/java/org/ecocean/Util.java b/src/main/java/org/ecocean/Util.java index ebb28488df..96dfd07334 100755 --- a/src/main/java/org/ecocean/Util.java +++ b/src/main/java/org/ecocean/Util.java @@ -1152,4 +1152,56 @@ public static String getISO8601Date(final String date) { if (iso8601.length() == 16) iso8601 += 'Z'; return iso8601; } + + //IOT Customizations + public static List findMeasurementEventDescs(String langCode,String context) { + List list = new ArrayList(); + List types = CommonConfiguration.getIndexedPropertyValues(MEASUREMENT,context); + if (types.size() > 0) { + List units = CommonConfiguration.getIndexedPropertyValues(UNITS,context); + for (int i = 0; i < types.size() && i < units.size(); i++) { + String type = types.get(i); + String unit = units.get(i); + String typeLabel = findLabel(type, langCode,context); + String unitsLabel = findLabel(unit, langCode,context); + list.add(new MeasurementEventDesc(type, typeLabel, unit, unitsLabel)); + } + } + return list; + } + + public static class MeasurementEventDesc { + private String type; + private String label; + private String units; + private String unitsLabel; + + private MeasurementEventDesc(String type, String label, String units, String unitsLabel) { + this.type = type; + this.label = label; + this.units = units; + this.unitsLabel = unitsLabel; + } + + public String getType() { + return type; + } + public String getLabel() { + return label; + } + public String getUnits() { + return units; + } + public String getUnitsLabel() { + return unitsLabel; + } + } + + + + + + //END IOT customizations + + }