From 53d4239b857678501850e93589ee04881d9f6849 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Tue, 9 Apr 2019 16:20:57 +0530 Subject: [PATCH 01/12] update #500, support one time reset on startup --- dist/pom.xml | 2 +- .../www/languages/mc_locale_gui-nl_nl.json | 14 +- .../www/languages/mc_locale_gui-pl_pl.json | 48 +++---- modules/core/pom.xml | 2 +- .../org/mycontroller/standalone/StartApp.java | 5 +- .../db/dao/MetricsBatteryUsageDao.java | 4 +- .../db/dao/MetricsBatteryUsageDaoImpl.java | 13 +- .../db/dao/MetricsBinaryTypeDeviceDao.java | 4 +- .../dao/MetricsBinaryTypeDeviceDaoImpl.java | 12 +- .../db/dao/MetricsCounterTypeDeviceDao.java | 4 +- .../dao/MetricsCounterTypeDeviceDaoImpl.java | 12 +- .../db/dao/MetricsDoubleTypeDeviceDao.java | 4 +- .../dao/MetricsDoubleTypeDeviceDaoImpl.java | 12 +- .../db/dao/MetricsGPSTypeDeviceDao.java | 4 +- .../db/dao/MetricsGPSTypeDeviceDaoImpl.java | 12 +- .../standalone/onetime/ExecuteOneTime.java | 133 ++++++++++++++++++ .../onetime/OnetimeResetCommand.java | 49 +++++++ .../{ => onetime}/ResetPassword.java | 7 +- pom.xml | 2 +- 19 files changed, 295 insertions(+), 48 deletions(-) create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/onetime/ExecuteOneTime.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java rename modules/core/src/main/java/org/mycontroller/standalone/{ => onetime}/ResetPassword.java (94%) diff --git a/dist/pom.xml b/dist/pom.xml index 5da9a2fe..da10bf27 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -21,7 +21,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.4.0.Final + 1.5.0-SNAPSHOT mycontroller-dist diff --git a/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json b/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json index 778f2f52..5401ac4b 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json @@ -96,7 +96,7 @@ "COLLECTION_COUNT": "Aantal collecties", "COLLECTION_TIME": "Collectie tijd", "COLOR": "Kleur", - "COMMAND": "Command", + "COMMAND": "Commando", "COMMITTED": "Toegewezen", "COMMITTED_VIRTUAL_MEMORY_SIZE": "Hoeveelheid Toegewezen Virtueel Geheugen", "CONDITION": "Conditie", @@ -113,7 +113,7 @@ "CURRENT_PASSWORD": "Huidig wachtwoord", "CUSTOM_MESSAGE": "Aangepast bericht", "DAEMON": "Daemon", - "DAILY_ONCE_JOB": "Daily once", + "DAILY_ONCE_JOB": "Een keer per dag", "DAMPENING": "Dempend", "DAMPENING_TYPE": "Type demping", "DASHBOARDS": "Dashboards", @@ -163,7 +163,7 @@ "EMAIL_ADDRESSES_COMMA_SEPARATED": "E-mail adressen door komma's gescheiden", "ENABLE": "Aanzetten", "ENABLED": "Aangezet", - "ENABLE_CONFIRMATION": "Enable confirmation", + "ENABLE_CONFIRMATION": "Bevestigen aanzetten", "ENABLE_DEFAULT_ON_NO_FIRMWARE": "Gebruik de standaard firmware als er geen firmware beschikbaar is", "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "Als deze optie aanstaat, zal de standaard firmware gebruikt worden wanneer de gevraagde firmware niet beschikbaar is op het systeem", "ENABLE_EDIT_MODE": "Edit mode aanzetten", @@ -362,7 +362,7 @@ "MESSAGE_TYPE": "Bericht type", "METRIC": "Metriek", "METRICS": "Metriek", - "METRICS_AGGREGATION_JOB": "Metrics aggregation", + "METRICS_AGGREGATION_JOB": "Metrics aggregatie", "METRIC_ENGINE": "Metric engine", "METRIC_ENGINE_DIALOG_CONFIRMATION_MSG": "U staat op het punt om de metrics database backend engine instellingen aan te passen.
Deze actie resulteerd in dataverlies. Raadpleeg de gebuikershandleiding voor verdere details.
MyController zal geen data importeren/exporteren bij het veranderen van de metric engine!", "METRIC_TYPE": "Metric type", @@ -485,7 +485,7 @@ "PURGE_EXISTING_DATA": "Bestaande data opschonen", "PURGE_RESOURCES_LOGS": "Bron logboek opschonen", "PURGE_SENSOR_VARIABLE": "Sensor variable opschonen", - "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", + "PURGE_VALUE_RANGE_EXAMPLE": "Voorbeeld: min>=45.6,max>=78.2,avg>=56.3 of min>=45.6 of >=56.3(gemiddelde weglaten)", "PURGE_WARNING": "LET OP: Als u geen parameter selecteerd, zal alles verwijderd worden", "PURGING": "Bezig met opschonen", "PUSHBULLET": "Pushbullet", @@ -517,7 +517,7 @@ "RESOURCES_DATA_DETAIL": "Bronnen data detail", "RESOURCES_GROUPS": "Bron groepen", "RESOURCES_LOGS": "Bron logboek", - "RESOURCES_LOGS_AGGREGATION_JOB": "ResourcesLogs Aggregation", + "RESOURCES_LOGS_AGGREGATION_JOB": "ResourcesLogs Aggregatie", "RESOURCES_LOGS_DETAIL": "Bron logboek detail", "RESOURCES_LOG_LEVEL": "Bron logboek niveau", "RESOURCES_LOG_RETENTION_DURATION": "Bronnen logboek bewaar tijd", @@ -622,7 +622,7 @@ "SYNTAX_ERROR": "Syntax error", "SYSTEM": "Systeem", "SYSTEM_CPU_LOAD": "Systeem processor load", - "SYSTEM_JOBS": "System jobs", + "SYSTEM_JOBS": "Systeem taken", "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "You are about to change system internal jobs. This cron expression is a bit different than Linux cron expression.
This action may lead to incorrect schedule, poor performance, etc., Read user manual for further details.
It is highly recommend a system backup before moving forward!
Cron expression documentation", "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "Read carefully before moving forward", "SYSTEM_LOAD_AVERAGE": "Systeem Gemiddelde Load", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json b/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json index 14b63bf3..0baaa9a5 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json @@ -96,7 +96,7 @@ "COLLECTION_COUNT": "Liczba kolekcji", "COLLECTION_TIME": "Czas kolekcji", "COLOR": "Kolor", - "COMMAND": "Command", + "COMMAND": "Komenda", "COMMITTED": "Przesłany", "COMMITTED_VIRTUAL_MEMORY_SIZE": "Przesłany rozmiar pamięci wirtualnej", "CONDITION": "Warunek", @@ -163,9 +163,9 @@ "EMAIL_ADDRESSES_COMMA_SEPARATED": "Adresy Email oddzielone przecinkami", "ENABLE": "Włącz", "ENABLED": "Włączony", - "ENABLE_CONFIRMATION": "Enable confirmation", + "ENABLE_CONFIRMATION": "Włącz potwierdzenie", "ENABLE_DEFAULT_ON_NO_FIRMWARE": "Włącz domyślne bez firmware", - "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "Po włączeniu tej opcji użyj domyślnego firmware, jeśli wymagane firmware jest niedostępny w systemie", + "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "Po włączeniu tej opcji, użyj domyślnego firmware jeśli wymagany firmware jest niedostępny w systemie", "ENABLE_EDIT_MODE": "Włącz tryb edycji", "ENABLE_MIN_MAX": "Włącz Min/Max", "ENABLE_SSL": "Włącz SSL", @@ -173,7 +173,7 @@ "ERASE_CONFIGURATION": "Wyczyść konfigurację", "ERASE_CONFIGURATION_CONFIRMATION_MESSAGE": "Za chwilę usuniesz całą konfigurację wybranych elementów.
 Kliknij \"Usuń konfigurację\", aby kontynuować.", "ERASE_CONFIGURATION_CONFIRMATION_TITLE": "Wyczyść konfigurację", - "ERASE_CONFIGURATION_INITIATED": "Usuń konfigurację uruchamiania wybranego elementu", + "ERASE_CONFIGURATION_INITIATED": "Zainicjowano usuwanie konfiguracji dla wybranych elementów", "ERROR_ITEMS_NOT_AVAILABLE": "Wybrany element(y) jest niedostępny!", "ETHERNET_ALIVE_TEST_FREQUENCY_EXAMPLE": "Przykład: 120", "ETHERNET_HOST_NAME_EXAMPLE": "Przykład: 192.168.1.69", @@ -343,7 +343,7 @@ "LOCATION_NAME": "Nazwa lokalizacji", "LOGIN_MESSAGE": "Wiadomość logowania", "LOGS": "Logi", - "LOG_DIRECTION": "Kierunek logu", + "LOG_DIRECTION": "Kierunek zapisu", "LOG_IN": "Zaloguj", "LOG_LEVEL": "Poziom dziennika", "LOG_OUT": "Wyloguj", @@ -357,7 +357,7 @@ "MEASUREMENT": "Pomiary", "MERGE_STATIONS": "Połącz stacje", "MESSAGE": "Wiadomość", - "MESSAGES_IN_QUEUE": "Wiadomość w kolejce", + "MESSAGES_IN_QUEUE": "Wiadomości w kolejce", "MESSAGE_CONTAINS": "Wiadomość zawiera", "MESSAGE_TYPE": "Typ wiadomości", "METRIC": "Metryczny", @@ -414,7 +414,7 @@ "NO_DATA_AVAILABLE": "Brak danych", "NO_EXTERNAL_SERVERS_SETUP": "Brak konfiguracji zewnętrznych serwerów.", "NO_FIRMWARES_SETUP": "Nie skonfigurowano firmware.", - "NO_FIRMWARE_TYPES_SETUP": "Brak konfiguracji firmware", + "NO_FIRMWARE_TYPES_SETUP": "Brak konfiguracji typów firmware", "NO_FIRMWARE_VERSIONS_SETUP": "Brak konfiguracji wersji firmware", "NO_FORWARD_PAYLOADS_SETUP": "Nie ustawiono danych przekazywania.", "NO_GATEWAYS_SETUP": "Nie skonfigurowano bram.", @@ -431,7 +431,7 @@ "NO_SCRIPTS_SETUP": "Nie skonfigurowano skryptów.", "NO_SENSORS_SETUP": "Nie skonfigurowano czujników.", "NO_TEMPLATES_SETUP": "Nie skonfigurowano szablonów.", - "NO_TIMERS_SETUP": "Nie ustawiono czasomierzy.", + "NO_TIMERS_SETUP": "Nie skonfigurowano czasomierzy.", "NO_UID_TAGS_SETUP": "Brak ustawień tagów UID.", "NO_VARIABLES_SETUP": "Nie skonfigurowano zmiennych.", "OCCURRENCES": "Zdarzenia", @@ -477,27 +477,27 @@ "PROFILE_UPDATED_SUCCESSFULLY": "Profil zaktualizowano pomyślnie", "PROPERTIES": "Właściwości", "PUBLIC": "Publiczny", - "PUBLIC_ACCESS": "Adres publiczny", + "PUBLIC_ACCESS": "Dostęp publiczny", "PUBLIC_KEY": "Klucz publiczny", - "PURGE": "Kasuj", - "PURGE_BEFORE": "Kasuj przed", - "PURGE_DONE_SUCCESSFULLY": "Kasowanie ukończone pomyślnie.", - "PURGE_EXISTING_DATA": "Kasuj istniejące dane", + "PURGE": "Wyczyść", + "PURGE_BEFORE": "Wyczyść przed", + "PURGE_DONE_SUCCESSFULLY": "Czyszczenie ukończone pomyślnie.", + "PURGE_EXISTING_DATA": "Wyczyść istniejące dane", "PURGE_RESOURCES_LOGS": "Wyczyść dziennik zasobów", - "PURGE_SENSOR_VARIABLE": "Kasuj zmienną czujnika", - "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", + "PURGE_SENSOR_VARIABLE": "Wyczyść zmienną czujnika", + "PURGE_VALUE_RANGE_EXAMPLE": "Przykład: min>= 45,6, maks.>= 78,2, średnio>= 56,3 lub min>= 45,6 lub>= 56,3 (wyczyść tylko średnią)", "PURGE_WARNING": "OSTRZEŻENIE: Jeśli nie wybierzesz żadnego parametru, ten proces usunie wszystko!", "PURGING": "Usuwanie", "PUSHBULLET": "Pushbullet", "QOS": "QoS", "QOS_0": "Co najwyżej raz (0)", - "QOS_1": "Co najwyżej raz (1)", - "QOS_2": "Co najwyżej raz (2)", + "QOS_1": "Przynajmniej raz (1)", + "QOS_2": "Dokładnie raz (2)", "RAW_DATA": "Surowe dane", "READ_ONLY": "Tylko do odczytu", "REALTIME": "Czas rzeczywisty", "REBOOT": "Uruchom ponownie", - "REBOOT_CONFIRMATION_MESSAGE": "Za chwilę ponownie uruchomisz wybraną pozycję
Kliknij \"Uruchom ponownie\", aby kontynuować.", + "REBOOT_CONFIRMATION_MESSAGE": "Za chwilę ponownie uruchomisz wybrane elementy
Kliknij \"Uruchom ponownie\", aby kontynuować.", "REBOOT_CONFIRMATION_TITLE": "Uruchom ponownie", "REBOOT_INITIATED": "Zainicjowano ponowne uruchomienie dla wybranych elementów.", "RECONNECT_DELAY": "Opóźnienie ponownego łączenia", @@ -510,7 +510,7 @@ "REGISTRATION_STATUS": "Status rejestracji", "RELEASES": "Wydania", "RELOAD": "Przeładuj", - "RELOAD_INITIATED_SUCCESSFULLY": "Ponownie uruchomiono przeładowanie", + "RELOAD_INITIATED_SUCCESSFULLY": "Przeładowanie zainicjowano pomyślnie", "RESOURCE": "Zasób", "RESOURCES": "Zasoby", "RESOURCES_DATA": "Dane o zasobach", @@ -530,7 +530,7 @@ "RESOURCE_TYPE": "Typ zasobów", "RESTORE": "Przywróć", "RESTORE_CONFIRMATION_MESSAGE": "Za chwilę przywrócisz system do \"{{name}}\".
 Przywracanie całkowicie usunie bieżące dane i konfigurację, system przejdzie w stan \"{{name}}\"!
Kliknij Przywróć, aby kontynuować.
Uwaga: Po pomyślnym przywróceniu musisz ręcznie uruchomić serwer z wiersza poleceń.", - "RESTORE_CONFIRMATION_TITLE": "Przywróć system do '{{nazwa}}'", + "RESTORE_CONFIRMATION_TITLE": "Przywróć system do '{{name}}'", "RESTORE_INITIATED_SUCCESSFULLY": "Przywracanie zainicjowane pomyślnie.", "RESULT": "Wynik", "RETAIN_MAX": "Zachowaj maksimum #", @@ -580,8 +580,8 @@ "SENSOR_TYPE": "Typ czujnika", "SENSOR_VARIABLE": "Zmienna czujnika", "SENSOR_VARIABLES": "Zmienne czujników", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Would you like to send the following payload to the selected resource?", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Send payload confirmation", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Czy chcesz wysłać następujące dane do wybranego zasobu?", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Wyślij potwierdzenie danych", "SENSOR_VARIABLE_TYPE": "Typ zmiennej czujnika", "SERIAL_BAUD_RATE_EXAMPLE": "Przykład: 115200", "SERIAL_PORT_NAME_EXAMPLE": "Przykład: /dev/ttyUSB0", @@ -675,7 +675,7 @@ "TWILIO": "Twilio", "TYPE": "Typ", "TYPES": "Typy", - "TYPE_ID": "Wpisz Id", + "TYPE_ID": "Typ Id", "UID": "UID", "UID_TAGS": "Etykiety UID", "UID_TAGS_DETAIL": "Szczegóły etykiet UID", @@ -688,7 +688,7 @@ "UNLOADED": "Rozładowany", "UP": "Aktywny", "UPDATE": "Uaktualnij", - "UPDATED_SUCCESSFULLY": "Aktualizacja zakończona sukcesem.", + "UPDATED_SUCCESSFULLY": "Zaktualizowano pomyślnie.", "UPDATE_AN_ENTRY": "Zaktualizuj wpis", "UPDATE_EXTERNAL_SERVER": "Zaktualizuj serwer zewnętrzny", "UPDATE_FIRMWARE": "Zaktualizuj firmware", diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 78a1c0d4..de158639 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -24,7 +24,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.4.0.Final + 1.5.0-SNAPSHOT ../../pom.xml diff --git a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java index 17dc957a..0301c9a4 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,6 +75,8 @@ import org.mycontroller.standalone.metrics.MetricsUtils; import org.mycontroller.standalone.mqttbroker.MoquetteMqttBroker; import org.mycontroller.standalone.offheap.OffHeapFactory; +import org.mycontroller.standalone.onetime.ExecuteOneTime; +import org.mycontroller.standalone.onetime.ResetPassword; import org.mycontroller.standalone.scheduler.SchedulerUtils; import org.mycontroller.standalone.scripts.McScriptEngineUtils; import org.mycontroller.standalone.settings.SettingsUtils; @@ -299,6 +301,7 @@ private static boolean startServices() throws ClassNotFoundException, SQLExcepti McScriptEngineUtils.listAvailableEngines(); //Check password reset file + new ExecuteOneTime().executeOnetimeReset(); ResetPassword.executeResetPassword(); //Start message Monitor Thread diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDao.java index c97a8f31..fa7812cf 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,4 +40,6 @@ List getAggregationRequiredNodeIds(AGGREGATION_TYPE aggrega boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end); + int purgeAll(); + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDaoImpl.java index 1b1e764a..5e2d0519 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBatteryUsageDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -170,4 +170,15 @@ public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long throw new McDatabaseException(ex); } } + + @Override + public int purgeAll() { + try { + return getDao().deleteBuilder().delete(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return -1; + } + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDao.java index 49cc4b0c..8ac7756f 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,4 +36,6 @@ public interface MetricsBinaryTypeDeviceDao extends BaseDao getAllLastN(SensorVariable sensorVariable, long lastN); void updateTimestamp(int sensorVariableId, long timestampOld, long timestanpNew); + + int purgeAll(); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDaoImpl.java index 198d692b..a120cac7 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsBinaryTypeDeviceDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -169,4 +169,14 @@ public void updateTimestamp(int sensorVariableId, long timestampOld, long timest throw new McDatabaseException(ex); } } + + @Override + public int purgeAll() { + try { + return getDao().deleteBuilder().delete(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return -1; + } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDao.java index a0504470..2d4b4a45 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,4 +43,6 @@ List getAggregationRequiredVariableIds(AGGREGATION_TYP boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end); + int purgeAll(); + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java index 341ed1cf..d91c6e0e 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -200,4 +200,14 @@ public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long throw new McDatabaseException(ex); } } + + @Override + public int purgeAll() { + try { + return getDao().deleteBuilder().delete(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return -1; + } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDao.java index 48e98153..935df0de 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -46,4 +46,6 @@ List getAggregationRequiredVariableIds(AGGREGATION_TYPE Long fromTimestamp, Long toTimestamp); + int purgeAll(); + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java index 077e6982..3ccdb34d 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -344,4 +344,14 @@ public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long throw new McDatabaseException(ex); } } + + @Override + public int purgeAll() { + try { + return getDao().deleteBuilder().delete(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return -1; + } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDao.java index 393104a5..99ae78d8 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,4 +37,6 @@ List getAggregationRequiredVariableIds(AGGREGATION_TYPE ag Long fromTimestamp, Long toTimestamp); + int purgeAll(); + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java index 5f0a123f..9c67aae8 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -162,4 +162,14 @@ public List getAggregationRequiredVariableIds(AGGREGATION_ throw new McDatabaseException(ex); } } + + @Override + public int purgeAll() { + try { + return getDao().deleteBuilder().delete(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return -1; + } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/onetime/ExecuteOneTime.java b/modules/core/src/main/java/org/mycontroller/standalone/onetime/ExecuteOneTime.java new file mode 100644 index 00000000..28aceaa7 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/onetime/ExecuteOneTime.java @@ -0,0 +1,133 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.onetime; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.db.DaoUtils; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ +@Slf4j +public class ExecuteOneTime { + public static final String[] ONE_TIME_FILES = { "conf/onetime_reset", "conf/onetime_reset.txt" }; + + public void executeOnetimeReset() { + File onetimeFile = null; + for (String _file : ONE_TIME_FILES) { + onetimeFile = FileUtils.getFile(AppProperties.getInstance().getAppDirectory() + _file); + try { + _logger.debug("Onetime file check on {}", onetimeFile.getCanonicalPath()); + } catch (Exception ex) { + _logger.error("Exception, ", ex); + } + if (onetimeFile.exists()) { + break; + } + } + if (onetimeFile != null && onetimeFile.exists()) { + try { + List dataArray = FileUtils.readLines(onetimeFile); + // execute one time reset commands + for (String rawData : dataArray) { + OnetimeResetCommand cmd = new OnetimeResetCommand(rawData); + if (cmd.isValid()) { + switch (cmd.getCommand()) { + case "reset_password": + resetPassword(cmd); + break; + case "purge_sensor_data": + purgeSensorData(cmd); + break; + case "purge_battery_data": + purgeBatteryData(cmd); + break; + default: + _logger.warn("Unknown command, raw:{}, {}", rawData, cmd); + break; + } + } + } + //Delete onetime reset file + if (onetimeFile.delete()) { + _logger.debug("onetime reset file deleted successfully. [{}]", onetimeFile.getCanonicalPath()); + } else { + _logger.warn("Failed to delete onetime reset file[{}]", onetimeFile.getCanonicalPath()); + } + } catch (IOException ex) { + _logger.error("Exception, ", ex); + } + } else { + _logger.debug("There was no password reset file!"); + } + } + + private void resetPassword(OnetimeResetCommand cmd) { + try { + String[] userData = cmd.getData().split(",", 2); + if (userData.length > 1) { + ResetPassword.resetPassword(userData[0], userData[1]); + } else { + _logger.warn("Invalid password reset data"); + } + } catch (Exception ex) { + _logger.error("Exception,", ex); + } + } + + private void purgeSensorData(OnetimeResetCommand cmd) { + try { + // all [or] node=[name_or_eui],sensor=[name] + // TODO: implement other options + if (cmd.getData().toLowerCase().startsWith("all")) { + _logger.info("Purged binary data, count:{}", DaoUtils.getMetricsBinaryTypeDeviceDao().purgeAll()); + _logger.info("Purged double data, count:{}", DaoUtils.getMetricsDoubleTypeDeviceDao().purgeAll()); + _logger.info("Purged counter data, count:{}", DaoUtils.getMetricsCounterTypeDeviceDao().purgeAll()); + _logger.info("Purged gps data, count:{}", DaoUtils.getMetricsGPSTypeDeviceDao().purgeAll()); + + } else if (cmd.getData().toLowerCase().startsWith("node")) { + + } else if (cmd.getData().toLowerCase().startsWith("sensor")) { + + } + } catch (Exception ex) { + _logger.error("Exception,", ex); + } + } + + private void purgeBatteryData(OnetimeResetCommand cmd) { + try { + // all [or] node=[name_or_eui] + // TODO: implement other options + if (cmd.getData().toLowerCase().startsWith("all")) { + _logger.info("Purged battery data, count:{}", DaoUtils.getMetricsBatteryUsageDao().purgeAll()); + } else if (cmd.getData().toLowerCase().startsWith("node")) { + + } + } catch (Exception ex) { + _logger.error("Exception,", ex); + } + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java b/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java new file mode 100644 index 00000000..050eda94 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.onetime; + +import lombok.ToString; + +import lombok.Getter; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Getter +@ToString +public class OnetimeResetCommand { + private String command; + private String data; + + public OnetimeResetCommand(String rawData) { + String[] raw = rawData.split(":", 2); + command = raw[0].trim().toLowerCase(); + if (raw.length > 1) { + data = raw[1].trim(); + } + } + + public boolean isValid() { + if (data != null && data.length() > 0) { + return true; + } + return false; + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/ResetPassword.java b/modules/core/src/main/java/org/mycontroller/standalone/onetime/ResetPassword.java similarity index 94% rename from modules/core/src/main/java/org/mycontroller/standalone/ResetPassword.java rename to modules/core/src/main/java/org/mycontroller/standalone/onetime/ResetPassword.java index 587c7907..7f90e8ea 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/ResetPassword.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/onetime/ResetPassword.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.mycontroller.standalone; +package org.mycontroller.standalone.onetime; import java.io.File; import java.io.IOException; import java.util.List; import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.AppProperties; import org.mycontroller.standalone.auth.McCrypt; import org.mycontroller.standalone.db.DaoUtils; import org.mycontroller.standalone.db.tables.User; @@ -33,7 +34,7 @@ */ @Slf4j public class ResetPassword { - public static final String[] PASSWORD_FILES = { "conf/password", "conf/password.txt" }; + public static final String[] PASSWORD_FILES = { "conf/password", "conf/password.txt", "conf/password" }; public static final String SPLITTER = ","; public static void executeResetPassword() { diff --git a/pom.xml b/pom.xml index 66c65416..8209f5d1 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.4.0.Final + 1.5.0-SNAPSHOT https://github.com/mycontroller-org 2015 pom From 222b1651fdf59521d16f37c092545c0ee49367dc Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Tue, 9 Apr 2019 16:39:23 +0530 Subject: [PATCH 02/12] fix checkstyle issues --- .../standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java | 2 +- .../standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java | 2 +- .../standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java | 2 +- .../mycontroller/standalone/onetime/OnetimeResetCommand.java | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java index d91c6e0e..32e37904 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsCounterTypeDeviceDaoImpl.java @@ -200,7 +200,7 @@ public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long throw new McDatabaseException(ex); } } - + @Override public int purgeAll() { try { diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java index 3ccdb34d..508747d2 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java @@ -344,7 +344,7 @@ public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long throw new McDatabaseException(ex); } } - + @Override public int purgeAll() { try { diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java index 9c67aae8..89e58943 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsGPSTypeDeviceDaoImpl.java @@ -162,7 +162,7 @@ public List getAggregationRequiredVariableIds(AGGREGATION_ throw new McDatabaseException(ex); } } - + @Override public int purgeAll() { try { diff --git a/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java b/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java index 050eda94..5646f5b3 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/onetime/OnetimeResetCommand.java @@ -16,9 +16,8 @@ */ package org.mycontroller.standalone.onetime; -import lombok.ToString; - import lombok.Getter; +import lombok.ToString; /** * @author Jeeva Kandasamy (jkandasa) From b29ec39c869b195933e653c9bc9fbe8278e224b4 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 24 Apr 2019 09:59:05 +0530 Subject: [PATCH 03/12] update #501, added support sleeping node for raw message --- .../org/mycontroller/standalone/api/SensorApi.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/SensorApi.java b/modules/core/src/main/java/org/mycontroller/standalone/api/SensorApi.java index bf855880..4ef24583 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/SensorApi.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/SensorApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -250,7 +250,13 @@ public SensorVariable getSensorVariable(String sensorName, String variableType, public void sendRawMessage(IMessage message) throws McBadRequestException { message.setTxMessage(true); if (message.isValid()) { - McObjectManager.getEngine(message.getGatewayId()).send(message); + // check does it a sleeping node or normal node + Node node = DaoUtils.getNodeDao().get(message.getGatewayId(), message.getNodeEui()); + if (node != null && node.getSmartSleepEnabled()) { + McObjectManager.getEngine(message.getGatewayId()).sendSleepNode(message); + } else { + McObjectManager.getEngine(message.getGatewayId()).send(message); + } } else { throw new McBadRequestException("Required field is missing! " + message); } From 9b49f979629a827865f4f209f298458023c0e9c1 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Fri, 12 Jul 2019 17:33:06 +0530 Subject: [PATCH 04/12] update locale --- .../www/languages/mc_locale_gui-el_gr.json | 262 +++++++++--------- .../www/languages/mc_locale_gui-zh_tw.json | 28 +- .../mc_locale/mc_locale_java_el_GR.properties | 102 +++---- .../standalone/AppProperties.java | 3 +- 4 files changed, 198 insertions(+), 197 deletions(-) diff --git a/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json b/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json index 202c8a4d..1de76e7a 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json @@ -1,44 +1,44 @@ { - "12_HOURS": "12 hours", - "24_HOURS": "24 hours", - "ABOUT": "About", - "ACCESS": "Access", - "ACCESS_TOKEN": "Access token", + "12_HOURS": "12 ώρες", + "24_HOURS": "24 ώρες", + "ABOUT": "Σχετικά με", + "ACCESS": "Πρόσβαση", + "ACCESS_TOKEN": "Διακριτικό πρόσβασης", "ACK": "Ack", "ACKNOWLEDGE": "Acknowledge", "ACK_ENABLED": "Ack enabled", "ACK_REQUEST": "Ack request", "ACK_RESPONSE": "Ack response", "ACK_WAIT_TIME": "Ack wait time", - "ACTIONS": "Actions", + "ACTIONS": "Ενέργειες", "ACTION_BOARD": "Action board", - "ACTIVE": "Active", - "ADD": "Add", + "ACTIVE": "Ενεργό", + "ADD": "Προσθήκη", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", "ADD_FIRMWARE_TYPE": "Add firmware type", "ADD_FIRMWARE_VERSION": "Add firmware version", "ADD_FORWARD_PAYLOAD_ENTRY": "Add forward payload entry", - "ADD_GATEWAY": "Add gateway", - "ADD_GROUP": "Add group", + "ADD_GATEWAY": "Πρόσθεσε πύλη", + "ADD_GROUP": "Πρόσθεσε ομάδα", "ADD_NEW_WIDGET": "Add new widget", - "ADD_NODE": "Add node", - "ADD_OPERATION": "Add operation", + "ADD_NODE": "Πρόσθεσε κόμβο", + "ADD_OPERATION": "Πρόσθεσε διεργασία", "ADD_RESOURCE": "Add resource", "ADD_RESOURCES_GROUP": "Add resources group", - "ADD_ROLE": "Add role", - "ADD_ROOM": "Add room", - "ADD_RULE": "Add rule", + "ADD_ROLE": "Πρόσθεσε ρόλο", + "ADD_ROOM": "Πρόσθεσε δωμάτιο", + "ADD_RULE": "Πρόσθεσε κανόνα", "ADD_SCRIPT": "Add script", - "ADD_SENSOR": "Add sensor", + "ADD_SENSOR": "Πρόσθεσε αισθητήρα", "ADD_TEMPLATE": "Add template", "ADD_TIMER": "Add timer", "ADD_UID_TAG_ENTRY": "Add UID tag entry", - "ADD_USER": "Add user", - "ADD_VARIABLE": "Add variable", + "ADD_USER": "Πρόσθεσε χρήστη", + "ADD_VARIABLE": "Πρόσθεσε μεταβλητή", "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", - "AFTER": "After", + "AFTER": "Μέτα", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", "ALLOW_ANONYMOUS": "Allow anonymous", @@ -46,9 +46,9 @@ "ANGULARJS_CUSTOM_CONTROLLERS": "AngularJS custom controllers", "APP.DESCRIPTION": "The Open Source Controller", "APP.LOG_IN_TO_MESSAGE": "LOG IN TO MYCONTROLLER.ORG", - "APP.WELCOME_MESSAGE": "Welcome to MyController.org! The Open Source Controller.", + "APP.WELCOME_MESSAGE": "Καλώς ήρθες στο MyController.org! Ο Ελεγκτής Ανοιχτού Κώδικα.", "ARCHITECTURE": "Architecture", - "AREA": "Area", + "AREA": "Περιοχή", "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", @@ -56,9 +56,9 @@ "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", "AVERAGE_TIME": "Average time", - "BACKUP": "Backup", - "BACKUPS_DETAIL": "Backups detail", - "BACKUP_COMPLETED_SUCCESSFULLY": "Backup completed successfully.", + "BACKUP": "Αντίγραφο ασφαλείας", + "BACKUPS_DETAIL": "Λεπτομέρειες αντιγράφου ασφαλείας", + "BACKUP_COMPLETED_SUCCESSFULLY": "Επιτυχής δημιουργία αντιγράφου ασφαλείας.", "BACKUP_EVERY": "Backup every", "BACKUP_FILE_PREFIX": "Backup file prefix", "BACKUP_LOCATION": "Backup location", @@ -68,10 +68,10 @@ "BASIS": "Basis", "BASIS_CLOSED": "Basis closed", "BASIS_OPEN": "Basis open", - "BATTERY": "Battery", - "BATTERY_LEVEL": "Battery level", - "BATTERY_USAGE": "Battery usage", - "BAUD_RATE": "Baud rate", + "BATTERY": "Μπαταρία", + "BATTERY_LEVEL": "Στάθμη μπαταρίας", + "BATTERY_USAGE": "Χρήση μπαταρίας", + "BAUD_RATE": "Ρυθμός μετάδοσης", "BINARY_DATA": "Binary data", "BIND_ADDRESS": "Bind address", "BLOCKS": "Blocks", @@ -83,29 +83,29 @@ "BUILT_ON": "Built on", "BUNDLE": "Bundle", "BUTTON_SETTINGS": "Button settings:", - "CANCEL": "Cancel", + "CANCEL": "Ακύρωση", "CARDINAL": "Cardinal", "CARDINAL_CLOSED": "Cardinal closed", "CARDINAL_OPEN": "Cardinal open", - "CHANNEL_TAGS": "Channel tag(s)", + "CHANNEL_TAGS": "Ετικέτα(ες) καναλιού", "CHANNEL_TAGS_COMMA_SEPARATED": "Channel tags comma seperated", "CHANNEL_USERNAME": "Channel username", "CLASS_LOADING_DETAILS": "Class Loading Details", "CLIENT_ID": "Client id", - "CLONE": "Clone", + "CLONE": "Κλώνος", "COLLECTION_COUNT": "Collection count", - "COLLECTION_TIME": "Collection time", - "COLOR": "Color", - "COMMAND": "Command", + "COLLECTION_TIME": "Χρόνος συλλογής", + "COLOR": "Χρώμα", + "COMMAND": "Εντολή", "COMMITTED": "Committed", "COMMITTED_VIRTUAL_MEMORY_SIZE": "Committed Virtual Memory Size", - "CONDITION": "Condition", + "CONDITION": "Κατάσταση", "CONDITION_TYPE": "Condition type", "CONNECTION_DETAILS": "Connection details", "CONTENT": "Content", - "CONTINUE": "Continue", + "CONTINUE": "Συνέχισε", "COUNT": "Count", - "COUNTER": "Counter", + "COUNTER": "Μετρητής", "CRC": "CRC", "CRON_EXPRESSION": "Cron expression", "CSS_FILES": "CSS files", @@ -128,41 +128,41 @@ "DATA_UNAVAILABLE": "Data unavailable!", "DATE_PATTERN": "Date pattern", "DATE_RANGE": "Date range", - "DAY": "Day", - "DAYS": "Days", - "DEFAULT": "Default", + "DAY": "Ημέρα", + "DAYS": "Ημέρες", + "DEFAULT": "Προεπιλογή", "DEFAULT_FIRMWARE": "Default firmware", "DEFAULT_TIME_RANGE": "Default time range", "DELAY_TIME_IN_SECONDS": "Delay time in seconds", - "DELETE": "Delete", + "DELETE": "Διαγραφή", "DELETE_DASHBOARD": "Delete dashboard", - "DELETE_ITEMS": "Delete item(s)", + "DELETE_ITEMS": "Διαγραφή αντικειμένου(ων)", "DELETE_MESSAGE": "You are about to delete selected item(s)
Deletion process will remove complete trace of this item(s)!
Click 'Delete' to proceed.", - "DESCRIPTION": "Description", + "DESCRIPTION": "Περιγραφή", "DESTINATION": "Destination", "DESTINATION_ID": "Destination id", - "DETAILS": "Details", - "DEVICES": "Devices", + "DETAILS": "Λεπτομέριες", + "DEVICES": "Συσκευές", "DEVICE_IDENS": "Device iden(s)", "DEVICE_IDENS_COMMA_SEPARATED": "Device idens comma seperated", "DIRECTION": "Direction", - "DISABLE": "Disable", - "DISABLED": "Disabled", + "DISABLE": "Απενεργοποίηση", + "DISABLED": "Απενεργοποιημένο", "DISABLE_WHEN_TRIGGER": "Disable when trigger", "DISCOVER": "Discover", "DISCOVER_INITIATED_SUCCESSFULLY": "Discover initiated successfully", "DISPLAY_NAMES": "Display names", "DOCUMENTS": "Documents", "DOUBLE": "Double", - "DOWN": "Down", + "DOWN": "Κάτω", "DRIVER": "Driver", - "EDIT": "Edit", + "EDIT": "Επεξεργασία", "EDIT_DASHBOARD": "Edit dashboard", "EMAIL": "Email", "EMAILS": "Email(s)", "EMAIL_ADDRESSES_COMMA_SEPARATED": "Email addresses comma seperated", - "ENABLE": "Enable", - "ENABLED": "Enabled", + "ENABLE": "Ενεργοποίηση", + "ENABLED": "Ενεργοποιημένο", "ENABLE_CONFIRMATION": "Enable confirmation", "ENABLE_DEFAULT_ON_NO_FIRMWARE": "Enable default on no firmware", "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "When enabled this option, use default firmware, where requested firmware is not available in system", @@ -175,9 +175,9 @@ "ERASE_CONFIGURATION_CONFIRMATION_TITLE": "Erase configuration", "ERASE_CONFIGURATION_INITIATED": "Erase configuration initiated for selected items", "ERROR_ITEMS_NOT_AVAILABLE": "Selected item(s) not available!", - "ETHERNET_ALIVE_TEST_FREQUENCY_EXAMPLE": "Example: 120", - "ETHERNET_HOST_NAME_EXAMPLE": "Example: 192.168.1.69", - "ETHERNET_PORT_EXAMPLE": "Example: 5003", + "ETHERNET_ALIVE_TEST_FREQUENCY_EXAMPLE": "Παράδειγμα: 120", + "ETHERNET_HOST_NAME_EXAMPLE": "Παράδειγμα: 192.168.1.69", + "ETHERNET_PORT_EXAMPLE": "Παράδειγμα: 5003", "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", @@ -187,9 +187,9 @@ "EXTERNAL_SERVERS_DETAIL": "External servers detail", "FAILED_RETRY_COUNT": "Failed retry count", "FAILURE_COUNT": "Failure count", - "FILE": "File", - "FILE_NAME": "File name", - "FILE_SIZE": "File size", + "FILE": "Αρχείο", + "FILE_NAME": "Όνομα αρχείου", + "FILE_SIZE": "Μέγεθος αρχείου", "FILTER_BY_BLOCKS": "Filter by Blocks", "FILTER_BY_CONDITION_TYPE": "Filter by Condition type", "FILTER_BY_DAMPENING_TYPE": "Filter by Dampening type", @@ -250,35 +250,35 @@ "FORUM": "Forum", "FORWARD_PAYLOAD": "Forward payload", "FORWARD_PAYLOADS_DETAIL": "Forward payloads detail", - "FREE": "Free", - "FREQUENCY": "Frequency", - "FROM": "From", - "FROM_ADDRESS": "From address", - "FROM_PHONE_NUMBER": "From phone number", - "FULL_NAME": "Full name", - "FULL_PATH": "Full path", + "FREE": "Ελεύθερο", + "FREQUENCY": "Συχνότητα", + "FROM": "Από", + "FROM_ADDRESS": "Από διεύθυνση", + "FROM_PHONE_NUMBER": "Από αριθμό τηλεφώνου", + "FULL_NAME": "Πλήρες όνομα", + "FULL_PATH": "Πλήρης διαδρομή", "GARBAGE_COLLECTOR": "Garbage Collector", - "GATEWAY": "Gateway", - "GATEWAYS": "Gateways", - "GATEWAYS_DETAIL": "Gateways detail", - "GATEWAY_DETAILS": "Gateway details", - "GATEWAY_NAME": "Gateway name", + "GATEWAY": "Πύλη", + "GATEWAYS": "Πύλες", + "GATEWAYS_DETAIL": "Λεπτομέρειες πύλης", + "GATEWAY_DETAILS": "Λεπτομέρειες πυλών", + "GATEWAY_NAME": "Όνομα πύλης", "GATEWAY_TYPE": "Gateway type", "GITTER_MESSAGING": "Gitter messaging", "GIT_COMMIT_BRANCH": "Git commit:branch", "GLOBAL_PAGE_REFRESH_TIME": "Global page refresh time", - "GPS_DATA": "GPS data", + "GPS_DATA": "Δεδομένα GPS", "GRANT_ACCESS_TO_CHILD_RESOURCES_IN_ROLES": "Grant access to child resources (in roles)", "GRAPHS_SETTINGS": "Graphs settings", "GRAPH_SETTINGS": "Graph settings", - "GROUPS": "Groups", - "GROUP_NAME": "Group name", + "GROUPS": "Ομάδες", + "GROUP_NAME": "Όνομα ομάδας", "HEAP_MEMORY": "Heap Memory", "HEIGHT": "Height", - "HIDE_MENU": "Hide menu", + "HIDE_MENU": "Απόκρυψη μενού", "HISTORICAL_BAR_CHART": "Historical Bar Chart", "HOST_NAME": "Host name", - "HOURS": "Hours", + "HOURS": "Ώρες", "HTML": "HTML", "HTML_ADDITIONAL_HEADERS": "HTML additional headers", "HTTP_PORT": "HTTP port", @@ -309,13 +309,13 @@ "JSON": "JSON", "KEY": "Key", "KEY_FORMAT": "Key format", - "LANGUAGE": "Language", - "LANGUAGE_VERSION": "Language version", - "LAST_5_MINUTES": "Last 5 minutes", - "LAST_6_HOURS": "Last 6 hours", - "LAST_12_HOURS": "Last 12 hours", - "LAST_DAY": "Last day", - "LAST_EXECUTION": "Last execution", + "LANGUAGE": "Γλώσσα", + "LANGUAGE_VERSION": "Έκδοση γλώσσας", + "LAST_5_MINUTES": "Τελευταία 5 λεπτά", + "LAST_6_HOURS": "Τελευταίες 6 ώρες", + "LAST_12_HOURS": "Τελευταίες 12 ώρες", + "LAST_DAY": "Προηγούμενη ήμερα", + "LAST_EXECUTION": "Τελευταία εκτέλεση", "LAST_FIRED": "Last fired", "LAST_GARBAGECOLLECTOR_DURATION": "Last GC duration", "LAST_HOUR": "Last hour", @@ -328,7 +328,7 @@ "LAST_TRIGGER": "Last trigger", "LAST_WEEK": "Last week", "LAST_YEAR": "Last year", - "LATITUDE": "Latitude", + "LATITUDE": "Γεωγραφικό Πλάτος", "LEFT": "Left", "LEVEL": "Level", "LIBRARY_VERSION": "Library version", @@ -346,13 +346,13 @@ "LOG_DIRECTION": "Log direction", "LOG_IN": "Log In", "LOG_LEVEL": "Log level", - "LOG_OUT": "Log Out", - "LONGITUDE": "Longitude", + "LOG_OUT": "Αποσύνδεση", + "LONGITUDE": "Γεωγραφικό μήκος", "LOWER": "Lower", "MANAGEMENT_SPECIFICATION_VERSION": "Management Specification Version", "MARGIN": "Margin", "MARKDOWN": "Markdown", - "MAX": "Max", + "MAX": "Μέγιστο", "MAXIMUM_BLOCK_SIZE": "Maximum block size", "MEASUREMENT": "Measurement", "MERGE_STATIONS": "Merge stations", @@ -378,31 +378,31 @@ "MQTT_BROKER_DISABLED_BACKEND": "MQTT broker has been disabled on the back-end. You shold enable it on the file: conf/mycontroller.properties and restart MyController server.", "MQTT_BROKER_EDIT_CONFIRMATION_MSG": "You are about to change MQTT broker settings.
This action leads, MQTT broker service restart with new settings.", "MQTT_BROKER_EDIT_DIALOG": "MQTT broker settings", - "MQTT_BROKER_HOST_EXAMPLE": "Example: tcp://localhost:1883", - "MQTT_CLIENT_ID_EXAMPLE": "Example: mycontroller-mqtt-client", + "MQTT_BROKER_HOST_EXAMPLE": "Παράδειγμα: tcp://localhost:1883", + "MQTT_CLIENT_ID_EXAMPLE": "Παράδειγμα: mycontroller-mqtt-client", "MQTT_PORT": "MQTT port", "MQTT_TOPIC_PUBLISH_EXAMPLE": "Example: mygateway-in", "MQTT_TOPIC_SUBSCRIBE_EXAMPLE": "Example: mygateway-out", "MYCONTROLLER_SERVER_LOG": "MyController server log", "MY_CONTROLLER": "MyController", "MY_SENSORS": "MySensors", - "NAME": "Name", - "NETWORK": "Network", + "NAME": "Όνομα", + "NETWORK": "Δίκτυο", "NETWORK_TYPE": "Network type", - "NEVER": "Never", - "NEW": "New", + "NEVER": "Ποτέ", + "NEW": "Νέο", "NEW_DASHBOARD": "New dashboard", "NEW_PASSWORD": "New password", "NEXT_EXECUTION": "Next execution", - "NO": "No", - "NODE": "Node", - "NODES": "Nodes", + "NO": "Όχι", + "NODE": "Κόμβος", + "NODES": "Κόμβοι", "NODES_ALIVE_CHECK_INTERVAL": "Nodes alive check interval", "NODES_DETAIL": "Nodes detail", "NODE_DETAILS": "Node details", "NODE_EUI": "Node EUI", "NODE_ID": "Node id", - "NODE_NAME": "Node name", + "NODE_NAME": "Όνομα κόμβου", "NODE_STATUS": "Node status", "NODE_TYPE": "Node type", "NON_HEAP_MEMORY": "Non Heap Memory", @@ -418,7 +418,7 @@ "NO_FIRMWARE_VERSIONS_SETUP": "No firmware versions set up", "NO_FORWARD_PAYLOADS_SETUP": "No forward payloads set up.", "NO_GATEWAYS_SETUP": "No gateways set up.", - "NO_ITEMS_IN_FILTER": "Oops! No results found. Modify your query.", + "NO_ITEMS_IN_FILTER": "Όπα! Δεν βρέθηκαν αποτελέσματα. Τροποποίησε το ερώτημά σου.", "NO_ITEMS_SETUP": "No items set up!", "NO_LOGS_AVAILABLE": "No logs available.", "NO_NODES_SETUP": "No nodes set up.", @@ -449,18 +449,18 @@ "OPERATION_TYPE": "Operation type", "OS_COMMAND_EXECTION_CONFIRMATION_MESSAGE": "Would you like to execute the following command on MyController server base Operating System?", "OS_COMMAND_EXECTION_CONFIRMATION_TITLE": "Execute Operating System command", - "OTHERS": "Others", - "PARENT": "Parent", + "OTHERS": "Λοιπά", + "PARENT": "Γονέας", "PARENT_NODE_EUI": "Parent node EUI", "PARSE_MODE": "Parse mode", - "PASSWORD": "Password", + "PASSWORD": "Κωδικός πρόσβασης", "PATTERN": "Pattern", "PAYLOAD": "Payload", "PAYLOAD_DELAY": "Payload / Delay", "PAYLOAD_OFF": "Payload OFF", "PAYLOAD_ON": "Payload ON", "PEAK": "Peak", - "PERCENTAGE": "Percentage", + "PERCENTAGE": "Ποσοστό", "PERMISSION": "Permission", "PHONE_NUMBERS": "Phone numbers", "PHONE_NUMBERS_COMMA_SEPARATED": "Phone numbers comma separated", @@ -469,16 +469,16 @@ "POLL_FREQUENCY_MINUTES": "Poll frequency (minutes)", "PORT": "Port", "PORT_NAME": "Port name", - "PRIORITY": "Priority", + "PRIORITY": "Προτεραιότητα", "PRIVATE": "Private", "PRIVATE_KEY": "Private key", "PROCESS_CPU": "Process CPU", - "PROFILE": "Profile", + "PROFILE": "Προφίλ", "PROFILE_UPDATED_SUCCESSFULLY": "Profile updated successfully", "PROPERTIES": "Properties", - "PUBLIC": "Public", - "PUBLIC_ACCESS": "Public access", - "PUBLIC_KEY": "Public key", + "PUBLIC": "Δημόσια", + "PUBLIC_ACCESS": "Δημόσια πρόσβαση", + "PUBLIC_KEY": "Δημόσιο κλειδί", "PURGE": "Purge", "PURGE_BEFORE": "Purge before", "PURGE_DONE_SUCCESSFULLY": "Purge completed successfully.", @@ -486,7 +486,7 @@ "PURGE_RESOURCES_LOGS": "Purge resources logs", "PURGE_SENSOR_VARIABLE": "Purge sensor variable", "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", - "PURGE_WARNING": "WARNING: If you don't select any parameter, this process will delete everything!", + "PURGE_WARNING": "ΠΡΟΣΟΧΗ: Εάν δεν επιλέξεις καμία παράμετρο, αυτή η διαδικασία θα διαγράψει τα πάντα!", "PURGING": "Purging", "PUSHBULLET": "Pushbullet", "QOS": "QoS", @@ -494,9 +494,9 @@ "QOS_1": "At least once (1)", "QOS_2": "Exactly once (2)", "RAW_DATA": "Raw data", - "READ_ONLY": "Read only", + "READ_ONLY": "Μόνο ανάγνωση", "REALTIME": "Realtime", - "REBOOT": "Reboot", + "REBOOT": "Επανεκκίνηση", "REBOOT_CONFIRMATION_MESSAGE": "You are about to reboot selected items
Click 'Reboot' to proceed.", "REBOOT_CONFIRMATION_TITLE": "Reboot", "REBOOT_INITIATED": "Reboot initiated for selected items.", @@ -554,20 +554,20 @@ "RUN_BACKUP": "Run backup", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", - "SAVE": "Save", - "SAVE_CHANGES": "Save changes", - "SAVING": "Saving...", + "SAVE": "Αποθήκευση", + "SAVE_CHANGES": "Αποθήκευση αλλαγών", + "SAVING": "Αποθήκευση...", "SCRIPT": "Script", "SCRIPTS": "Scripts", "SCRIPTS_DETAIL": "Scripts detail", "SCRIPT_BINDINGS": "Script bindings", "SCRIPT_ENGINES": "Script engines", "SCRIPT_FILES": "Script files", - "SEARCH": "Search", - "SECONDS": "Seconds", - "SELECT": "Select", + "SEARCH": "Αναζήτηση", + "SECONDS": "Δευτερόλεπτα", + "SELECT": "Επιλογή", "SEND": "Send", - "SENDING": "Sending...", + "SENDING": "Αποστολή...", "SEND_RAW_MESSAGE": "Send raw message", "SENSOR": "Sensor", "SENSORS": "Sensors", @@ -583,10 +583,10 @@ "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Would you like to send the following payload to the selected resource?", "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Send payload confirmation", "SENSOR_VARIABLE_TYPE": "Sensor variable type", - "SERIAL_BAUD_RATE_EXAMPLE": "Example: 115200", - "SERIAL_PORT_NAME_EXAMPLE": "Example: /dev/ttyUSB0", - "SERIAL_RETRY_FREQUENCY_EXAMPLE": "Example: 120", - "SETTINGS": "Settings", + "SERIAL_BAUD_RATE_EXAMPLE": "Παράδειγμα: 115200", + "SERIAL_PORT_NAME_EXAMPLE": "Παράδειγμα: /dev/ttyUSB0", + "SERIAL_RETRY_FREQUENCY_EXAMPLE": "Παράδειγμα: 120", + "SETTINGS": "Ρυθμίσεις", "SHOW_ICON": "Show icon", "SHOW_LEGENDS": "Show legends", "SHOW_MENU": "Show menu", @@ -654,7 +654,7 @@ "TIME_OFFSET_HH_MM_SS": "Time offset (HH:mm:ss)", "TIME_RANGE": "Time range", "TIME_TAKEN_LAST_UPDATE": "Last update(time taken)", - "TITLE": "Title", + "TITLE": "Τίτλος", "TO": "To", "TOKEN": "Token", "TOP": "Top", @@ -662,7 +662,7 @@ "TOPICS_SUBSCRIBE": "Topics subscribe", "TOPIC_PUBLISH": "Topic publish", "TOPIC_SUBSCRIBE": "Topic subscribe", - "TOPOLOGY": "Topology", + "TOPOLOGY": "Τοπολογία", "TOTAL": "Total", "TOTAL_LOADED": "Total loaded", "TOTAL_STARTED": "Total started", @@ -687,16 +687,16 @@ "UNITS_METRICS_IMPERIAL": "Units [Metrics/Imperial]", "UNLOADED": "Unloaded", "UP": "Up", - "UPDATE": "Update", - "UPDATED_SUCCESSFULLY": "Updated successfully.", + "UPDATE": "Ενημέρωση", + "UPDATED_SUCCESSFULLY": "Επιτυχής ενημέρωση.", "UPDATE_AN_ENTRY": "Update an entry", "UPDATE_EXTERNAL_SERVER": "Update external server", "UPDATE_FIRMWARE": "Update firmware", "UPDATE_FIRMWARE_TYPE": "Update firmware type", "UPDATE_FIRMWARE_VERSION": "Update firmware version", "UPDATE_FORWARD_PAYLOAD_ENTRY": "Update forward payload entry", - "UPDATE_GATEWAY": "Update gateway", - "UPDATE_NODE": "Update node", + "UPDATE_GATEWAY": "Ενημέρωση πύλης", + "UPDATE_NODE": "Ενημέρωση κόμβου", "UPDATE_OPERATION": "Update operation", "UPDATE_RESOURCE": "Update resource", "UPDATE_RESOURCES_GROUP": "Update resources group", @@ -713,13 +713,13 @@ "UPLOADED_ON": "Uploaded on", "UPLOAD_FIRMWARE": "Upload firmware", "UPPER": "Upper", - "UPPER_LIMIT": "Upper limit", + "UPPER_LIMIT": "Άνω όριο", "UP_TIME": "Up Time", "URL": "URL", "USE": "Use", "USED": "Used", - "USERNAME": "Username", - "USERS": "Users", + "USERNAME": "Όνομα χρήστη", + "USERS": "Χρήστες", "USERS_DETAIL": "Users detail", "USER_WORKING_DIRECTORY": "User working directory", "USE_GLOBAL": "Use global", @@ -742,13 +742,13 @@ "VERSIONS": "Versions", "VERSION_ID": "Version id", "VERSION_KERNEL": "Version/Kernel", - "VIEW_DETAILS": "View details", + "VIEW_DETAILS": "Προβολή Λεπτομερειών", "VM_NAME": "VM Name", "VM_VENDOR": "VM Vendor", "VM_VERSION": "VM Version", "WEBSOCKET_PORT": "Websocket port", "WIDGET_IMAGE_FILES_DISK_LOCATION": "Widget image files disk location", "WRITE_API_KEY": "Write API key", - "YEARS": "Years", - "YES": "Yes" + "YEARS": "Έτη", + "YES": "Ναι" } \ No newline at end of file diff --git a/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json b/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json index d15de9fb..a07d1d7d 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json @@ -37,7 +37,7 @@ "ADD_UID_TAG_ENTRY": "新增 UID 標記項目", "ADD_USER": "新增使用者", "ADD_VARIABLE": "新增變數", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "要加載的其他AngularJS模塊", "AFTER": "後", "ALIAS": "別名", "ALIVE_TEST_FREQUENCY": "線上檢核頻率(秒)", @@ -96,7 +96,7 @@ "COLLECTION_COUNT": "Collection 計數", "COLLECTION_TIME": "Collection 時間", "COLOR": "顏色", - "COMMAND": "Command", + "COMMAND": "命令", "COMMITTED": "已提交的", "COMMITTED_VIRTUAL_MEMORY_SIZE": "提交的虛擬記憶體大小", "CONDITION": "條件", @@ -113,7 +113,7 @@ "CURRENT_PASSWORD": "當前密碼", "CUSTOM_MESSAGE": "自訂訊息", "DAEMON": "Daemon", - "DAILY_ONCE_JOB": "Daily once", + "DAILY_ONCE_JOB": "每日一次", "DAMPENING": "Dampening(抑制)", "DAMPENING_TYPE": "Dampening(抑制)類型", "DASHBOARDS": "儀表板", @@ -163,7 +163,7 @@ "EMAIL_ADDRESSES_COMMA_SEPARATED": "逗號分隔 Email 地址", "ENABLE": "啟用", "ENABLED": "已啟用", - "ENABLE_CONFIRMATION": "Enable confirmation", + "ENABLE_CONFIRMATION": "啟用確認", "ENABLE_DEFAULT_ON_NO_FIRMWARE": "無韌體時預設啟用", "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "當啟用此選項,在系統中無可用的請求韌體時,將使用預設韌體。", "ENABLE_EDIT_MODE": "啟用編輯模式", @@ -362,7 +362,7 @@ "MESSAGE_TYPE": "消息類型", "METRIC": "公制", "METRICS": "度量標準", - "METRICS_AGGREGATION_JOB": "Metrics aggregation", + "METRICS_AGGREGATION_JOB": "度量單位聚合", "METRIC_ENGINE": "Metric engine", "METRIC_ENGINE_DIALOG_CONFIRMATION_MSG": "You are about to change metrics data backend engine settings.
This action will lead data loss. Read user manual for further details.
MyController will not import/export metric data when switching metric engine!", "METRIC_TYPE": "度量類型", @@ -485,7 +485,7 @@ "PURGE_EXISTING_DATA": "Purge existing data", "PURGE_RESOURCES_LOGS": "清除資源日誌", "PURGE_SENSOR_VARIABLE": "清除感測器變數", - "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", + "PURGE_VALUE_RANGE_EXAMPLE": "範例:min>=45.6, max>=78.2,avg>=56.3或min>= 45.6或>= 56.3(僅除了avg)", "PURGE_WARNING": "警告︰ 如果您不選擇任何參數,本次過程將刪除全部 !", "PURGING": "清除", "PUSHBULLET": "Pushbullet", @@ -517,7 +517,7 @@ "RESOURCES_DATA_DETAIL": "資來源資料詳細資訊", "RESOURCES_GROUPS": "資源群組", "RESOURCES_LOGS": "資源日誌", - "RESOURCES_LOGS_AGGREGATION_JOB": "ResourcesLogs Aggregation", + "RESOURCES_LOGS_AGGREGATION_JOB": "資源記錄聚合", "RESOURCES_LOGS_DETAIL": "資源日誌詳細資訊", "RESOURCES_LOG_LEVEL": "資源日誌級別", "RESOURCES_LOG_RETENTION_DURATION": "資源日誌保留時間", @@ -546,8 +546,8 @@ "ROOM_NAME": "房間名稱", "RULES": "規則", "RULES_DETAIL": "規則詳細資訊", - "RULE_DEFINITION_ENGINE_JOB": "Rule definition engine", - "RULE_DEFINITION_RE_ENABLE_JOB": "Rule definition re-enable", + "RULE_DEFINITION_ENGINE_JOB": "規則定義引擎", + "RULE_DEFINITION_RE_ENABLE_JOB": "規則定義重新啟用", "RULE_NAME": "規則名稱", "RUN": "運行", "RUNNING": "正在運行...", @@ -580,8 +580,8 @@ "SENSOR_TYPE": "感測器類型", "SENSOR_VARIABLE": "感測器變數", "SENSOR_VARIABLES": "感測器變數", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Would you like to send the following payload to the selected resource?", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Send payload confirmation", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "是否要將以下有效負載發送到所選資源?", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "發送有效負載確認", "SENSOR_VARIABLE_TYPE": "感測器的變數類型", "SERIAL_BAUD_RATE_EXAMPLE": "示例︰ 115200", "SERIAL_PORT_NAME_EXAMPLE": "示", @@ -622,9 +622,9 @@ "SYNTAX_ERROR": "語法錯誤", "SYSTEM": "系統", "SYSTEM_CPU_LOAD": "系統 Cpu 負載", - "SYSTEM_JOBS": "System jobs", - "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "You are about to change system internal jobs. This cron expression is a bit different than Linux cron expression.
This action may lead to incorrect schedule, poor performance, etc., Read user manual for further details.
It is highly recommend a system backup before moving forward!
Cron expression documentation", - "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "Read carefully before moving forward", + "SYSTEM_JOBS": "系統工作", + "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "你即將改變系統內部工作。 這個cron表達式與Linux cron表達式略有不同。
這個動作可能會導致錯誤的排程、性能變差等。請閱讀用戶手冊以獲取更多詳細信息。
強烈建議在繼續之前進行系統備份!
Cron表達式文檔", + "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "請在繼續之前仔細閱讀", "SYSTEM_LOAD_AVERAGE": "系統平均負載", "SYSTEM_STATUS": "系統狀態", "S_VARIABLE_DIALOG_CONFIRMATION_MSG": "您將要更新感測器變數的配置。
當更新配置,如果度量類型也更改,這個感測器變數現有的所有資料將刪除!", diff --git a/dist/src/main/resources/mc_locale/mc_locale_java_el_GR.properties b/dist/src/main/resources/mc_locale/mc_locale_java_el_GR.properties index 7f1a387d..b0c9fee8 100644 --- a/dist/src/main/resources/mc_locale/mc_locale_java_el_GR.properties +++ b/dist/src/main/resources/mc_locale/mc_locale_java_el_GR.properties @@ -1,12 +1,12 @@ -AFTER_SUNRISE=After sunrise -AFTER_SUNSET=After sunset +AFTER_SUNRISE=\u039c\u03b5\u03c4\u03ac \u03c4\u03b7\u03bd \u03b1\u03bd\u03b1\u03c4\u03bf\u03bb\u03ae +AFTER_SUNSET=\u039c\u03ad\u03c4\u03b1 \u03c4\u03bf \u03b7\u03bb\u03b9\u03bf\u03b2\u03b1\u03c3\u03af\u03bb\u03b5\u03bc\u03b1 ANY=Any AUTO=Auto AVERAGE=Average -BEFORE_SUNRISE=Before sunrise -BEFORE_SUNSET=Before sunset +BEFORE_SUNRISE=\u03a0\u03c1\u03b9\u03bd \u03c4\u03b7\u03bd \u03b1\u03bd\u03b1\u03c4\u03bf\u03bb\u03ae +BEFORE_SUNSET=\u03a0\u03c1\u03b9\u03bd \u03c4\u03bf \u03b7\u03bb\u03b9\u03bf\u03b2\u03b1\u03c3\u03af\u03bb\u03b5\u03bc\u03b1 BLOCKED=Blocked -BYE_HAVE_A_NICE_DAY=Bye, Have a nice day\! See you soon +BYE_HAVE_A_NICE_DAY=\u0393\u03b5\u03b9\u03b1, \u03bd\u03b1 \u03ad\u03c7\u03b5\u03b9\u03c2 \u03bc\u03b9\u03b1 \u03cc\u03bc\u03bf\u03c1\u03c6\u03b7 \u03b7\u03bc\u03ad\u03c1\u03b1\! \u0395\u03b9\u03c2 \u03c4\u03bf \u03b5\u03c0\u03b1\u03bd\u03b9\u03b4\u03b5\u03af\u03bd C_INTERNAL=Internal C_PRESENTATION=Presentation C_REQ=Request @@ -16,7 +16,7 @@ CORRUPTED_DATA=CORRUPTED DATA CRON=Cron DEFAULT=Default ETHERNET=Ethernet -I_BATTERY_LEVEL=Battery level +I_BATTERY_LEVEL=\u03a3\u03c4\u03ac\u03b8\u03bc\u03b7 \u03bc\u03c0\u03b1\u03c4\u03b1\u03c1\u03af\u03b1\u03c2 I_CHILDREN=Children I_CONFIG=Config I_DEBUG=Debug @@ -39,9 +39,9 @@ I_PING=Ping I_PONG=Pong I_POST_SLEEP_NOTIFICATION=Post sleep notification I_PRE_SLEEP_NOTIFICATION=Pre sleep notification -I_PRESENTATION=Presentation -I_PROPERTIES=Properties -I_REBOOT=Reboot +I_PRESENTATION=\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03af\u03b1\u03c3\u03b7 +I_PROPERTIES=\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 +I_REBOOT=\u0395\u03c0\u03b1\u03bd\u03b5\u03ba\u03ba\u03af\u03bd\u03b7\u03c3\u03b7 I_REGISTRATION_REQUEST=Register request I_REGISTRATION_RESPONSE=Register response I_REQUEST_SIGNING=Request signing @@ -52,11 +52,11 @@ I_SIGNAL_REPORT_REVERSE=Signal report reverse I_SKETCH_NAME=Sketch name I_SKETCH_VERSION=Sketch version I_TIME=Time -I_VERSION=Version +I_VERSION=\u0388\u03ba\u03b4\u03bf\u03c3\u03b7 JSERIALCOMM=jserialcomm JSSC=jssc -MAXIMUM=Maximum -MINIMUM=Minimum +MAXIMUM=\u039c\u03ad\u03b3\u03b9\u03c3\u03c4\u03bf +MINIMUM=\u0395\u03bb\u03ac\u03c7\u03b9\u03c3\u03c4\u03bf MQTT=MQTT NEW=New NORMAL=Normal @@ -64,8 +64,8 @@ PHANT_IO=Sparkfun [phant.io] PHILIPS_HUE=Philips Hue PI4J=pi4j REGISTERED=Registered -S_AIR_QUALITY=Air quality -S_ARDUINO_NODE=Node +S_AIR_QUALITY=\u03a0\u03bf\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1 \u03b1\u03ad\u03c1\u03b1 +S_ARDUINO_NODE=\u039a\u03cc\u03bc\u03b2\u03bf\u03c2 S_ARDUINO_REPEATER_NODE=Repeater node S_BARO=Barometer S_BINARY=Binary @@ -75,92 +75,92 @@ S_CPU=CPU S_CUSTOM=Custom S_DIMMER=Dimmer S_DISK=Disk -S_DISTANCE=Distance -S_DOOR=Door +S_DISTANCE=\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 +S_DOOR=\u03a0\u03cc\u03c1\u03c4\u03b1 S_DUST=Dust -S_GAS=Gas +S_GAS=\u0391\u03ad\u03c1\u03b9\u03bf S_GPS=GPS S_HEATER=Heater -S_HUM=Humidity +S_HUM=\u03a5\u03b3\u03c1\u03b1\u03c3\u03af\u03b1 S_HVAC=HVAC -S_INFO=Information +S_INFO=\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b1 S_IR=IR -S_LIGHT_LEVEL=Light level +S_LIGHT_LEVEL=\u03a3\u03c4\u03ac\u03b8\u03bc\u03b7 \u03c6\u03c9\u03c4\u03cc\u03c2 S_LOCK=Lock -S_MEMORY=Memory -S_MOISTURE=Moisture +S_MEMORY=\u039c\u03bd\u03ae\u03bc\u03b7 +S_MOISTURE=\u03a5\u03b3\u03c1\u03b1\u03c3\u03af\u03b1 S_MOTION=Motion S_MULTIMETER=Multimeter -S_POWER=Power +S_POWER=\u0399\u03c3\u03c7\u03cd\u03c2 S_PWM=PWM -S_RAIN=Rain +S_RAIN=\u0392\u03c1\u03bf\u03c7\u03ae S_RGB_LIGHT=RGB light S_RGBW_LIGHT=RGBW light S_SCENE_CONTROLLER=Scene controller -S_SMOKE=Smoke -S_SOUND=Sound +S_SMOKE=\u039a\u03b1\u03c0\u03bd\u03cc\u03c2 +S_SOUND=\u0389\u03c7\u03bf\u03c2 S_SPRINKLER=Sprinkler -S_TEMP=Temperature +S_TEMP=\u0398\u03b5\u03c1\u03bc\u03bf\u03ba\u03c1\u03b1\u03c3\u03af\u03b1 S_UV=UV -S_VIBRATION=Vibration -S_WATER_LEAK=Water leak -S_WATER_QUALITY=Water quality -S_WATER=Water -S_WEIGHT=Weight -S_WIND=Wind +S_VIBRATION=\u0394\u03cc\u03bd\u03b7\u03c3\u03b7 +S_WATER_LEAK=\u0394\u03b9\u03b1\u03c1\u03c1\u03bf\u03ae \u03bd\u03b5\u03c1\u03bf\u03cd +S_WATER_QUALITY=\u03a0\u03bf\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1 \u03bd\u03b5\u03c1\u03bf\u03cd +S_WATER=\u039d\u03b5\u03c1\u03cc +S_WEIGHT=\u0392\u03ac\u03c1\u03bf\u03c2 +S_WIND=\u0386\u03bd\u03b5\u03bc\u03bf\u03c2 SERIAL=Serial SIMPLE=Simple ST_FIRMWARE_CONFIG_REQUEST=Firmware config request ST_FIRMWARE_CONFIG_RESPONSE=Firmware config response ST_FIRMWARE_REQUEST=Firmware request ST_FIRMWARE_RESPONSE=Firmware response -ST_IMAGE=Image -ST_SOUND=Sound +ST_IMAGE=\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 +ST_SOUND=\u0389\u03c7\u03bf\u03c2 UNDEFINED=Undefined V_ARMED=Armed V_COUNT=Count V_CURRENT=Current V_CUSTOM=Custom V_DIRECTION=Direction -V_DISTANCE=Distance +V_DISTANCE=\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 V_DOWN=Down V_EC=EC -V_FLOW=Flow -V_FORECAST=Forecast +V_FLOW=\u03a1\u03bf\u03ae +V_FORECAST=\u03a0\u03c1\u03cc\u03b3\u03bd\u03c9\u03c3\u03b7 \u03ba\u03b1\u03b9\u03c1\u03bf\u03cd V_FREE=Free -V_GUST=Gust -V_HUM=Humidity +V_GUST=\u03a1\u03b9\u03c0\u03ae +V_HUM=\u03a5\u03b3\u03c1\u03b1\u03c3\u03af\u03b1 V_HVAC_FLOW_MODE=HVAC flow mode V_HVAC_FLOW_STATE=HVAC flow state V_HVAC_SETPOINT_COOL=HVAC setpoint cool V_HVAC_SETPOINT_HEAT=HVAC setpoint heat V_HVAC_SPEED=HVAC speed V_ID=Id -V_IMPEDANCE=Impedance +V_IMPEDANCE=\u0395\u03bc\u03c0\u03ad\u03b4\u03b7\u03c3\u03b7 V_IR_RECEIVE=IR receive V_IR_RECORD=IR record V_IR_SEND=IR send V_KWH=kWh V_LEVEL=Level -V_LIGHT_LEVEL=Light level +V_LIGHT_LEVEL=\u03a3\u03c4\u03ac\u03b8\u03bc\u03b7 \u03c6\u03c9\u03c4\u03cc\u03c2 V_LOCK_STATUS=Lock status V_ORP=ORP -V_PERCENTAGE=Percentage +V_PERCENTAGE=\u03a0\u03bf\u03c3\u03bf\u03c3\u03c4\u03cc V_PH=PH -V_POSITION=Position +V_POSITION=\u0398\u03ad\u03c3\u03b7 V_POWER_FACTOR=Power factor -V_PRESSURE=Pressure -V_RAIN=Rain -V_RAINRATE=Rain rate -V_RATE=Rate +V_PRESSURE=\u03a0\u03af\u03b5\u03c3\u03b7 +V_RAIN=\u0392\u03c1\u03bf\u03c7\u03ae +V_RAINRATE=\u0388\u03bd\u03c4\u03b1\u03c3\u03b7 \u03b2\u03c1\u03bf\u03c7\u03ae\u03c2 +V_RATE=\u03a1\u03c5\u03b8\u03bc\u03cc\u03c2 V_RGB=RGB V_RGBW=RGBW V_SCENE_OFF=Scene OFF V_SCENE_ON=Scene ON V_STATUS=Status V_STOP=Stop -V_TEMP=Temperature -V_TEXT=Text +V_TEMP=\u0398\u03b5\u03c1\u03bc\u03bf\u03ba\u03c1\u03b1\u03c3\u03af\u03b1 +V_TEXT=\u039a\u03b5\u03af\u03bc\u03b5\u03bd\u03bf V_TOTAL=Total V_TRIPPED=Tripped V_UNIT_PREFIX=Unit prefix @@ -177,6 +177,6 @@ V_VAR5=Variable 5 V_VOLTAGE=Voltage V_VOLUME=Volume V_WATT=Watt -V_WEIGHT=Weight +V_WEIGHT=\u0392\u03ac\u03c1\u03bf\u03c2 V_WIND=Wind WUNDERGROUND=Weather Underground diff --git a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java index 16510514..ee71fca0 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -148,6 +148,7 @@ public enum MC_LANGUAGE { CS_CZ("čeština (CZ)"), DA_DK("Dansk (DK)"), DE_DE("Deutsch (DE)"), + EL_GR("ελληνικά (GR)"), EN_US("English (US)"), ES_AR("Español (AR)"), ES_ES("Español (ES)"), From 1f94dee9feaec3784d438a572d3fea9ca757e2b1 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Fri, 12 Jul 2019 18:18:03 +0530 Subject: [PATCH 05/12] switch to openjdk --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 06c3afff..9a6fcbbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java jdk: -- oraclejdk8 +- openjdk8 branches: only: - master From c619d3c36b14b0b1e620bab3793a16988242f3df Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 9 Oct 2019 18:43:07 +0530 Subject: [PATCH 06/12] support env variables --- .../java/org/mycontroller/standalone/AppProperties.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java index ee71fca0..41516fd2 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java @@ -536,7 +536,12 @@ public void createDirectoryLocation(String directoryLocation) { } private String getValue(Properties properties, String key, String defaultValue) { - String value = properties.getProperty(key, defaultValue); + // first check it on system environment. "mcc.db.type" becomes "MCC_DB_TYPE" + String envKey = key.replaceAll("\\.", "_").toUpperCase(); + String value = System.getenv().get(envKey); + if (value == null) { + value = properties.getProperty(key, defaultValue); + } if (!key.contains("password")) { _logger.debug("Key:{}-->{}", key, value); } From 6af5147ab07975b5bbcb9adb0cae838dd4fcc862 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Thu, 10 Oct 2019 15:39:46 +0530 Subject: [PATCH 07/12] Export and Import feature, now we can import and export data across different database, update #361 --- dist/src/main/package/www/app.js | 16 +- .../main/package/www/controllers/export.js | 224 +++++ dist/src/main/package/www/index.html | 4 +- .../www/languages/mc_locale_gui-ca_es.json | 18 +- .../www/languages/mc_locale_gui-cs_cz.json | 18 +- .../www/languages/mc_locale_gui-da_dk.json | 18 +- .../www/languages/mc_locale_gui-de_de.json | 18 +- .../www/languages/mc_locale_gui-el_gr.json | 18 +- .../www/languages/mc_locale_gui-en_us.json | 18 +- .../www/languages/mc_locale_gui-es_ar.json | 18 +- .../www/languages/mc_locale_gui-es_es.json | 18 +- .../www/languages/mc_locale_gui-fr_fr.json | 18 +- .../www/languages/mc_locale_gui-he_il.json | 18 +- .../www/languages/mc_locale_gui-hu_hu.json | 18 +- .../www/languages/mc_locale_gui-id_id.json | 18 +- .../www/languages/mc_locale_gui-it_it.json | 18 +- .../www/languages/mc_locale_gui-mk_mk.json | 18 +- .../www/languages/mc_locale_gui-nl_nl.json | 18 +- .../www/languages/mc_locale_gui-no_no.json | 18 +- .../www/languages/mc_locale_gui-pl_pl.json | 18 +- .../www/languages/mc_locale_gui-pt_br.json | 18 +- .../www/languages/mc_locale_gui-pt_pt.json | 770 ++++++++++++++++++ .../www/languages/mc_locale_gui-ro_ro.json | 18 +- .../www/languages/mc_locale_gui-ru_ru.json | 18 +- .../www/languages/mc_locale_gui-sk_sk.json | 18 +- .../www/languages/mc_locale_gui-ta_in.json | 18 +- .../www/languages/mc_locale_gui-zh_cn.json | 18 +- .../www/languages/mc_locale_gui-zh_tw.json | 18 +- .../languages/mc_locale_gui_source_en.json | 18 +- .../export/automatic-export-settings.html | 126 +++ .../www/partials/export/export-list.html | 95 +++ .../export/import-confirmation-modal.html | 36 + .../package/www/services/rest_services.js | 15 +- .../mc_locale/mc_locale_java_pt_PT.properties | 182 +++++ .../standalone/AppProperties.java | 11 + .../standalone/McThreadPoolFactory.java | 3 +- .../org/mycontroller/standalone/StartApp.java | 16 +- .../standalone/api/BackupApi.java | 142 +--- .../standalone/api/ExportApi.java | 68 ++ .../standalone/api/jaxrs/BackupHandler.java | 9 +- .../standalone/api/jaxrs/ExportHandler.java | 141 ++++ .../model/{BackupFile.java => McFile.java} | 6 +- .../standalone/backup/BRCommons.java | 42 - .../standalone/backup/Backup.java | 61 +- .../standalone/backup/Commons.java | 286 +++++++ .../standalone/backup/Export.java | 131 +++ .../standalone/backup/ExportMap.java | 52 ++ .../standalone/backup/Import.java | 153 ++++ .../standalone/backup/JsonUtils.java | 162 ++++ .../standalone/backup/McFileUtils.java | 292 +++++++ .../standalone/backup/Restore.java | 107 +-- .../MixinExternalServerResourceMap.java | 37 + .../backup/mixins/MixinFirmware.java | 39 + .../backup/mixins/MixinFirmwareType.java | 30 + .../backup/mixins/MixinFirmwareVersion.java | 30 + .../backup/mixins/MixinForwardPayload.java | 37 + .../mixins/MixinMetricsBatteryUsage.java | 36 + .../backup/mixins/MixinMetricsData.java | 36 + .../standalone/backup/mixins/MixinNode.java | 39 + .../MixinOperationRuleDefinitionMap.java | 37 + .../backup/mixins/MixinOperationTable.java | 33 + .../backup/mixins/MixinOperationTimerMap.java | 37 + .../backup/mixins/MixinResource.java | 30 + .../backup/mixins/MixinResourceGroupMap.java | 34 + .../backup/mixins/MixinResourcesLogs.java | 30 + .../backup/mixins/MixinRoleGatewayMap.java | 37 + .../backup/mixins/MixinRoleMqttMap.java | 33 + .../backup/mixins/MixinRoleNodeMap.java | 37 + .../backup/mixins/MixinRoleSensorMap.java | 37 + .../backup/mixins/MixinRoleUserMap.java | 37 + .../standalone/backup/mixins/MixinRoom.java | 30 + .../standalone/backup/mixins/MixinSensor.java | 39 + .../backup/mixins/MixinSensorVariable.java | 35 + .../standalone/backup/mixins/MixinTimer.java | 30 + .../standalone/backup/mixins/MixinUidTag.java | 30 + .../standalone/backup/mixins/MixinUser.java | 30 + .../SerializerSimpleExternalServerTable.java | 51 ++ .../mixins/SerializerSimpleFirmware.java | 50 ++ .../mixins/SerializerSimpleFirmwareType.java | 50 ++ .../SerializerSimpleFirmwareVersion.java | 50 ++ .../mixins/SerializerSimpleGatewayTable.java | 50 ++ .../backup/mixins/SerializerSimpleNode.java | 50 ++ .../SerializerSimpleOperationTable.java | 51 ++ .../mixins/SerializerSimpleResource.java | 50 ++ .../mixins/SerializerSimpleResourceGroup.java | 51 ++ .../backup/mixins/SerializerSimpleRole.java | 50 ++ .../backup/mixins/SerializerSimpleRoom.java | 50 ++ .../SerializerSimpleRuleDefinitionTable.java | 51 ++ .../backup/mixins/SerializerSimpleSensor.java | 50 ++ .../SerializerSimpleSensorVariable.java | 50 ++ .../backup/mixins/SerializerSimpleTimer.java | 51 ++ .../backup/mixins/SerializerSimpleUser.java | 50 ++ .../db/dao/BaseAbstractDaoImpl.java | 38 +- .../standalone/db/dao/BaseDao.java | 8 +- .../dao/MetricsDoubleTypeDeviceDaoImpl.java | 49 +- .../db/dao/ResourcesGroupMapDao.java | 4 +- .../db/dao/ResourcesGroupMapDaoImpl.java | 14 +- .../standalone/db/dao/ResourcesLogsDao.java | 4 +- .../db/dao/ResourcesLogsDaoImpl.java | 14 +- .../db/dao/SensorsVariablesMapDao.java | 4 +- .../db/dao/SensorsVariablesMapDaoImpl.java | 8 +- .../standalone/db/dao/UserSettingsDao.java | 4 +- .../db/dao/UserSettingsDaoImpl.java | 8 +- .../standalone/db/tables/SensorVariable.java | 8 +- .../config/ExternalServerConfig.java | 8 +- .../gateway/config/GatewayConfig.java | 6 +- .../standalone/jobs/SystemBackupJob.java | 62 +- .../standalone/jobs/SystemExportJob.java | 91 +++ .../operation/model/OperationSendPayload.java | 4 +- .../rule/model/DampeningActiveTime.java | 8 +- .../standalone/settings/ExportSettings.java | 152 ++++ 111 files changed, 5321 insertions(+), 438 deletions(-) create mode 100644 dist/src/main/package/www/controllers/export.js create mode 100644 dist/src/main/package/www/languages/mc_locale_gui-pt_pt.json create mode 100644 dist/src/main/package/www/partials/export/automatic-export-settings.html create mode 100644 dist/src/main/package/www/partials/export/export-list.html create mode 100644 dist/src/main/package/www/partials/export/import-confirmation-modal.html create mode 100644 dist/src/main/resources/mc_locale/mc_locale_java_pt_PT.properties create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/api/ExportApi.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/ExportHandler.java rename modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/{BackupFile.java => McFile.java} (87%) delete mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/BRCommons.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/Export.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/Import.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/JsonUtils.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinExternalServerResourceMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmware.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareType.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareVersion.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinForwardPayload.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsBatteryUsage.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsData.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinNode.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationRuleDefinitionMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTimerMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResource.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourceGroupMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourcesLogs.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleGatewayMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleMqttMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleNodeMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleSensorMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleUserMap.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoom.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensor.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensorVariable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinTimer.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUidTag.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUser.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleExternalServerTable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmware.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareType.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareVersion.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleGatewayTable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleNode.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleOperationTable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResource.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResourceGroup.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRole.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRoom.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRuleDefinitionTable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensor.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensorVariable.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleTimer.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleUser.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemExportJob.java create mode 100644 modules/core/src/main/java/org/mycontroller/standalone/settings/ExportSettings.java diff --git a/dist/src/main/package/www/app.js b/dist/src/main/package/www/app.js index dac73da9..eef10d28 100644 --- a/dist/src/main/package/www/app.js +++ b/dist/src/main/package/www/app.js @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -567,6 +567,20 @@ myControllerModule.config(function($stateProvider, $urlRouterProvider) { data: { requireLogin: true } + }).state('settingsExportList', { + url:"/settings/export/list", + templateUrl: "partials/export/export-list.html?mcv=${mc.gui.version}", + controller: "ExportControllerList", + data: { + requireLogin: true + } + }).state('settingsExportAuto', { + url:"/settings/export/settings", + templateUrl: "partials/export/automatic-export-settings.html?mcv=${mc.gui.version}", + controller: "ExportControllerAutoSettings", + data: { + requireLogin: true + } }) /* Login */ diff --git a/dist/src/main/package/www/controllers/export.js b/dist/src/main/package/www/controllers/export.js new file mode 100644 index 00000000..74ebe9c2 --- /dev/null +++ b/dist/src/main/package/www/controllers/export.js @@ -0,0 +1,224 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +myControllerModule.controller('ExportControllerList', function(alertService, $scope, $filter, displayRestError, ExportImportFactory, $filter, mchelper, CommonServices, $uibModal) { + //GUI page settings + $scope.headerStringList = $filter('translate')('EXPORTS_DETAIL'); + $scope.noItemsSystemMsg = $filter('translate')('NO_EXPORTS_SETUP'); + $scope.noItemsSystemIcon = "fa fa-upload"; + + //load empty, configuration, etc., + $scope.mchelper = mchelper; + $scope.filteredList=[]; + + //data query details + $scope.currentPage = 1; + $scope.query = CommonServices.getQuery(); + $scope.queryResponse = {}; + + //Get min number + $scope.getMin = function(item1, item2){ + return CommonServices.getMin(item1, item2); + }; + + //get all items + $scope.getAllItems = function(){ + ExportImportFactory.getAll($scope.query, function(response) { + $scope.queryResponse = response; + $scope.filteredList = $scope.queryResponse.data; + $scope.filterConfig.resultsCount = $scope.queryResponse.query.filteredCount; + },function(error){ + $scope.queryResponse.$resolved = true; + displayRestError.display(error); + }); + } + + + //Hold all the selected item ids + $scope.itemIds = []; + + $scope.selectAllItems = function(){ + CommonServices.selectAllItems($scope, 'name'); + }; + + $scope.selectItem = function(item){ + CommonServices.selectItem($scope, item, 'name'); + }; + + //On page change + $scope.pageChanged = function(newPage){ + CommonServices.updatePageChange($scope, newPage); + }; + + //Filter change method + var filterChange = function (filters) { + //Reset filter fields and update items + CommonServices.updateFiltersChange($scope, filters); + }; + + $scope.filterConfig = { + fields: [ + { + id: 'name', + title: $filter('translate')('NAME'), + placeholder: $filter('translate')('FILTER_BY_NAME'), + filterType: 'text' + } + ], + resultsCount: $scope.filteredList.length, + appliedFilters: [], + onFilterChange: filterChange + }; + + //Sort columns [*** NOT IN USE ***] + var sortChange = function (sortId, isAscending) { + //Reset sort type and update items + CommonServices.updateSortChange($scope, sortId, isAscending); + }; + + $scope.sortConfig = { + fields: [ + { + id: 'name', + title: $filter('translate')('NAME'), + sortType: 'text' + } + ], + onSortChange: sortChange + }; + + //Pre load + $scope.disableRunExport = false; + + //Delete item(s) + $scope.delete = function (size) { + var modalInstance = $uibModal.open({ + templateUrl: 'partials/common-html/delete-modal.html', + controller: 'ControllerDeleteModal', + size: size, + resolve: {} + }); + + modalInstance.result.then(function () { + ExportImportFactory.deleteIds($scope.itemIds, function(response) { + alertService.success($filter('translate')('ITEMS_DELETED_SUCCESSFULLY')); + //Update display table + $scope.getAllItems(); + $scope.itemIds = []; + },function(error){ + displayRestError.display(error); + }); + }), + function () { + //console.log('Modal dismissed at: ' + new Date()); + } + }; + + //export now + $scope.exportNow = function(){ + $scope.disableRunExport = true; + ExportImportFactory.exportNow({"rowLimit": 1000}, function(){ + $scope.getAllItems(); + alertService.success($filter('translate')('EXPORT_TRIGGERED_SUCCESSFULLY')); + $scope.disableRunExport = false; + },function(error){ + displayRestError.display(error); + $scope.disableRunExport = false; + }); + }; + + //Import + $scope.importItemFn = function (size) { + var addModalInstance = $uibModal.open({ + templateUrl: 'partials/export/import-confirmation-modal.html', + controller: 'ExportControllerImport', + size: size, + resolve: {fileName: function () {return {'name': $scope.itemIds[0]}}} + }); + + addModalInstance.result.then(function () { + ExportImportFactory.importNow({"fileName": $scope.itemIds[0]}, function(response) { + alertService.success($filter('translate')('IMPORT_INITIATED_SUCCESSFULLY')+' '+response.message); + },function(error){ + displayRestError.display(error); + }); + }), + function () { + //console.log('Modal dismissed at: ' + new Date()); + } + }; + +}); + +//restore Modal +myControllerModule.controller('ExportControllerImport', function ($scope, $uibModalInstance, $filter, fileName) { + $scope.header = $filter('translate')('IMPORT_CONFIRMATION_TITLE', fileName); + $scope.rebootMsg = $filter('translate')('IMPORT_CONFIRMATION_MESSAGE', fileName); + $scope.importNow = function() {$uibModalInstance.close(); }; + $scope.cancel = function () { $uibModalInstance.dismiss('cancel'); } +}); + +//Automatice export settings +myControllerModule.controller('ExportControllerAutoSettings', function ($scope, ExportImportFactory, mchelper, alertService, displayRestError, $filter, CommonServices) { + $scope.mchelper = mchelper; + $scope.item = {}; + $scope.item.enabled = false; + $scope.cs = CommonServices; + + $scope.resetSettings = function(){ + ExportImportFactory.getSettings(function(response) { + $scope.item = response; + //Update dropdown + if($scope.item.interval % 86400000 == 0){ + $scope.intervalLocal = $scope.item.interval / 86400000; + $scope.intervalTimeConstant = "86400000"; + $scope.intervalTimeConstantString = $filter('translate')('DAYS'); + }else if($scope.item.interval % 3600000 == 0){ + $scope.intervalLocal = $scope.item.interval / 3600000; + $scope.intervalTimeConstant = "3600000"; + $scope.intervalTimeConstantString = $filter('translate')('Hours'); + }else if($scope.item.interval % 60000 == 0){ + $scope.intervalLocal = $scope.item.interval / 60000; + $scope.intervalTimeConstant = "60000"; + $scope.intervalTimeConstantString = $filter('translate')('Minutes'); + } + },function(error){ + displayRestError.display(error); + }); + } + + //GUI page settings + $scope.saveProgress = false; + + //Load details + $scope.resetSettings(); + + $scope.save = function(){ + if($scope.item.enabled){ + //Update time + $scope.item.interval = $scope.intervalLocal * $scope.intervalTimeConstant; + } + $scope.saveProgress = true; + ExportImportFactory.updateSettings($scope.item,function(response) { + $scope.saveProgress = false; + $scope.editEnable.exportSettings = false; + $scope.resetSettings(); + },function(error){ + displayRestError.display(error); + $scope.saveProgress = false; + }); + } +}); diff --git a/dist/src/main/package/www/index.html b/dist/src/main/package/www/index.html index 03685050..496a942c 100644 --- a/dist/src/main/package/www/index.html +++ b/dist/src/main/package/www/index.html @@ -152,7 +152,7 @@ - + @@ -173,6 +173,7 @@ + @@ -367,6 +368,7 @@
  • {{ 'USERS' | translate }}
  • {{ 'ROLES' | translate }}
  • {{ 'BACKUP' | translate }}
  • +
  • {{ 'EXPORT' | translate }}
  • diff --git a/dist/src/main/package/www/languages/mc_locale_gui-ca_es.json b/dist/src/main/package/www/languages/mc_locale_gui-ca_es.json index e19b0387..ea9baf13 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-ca_es.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-ca_es.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Tauler d'accions", "ACTIVE": "Actiu", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Afegir entrada", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Agefir firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Afegir entrada de cordó UID", "ADD_USER": "Afegir usuari", "ADD_VARIABLE": "Afegir la variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Després", "ALIAS": "Àlies", "ALIVE_TEST_FREQUENCY": "Comprobació temps de vida (segons)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Autorització ID", "AUTH_TOKEN": "Token Auth.", "AUTOMATIC_BACKUP_SETTINGS": "Paramètres de copies automàtiques", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Usuari autoritzat", "AUTO_GENERATE": "Autogeneració", "AVAILABLE_PROCESS": "Processos disponibles", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluacions", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extensió", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Cas d'ignorar", "IGNORE_DUPLICATE": "Ignorar duplicats", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Inclouen llindar alt", "INCLUDE_THRESHOLD_LOW": "Inclouen llindar baix", "INDIVIDUAL_SETTINGS": "Parametres individuals", @@ -412,6 +426,7 @@ "NO_ACK": "Cap ack", "NO_BACKUPS_SETUP": "Backups no configurats", "NO_DATA_AVAILABLE": "Dades no disponibles", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "Firmware no configurats", "NO_FIRMWARE_TYPES_SETUP": "Tipus de firmware no configurats", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Executar la còpia de seguretat", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Ara executi", "SAVE": "Desa", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json b/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json index 24347d53..d6847cb5 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Panel akcí", "ACTIVE": "Aktivní", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Přidat záznam", "ADD_EXTERNAL_SERVER": "Přidat externí server", "ADD_FIRMWARE": "Přidat firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Přidat UID štítek", "ADD_USER": "Přidat uživatele", "ADD_VARIABLE": "Přidat proměnnou", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Po", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frekvence kontroly \"alive\" (sekund)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Nastavení automatické zálohy", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Automaticky generuj", "AVAILABLE_PROCESS": "Dostupný Proces", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Hodnocení", "EXECUTE_DISCOVER_INTERVAL": "Interval zjišťování uzlů", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Přípona", "EXTENSIONS": "Přípony", "EXTERNAL_SERVERS": "Externí servery", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorovat velikost", "IGNORE_DUPLICATE": "Ignorovat duplicitu", "IMPERIAL": "Imperiiální", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Zahrnout horní práh", "INCLUDE_THRESHOLD_LOW": "Zahrnout spodní práh", "INDIVIDUAL_SETTINGS": "Vlastní nastavení", @@ -412,6 +426,7 @@ "NO_ACK": "Bez potvrzení", "NO_BACKUPS_SETUP": "Zálohy nejsou nastaveny.", "NO_DATA_AVAILABLE": "Data nejsou dostupná.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Externí servery nejsou nastaveny.", "NO_FIRMWARES_SETUP": "Firmwary nejsou nastaveny.", "NO_FIRMWARE_TYPES_SETUP": "Typy firmware nejsou nastaveny.", @@ -552,6 +567,7 @@ "RUN": "Spustit", "RUNNING": "Běží...", "RUN_BACKUP": "Spusť zálohování", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Spustit garbage collection", "RUN_NOW": "Spustit teď", "SAVE": "Uložit", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-da_dk.json b/dist/src/main/package/www/languages/mc_locale_gui-da_dk.json index c037d06e..823ac3b2 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-da_dk.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-da_dk.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Aktionstavle", "ACTIVE": "Aktiv", "ADD": "Tilføj", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Tilføj et punkt", "ADD_EXTERNAL_SERVER": "Tilføj ekstern server", "ADD_FIRMWARE": "Tilføj firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Tilføj punkt for UID-mærkat", "ADD_USER": "Tilføj bruger", "ADD_VARIABLE": "Tilføj variabel", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Efter", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Intervaltid for kontrol (sekunder)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Autoriseret id/sid", "AUTH_TOKEN": "Autoriseret billet", "AUTOMATIC_BACKUP_SETTINGS": "Indstillinger for automatisk backup", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autoriseret bruger", "AUTO_GENERATE": "Auto-generér", "AVAILABLE_PROCESS": "Tilgængelige kerner", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evalueringer", "EXECUTE_DISCOVER_INTERVAL": "Interval for opdagelse af nye noder", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Format", "EXTENSIONS": "Formater", "EXTERNAL_SERVERS": "Eksterne servere", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorer sag", "IGNORE_DUPLICATE": "Ignorer dubletter", "IMPERIAL": "Imperisk", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Inkluder høj grænseværdi", "INCLUDE_THRESHOLD_LOW": "Inkluder lav grænseværdi", "INDIVIDUAL_SETTINGS": "Individuelle indstillinger", @@ -412,6 +426,7 @@ "NO_ACK": "Ingen bekræftigelse", "NO_BACKUPS_SETUP": "Ingen backups sat op.", "NO_DATA_AVAILABLE": "Ingen data til rådighed.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Ingen eksterne servere tilføjet.", "NO_FIRMWARES_SETUP": "Ingen firmware tilføjet.", "NO_FIRMWARE_TYPES_SETUP": "Ingen firmwaretype indsat.", @@ -552,6 +567,7 @@ "RUN": "Kør", "RUNNING": "Afvikler...", "RUN_BACKUP": "Kør backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Kør affaldsopsamling", "RUN_NOW": "Kør nu", "SAVE": "Gem", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-de_de.json b/dist/src/main/package/www/languages/mc_locale_gui-de_de.json index 08a180bc..35638afe 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-de_de.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-de_de.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Aktionstafel", "ACTIVE": "Aktiv", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Eintrag hinzufügen", "ADD_EXTERNAL_SERVER": "Externen Server hinzufügen", "ADD_FIRMWARE": "Firmware hinzufügen", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "UID-Tag-Eintrag hinzufügen", "ADD_USER": "Benutzer hinzufügen", "ADD_VARIABLE": "Variable hinzufügen", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Nach", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Lebensüberprüfungsfrequenz (Sekunden)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "ID/SID der Authentifikation", "AUTH_TOKEN": "Authentifikations-Token", "AUTOMATIC_BACKUP_SETTINGS": "Einstelllungen automatisches Backup", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Automatisch Generieren", "AVAILABLE_PROCESS": "Verfügbarer Prozess", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Auswertungen", "EXECUTE_DISCOVER_INTERVAL": "Intervall zum entdecken ausführen", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Erweiterung", "EXTENSIONS": "Erweiterungen", "EXTERNAL_SERVERS": "Externe Server", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Groß-/Kleinschreibung ignorieren", "IGNORE_DUPLICATE": "Ignoriere Duplikate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Hohe Schwelle einfügen", "INCLUDE_THRESHOLD_LOW": "Niedrige Schwelle einfügen", "INDIVIDUAL_SETTINGS": "Individuelle Einstellungen", @@ -412,6 +426,7 @@ "NO_ACK": "Kein ACK", "NO_BACKUPS_SETUP": "Keine Sicherungen eingerichtet.", "NO_DATA_AVAILABLE": "Keine Daten verfügbar.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Kein externer Server Setup.", "NO_FIRMWARES_SETUP": "Keine Firmware eingerichtet.", "NO_FIRMWARE_TYPES_SETUP": "Kein Firmware-Typen eingerichtet..", @@ -552,6 +567,7 @@ "RUN": "starten", "RUNNING": "Wird ausgeführt...", "RUN_BACKUP": "Systemsicherung durchführen", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Garbage Collection ausführen", "RUN_NOW": "Jetzt ausführen", "SAVE": "Speichern", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json b/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json index 1de76e7a..c7db903b 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-el_gr.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Action board", "ACTIVE": "Ενεργό", "ADD": "Προσθήκη", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Πρόσθεσε χρήστη", "ADD_VARIABLE": "Πρόσθεσε μεταβλητή", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Μέτα", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Αποθήκευση", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-en_us.json b/dist/src/main/package/www/languages/mc_locale_gui-en_us.json index a4970d5a..ddb8e5b9 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-en_us.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-en_us.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Action board", "ACTIVE": "Active", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Add user", "ADD_VARIABLE": "Add variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Save", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-es_ar.json b/dist/src/main/package/www/languages/mc_locale_gui-es_ar.json index a68cb498..21052563 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-es_ar.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-es_ar.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Tablero de acción", "ACTIVE": "Activo", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Agregar una entrada", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Agregar firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Agregar entrada de tag UID", "ADD_USER": "Agregar usuario", "ADD_VARIABLE": "Agregar variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frecuencia de verificación de vida (segundos)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Token de autenticacón", "AUTOMATIC_BACKUP_SETTINGS": "Configuración automática de Backup", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Autogenerar", "AVAILABLE_PROCESS": "Proceso disponible", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluaciones", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extensión", "EXTENSIONS": "Extensiones", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorar mayúsculas", "IGNORE_DUPLICATE": "Ignorar duplicados", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Incluir umbral alto", "INCLUDE_THRESHOLD_LOW": "Incluir umbral bajo", "INDIVIDUAL_SETTINGS": "Configuraciones individuales", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No hay backups configurados.", "NO_DATA_AVAILABLE": "No hay datos disponibles.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No hay firmwares configurados.", "NO_FIRMWARE_TYPES_SETUP": "No hay tipos de firmware configurados.", @@ -552,6 +567,7 @@ "RUN": "Ejecutar", "RUNNING": "Corriendo...", "RUN_BACKUP": "Correr backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Ejecutar recolector de basura", "RUN_NOW": "Ejecutar ahora", "SAVE": "Guardar", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-es_es.json b/dist/src/main/package/www/languages/mc_locale_gui-es_es.json index cc8eeac9..14b8ac36 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-es_es.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-es_es.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Tablero de acción", "ACTIVE": "Activo", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Agregar entrada", "ADD_EXTERNAL_SERVER": "Agregar servidor externo", "ADD_FIRMWARE": "Agregar firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Agregar UID tag", "ADD_USER": "Agregar usuario", "ADD_VARIABLE": "Agregar variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Después", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frequencia de chequeo de vida (segundos)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Token de autenticación", "AUTOMATIC_BACKUP_SETTINGS": "Configuración de copia de seguridad automática", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Usuario autorizado", "AUTO_GENERATE": "Auto generar", "AVAILABLE_PROCESS": "Proceso disposible", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluaciones", "EXECUTE_DISCOVER_INTERVAL": "Ejecutar intervalo de descuvrimiento", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extensión", "EXTENSIONS": "Extensiones", "EXTERNAL_SERVERS": "Servidores externos", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorar caso", "IGNORE_DUPLICATE": "Ignorar duplicados", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Incluir umbral alto", "INCLUDE_THRESHOLD_LOW": "Incluir umbral bajo", "INDIVIDUAL_SETTINGS": "Configuración individual", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No hay backups configurados.", "NO_DATA_AVAILABLE": "No hay datos disponibles.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No hay servidores externos configurados.", "NO_FIRMWARES_SETUP": "No hay firmware configurados.", "NO_FIRMWARE_TYPES_SETUP": "No hay tipos de firmware configurados.", @@ -552,6 +567,7 @@ "RUN": "Ejecutar", "RUNNING": "Corriendo...", "RUN_BACKUP": "Ejecutar copia de seguridad", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Ejecutar la recolección de basura", "RUN_NOW": "Ejecutar ahora", "SAVE": "Guardar", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-fr_fr.json b/dist/src/main/package/www/languages/mc_locale_gui-fr_fr.json index 77098b79..6c86ffd0 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-fr_fr.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-fr_fr.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Panneau de contrôle", "ACTIVE": "Actif", "ADD": "Ajouter", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Ajouter une entrée", "ADD_EXTERNAL_SERVER": "Ajouter serveur externe", "ADD_FIRMWARE": "Ajouter firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Ajouter une balise UID", "ADD_USER": "Ajouter un utilisateur", "ADD_VARIABLE": "Ajouter une variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Après", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Vérification du fonctionnement (en secondes)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth ID", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Sauvegarde automatique", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Utilisateur autorisé", "AUTO_GENERATE": "Générer automatiquement", "AVAILABLE_PROCESS": "Processus disponible", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Intervalle découverte", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "Serveurs externes", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorer la casse", "IGNORE_DUPLICATE": "Ignorer doublons", "IMPERIAL": "Impérial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Inclure seuil haut", "INCLUDE_THRESHOLD_LOW": "Inclure seuil bas", "INDIVIDUAL_SETTINGS": "Réglages individuels", @@ -412,6 +426,7 @@ "NO_ACK": "Sans ack", "NO_BACKUPS_SETUP": "Aucun backup configuré", "NO_DATA_AVAILABLE": "Aucune donnée disponible.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Aucun serveur externe configuré", "NO_FIRMWARES_SETUP": "Aucun firmware configuré", "NO_FIRMWARE_TYPES_SETUP": "Aucun type de firmware configuré.", @@ -552,6 +567,7 @@ "RUN": "Exécuter", "RUNNING": "En exécution...", "RUN_BACKUP": "Exécuter la sauvegarde", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Lancer le nettoyage de la mémoire", "RUN_NOW": "Exécuter maintenant", "SAVE": "Enregistrer", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-he_il.json b/dist/src/main/package/www/languages/mc_locale_gui-he_il.json index efc1bafe..452aebc8 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-he_il.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-he_il.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "לוח פעולה", "ACTIVE": "פעיל", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "הוספת רשומה", "ADD_EXTERNAL_SERVER": "הוספת שרת חיצוני", "ADD_FIRMWARE": "הוספת קושחה", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "הוספת ערך של תג UID", "ADD_USER": "הוספת משתמש", "ADD_VARIABLE": "הוספת משתנה", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "אחרי", "ALIAS": "כינוי", "ALIVE_TEST_FREQUENCY": "תדירות בדיקת ALIVE (שניות)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "מזהה הרשאה", "AUTH_TOKEN": " Auth token", "AUTOMATIC_BACKUP_SETTINGS": "הגדרות גיבוי אוטומטי", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "משתמש מאושר", "AUTO_GENERATE": "מחולל אוטומטי", "AVAILABLE_PROCESS": "תהליך זמין", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "הערכות", "EXECUTE_DISCOVER_INTERVAL": "בצע מרווח גילוי", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "הרחבה", "EXTENSIONS": "הרחבות", "EXTERNAL_SERVERS": "הרחבות שרתים", @@ -287,6 +297,10 @@ "IGNORE_CASE": "התעלם במקרה", "IGNORE_DUPLICATE": "התעלם משכפול", "IMPERIAL": "מלכותי", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "כלול סף גבוה", "INCLUDE_THRESHOLD_LOW": "כלול סף נמוך", "INDIVIDUAL_SETTINGS": "הגדרות אישיות", @@ -412,6 +426,7 @@ "NO_ACK": "אין ACK", "NO_BACKUPS_SETUP": "לא הוגדרו גיבויים", "NO_DATA_AVAILABLE": "המידע אינו זמין", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "לא הוגדרו שרתים חיצוניים", "NO_FIRMWARES_SETUP": "לא הוגדרו קושחות", "NO_FIRMWARE_TYPES_SETUP": "לא הוגדרו סוגי קושחות", @@ -552,6 +567,7 @@ "RUN": "הפעל", "RUNNING": "פועל...", "RUN_BACKUP": "הפעל גיבוי", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "הפעל איסוף אשפה", "RUN_NOW": "הפעל עכשיו", "SAVE": "שמור", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-hu_hu.json b/dist/src/main/package/www/languages/mc_locale_gui-hu_hu.json index 22ce651a..96592915 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-hu_hu.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-hu_hu.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Action board", "ACTIVE": "Aktív", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": " Bejegyzés hozzáadása", "ADD_EXTERNAL_SERVER": "Külső szerver hozzáadása", "ADD_FIRMWARE": "Firmware hozzáadása", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "UID tag hozzáadása", "ADD_USER": "Felhasználó hozzáadása", "ADD_VARIABLE": "Változó hozzáadása", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Utána", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatikus biztonsági mentés beállítások", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Automatikusan generált", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Futtatás", "RUNNING": "Fut...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Futtatás most", "SAVE": "Mentés", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-id_id.json b/dist/src/main/package/www/languages/mc_locale_gui-id_id.json index 3054b98b..0190c9d7 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-id_id.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-id_id.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Papan aksi", "ACTIVE": "Aktif", "ADD": "Tambah", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Tambah entri", "ADD_EXTERNAL_SERVER": "Tambah server eksternal", "ADD_FIRMWARE": "Tambah firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Tambah entri tag UID ", "ADD_USER": "Tambah user", "ADD_VARIABLE": "Tambah variabel", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Setelah", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frekuensi alive check (detik)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Pengaturan backup otomatis", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Authorized user", "AUTO_GENERATE": "Generate otomatis", "AVAILABLE_PROCESS": "Proses tersedia", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Save", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-it_it.json b/dist/src/main/package/www/languages/mc_locale_gui-it_it.json index 51c2131c..bc3fc56f 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-it_it.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-it_it.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Pannello Comandi", "ACTIVE": "Attivo", "ADD": "Aggiungi", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Aggiungi una voce", "ADD_EXTERNAL_SERVER": "Aggiungi server esterno", "ADD_FIRMWARE": "Aggiungi firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Aggiungi voce tag UID", "ADD_USER": "Aggiungi utente", "ADD_VARIABLE": "Aggiungi variabile", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Dopo", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frequenza di controllo in vita (secondi)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Autenticazione id/sid", "AUTH_TOKEN": "gettone di Autenticazione", "AUTOMATIC_BACKUP_SETTINGS": "Impostazioni di salvataggio automatico", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Utente autorizzato", "AUTO_GENERATE": "Genera automaticamente", "AVAILABLE_PROCESS": "Processo disponibile", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Valutazioni", "EXECUTE_DISCOVER_INTERVAL": "Intervallo di esecuzione esplorazione", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Estensione", "EXTENSIONS": "Estensioni", "EXTERNAL_SERVERS": "Servers esterni", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignora case", "IGNORE_DUPLICATE": "Ignora duplicato", "IMPERIAL": "Imperiale", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Soglia alta inclusione", "INCLUDE_THRESHOLD_LOW": "Soglia bassa inclusione", "INDIVIDUAL_SETTINGS": "Impostazioni individuali", @@ -412,6 +426,7 @@ "NO_ACK": "Non ack", "NO_BACKUPS_SETUP": "Nessun backup impostato", "NO_DATA_AVAILABLE": "Nessun dato disponibile", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Non ci sono servers esterni impostati", "NO_FIRMWARES_SETUP": "Non ci sono firmware impostati", "NO_FIRMWARE_TYPES_SETUP": "Non ci sono tipi di firmware impostati", @@ -552,6 +567,7 @@ "RUN": "Esegui", "RUNNING": "Esecuzione in corso...", "RUN_BACKUP": "Esegui backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Esegui garbage collection", "RUN_NOW": "Esegui ora", "SAVE": "Salva", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-mk_mk.json b/dist/src/main/package/www/languages/mc_locale_gui-mk_mk.json index 7fa0d066..0cc54aab 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-mk_mk.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-mk_mk.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Акциона табла", "ACTIVE": "Активен", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Додај Корисник", "ADD_VARIABLE": "Add variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Игнорирај дупликати", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Стартувај сега", "SAVE": "Зачувај", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json b/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json index 5401ac4b..bf511d7d 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-nl_nl.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Controle paneel", "ACTIVE": "Actief", "ADD": "Toevoegen", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Regel toevoegen", "ADD_EXTERNAL_SERVER": "Externe server toevoegen", "ADD_FIRMWARE": "Firmware toevoegen", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Voeg UID label toe", "ADD_USER": "Gebruiker toevoegen", "ADD_VARIABLE": "Variable toevoegen", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Na", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Bereikbaarheid verificatie frequentie (seconden)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatische backup instellingen", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Geautoriseerde gebruiker", "AUTO_GENERATE": "Automatisch aanmaken", "AVAILABLE_PROCESS": "Beschikbare Processen", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluaties", "EXECUTE_DISCOVER_INTERVAL": "Discover interval uitvoeren", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Achtervoegsel", "EXTENSIONS": "Uitbreidingen", "EXTERNAL_SERVERS": "Externe servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Negeer hoofd/kleine letters", "IGNORE_DUPLICATE": "Negeer duplicaat", "IMPERIAL": "Imperiaal", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Voeg drempel waarde hoog toe", "INCLUDE_THRESHOLD_LOW": "Voeg drempel waarde laag toe", "INDIVIDUAL_SETTINGS": "Individuele instellingen", @@ -412,6 +426,7 @@ "NO_ACK": "Geen Ack", "NO_BACKUPS_SETUP": "Geen herstelpunt ingesteld.", "NO_DATA_AVAILABLE": "Geen data beschikbaar.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Geen externe servers ingesteld", "NO_FIRMWARES_SETUP": "Geen firmware ingesteld.", "NO_FIRMWARE_TYPES_SETUP": "Geen firmware types ingesteld.", @@ -552,6 +567,7 @@ "RUN": "Uitvoeren", "RUNNING": "Bezig......", "RUN_BACKUP": "Maak Herstelpunt", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Opschonen uitvoeren", "RUN_NOW": "Nu uitvoeren", "SAVE": "Opslaan", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-no_no.json b/dist/src/main/package/www/languages/mc_locale_gui-no_no.json index 640d465d..dbb72c73 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-no_no.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-no_no.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Handling bord", "ACTIVE": "Aktiv", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Legg til en oppføring", "ADD_EXTERNAL_SERVER": "Legg til ekstern server", "ADD_FIRMWARE": "Legg til firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Legg til UID tag oppføring", "ADD_USER": "Legg til bruker", "ADD_VARIABLE": "Legg til variabel", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "Etter", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Online sjekk frekvens (sekunder)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Autoriseringstoken", "AUTOMATIC_BACKUP_SETTINGS": "Automatisk backup innstilinger", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorisert bruker", "AUTO_GENERATE": "Auto generer", "AVAILABLE_PROCESS": "Tilgjengelig Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evalueringer", "EXECUTE_DISCOVER_INTERVAL": "Utfør Discover intervall", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Utvidelse", "EXTENSIONS": "Utvidelser", "EXTERNAL_SERVERS": "Skstern server", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignorer sak", "IGNORE_DUPLICATE": "Ignorer duplisert", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Inkluder terskel høy", "INCLUDE_THRESHOLD_LOW": "Inkluder terskel lav", "INDIVIDUAL_SETTINGS": "Individuelle innstillinger", @@ -412,6 +426,7 @@ "NO_ACK": "Ingen ack", "NO_BACKUPS_SETUP": "Ingen sikkerhetskopier satt opp", "NO_DATA_AVAILABLE": "Ingen data tilgjengelig", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Ingen eksterne servere satt opp", "NO_FIRMWARES_SETUP": "Ingen firmwares satt opp", "NO_FIRMWARE_TYPES_SETUP": "Ingen firmware typer satt opp", @@ -552,6 +567,7 @@ "RUN": "Kjør", "RUNNING": "Kjører...", "RUN_BACKUP": "Kjør sikkerhetskopi", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Kjør søppel samler", "RUN_NOW": "Kjør nå", "SAVE": "Lagre", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json b/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json index 0baaa9a5..67de2b7f 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-pl_pl.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Tablica akcji", "ACTIVE": "Aktywny", "ADD": "Dodaj", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Dodatkowe moduły AngularJS do załadowania", "ADD_AN_ENTRY": "Dodaj wpis", "ADD_EXTERNAL_SERVER": "Dodaj zewnętrzny serwer", "ADD_FIRMWARE": "Dodaj firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Dodaj etykietę UID", "ADD_USER": "Dodaj użytkownika", "ADD_VARIABLE": "Dodaj zmienną", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Dodatkowe moduły AngularJS do załadowania", "AFTER": "Po", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Częstotliwość sprawdzania aktywności (sekundy)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Identyfikator id/sid", "AUTH_TOKEN": "Token uwierzytelniania", "AUTOMATIC_BACKUP_SETTINGS": "Ustawienia automatycznej kopii zapasowej", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autoryzowany użytkownik", "AUTO_GENERATE": "Generuj automatycznie", "AVAILABLE_PROCESS": "Dostępny proces", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Obliczenia", "EXECUTE_DISCOVER_INTERVAL": "Wykonaj interwał wykrywania", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Rozszerzenie", "EXTENSIONS": "Rozszerzenia", "EXTERNAL_SERVERS": "Zewnętrzne serwery", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignoruj przypadek", "IGNORE_DUPLICATE": "Ignoruj duplikat", "IMPERIAL": "Jednostki imperialne", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Dodaj próg wysoki", "INCLUDE_THRESHOLD_LOW": "Dodaj próg niski", "INDIVIDUAL_SETTINGS": "Indywidualne ustawienia", @@ -412,6 +426,7 @@ "NO_ACK": "Brak ack", "NO_BACKUPS_SETUP": "Nie skonfigurowano kopii zapasowych.", "NO_DATA_AVAILABLE": "Brak danych", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Brak konfiguracji zewnętrznych serwerów.", "NO_FIRMWARES_SETUP": "Nie skonfigurowano firmware.", "NO_FIRMWARE_TYPES_SETUP": "Brak konfiguracji typów firmware", @@ -552,6 +567,7 @@ "RUN": "Uruchom", "RUNNING": "Działa...", "RUN_BACKUP": "Wykonaj kopię zapasową", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Uruchom zbieranie śmieci", "RUN_NOW": "Uruchom teraz", "SAVE": "Zapisz", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-pt_br.json b/dist/src/main/package/www/languages/mc_locale_gui-pt_br.json index 025f4b06..34a5a906 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-pt_br.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-pt_br.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Esboço seqüencial", "ACTIVE": "Ativo", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Adicione uma entrada", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Adicionar firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Adicionar usuário", "ADD_VARIABLE": "Add variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Configurações da cópia de segurança automática", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extensão", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Salvar", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-pt_pt.json b/dist/src/main/package/www/languages/mc_locale_gui-pt_pt.json new file mode 100644 index 00000000..021ebde0 --- /dev/null +++ b/dist/src/main/package/www/languages/mc_locale_gui-pt_pt.json @@ -0,0 +1,770 @@ +{ + "12_HOURS": "12 hours", + "24_HOURS": "24 hours", + "ABOUT": "About", + "ACCESS": "Access", + "ACCESS_TOKEN": "Access token", + "ACK": "Ack", + "ACKNOWLEDGE": "Acknowledge", + "ACK_ENABLED": "Ack enabled", + "ACK_REQUEST": "Ack request", + "ACK_RESPONSE": "Ack response", + "ACK_WAIT_TIME": "Ack wait time", + "ACTIONS": "Actions", + "ACTION_BOARD": "Action board", + "ACTIVE": "Active", + "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", + "ADD_AN_ENTRY": "Add an entry", + "ADD_EXTERNAL_SERVER": "Add external server", + "ADD_FIRMWARE": "Add firmware", + "ADD_FIRMWARE_TYPE": "Add firmware type", + "ADD_FIRMWARE_VERSION": "Add firmware version", + "ADD_FORWARD_PAYLOAD_ENTRY": "Add forward payload entry", + "ADD_GATEWAY": "Add gateway", + "ADD_GROUP": "Add group", + "ADD_NEW_WIDGET": "Add new widget", + "ADD_NODE": "Add node", + "ADD_OPERATION": "Add operation", + "ADD_RESOURCE": "Add resource", + "ADD_RESOURCES_GROUP": "Add resources group", + "ADD_ROLE": "Add role", + "ADD_ROOM": "Add room", + "ADD_RULE": "Add rule", + "ADD_SCRIPT": "Add script", + "ADD_SENSOR": "Add sensor", + "ADD_TEMPLATE": "Add template", + "ADD_TIMER": "Add timer", + "ADD_UID_TAG_ENTRY": "Add UID tag entry", + "ADD_USER": "Add user", + "ADD_VARIABLE": "Add variable", + "AFTER": "After", + "ALIAS": "Alias", + "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", + "ALLOW_ANONYMOUS": "Allow anonymous", + "ALPHABETICAL_KEY_CASE": "Alphabetical key case", + "ANGULARJS_CUSTOM_CONTROLLERS": "AngularJS custom controllers", + "APP.DESCRIPTION": "The Open Source Controller", + "APP.LOG_IN_TO_MESSAGE": "LOG IN TO MYCONTROLLER.ORG", + "APP.WELCOME_MESSAGE": "Welcome to MyController.org! The Open Source Controller.", + "ARCHITECTURE": "Architecture", + "AREA": "Area", + "AUTH_ID_SID": "Auth id/sid", + "AUTH_TOKEN": "Auth token", + "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", + "AUTORIZED_USER": "Autorized user", + "AUTO_GENERATE": "Auto generate", + "AVAILABLE_PROCESS": "Available Process", + "AVERAGE_TIME": "Average time", + "BACKUP": "Backup", + "BACKUPS_DETAIL": "Backups detail", + "BACKUP_COMPLETED_SUCCESSFULLY": "Backup completed successfully.", + "BACKUP_EVERY": "Backup every", + "BACKUP_FILE_PREFIX": "Backup file prefix", + "BACKUP_LOCATION": "Backup location", + "BACKUP_ON": "Backup on", + "BACKUP_SETTINGS": "Backup settings", + "BAR": "Bar", + "BASIS": "Basis", + "BASIS_CLOSED": "Basis closed", + "BASIS_OPEN": "Basis open", + "BATTERY": "Battery", + "BATTERY_LEVEL": "Battery level", + "BATTERY_USAGE": "Battery usage", + "BAUD_RATE": "Baud rate", + "BINARY_DATA": "Binary data", + "BIND_ADDRESS": "Bind address", + "BLOCKS": "Blocks", + "BLOCKS_SENT": "Blocks sent", + "BOTTOM": "Bottom", + "BROKET_HOST": "Broker host", + "BUILD_JDK": "Build JDK", + "BUILD_TOOL": "Build tool", + "BUILT_ON": "Built on", + "BUNDLE": "Bundle", + "BUTTON_SETTINGS": "Button settings:", + "CANCEL": "Cancel", + "CARDINAL": "Cardinal", + "CARDINAL_CLOSED": "Cardinal closed", + "CARDINAL_OPEN": "Cardinal open", + "CHANNEL_TAGS": "Channel tag(s)", + "CHANNEL_TAGS_COMMA_SEPARATED": "Channel tags comma seperated", + "CHANNEL_USERNAME": "Channel username", + "CLASS_LOADING_DETAILS": "Class Loading Details", + "CLIENT_ID": "Client id", + "CLONE": "Clone", + "COLLECTION_COUNT": "Collection count", + "COLLECTION_TIME": "Collection time", + "COLOR": "Color", + "COMMAND": "Command", + "COMMITTED": "Committed", + "COMMITTED_VIRTUAL_MEMORY_SIZE": "Committed Virtual Memory Size", + "CONDITION": "Condition", + "CONDITION_TYPE": "Condition type", + "CONNECTION_DETAILS": "Connection details", + "CONTENT": "Content", + "CONTINUE": "Continue", + "COUNT": "Count", + "COUNTER": "Counter", + "CRC": "CRC", + "CRON_EXPRESSION": "Cron expression", + "CSS_FILES": "CSS files", + "CURRENT": "Current", + "CURRENT_PASSWORD": "Current password", + "CUSTOM_MESSAGE": "Custom message", + "DAEMON": "Daemon", + "DAILY_ONCE_JOB": "Daily once", + "DAMPENING": "Dampening", + "DAMPENING_TYPE": "Dampening type", + "DASHBOARDS": "Dashboards", + "DASHBOARD_LIMIT": "Maximum dashboards allowed", + "DATA": "Data", + "DATABASE": "Database", + "DATABASE_SCHEMA_REVISION": "Database schema revision", + "DATABASE_TYPE": "Database type", + "DATABASE_VERSION": "Database version", + "DATA_RETENTION_SETTINGS": "Data retention settings", + "DATA_TYPE": "Data type", + "DATA_UNAVAILABLE": "Data unavailable!", + "DATE_PATTERN": "Date pattern", + "DATE_RANGE": "Date range", + "DAY": "Day", + "DAYS": "Days", + "DEFAULT": "Default", + "DEFAULT_FIRMWARE": "Default firmware", + "DEFAULT_TIME_RANGE": "Default time range", + "DELAY_TIME_IN_SECONDS": "Delay time in seconds", + "DELETE": "Delete", + "DELETE_DASHBOARD": "Delete dashboard", + "DELETE_ITEMS": "Delete item(s)", + "DELETE_MESSAGE": "You are about to delete selected item(s)
    Deletion process will remove complete trace of this item(s)!
    Click 'Delete' to proceed.", + "DESCRIPTION": "Description", + "DESTINATION": "Destination", + "DESTINATION_ID": "Destination id", + "DETAILS": "Details", + "DEVICES": "Devices", + "DEVICE_IDENS": "Device iden(s)", + "DEVICE_IDENS_COMMA_SEPARATED": "Device idens comma seperated", + "DIRECTION": "Direction", + "DISABLE": "Disable", + "DISABLED": "Disabled", + "DISABLE_WHEN_TRIGGER": "Disable when trigger", + "DISCOVER": "Discover", + "DISCOVER_INITIATED_SUCCESSFULLY": "Discover initiated successfully", + "DISPLAY_NAMES": "Display names", + "DOCUMENTS": "Documents", + "DOUBLE": "Double", + "DOWN": "Down", + "DRIVER": "Driver", + "EDIT": "Edit", + "EDIT_DASHBOARD": "Edit dashboard", + "EMAIL": "Email", + "EMAILS": "Email(s)", + "EMAIL_ADDRESSES_COMMA_SEPARATED": "Email addresses comma seperated", + "ENABLE": "Enable", + "ENABLED": "Enabled", + "ENABLE_CONFIRMATION": "Enable confirmation", + "ENABLE_DEFAULT_ON_NO_FIRMWARE": "Enable default on no firmware", + "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "When enabled this option, use default firmware, where requested firmware is not available in system", + "ENABLE_EDIT_MODE": "Enable edit mode", + "ENABLE_MIN_MAX": "Enable Min/Max", + "ENABLE_SSL": "Enable SSL", + "ENABLE_UNIQUE_NAME": "Enable unique name", + "ERASE_CONFIGURATION": "Erase configuration", + "ERASE_CONFIGURATION_CONFIRMATION_MESSAGE": "You are about to erase complete configuration of selected items.
    Click 'Erase configuration' to proceed further.", + "ERASE_CONFIGURATION_CONFIRMATION_TITLE": "Erase configuration", + "ERASE_CONFIGURATION_INITIATED": "Erase configuration initiated for selected items", + "ERROR_ITEMS_NOT_AVAILABLE": "Selected item(s) not available!", + "ETHERNET_ALIVE_TEST_FREQUENCY_EXAMPLE": "Example: 120", + "ETHERNET_HOST_NAME_EXAMPLE": "Example: 192.168.1.69", + "ETHERNET_PORT_EXAMPLE": "Example: 5003", + "EUI": "EUI", + "EVALUATIONS": "Evaluations", + "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", + "EXTENSION": "Extension", + "EXTENSIONS": "Extensions", + "EXTERNAL_SERVERS": "External servers", + "EXTERNAL_SERVERS_DETAIL": "External servers detail", + "FAILED_RETRY_COUNT": "Failed retry count", + "FAILURE_COUNT": "Failure count", + "FILE": "File", + "FILE_NAME": "File name", + "FILE_SIZE": "File size", + "FILTER_BY_BLOCKS": "Filter by Blocks", + "FILTER_BY_CONDITION_TYPE": "Filter by Condition type", + "FILTER_BY_DAMPENING_TYPE": "Filter by Dampening type", + "FILTER_BY_DESCRIPTION": "Filter by Description", + "FILTER_BY_DESTINATION_ID": "Filter by Destination id", + "FILTER_BY_DIRECTION": "Filter by Direction", + "FILTER_BY_EMAIL": "Filter by Email", + "FILTER_BY_ENABLED": "Filter by Enabled", + "FILTER_BY_EUI": "Filter by EUI", + "FILTER_BY_EXTENSION": "Filter by Extension", + "FILTER_BY_FILE_NAME": "Filter by File name", + "FILTER_BY_FREQUENCY": "Filter by Frequency", + "FILTER_BY_FULL_NAME": "Filter by Full name", + "FILTER_BY_KEY": "Filter by Key", + "FILTER_BY_LEVEL": "Filter by Level", + "FILTER_BY_LIBRARY_VERSION": "Filter by Library version", + "FILTER_BY_MESSAGE": "Filter by Message", + "FILTER_BY_MESSGAE_TYPE": "Filter by Message type", + "FILTER_BY_NAME": "Filter by Name", + "FILTER_BY_NETWORK_TYPE": "Filter by Network type", + "FILTER_BY_NODE_ID": "Filter by Node id", + "FILTER_BY_OPERATION": "Filter by Operation", + "FILTER_BY_OPERATION_TYPE": "Filter by Operation type", + "FILTER_BY_PAYLOAD_OFF": "Filter by Payload OFF", + "FILTER_BY_PAYLOAD_ON": "Filter by Payload ON", + "FILTER_BY_PERMISSION": "Filter by Permission", + "FILTER_BY_PUBLIC_ACCESS": "Filter by Public access", + "FILTER_BY_RESOURCE": "Filter by Resource", + "FILTER_BY_RESOURCE_TYPE": "Filter by Resource type", + "FILTER_BY_SENSOR_ID": "Filter by Sensor id", + "FILTER_BY_SENSOR_NAME": "Filter by Sensor name", + "FILTER_BY_SENSOR_TYPE": "Filter by Sensor type", + "FILTER_BY_SENSOR_VARIABLES": "Filter by Sensor variables", + "FILTER_BY_SOURCE_ID": "Filter by Source id", + "FILTER_BY_STATUS": "Filter by Status", + "FILTER_BY_STATUS_MESSAGE": "Filter by Status message", + "FILTER_BY_TYPE": "Filter by Type", + "FILTER_BY_TYPE_ID": "Filter by Type id", + "FILTER_BY_UID": "Filter by UID", + "FILTER_BY_USERNAME": "Filter by Username", + "FILTER_BY_VALUE": "Filter by Value", + "FILTER_BY_VALUE2": "Filter by Value #2", + "FILTER_BY_VALUE3": "Filter by Value #3", + "FILTER_BY_VARIABLE_TYPES": "Filter by Variable types", + "FILTER_BY_VERSION": "Filter by Version", + "FILTER_BY_VERSION_ID": "Filter by Version id", + "FIRMWARE": "Firmware", + "FIRMWARES": "Firmwares", + "FIRMWARES_DETAIL": "Firmwares detail", + "FIRMWARE_OTA_STATUS": "Firmware OTA status", + "FIRMWARE_TYPES_DETAIL": "Firmware types detail", + "FIRMWARE_TYPE_NAME": "Firmware type name", + "FIRMWARE_UPLOAD_INITIATED": "Firmware upload initiated for selected items.", + "FIRMWARE_VERSION": "Firmware version", + "FIRMWARE_VERSIONS_DETAIL": "Firmware versions detail", + "FIRST_NAME": "Firstname", + "FIVE_MINUTES_DATA": "Five minutes data", + "FORUM": "Forum", + "FORWARD_PAYLOAD": "Forward payload", + "FORWARD_PAYLOADS_DETAIL": "Forward payloads detail", + "FREE": "Free", + "FREQUENCY": "Frequency", + "FROM": "From", + "FROM_ADDRESS": "From address", + "FROM_PHONE_NUMBER": "From phone number", + "FULL_NAME": "Full name", + "FULL_PATH": "Full path", + "GARBAGE_COLLECTOR": "Garbage Collector", + "GATEWAY": "Gateway", + "GATEWAYS": "Gateways", + "GATEWAYS_DETAIL": "Gateways detail", + "GATEWAY_DETAILS": "Gateway details", + "GATEWAY_NAME": "Gateway name", + "GATEWAY_TYPE": "Gateway type", + "GITTER_MESSAGING": "Gitter messaging", + "GIT_COMMIT_BRANCH": "Git commit:branch", + "GLOBAL_PAGE_REFRESH_TIME": "Global page refresh time", + "GPS_DATA": "GPS data", + "GRANT_ACCESS_TO_CHILD_RESOURCES_IN_ROLES": "Grant access to child resources (in roles)", + "GRAPHS_SETTINGS": "Graphs settings", + "GRAPH_SETTINGS": "Graph settings", + "GROUPS": "Groups", + "GROUP_NAME": "Group name", + "HEAP_MEMORY": "Heap Memory", + "HEIGHT": "Height", + "HIDE_MENU": "Hide menu", + "HISTORICAL_BAR_CHART": "Historical Bar Chart", + "HOST_NAME": "Host name", + "HOURS": "Hours", + "HTML": "HTML", + "HTML_ADDITIONAL_HEADERS": "HTML additional headers", + "HTTP_PORT": "HTTP port", + "ID": "Id", + "IDEN": "Iden", + "IGNORE_CASE": "Ignore case", + "IGNORE_DUPLICATE": "Ignore duplicate", + "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", + "INCLUDE_THRESHOLD_HIGH": "Include threshold high", + "INCLUDE_THRESHOLD_LOW": "Include threshold low", + "INDIVIDUAL_SETTINGS": "Individual settings", + "INIT": "Init", + "INTERPOLATE_TYPE": "Interpolate type", + "INTERVAL": "Interval", + "INTERVAL_IN_SECONDS": "Interval in seconds", + "INVALID_USERNAME_OR_PASSWORD": "Invalid username or password!", + "IN_RANGE": "In range", + "IS_BOT": "Is bot", + "ITEMS_DELETED_SUCCESSFULLY": "Item(s) deleted successfully", + "ITEMS_DISABLED_SUCCESSFULLY": "Item(s) disabled successfully", + "ITEMS_ENABLED_SUCCESSFULLY": "Item(s) enabled successfully", + "ITEMS_PER_ROW": "Items per row", + "ITEM_CREATED_SUCCESSFULLY": "Item created successfully", + "ITEM_UPDATED_SUCCESSFULLY": "Item updated successfully", + "JAVA_HOME": "Java Home", + "JAVA_VENDOR_URL": "Java Vendor Url", + "JAVA_VIRTUAL_MACHINE_SPECIFICATION": "Java Virtual Machine Specification", + "JSON": "JSON", + "KEY": "Key", + "KEY_FORMAT": "Key format", + "LANGUAGE": "Language", + "LANGUAGE_VERSION": "Language version", + "LAST_5_MINUTES": "Last 5 minutes", + "LAST_6_HOURS": "Last 6 hours", + "LAST_12_HOURS": "Last 12 hours", + "LAST_DAY": "Last day", + "LAST_EXECUTION": "Last execution", + "LAST_FIRED": "Last fired", + "LAST_GARBAGECOLLECTOR_DURATION": "Last GC duration", + "LAST_HOUR": "Last hour", + "LAST_MESSAGE": "Last message", + "LAST_MINUTE_AVERAGE": "Last minute average", + "LAST_MINUTE_RATE": "Last minute rate", + "LAST_MODIFIED": "Last modified", + "LAST_MONTH": "Last month", + "LAST_SEEN": "Last seen", + "LAST_TRIGGER": "Last trigger", + "LAST_WEEK": "Last week", + "LAST_YEAR": "Last year", + "LATITUDE": "Latitude", + "LEFT": "Left", + "LEVEL": "Level", + "LIBRARY_VERSION": "Library version", + "LINE": "Line", + "LINEAR": "Linear", + "LINE_CHART": "Line chart", + "LOAD": "Load", + "LOADED": "Loaded", + "LOADING": "Loading...", + "LOCATION": "Location", + "LOCATION_IP": "Location IP", + "LOCATION_NAME": "Location name", + "LOGIN_MESSAGE": "Login message", + "LOGS": "Logs", + "LOG_DIRECTION": "Log direction", + "LOG_IN": "Log In", + "LOG_LEVEL": "Log level", + "LOG_OUT": "Log Out", + "LONGITUDE": "Longitude", + "LOWER": "Lower", + "MANAGEMENT_SPECIFICATION_VERSION": "Management Specification Version", + "MARGIN": "Margin", + "MARKDOWN": "Markdown", + "MAX": "Max", + "MAXIMUM_BLOCK_SIZE": "Maximum block size", + "MEASUREMENT": "Measurement", + "MERGE_STATIONS": "Merge stations", + "MESSAGE": "Message", + "MESSAGES_IN_QUEUE": "Messages in queue", + "MESSAGE_CONTAINS": "Message contains", + "MESSAGE_TYPE": "Message type", + "METRIC": "Metric", + "METRICS": "Metrics", + "METRICS_AGGREGATION_JOB": "Metrics aggregation", + "METRIC_ENGINE": "Metric engine", + "METRIC_ENGINE_DIALOG_CONFIRMATION_MSG": "You are about to change metrics data backend engine settings.
    This action will lead data loss. Read user manual for further details.
    MyController will not import/export metric data when switching metric engine!", + "METRIC_TYPE": "Metric type", + "MILLISECONDS": "Milliseconds", + "MILLISECONDS_SHORT": "ms", + "MINIMUM_HEIGHT": "Minimum height", + "MINIMUM_WIDTH": "Minimum width", + "MINUTES": "Minutes", + "MIN_MAX": "Min/Max", + "MODIFIY_SENSOR_VARIABLES_MAPPING": "Modify sensor and variables mapping", + "MONOTONE": "Monotone", + "MQTT_BROKER": "MQTT broker", + "MQTT_BROKER_DISABLED_BACKEND": "MQTT broker has been disabled on the back-end. You shold enable it on the file: conf/mycontroller.properties and restart MyController server.", + "MQTT_BROKER_EDIT_CONFIRMATION_MSG": "You are about to change MQTT broker settings.
    This action leads, MQTT broker service restart with new settings.", + "MQTT_BROKER_EDIT_DIALOG": "MQTT broker settings", + "MQTT_BROKER_HOST_EXAMPLE": "Example: tcp://localhost:1883", + "MQTT_CLIENT_ID_EXAMPLE": "Example: mycontroller-mqtt-client", + "MQTT_PORT": "MQTT port", + "MQTT_TOPIC_PUBLISH_EXAMPLE": "Example: mygateway-in", + "MQTT_TOPIC_SUBSCRIBE_EXAMPLE": "Example: mygateway-out", + "MYCONTROLLER_SERVER_LOG": "MyController server log", + "MY_CONTROLLER": "MyController", + "MY_SENSORS": "MySensors", + "NAME": "Name", + "NETWORK": "Network", + "NETWORK_TYPE": "Network type", + "NEVER": "Never", + "NEW": "New", + "NEW_DASHBOARD": "New dashboard", + "NEW_PASSWORD": "New password", + "NEXT_EXECUTION": "Next execution", + "NO": "No", + "NODE": "Node", + "NODES": "Nodes", + "NODES_ALIVE_CHECK_INTERVAL": "Nodes alive check interval", + "NODES_DETAIL": "Nodes detail", + "NODE_DETAILS": "Node details", + "NODE_EUI": "Node EUI", + "NODE_ID": "Node id", + "NODE_NAME": "Node name", + "NODE_STATUS": "Node status", + "NODE_TYPE": "Node type", + "NON_HEAP_MEMORY": "Non Heap Memory", + "NOTHING_SELECTED": "Nothing selected", + "NOTIFICATIONS": "Notifications", + "NOT_SET": "Not set", + "NO_ACK": "No ack", + "NO_BACKUPS_SETUP": "No backups set up.", + "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", + "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", + "NO_FIRMWARES_SETUP": "No firmwares set up.", + "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", + "NO_FIRMWARE_VERSIONS_SETUP": "No firmware versions set up", + "NO_FORWARD_PAYLOADS_SETUP": "No forward payloads set up.", + "NO_GATEWAYS_SETUP": "No gateways set up.", + "NO_ITEMS_IN_FILTER": "Oops! No results found. Modify your query.", + "NO_ITEMS_SETUP": "No items set up!", + "NO_LOGS_AVAILABLE": "No logs available.", + "NO_NODES_SETUP": "No nodes set up.", + "NO_OPERATIONS_SETUP": "No operations set up.", + "NO_RESOURCES_DATA_SETUP": "No resources data setup.", + "NO_RESOURCE_GROUPS_MAP_SETUP": "No resources mapped with this group.", + "NO_RESOURCE_GROUPS_SETUP": "No resource groups set up.", + "NO_ROOMS_SETUP": "No rooms set up.", + "NO_RULES_SETUP": "No rules set up.", + "NO_SCRIPTS_SETUP": "No scripts set up.", + "NO_SENSORS_SETUP": "No sensors set up.", + "NO_TEMPLATES_SETUP": "No templates set up.", + "NO_TIMERS_SETUP": "No timers set up.", + "NO_UID_TAGS_SETUP": "No UID tags setup.", + "NO_VARIABLES_SETUP": "No variables set up.", + "OCCURRENCES": "Occurrences", + "OFF": "OFF", + "OFFSET": "Offset", + "ON": "ON", + "ONE_DAY_DATA": "One day data", + "ONE_HOUR_DATA": "One hour data", + "ONE_MINUTE_DATA": "One minute data", + "OPERATING_SYSTEM": "Operating System", + "OPERATION": "Operation", + "OPERATIONS": "Operations", + "OPERATIONS_DETAIL": "Operations detail", + "OPERATION_NAME": "Operation name", + "OPERATION_TYPE": "Operation type", + "OS_COMMAND_EXECTION_CONFIRMATION_MESSAGE": "Would you like to execute the following command on MyController server base Operating System?", + "OS_COMMAND_EXECTION_CONFIRMATION_TITLE": "Execute Operating System command", + "OTHERS": "Others", + "PARENT": "Parent", + "PARENT_NODE_EUI": "Parent node EUI", + "PARSE_MODE": "Parse mode", + "PASSWORD": "Password", + "PATTERN": "Pattern", + "PAYLOAD": "Payload", + "PAYLOAD_DELAY": "Payload / Delay", + "PAYLOAD_OFF": "Payload OFF", + "PAYLOAD_ON": "Payload ON", + "PEAK": "Peak", + "PERCENTAGE": "Percentage", + "PERMISSION": "Permission", + "PHONE_NUMBERS": "Phone numbers", + "PHONE_NUMBERS_COMMA_SEPARATED": "Phone numbers comma separated", + "PHYSICAL_MEMORY": "Physical Memory (RAM)", + "PLIVO": "Plivo", + "POLL_FREQUENCY_MINUTES": "Poll frequency (minutes)", + "PORT": "Port", + "PORT_NAME": "Port name", + "PRIORITY": "Priority", + "PRIVATE": "Private", + "PRIVATE_KEY": "Private key", + "PROCESS_CPU": "Process CPU", + "PROFILE": "Profile", + "PROFILE_UPDATED_SUCCESSFULLY": "Profile updated successfully", + "PROPERTIES": "Properties", + "PUBLIC": "Public", + "PUBLIC_ACCESS": "Public access", + "PUBLIC_KEY": "Public key", + "PURGE": "Purge", + "PURGE_BEFORE": "Purge before", + "PURGE_DONE_SUCCESSFULLY": "Purge completed successfully.", + "PURGE_EXISTING_DATA": "Purge existing data", + "PURGE_RESOURCES_LOGS": "Purge resources logs", + "PURGE_SENSOR_VARIABLE": "Purge sensor variable", + "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", + "PURGE_WARNING": "WARNING: If you don't select any parameter, this process will delete everything!", + "PURGING": "Purging", + "PUSHBULLET": "Pushbullet", + "QOS": "QoS", + "QOS_0": "At most once (0)", + "QOS_1": "At least once (1)", + "QOS_2": "Exactly once (2)", + "RAW_DATA": "Raw data", + "READ_ONLY": "Read only", + "REALTIME": "Realtime", + "REBOOT": "Reboot", + "REBOOT_CONFIRMATION_MESSAGE": "You are about to reboot selected items
    Click 'Reboot' to proceed.", + "REBOOT_CONFIRMATION_TITLE": "Reboot", + "REBOOT_INITIATED": "Reboot initiated for selected items.", + "RECONNECT_DELAY": "Reconnect delay", + "RECORDS_LIMIT": "Records limit", + "REFRESH": "Refresh", + "REFRESH_NODES_INFO": "Refresh nodes info", + "REFRESH_NODES_INFO_INITIATED_SUCCESSFULLY": "'Refresh nodes info' initiated successfully.", + "REFRESH_TIME_SECONDS": "Refresh time (seconds)", + "REGISTER_NODES_AUTOMATICALLY": "Register nodes automatically", + "REGISTRATION_STATUS": "Registration status", + "RELEASES": "Releases", + "RELOAD": "Reload", + "RELOAD_INITIATED_SUCCESSFULLY": "Reload initiated successfully", + "RESOURCE": "Resource", + "RESOURCES": "Resources", + "RESOURCES_DATA": "Resources data", + "RESOURCES_DATA_DETAIL": "Resources data detail", + "RESOURCES_GROUPS": "Resources groups", + "RESOURCES_LOGS": "Resources logs", + "RESOURCES_LOGS_AGGREGATION_JOB": "ResourcesLogs Aggregation", + "RESOURCES_LOGS_DETAIL": "Resources logs detail", + "RESOURCES_LOG_LEVEL": "Resources logs level", + "RESOURCES_LOG_RETENTION_DURATION": "Resources logs retention duration", + "RESOURCE_GROUPS_DETAIL": "Resource groups detail", + "RESOURCE_GROUPS_MAPS_DETAIL": "Resources groups maps detail", + "RESOURCE_GROUPS_TURNED_OFF": "Resource groups turned OFF", + "RESOURCE_GROUPS_TURNED_ON": "Resource groups turned ON", + "RESOURCE_GROUP_TURNED_OFF": "Resource group turned OFF", + "RESOURCE_GROUP_TURNED_ON": "Resource group turned ON", + "RESOURCE_TYPE": "Resource type", + "RESTORE": "Restore", + "RESTORE_CONFIRMATION_MESSAGE": "You are about to restore system to '{{name}}'.
    Restore removes current data/configuration completely and system goes to '{{name}}' state!
    Click 'Restore' to proceed.
    NOTE: After successful restore you have to start the server manually from command line", + "RESTORE_CONFIRMATION_TITLE": "Restore system to '{{name}}'", + "RESTORE_INITIATED_SUCCESSFULLY": "Restore initiated successfully.", + "RESULT": "Result", + "RETAIN_MAX": "Retain maximum #", + "RETENTION_DIALOG_CONFIRMATION_MSG": "You are about to change metrics data retention settings.
    This action may lead data loss. Read user manual for further details.
    It is highly recommend a system backup before moving forward!", + "RETENTION_DIALOG_TITLE": "Read carefully before moving forward", + "RE_ENABLE": "Re enable", + "RIGHT": "Right", + "ROLES": "Roles", + "ROLES_DETAIL": "Roles detail", + "ROOM": "Room", + "ROOMS": "Rooms", + "ROOMS_DETAIL": "Rooms detail", + "ROOM_NAME": "Room name", + "RULES": "Rules", + "RULES_DETAIL": "Rules detail", + "RULE_DEFINITION_ENGINE_JOB": "Rule definition engine", + "RULE_DEFINITION_RE_ENABLE_JOB": "Rule definition re-enable", + "RULE_NAME": "Rule name", + "RUN": "Run", + "RUNNING": "Running...", + "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", + "RUN_GARBAGE_COLLECTION": "Run garbage collection", + "RUN_NOW": "Run now", + "SAVE": "Save", + "SAVE_CHANGES": "Save changes", + "SAVING": "Saving...", + "SCRIPT": "Script", + "SCRIPTS": "Scripts", + "SCRIPTS_DETAIL": "Scripts detail", + "SCRIPT_BINDINGS": "Script bindings", + "SCRIPT_ENGINES": "Script engines", + "SCRIPT_FILES": "Script files", + "SEARCH": "Search", + "SECONDS": "Seconds", + "SELECT": "Select", + "SEND": "Send", + "SENDING": "Sending...", + "SEND_RAW_MESSAGE": "Send raw message", + "SENSOR": "Sensor", + "SENSORS": "Sensors", + "SENSORS_ACTION": "Sensors action", + "SENSORS_AND_VARIABLES_MAPPING": "Sensors and variables mapping", + "SENSORS_DETAIL": "Sensors detail", + "SENSOR_DETAILS": "Sensor details", + "SENSOR_ID": "Sensor id", + "SENSOR_NAME": "Sensor name", + "SENSOR_TYPE": "Sensor type", + "SENSOR_VARIABLE": "Sensor variable", + "SENSOR_VARIABLES": "Sensor variables", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Would you like to send the following payload to the selected resource?", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Send payload confirmation", + "SENSOR_VARIABLE_TYPE": "Sensor variable type", + "SERIAL_BAUD_RATE_EXAMPLE": "Example: 115200", + "SERIAL_PORT_NAME_EXAMPLE": "Example: /dev/ttyUSB0", + "SERIAL_RETRY_FREQUENCY_EXAMPLE": "Example: 120", + "SETTINGS": "Settings", + "SHOW_ICON": "Show icon", + "SHOW_LEGENDS": "Show legends", + "SHOW_MENU": "Show menu", + "SIX_HOURS_DATA": "Six hours data", + "SMART_SLEEP_ENABLED": "Smart sleep enabled", + "SMS": "SMS", + "SMTP_HOST": "SMTP host", + "SMTP_PASSWORD": "SMTP password", + "SMTP_PORT": "SMTP port", + "SMTP_USERNAME": "SMTP username", + "SOURCE": "Source", + "SOURCE_CODE": "Source code", + "SOURCE_ID": "Source id", + "SPECIFICATION_VENDOR": "Specification Vendor", + "SPECIFICATION_VERSION": "Specification Version", + "STACKED_AREA_CHART": "Stacked area chart", + "STATION_ID": "Station id", + "STATION_PASSWORD": "Station password", + "STATISTICS": "Statistics", + "STATUS": "Status", + "STATUS_MESSAGE": "Status message", + "STATUS_SINCE": "Status since", + "STEP_AFTER": "Step after", + "STEP_BEFORE": "Step before", + "STREAM_ACK_ENABLED": "Stream ack enabled", + "SUBJECT": "Subject", + "SUB_TYPE": "Sub type", + "SUNRISE": "Sunrise", + "SUNSET": "Sunset", + "SUPPORT": "Support", + "SWAP": "Swap", + "SWAP_SPACE": "Swap Space", + "SYNTAX_ERROR": "Syntax error", + "SYSTEM": "System", + "SYSTEM_CPU_LOAD": "System Cpu Load", + "SYSTEM_JOBS": "System jobs", + "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "You are about to change system internal jobs. This cron expression is a bit different than Linux cron expression.
    This action may lead to incorrect schedule, poor performance, etc., Read user manual for further details.
    It is highly recommend a system backup before moving forward!
    Cron expression documentation", + "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "Read carefully before moving forward", + "SYSTEM_LOAD_AVERAGE": "System Load Average", + "SYSTEM_STATUS": "System status", + "S_VARIABLE_DIALOG_CONFIRMATION_MSG": "You are about to update configurations of a 'Sensor variable'.
    When updating configurations, if there is a change in 'Metric type', all existing data will be removed from this 'Sensor variable'!", + "S_VARIABLE_DIALOG_TITLE": "Update 'Sensor variable' configurations", + "TABLE_ROWS_LIMIT": "Table rows limit", + "TAGS": "Tags", + "TELEGRAM_BOT": "Telegram bot", + "TEMPLATE": "Template", + "TEMPLATES": "Templates", + "TEMPLATES_DETAIL": "Templates detail", + "TEMPLATE_BINDINGS": "Template bindings", + "TENANT": "Tenant", + "TESTING": "Testing...", + "TEST_CONNECTION": "Test connection", + "TEXT": "Text", + "THREADS_COUNT": "Threads count", + "THRESHOLD_VALUE": "Threshold value", + "THRESHOLD_VALUE_HIGH": "Threshold value high", + "THRESHOLD_VALUE_LOW": "Threshold value low", + "TIME": "Time", + "TIMERS": "Timers", + "TIMERS_DETAIL": "Timers detail", + "TIMER_NAME": "Timer name", + "TIMER_TYPE": "Timer type", + "TIME_FORMAT": "Time format", + "TIME_HH_MM_SS": "Time(HH:mm:ss)", + "TIME_OFFSET_HH_MM_SS": "Time offset (HH:mm:ss)", + "TIME_RANGE": "Time range", + "TIME_TAKEN_LAST_UPDATE": "Last update(time taken)", + "TITLE": "Title", + "TO": "To", + "TOKEN": "Token", + "TOP": "Top", + "TOPICS_PUBLISH": "Topics publish", + "TOPICS_SUBSCRIBE": "Topics subscribe", + "TOPIC_PUBLISH": "Topic publish", + "TOPIC_SUBSCRIBE": "Topic subscribe", + "TOPOLOGY": "Topology", + "TOTAL": "Total", + "TOTAL_LOADED": "Total loaded", + "TOTAL_STARTED": "Total started", + "TRANSMIT_DELAY": "Transmit delay", + "TRIGGER_WHEN": "Trigger when", + "TRUST_HOST": "Trust host", + "TURN_OFF": "Turn OFF", + "TURN_ON": "Turn ON", + "TWELVE_HOURS_DATA": "Twelve hours data", + "TWILIO": "Twilio", + "TYPE": "Type", + "TYPES": "Types", + "TYPE_ID": "Type id", + "UID": "UID", + "UID_TAGS": "UID tags", + "UID_TAGS_DETAIL": "UID tags detail", + "UNAVAILABLE": "Unavailable", + "UNDO_CHANGES": "Undo changes", + "UNIT": "Unit", + "UNITS": "Units", + "UNITS_CONFIGURATION": "Units configuration", + "UNITS_METRICS_IMPERIAL": "Units [Metrics/Imperial]", + "UNLOADED": "Unloaded", + "UP": "Up", + "UPDATE": "Update", + "UPDATED_SUCCESSFULLY": "Updated successfully.", + "UPDATE_AN_ENTRY": "Update an entry", + "UPDATE_EXTERNAL_SERVER": "Update external server", + "UPDATE_FIRMWARE": "Update firmware", + "UPDATE_FIRMWARE_TYPE": "Update firmware type", + "UPDATE_FIRMWARE_VERSION": "Update firmware version", + "UPDATE_FORWARD_PAYLOAD_ENTRY": "Update forward payload entry", + "UPDATE_GATEWAY": "Update gateway", + "UPDATE_NODE": "Update node", + "UPDATE_OPERATION": "Update operation", + "UPDATE_RESOURCE": "Update resource", + "UPDATE_RESOURCES_GROUP": "Update resources group", + "UPDATE_ROOM": "Update room", + "UPDATE_RULE": "Update rule", + "UPDATE_SCRIPT": "Update script", + "UPDATE_SENSOR": "Update sensor", + "UPDATE_SENSOR_VARIABLE": "Update sensor variable", + "UPDATE_TEMPLATE": "Update template", + "UPDATE_TIMER": "Update timer", + "UPDATE_UID_TAG_ENTRY": "Update UID tag entry", + "UPDATE_USER": "Update user", + "UPDATE_VARIABLE": "Update variable", + "UPLOADED_ON": "Uploaded on", + "UPLOAD_FIRMWARE": "Upload firmware", + "UPPER": "Upper", + "UPPER_LIMIT": "Upper limit", + "UP_TIME": "Up Time", + "URL": "URL", + "USE": "Use", + "USED": "Used", + "USERNAME": "Username", + "USERS": "Users", + "USERS_DETAIL": "Users detail", + "USER_WORKING_DIRECTORY": "User working directory", + "USE_GLOBAL": "Use global", + "USE_INTERACTIVE_GUIDE_LINE": "Use interactive guide line", + "UTILITIES": "Utilities", + "VALIDATION_ERROR_NO_SPACE_ALLOWED": "No space allowed.", + "VALIDATION_ERROR_NUMBER": "The value entered is not a number.", + "VALIDITY": "Validity", + "VALUE": "Value", + "VALUE2": "Value #2", + "VALUE3": "Value #3", + "VARIABLES": "Variables", + "VARIABLES_DETAIL": "Variables detail", + "VARIABLES_GRAPHICAL_VIEW": "Variables graphical view", + "VARIABLES_MAPPER": "Variables mapper", + "VARIABLES_REPOSITORY": "Variables repository", + "VARIABLE_TYPES": "Variable types", + "VENDOR": "Vendor", + "VERSION": "Version", + "VERSIONS": "Versions", + "VERSION_ID": "Version id", + "VERSION_KERNEL": "Version/Kernel", + "VIEW_DETAILS": "View details", + "VM_NAME": "VM Name", + "VM_VENDOR": "VM Vendor", + "VM_VERSION": "VM Version", + "WEBSOCKET_PORT": "Websocket port", + "WIDGET_IMAGE_FILES_DISK_LOCATION": "Widget image files disk location", + "WRITE_API_KEY": "Write API key", + "YEARS": "Years", + "YES": "Yes" +} \ No newline at end of file diff --git a/dist/src/main/package/www/languages/mc_locale_gui-ro_ro.json b/dist/src/main/package/www/languages/mc_locale_gui-ro_ro.json index 474ac5e1..f9b9a4c6 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-ro_ro.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-ro_ro.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Panou acțiuni", "ACTIVE": "Activ", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Adaugă o înregistrare", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Adaugă firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Adaugă etichetă UID", "ADD_USER": "Adaugă utilizator", "ADD_VARIABLE": "Adaugă variabilă", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Frecvența verificare stare (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Id/Sid de autentificare", "AUTH_TOKEN": "Tichet de autentificare", "AUTOMATIC_BACKUP_SETTINGS": "Setări copii de siguranță automate", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generat", "AVAILABLE_PROCESS": "Procese disponibile", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluări", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extensie", "EXTENSIONS": "Extensii", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignoră capitalizarea literelor", "IGNORE_DUPLICATE": "Ignoră duplicatele", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include prag superior", "INCLUDE_THRESHOLD_LOW": "Include prag inferior", "INDIVIDUAL_SETTINGS": "Setări individuale", @@ -412,6 +426,7 @@ "NO_ACK": "Fără ack", "NO_BACKUPS_SETUP": "Copiile de siguranță neconfigurate.", "NO_DATA_AVAILABLE": "Nu există date disponibile.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "Nici un firmware configurat.", "NO_FIRMWARE_TYPES_SETUP": "Nici un tip de firmware configurat.", @@ -552,6 +567,7 @@ "RUN": "Rulează", "RUNNING": "Rulează...", "RUN_BACKUP": "Rulează copia de siguranță", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Rulează gestionarul de memorie (GC)", "RUN_NOW": "Rulează acum", "SAVE": "Salvează", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json b/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json index 936aab05..456b9f33 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Панель действий", "ACTIVE": "Включен", "ADD": "Добавить", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Добавить запись", "ADD_EXTERNAL_SERVER": "Добавить внешний сервер", "ADD_FIRMWARE": "Добавить прошивку", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Добавить запись UID тэга", "ADD_USER": "Добавить пользователя", "ADD_VARIABLE": "Добавить переменную", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "После", "ALIAS": "Псевдоним", "ALIVE_TEST_FREQUENCY": "Интервал проверки датчиков (секунды)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "id/sid авторизации", "AUTH_TOKEN": "Токен авторизации", "AUTOMATIC_BACKUP_SETTINGS": "Настройки автоматического резервного копирования", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Авторизованный пользователь", "AUTO_GENERATE": "Автогенерация", "AVAILABLE_PROCESS": "Доступные процессы", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Оценки", "EXECUTE_DISCOVER_INTERVAL": "Интервал поиска", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Расширения", "EXTENSIONS": "Расширения", "EXTERNAL_SERVERS": "Внешние серверы", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Игнорировать регистр", "IGNORE_DUPLICATE": "Игнорировать дубликаты", "IMPERIAL": "Имперская система измерения", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Включая верхний порог", "INCLUDE_THRESHOLD_LOW": "Включая нижний порог", "INDIVIDUAL_SETTINGS": "Индивидуальные параметры настройки", @@ -412,6 +426,7 @@ "NO_ACK": "нет ack", "NO_BACKUPS_SETUP": "Никаких резервных копий не создано.", "NO_DATA_AVAILABLE": "Нет данных", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "Не настроенны внешние сервера", "NO_FIRMWARES_SETUP": "Никаких прошивок не установлено.", "NO_FIRMWARE_TYPES_SETUP": "Нет настройки типов прошивки.", @@ -552,6 +567,7 @@ "RUN": "Запустить", "RUNNING": "Исполняется", "RUN_BACKUP": "Выполнить резервное копирование", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Выполнить сборку мусора", "RUN_NOW": "Выполнить сейчас", "SAVE": "Сохранить", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-sk_sk.json b/dist/src/main/package/www/languages/mc_locale_gui-sk_sk.json index 202c8a4d..021ebde0 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-sk_sk.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-sk_sk.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Action board", "ACTIVE": "Active", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Add user", "ADD_VARIABLE": "Add variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Save", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-ta_in.json b/dist/src/main/package/www/languages/mc_locale_gui-ta_in.json index 21b2cf58..a11ae529 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-ta_in.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-ta_in.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "நடவடிக்கை பலகை", "ACTIVE": "செயலில்", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "புதிதாக சேர்க்க", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "மென்பொருள் சேர்க்க", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "UID குறிச்சொல் சேர்க்க", "ADD_USER": "பயனரை சேர்க்க", "ADD_VARIABLE": "மாறி சேர்க்க", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "மறுபெயர்", "ALIVE_TEST_FREQUENCY": "உயிருடன் உள்ளதா சோதனை (வினாடிகளில்)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "அங்கீகார Id", "AUTH_TOKEN": "அங்கீகார டோக்கன்", "AUTOMATIC_BACKUP_SETTINGS": "தானியங்கி காப்பு அமைப்புகள்", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "தானாக உருவாக்க", "AVAILABLE_PROCESS": "செயல்பாட்டில் உள்ளவை", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "மதிப்பாய்வு", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "சேமிக்க", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-zh_cn.json b/dist/src/main/package/www/languages/mc_locale_gui-zh_cn.json index d4733525..9e91bf58 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-zh_cn.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-zh_cn.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "操作板块", "ACTIVE": "活动", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "添加条目", "ADD_EXTERNAL_SERVER": "添加外部服务器", "ADD_FIRMWARE": "添加固件", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "添加 UID 标记项", "ADD_USER": "添加用户", "ADD_VARIABLE": "添加变量", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "后", "ALIAS": "别名", "ALIVE_TEST_FREQUENCY": "在线确认检查频率 (秒)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "身份验证 id/sid", "AUTH_TOKEN": "身份验证令牌", "AUTOMATIC_BACKUP_SETTINGS": "自动备份设置", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "自动生成", "AVAILABLE_PROCESS": "可用的进程", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "诊断", "EXECUTE_DISCOVER_INTERVAL": "执行“发现”间隔", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "扩展", "EXTENSIONS": "扩展", "EXTERNAL_SERVERS": "外部服务器", @@ -287,6 +297,10 @@ "IGNORE_CASE": "忽略大小写", "IGNORE_DUPLICATE": "忽略重复", "IMPERIAL": "英制", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "包含最高阈值", "INCLUDE_THRESHOLD_LOW": "包含最低阈值", "INDIVIDUAL_SETTINGS": "个人设置", @@ -412,6 +426,7 @@ "NO_ACK": "没有 ack", "NO_BACKUPS_SETUP": "未设置任何备份。", "NO_DATA_AVAILABLE": "没有可用的数据。", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "没有外部服务安装程序。", "NO_FIRMWARES_SETUP": "未设置任何固件。", "NO_FIRMWARE_TYPES_SETUP": "未设置任何固件类型。", @@ -552,6 +567,7 @@ "RUN": "运行", "RUNNING": "正在运行...", "RUN_BACKUP": "运行备份", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "运行垃圾回收", "RUN_NOW": "立即运行", "SAVE": "保存", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json b/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json index a07d1d7d..858cf3df 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-zh_tw.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "操作板", "ACTIVE": "啟用", "ADD": "新增", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "要加載的其他AngularJS模塊", "ADD_AN_ENTRY": "新增項目", "ADD_EXTERNAL_SERVER": "新增外部伺服器", "ADD_FIRMWARE": "新增韌體", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "新增 UID 標記項目", "ADD_USER": "新增使用者", "ADD_VARIABLE": "新增變數", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "要加載的其他AngularJS模塊", "AFTER": "後", "ALIAS": "別名", "ALIVE_TEST_FREQUENCY": "線上檢核頻率(秒)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "身份驗證 id/sid", "AUTH_TOKEN": "身份驗證權杖", "AUTOMATIC_BACKUP_SETTINGS": "自動備份設定", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "已獲授權使用者", "AUTO_GENERATE": "自動產生", "AVAILABLE_PROCESS": "可用的程序", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "評估", "EXECUTE_DISCOVER_INTERVAL": "執行 discover 間隔", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "擴展", "EXTENSIONS": "擴展", "EXTERNAL_SERVERS": "外部伺服器", @@ -287,6 +297,10 @@ "IGNORE_CASE": "忽略大小寫", "IGNORE_DUPLICATE": "忽略重複", "IMPERIAL": "英制", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "包含最高閾值", "INCLUDE_THRESHOLD_LOW": "包含最低閾值", "INDIVIDUAL_SETTINGS": "個人設置", @@ -412,6 +426,7 @@ "NO_ACK": "沒有 ack", "NO_BACKUPS_SETUP": "未設置任何備份。", "NO_DATA_AVAILABLE": "沒有可用的資料。", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "沒有外部服務安裝程式。", "NO_FIRMWARES_SETUP": "未設置任何硬體。", "NO_FIRMWARE_TYPES_SETUP": "未設置任何硬體類型。", @@ -552,6 +567,7 @@ "RUN": "運行", "RUNNING": "正在運行...", "RUN_BACKUP": "運行備份", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "運行垃圾回收", "RUN_NOW": "立即運行", "SAVE": "儲存", diff --git a/dist/src/main/package/www/languages/mc_locale_gui_source_en.json b/dist/src/main/package/www/languages/mc_locale_gui_source_en.json index 54530f0f..56fcbac0 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui_source_en.json +++ b/dist/src/main/package/www/languages/mc_locale_gui_source_en.json @@ -14,6 +14,7 @@ "ACTION_BOARD": "Action board", "ACTIVE": "Active", "ADD": "Add", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "ADD_AN_ENTRY": "Add an entry", "ADD_EXTERNAL_SERVER": "Add external server", "ADD_FIRMWARE": "Add firmware", @@ -37,7 +38,6 @@ "ADD_UID_TAG_ENTRY": "Add UID tag entry", "ADD_USER": "Add user", "ADD_VARIABLE": "Add variable", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", "AFTER": "After", "ALIAS": "Alias", "ALIVE_TEST_FREQUENCY": "Alive check frequency (seconds)", @@ -52,6 +52,7 @@ "AUTH_ID_SID": "Auth id/sid", "AUTH_TOKEN": "Auth token", "AUTOMATIC_BACKUP_SETTINGS": "Automatic backup settings", + "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", "AUTORIZED_USER": "Autorized user", "AUTO_GENERATE": "Auto generate", "AVAILABLE_PROCESS": "Available Process", @@ -181,6 +182,15 @@ "EUI": "EUI", "EVALUATIONS": "Evaluations", "EXECUTE_DISCOVER_INTERVAL": "Execute discover interval", + "EXPORT": "Export", + "EXPORTS_DETAIL": "Exports detail", + "EXPORT_EVERY": "Export every", + "EXPORT_FILE_PREFIX": "Export file prefix", + "EXPORT_LOCATION": "Export location", + "EXPORT_ON": "Exported on", + "EXPORT_ROW_LIMIT": "Row limit / per file", + "EXPORT_SETTINGS": "Export settings", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", "EXTENSION": "Extension", "EXTENSIONS": "Extensions", "EXTERNAL_SERVERS": "External servers", @@ -287,6 +297,10 @@ "IGNORE_CASE": "Ignore case", "IGNORE_DUPLICATE": "Ignore duplicate", "IMPERIAL": "Imperial", + "IMPORT": "Import", + "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", + "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", "INCLUDE_THRESHOLD_HIGH": "Include threshold high", "INCLUDE_THRESHOLD_LOW": "Include threshold low", "INDIVIDUAL_SETTINGS": "Individual settings", @@ -412,6 +426,7 @@ "NO_ACK": "No ack", "NO_BACKUPS_SETUP": "No backups set up.", "NO_DATA_AVAILABLE": "No data available.", + "NO_EXPORTS_SETUP": "No export files available.", "NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.", "NO_FIRMWARES_SETUP": "No firmwares set up.", "NO_FIRMWARE_TYPES_SETUP": "No firmware types setup.", @@ -552,6 +567,7 @@ "RUN": "Run", "RUNNING": "Running...", "RUN_BACKUP": "Run backup", + "RUN_EXPORT": "Run export", "RUN_GARBAGE_COLLECTION": "Run garbage collection", "RUN_NOW": "Run now", "SAVE": "Save", diff --git a/dist/src/main/package/www/partials/export/automatic-export-settings.html b/dist/src/main/package/www/partials/export/automatic-export-settings.html new file mode 100644 index 00000000..e3caeeae --- /dev/null +++ b/dist/src/main/package/www/partials/export/automatic-export-settings.html @@ -0,0 +1,126 @@ + +
    + + +
    +
    +
    + +
    + + +
    +
    +

    {{ 'EXPORT_SETTINGS' | translate }}

    +
    +
    + +
    + +
    + +
    {{item.exportLocation}}
    +
    +
    + + {{ 'AUTOMATIC_EXPORT_SETTINGS' | translate }} + +
    + +
    + +
    +
    + +
    +
    + +
    + + {{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }} +
    {{item.prefix}}
    +
    +
    + +
    + +
    + + {{ 'VALIDATION_ERROR_NUMBER' | translate }} +
    {{item.rowLimit}}
    +
    +
    + +
    + +
    + + {{ 'VALIDATION_ERROR_NUMBER' | translate }} +
    +
    +
    {{$parent.intervalLocal}} {{$parent.intervalTimeConstantString}}
    +
    +
    + +
    +
    + +
    + +
    + + {{ 'VALIDATION_ERROR_NUMBER' | translate }} +
    {{item.retainMax}}
    +
    +
    +
    + +
    +
    + +
    +
    {{item.nextFire | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}
    +
    +
    +
    + +
    + +
    + + + +
    +
    +
    +
    + +
    +
    diff --git a/dist/src/main/package/www/partials/export/export-list.html b/dist/src/main/package/www/partials/export/export-list.html new file mode 100644 index 00000000..4c5c0a91 --- /dev/null +++ b/dist/src/main/package/www/partials/export/export-list.html @@ -0,0 +1,95 @@ + + +
    + + +
    +
    +
    + +
    + + +
    + +
    + + + +
    +
    +
    + +
    +
    + + +
    + + +
    + +
    + + + + + + + + + + + + + + + + +
    {{ 'FILE_NAME' | translate }}{{ 'FILE_SIZE' | translate }}{{ 'EXPORT_ON' | translate }}
    {{item.name}}{{item.size | byteToFriendlyConvertor}}
    + +
    + +
    + +
    + diff --git a/dist/src/main/package/www/partials/export/import-confirmation-modal.html b/dist/src/main/package/www/partials/export/import-confirmation-modal.html new file mode 100644 index 00000000..bb427b5c --- /dev/null +++ b/dist/src/main/package/www/partials/export/import-confirmation-modal.html @@ -0,0 +1,36 @@ + +
    + + + + + + + +
    diff --git a/dist/src/main/package/www/services/rest_services.js b/dist/src/main/package/www/services/rest_services.js index d0174c16..54883f64 100644 --- a/dist/src/main/package/www/services/rest_services.js +++ b/dist/src/main/package/www/services/rest_services.js @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -435,6 +435,19 @@ myControllerModule.factory('BackupRestoreFactory', function ($resource) { }) }); +//Export and import services +myControllerModule.factory('ExportImportFactory', function ($resource) { + return $resource('/mc/rest/export/:type', {}, { + getAll: { method: 'GET', isArray: false, params: {type: 'files'}}, + exportNow: { method: 'PUT', params: {type: 'exportNow'}}, + importNow: { method: 'POST', params: {type: 'import'}}, + deleteIds: { method: 'POST', params: {type: 'delete'}}, + getSettings: { method: 'GET', params: {type: 'settings'}}, + updateSettings: { method: 'PUT', params: {type: 'settings'}}, + }) +}); + + //Rooms Services myControllerModule.factory('RoomsFactory', function ($resource) { return $resource('/mc/rest/rooms/:id', {id: '@id'}, { diff --git a/dist/src/main/resources/mc_locale/mc_locale_java_pt_PT.properties b/dist/src/main/resources/mc_locale/mc_locale_java_pt_PT.properties new file mode 100644 index 00000000..7f1a387d --- /dev/null +++ b/dist/src/main/resources/mc_locale/mc_locale_java_pt_PT.properties @@ -0,0 +1,182 @@ +AFTER_SUNRISE=After sunrise +AFTER_SUNSET=After sunset +ANY=Any +AUTO=Auto +AVERAGE=Average +BEFORE_SUNRISE=Before sunrise +BEFORE_SUNSET=Before sunset +BLOCKED=Blocked +BYE_HAVE_A_NICE_DAY=Bye, Have a nice day\! See you soon +C_INTERNAL=Internal +C_PRESENTATION=Presentation +C_REQ=Request +C_SET=Set +C_STREAM=Stream +CORRUPTED_DATA=CORRUPTED DATA +CRON=Cron +DEFAULT=Default +ETHERNET=Ethernet +I_BATTERY_LEVEL=Battery level +I_CHILDREN=Children +I_CONFIG=Config +I_DEBUG=Debug +I_DISCOVER_RESPONSE=Discover response +I_DISCOVER=Discover +I_FACTORY_RESET=Factory reset +I_FIND_PARENT_RESPONSE=Find parent response +I_FIND_PARENT=Find parent +I_GATEWAY_READY=Gateway ready +I_GET_NONCE_RESPONSE=Get nonce response +I_GET_NONCE=Get nonce +I_HEARTBEAT_RESPONSE=Heartbeat Response +I_HEARTBEAT=Heartbeat +I_ID_REQUEST=Id request +I_ID_RESPONSE=Id response +I_INCLUSION_MODE=Inclusion mode +I_LOCKED=Locked +I_LOG_MESSAGE=Log message +I_PING=Ping +I_PONG=Pong +I_POST_SLEEP_NOTIFICATION=Post sleep notification +I_PRE_SLEEP_NOTIFICATION=Pre sleep notification +I_PRESENTATION=Presentation +I_PROPERTIES=Properties +I_REBOOT=Reboot +I_REGISTRATION_REQUEST=Register request +I_REGISTRATION_RESPONSE=Register response +I_REQUEST_SIGNING=Request signing +I_RSSI=RSSI +I_SIGNAL_REPORT_REQUEST=Signal report request +I_SIGNAL_REPORT_RESPONSE=Signal report response +I_SIGNAL_REPORT_REVERSE=Signal report reverse +I_SKETCH_NAME=Sketch name +I_SKETCH_VERSION=Sketch version +I_TIME=Time +I_VERSION=Version +JSERIALCOMM=jserialcomm +JSSC=jssc +MAXIMUM=Maximum +MINIMUM=Minimum +MQTT=MQTT +NEW=New +NORMAL=Normal +PHANT_IO=Sparkfun [phant.io] +PHILIPS_HUE=Philips Hue +PI4J=pi4j +REGISTERED=Registered +S_AIR_QUALITY=Air quality +S_ARDUINO_NODE=Node +S_ARDUINO_REPEATER_NODE=Repeater node +S_BARO=Barometer +S_BINARY=Binary +S_COLOR_SENSOR=Color sensor +S_COVER=Cover +S_CPU=CPU +S_CUSTOM=Custom +S_DIMMER=Dimmer +S_DISK=Disk +S_DISTANCE=Distance +S_DOOR=Door +S_DUST=Dust +S_GAS=Gas +S_GPS=GPS +S_HEATER=Heater +S_HUM=Humidity +S_HVAC=HVAC +S_INFO=Information +S_IR=IR +S_LIGHT_LEVEL=Light level +S_LOCK=Lock +S_MEMORY=Memory +S_MOISTURE=Moisture +S_MOTION=Motion +S_MULTIMETER=Multimeter +S_POWER=Power +S_PWM=PWM +S_RAIN=Rain +S_RGB_LIGHT=RGB light +S_RGBW_LIGHT=RGBW light +S_SCENE_CONTROLLER=Scene controller +S_SMOKE=Smoke +S_SOUND=Sound +S_SPRINKLER=Sprinkler +S_TEMP=Temperature +S_UV=UV +S_VIBRATION=Vibration +S_WATER_LEAK=Water leak +S_WATER_QUALITY=Water quality +S_WATER=Water +S_WEIGHT=Weight +S_WIND=Wind +SERIAL=Serial +SIMPLE=Simple +ST_FIRMWARE_CONFIG_REQUEST=Firmware config request +ST_FIRMWARE_CONFIG_RESPONSE=Firmware config response +ST_FIRMWARE_REQUEST=Firmware request +ST_FIRMWARE_RESPONSE=Firmware response +ST_IMAGE=Image +ST_SOUND=Sound +UNDEFINED=Undefined +V_ARMED=Armed +V_COUNT=Count +V_CURRENT=Current +V_CUSTOM=Custom +V_DIRECTION=Direction +V_DISTANCE=Distance +V_DOWN=Down +V_EC=EC +V_FLOW=Flow +V_FORECAST=Forecast +V_FREE=Free +V_GUST=Gust +V_HUM=Humidity +V_HVAC_FLOW_MODE=HVAC flow mode +V_HVAC_FLOW_STATE=HVAC flow state +V_HVAC_SETPOINT_COOL=HVAC setpoint cool +V_HVAC_SETPOINT_HEAT=HVAC setpoint heat +V_HVAC_SPEED=HVAC speed +V_ID=Id +V_IMPEDANCE=Impedance +V_IR_RECEIVE=IR receive +V_IR_RECORD=IR record +V_IR_SEND=IR send +V_KWH=kWh +V_LEVEL=Level +V_LIGHT_LEVEL=Light level +V_LOCK_STATUS=Lock status +V_ORP=ORP +V_PERCENTAGE=Percentage +V_PH=PH +V_POSITION=Position +V_POWER_FACTOR=Power factor +V_PRESSURE=Pressure +V_RAIN=Rain +V_RAINRATE=Rain rate +V_RATE=Rate +V_RGB=RGB +V_RGBW=RGBW +V_SCENE_OFF=Scene OFF +V_SCENE_ON=Scene ON +V_STATUS=Status +V_STOP=Stop +V_TEMP=Temperature +V_TEXT=Text +V_TOTAL=Total +V_TRIPPED=Tripped +V_UNIT_PREFIX=Unit prefix +V_UP=Up +V_USED=Used +V_UV=UV +V_VA=Volt-ampere +V_VAR=Volt-ampere reactive +V_VAR1=Variable 1 +V_VAR2=Variable 2 +V_VAR3=Variable 3 +V_VAR4=Variable 4 +V_VAR5=Variable 5 +V_VOLTAGE=Voltage +V_VOLUME=Volume +V_WATT=Watt +V_WEIGHT=Weight +V_WIND=Wind +WUNDERGROUND=Weather Underground diff --git a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java index 41516fd2..89132950 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/AppProperties.java @@ -24,6 +24,7 @@ import org.mycontroller.standalone.db.LoggerMySql; import org.mycontroller.standalone.settings.BackupSettings; import org.mycontroller.standalone.settings.EmailSettings; +import org.mycontroller.standalone.settings.ExportSettings; import org.mycontroller.standalone.settings.LocationSettings; import org.mycontroller.standalone.settings.MetricsDataRetentionSettings; import org.mycontroller.standalone.settings.MetricsGraphSettings; @@ -103,6 +104,7 @@ public class AppProperties { MetricsGraphSettings metricsGraphSettings; MetricsDataRetentionSettings metricsDataRetentionSettings; BackupSettings backupSettings; + ExportSettings exportSettings; MqttBrokerSettings mqttBrokerSettings; public enum DB_TYPE { @@ -565,6 +567,7 @@ public void loadPropertiesFromDb() { metricsGraphSettings = MetricsGraphSettings.get(); metricsDataRetentionSettings = MetricsDataRetentionSettings.get(); backupSettings = BackupSettings.get(); + exportSettings = ExportSettings.get(); pushbulletSettings = PushbulletSettings.get(); telegramBotSettings = TelegramBotSettings.get(); mqttBrokerSettings = MqttBrokerSettings.get(); @@ -721,6 +724,14 @@ public void setBackupSettings(BackupSettings backupSettings) { this.backupSettings = backupSettings; } + public ExportSettings getExportSettings() { + return exportSettings; + } + + public void setExportSettings(ExportSettings exportSettings) { + this.exportSettings = exportSettings; + } + public MetricsDataRetentionSettings getMetricsDataRetentionSettings() { return metricsDataRetentionSettings; } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/McThreadPoolFactory.java b/modules/core/src/main/java/org/mycontroller/standalone/McThreadPoolFactory.java index 250e608d..36b205ac 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/McThreadPoolFactory.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/McThreadPoolFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,7 +67,6 @@ public static void shutdownNow() { @Slf4j class McUncaughtException implements UncaughtExceptionHandler { - @Override public void uncaughtException(Thread th, Throwable ex) { _logger.error("Exception,", ex); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java index 0301c9a4..ca2255ae 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java @@ -36,6 +36,7 @@ import org.mycontroller.standalone.api.jaxrs.FirmwareHandler; import org.mycontroller.standalone.api.jaxrs.ForwardPayloadHandler; import org.mycontroller.standalone.api.jaxrs.GatewayHandler; +import org.mycontroller.standalone.api.jaxrs.ExportHandler; import org.mycontroller.standalone.api.jaxrs.MetricsHandler; import org.mycontroller.standalone.api.jaxrs.MyControllerHandler; import org.mycontroller.standalone.api.jaxrs.NodeHandler; @@ -164,6 +165,7 @@ private static ResteasyDeployment getResteasyDeployment() { resources.add(FirmwareHandler.class.getName()); resources.add(ForwardPayloadHandler.class.getName()); resources.add(GatewayHandler.class.getName()); + resources.add(ExportHandler.class.getName()); resources.add(MetricsHandler.class.getName()); resources.add(MyControllerHandler.class.getName()); resources.add(NodeHandler.class.getName()); @@ -350,6 +352,10 @@ private static void cleanUpServices() { } public static synchronized void stopServices() { + stopServices(true); + } + + public static synchronized void stopServices(boolean stopAll) { //Stop order.. // - stop web server // - clear external servers @@ -365,11 +371,15 @@ public static synchronized void stopServices() { SchedulerUtils.stop(); GatewayUtils.unloadEngineAll(); MoquetteMqttBroker.stop(); - DataBaseUtils.stop(); MetricsUtils.shutdownEngine(); OffHeapFactory.close(); - McThreadPoolFactory.shutdownNow(); - _logger.debug("All services stopped."); + if (stopAll) { + DataBaseUtils.stop(); + McThreadPoolFactory.shutdownNow(); + _logger.debug("Stopped minimal services."); + } else { + _logger.debug("All services stopped."); + } //Remove references McObjectManager.clearAllReferences(); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java b/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java index 9cff1b59..87a1af56 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,31 +16,20 @@ */ package org.mycontroller.standalone.api; -import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOCase; -import org.apache.commons.io.filefilter.FileFilterUtils; -import org.apache.commons.io.filefilter.IOFileFilter; -import org.apache.commons.io.filefilter.SuffixFileFilter; -import org.apache.commons.io.filefilter.TrueFileFilter; -import org.apache.commons.io.filefilter.WildcardFileFilter; import org.mycontroller.standalone.AppProperties; -import org.mycontroller.standalone.api.jaxrs.model.BackupFile; -import org.mycontroller.standalone.api.jaxrs.model.Query; +import org.mycontroller.standalone.McThreadPoolFactory; +import org.mycontroller.standalone.api.jaxrs.model.McFile; import org.mycontroller.standalone.api.jaxrs.model.QueryResponse; -import org.mycontroller.standalone.backup.BRCommons; +import org.mycontroller.standalone.backup.Commons; import org.mycontroller.standalone.backup.Backup; +import org.mycontroller.standalone.backup.McFileUtils; import org.mycontroller.standalone.backup.Restore; import org.mycontroller.standalone.exceptions.McBadRequestException; import org.mycontroller.standalone.exceptions.McException; -import org.mycontroller.standalone.utils.McUtils; import lombok.extern.slf4j.Slf4j; @@ -52,9 +41,6 @@ */ @Slf4j public class BackupApi { - public static final String KEY_NAME = "name"; - public static final String[] BACKUP_FILE_SUFFIX_FILTER = { "zip", "ZIP" }; - /** * Call this method to get list of available backup files. *

    Filter(s): @@ -69,82 +55,9 @@ public class BackupApi { * @throws IOException throws when problem with backup location */ public QueryResponse getBackupFiles(HashMap filters) throws IOException { - Query query = Query.get(filters); - - String locationCanonicalPath = McUtils.getDirectoryLocation(FileUtils.getFile( - AppProperties.getInstance().getBackupSettings().getBackupLocation()).getCanonicalPath()); - - if (FileUtils.getFile(locationCanonicalPath).exists()) { - List files = new ArrayList(); - - //Filters - //Extension filter - SuffixFileFilter extensionFilter = new SuffixFileFilter(BACKUP_FILE_SUFFIX_FILTER, IOCase.INSENSITIVE); - - //name filter - IOFileFilter nameFileFilter = null; - @SuppressWarnings("unchecked") - List fileNames = (List) query.getFilters().get(KEY_NAME); - if (fileNames == null) { - fileNames = new ArrayList(); - } - fileNames.add(BRCommons.FILE_NAME_IDENTITY); - - if (fileNames != null && !fileNames.isEmpty()) { - for (String fileName : fileNames) { - if (nameFileFilter == null) { - nameFileFilter = FileFilterUtils.and( - new WildcardFileFilter("*" + fileName + "*", IOCase.INSENSITIVE)); - } else { - nameFileFilter = FileFilterUtils.and(nameFileFilter, - new WildcardFileFilter("*" + fileName + "*", IOCase.INSENSITIVE)); - } - } - } - //Combine all filters - IOFileFilter finalFileFilter = null; - if (nameFileFilter != null) { - finalFileFilter = FileFilterUtils.and(extensionFilter, nameFileFilter); - } else { - finalFileFilter = extensionFilter; - } - List backupFiles = new ArrayList(FileUtils.listFiles(FileUtils.getFile(locationCanonicalPath), - finalFileFilter, TrueFileFilter.INSTANCE)); - query.setFilteredCount((long) backupFiles.size()); - //Get total items without filter - query.setTotalItems((long) FileUtils.listFiles(FileUtils.getFile(locationCanonicalPath), - extensionFilter, TrueFileFilter.INSTANCE).size()); - int fileFrom; - int fileTo; - if (query.getPageLimit() == -1) { - fileTo = backupFiles.size(); - fileFrom = 0; - } else { - fileFrom = query.getStartingRow().intValue(); - fileTo = (int) (query.getPage() * query.getPageLimit()); - } - for (File backupFile : backupFiles) { - String name = backupFile.getCanonicalPath().replace(locationCanonicalPath, ""); - files.add(BackupFile.builder() - .name(name) - .size(backupFile.length()) - .timestamp(backupFile.lastModified()) - .canonicalPath(backupFile.getCanonicalPath()) - .build()); - } - - if (!files.isEmpty()) { - //Do order reverse - Collections.sort(files, Collections.reverseOrder()); - if (fileFrom < files.size()) { - files = files.subList(Math.max(0, fileFrom), Math.min(fileTo, files.size())); - } - } - return QueryResponse.builder().data(files).query(query).build(); - - } else { - throw new FileNotFoundException("File location not found: " + locationCanonicalPath); - } + return McFileUtils.getMcFiles( + AppProperties.getInstance().getBackupSettings().getBackupLocation(), + Commons.BACKUP_FILE_NAME_IDENTITY, filters); } /** @@ -153,21 +66,7 @@ public QueryResponse getBackupFiles(HashMap filters) throws IOEx * @throws IOException throws when problem with backup location */ public void deleteBackupFiles(List backupFiles) throws IOException { - String backupFileLocation = McUtils.getDirectoryLocation(FileUtils.getFile( - AppProperties.getInstance().getBackupSettings().getBackupLocation()).getCanonicalPath()); - for (String backupFile : backupFiles) { - String fileFullPath = backupFileLocation + backupFile; - if (McUtils.isInScope(backupFileLocation, fileFullPath)) { - if (FileUtils.deleteQuietly(FileUtils.getFile(fileFullPath))) { - _logger.debug("File deleted successfully! {}", fileFullPath); - } else { - _logger.warn("File deletion failed! {}", fileFullPath); - } - } else { - _logger.warn("Trying to delete file from outside scope! Filepath:{}, CanonicalPath:{}", - fileFullPath, FileUtils.getFile(fileFullPath).getCanonicalPath()); - } - } + McFileUtils.deleteMcFiles(AppProperties.getInstance().getBackupSettings().getBackupLocation(), backupFiles); } /** @@ -201,24 +100,9 @@ public String backupNow() throws McException, IOException { * @throws McBadRequestException given file name not available */ public void restore(String fileName) throws IOException, McBadRequestException { - if (fileName == null) { - throw new McBadRequestException("backup file should not be null"); - } - String backupCanonicalPath = FileUtils.getFile( - AppProperties.getInstance().getBackupSettings().getBackupLocation()).getCanonicalPath(); - String fileFullName = AppProperties.getInstance().getBackupSettings().getBackupLocation() + fileName; - if (McUtils.isInScope(backupCanonicalPath, fileFullName)) { - File bkpFile = FileUtils.getFile(fileFullName); - BackupFile backupFile = BackupFile.builder() - .name(bkpFile.getName()) - .canonicalPath(bkpFile.getCanonicalPath()) - .timestamp(bkpFile.lastModified()) - .size(bkpFile.length()) - .build(); - new Thread(new Restore(backupFile)).start(); - _logger.info("Restore triggered."); - } else { - throw new McBadRequestException("Trying to restore file from outside backup scope"); - } + McFile backupFile = McFileUtils.getMcFile( + AppProperties.getInstance().getBackupSettings().getBackupLocation(), fileName); + McThreadPoolFactory.execute(new Restore(backupFile)); + _logger.info("Restore triggered."); } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/ExportApi.java b/modules/core/src/main/java/org/mycontroller/standalone/api/ExportApi.java new file mode 100644 index 00000000..9d7921d0 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/ExportApi.java @@ -0,0 +1,68 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.api; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; + +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.McThreadPoolFactory; +import org.mycontroller.standalone.api.jaxrs.model.McFile; +import org.mycontroller.standalone.api.jaxrs.model.QueryResponse; +import org.mycontroller.standalone.backup.Commons; +import org.mycontroller.standalone.backup.Export; +import org.mycontroller.standalone.backup.Import; +import org.mycontroller.standalone.backup.McFileUtils; +import org.mycontroller.standalone.exceptions.McBadRequestException; +import org.mycontroller.standalone.exceptions.McException; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ +@Slf4j +public class ExportApi { + + public QueryResponse getExportFiles(HashMap filters) throws IOException { + return McFileUtils.getMcFiles( + AppProperties.getInstance().getExportSettings().getExportLocation(), + Commons.EXPORT_FILE_NAME_IDENTITY, filters); + } + + public void deleteExportFiles(List backupFiles) throws IOException { + McFileUtils.deleteMcFiles(AppProperties.getInstance().getExportSettings().getExportLocation(), backupFiles); + } + + public void exportNow(String exportFilePrefix, long rowLimit) throws McException, IOException { + _logger.debug("Export triggered."); + McThreadPoolFactory.execute(new Export(exportFilePrefix, rowLimit)); + } + + public void exportNow(long rowLimit) throws McException, IOException { + exportNow("on-demand", rowLimit); + } + + public void importNow(String fileName) throws IOException, McBadRequestException { + McFile exportFile = McFileUtils.getMcFile( + AppProperties.getInstance().getExportSettings().getExportLocation(), fileName); + McThreadPoolFactory.execute(new Import(exportFile)); + _logger.info("Import triggered."); + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/BackupHandler.java b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/BackupHandler.java index 96333707..b889a79d 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/BackupHandler.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/BackupHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,6 +39,7 @@ import org.mycontroller.standalone.api.jaxrs.model.ApiMessage; import org.mycontroller.standalone.api.jaxrs.model.Query; import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.backup.McFileUtils; import org.mycontroller.standalone.settings.BackupSettings; import lombok.extern.slf4j.Slf4j; @@ -59,17 +60,17 @@ public class BackupHandler { @GET @Path("/backupFiles") - public Response getBackupList(@QueryParam(BackupApi.KEY_NAME) List name, + public Response getBackupList(@QueryParam(McFileUtils.KEY_NAME) List name, @QueryParam(Query.PAGE_LIMIT) Long pageLimit, @QueryParam(Query.PAGE) Long page, @QueryParam(Query.ORDER_BY) String orderBy, @QueryParam(Query.ORDER) String order) { HashMap filters = new HashMap(); - filters.put(BackupApi.KEY_NAME, name); + filters.put(McFileUtils.KEY_NAME, name); if (orderBy == null) { - orderBy = BackupApi.KEY_NAME; + orderBy = McFileUtils.KEY_NAME; } //Query primary filters filters.put(Query.ORDER, order); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/ExportHandler.java b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/ExportHandler.java new file mode 100644 index 00000000..c458db55 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/ExportHandler.java @@ -0,0 +1,141 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.api.jaxrs; + +import static javax.ws.rs.core.MediaType.APPLICATION_JSON; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.security.RolesAllowed; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.api.ExportApi; +import org.mycontroller.standalone.api.jaxrs.model.ApiError; +import org.mycontroller.standalone.api.jaxrs.model.ApiMessage; +import org.mycontroller.standalone.api.jaxrs.model.Query; +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.backup.McFileUtils; +import org.mycontroller.standalone.settings.ExportSettings; +import org.mycontroller.standalone.utils.McUtils; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Slf4j +@Path("/rest/export") +@Produces(APPLICATION_JSON) +@Consumes(APPLICATION_JSON) +@RolesAllowed({ "Admin" }) +public class ExportHandler extends AccessEngine { + + private ExportApi exportApi = new ExportApi(); + + @GET + @Path("/files") + public Response getBackupList(@QueryParam(McFileUtils.KEY_NAME) List name, + @QueryParam(Query.PAGE_LIMIT) Long pageLimit, + @QueryParam(Query.PAGE) Long page, + @QueryParam(Query.ORDER_BY) String orderBy, + @QueryParam(Query.ORDER) String order) { + + HashMap filters = new HashMap(); + filters.put(McFileUtils.KEY_NAME, name); + + if (orderBy == null) { + orderBy = McFileUtils.KEY_NAME; + } + //Query primary filters + filters.put(Query.ORDER, order); + filters.put(Query.ORDER_BY, orderBy); + filters.put(Query.PAGE_LIMIT, pageLimit); + filters.put(Query.PAGE, page); + + try { + return RestUtils.getResponse(Status.OK, exportApi.getExportFiles(filters)); + } catch (Exception ex) { + _logger.error("Error,", ex); + return RestUtils.getResponse(Status.INTERNAL_SERVER_ERROR, new ApiError(ex.getMessage())); + } + } + + @GET + @Path("/settings") + public Response getSettings() { + return RestUtils.getResponse(Status.OK, AppProperties.getInstance().getExportSettings()); + } + + @PUT + @Path("/settings") + public Response updateBackupSettings(ExportSettings settings) { + settings.save(); + ExportSettings.reloadJob();//Reload backup job + AppProperties.getInstance().setExportSettings(ExportSettings.get()); + return RestUtils.getResponse(Status.OK); + } + + @PUT + @Path("/exportNow") + public Response exportNow(Map data) { + try { + exportApi.exportNow(McUtils.getLong(data.get("rowLimit"))); + return RestUtils.getResponse(Status.OK); + } catch (Exception ex) { + _logger.error("Error,", ex); + return RestUtils.getResponse(Status.BAD_REQUEST, new ApiError(ex.getMessage())); + } + } + + @POST + @Path("/delete") + public Response deleteIds(List files) { + try { + exportApi.deleteExportFiles(files); + } catch (IOException ex) { + RestUtils.getResponse(Status.BAD_REQUEST, new ApiError(ex.getMessage())); + } + return RestUtils.getResponse(Status.NO_CONTENT); + } + + @POST + @Path("/import") + public Response restore(Map data) { + try { + exportApi.importNow((String) data.get("fileName")); + return RestUtils.getResponse(Status.OK, new ApiMessage( + "Server is going to down now! Monitor log file of the server.")); + } catch (Exception ex) { + _logger.error("Error in import,", ex); + return RestUtils.getResponse(Status.BAD_REQUEST, new ApiError(ex.getMessage())); + } + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/BackupFile.java b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/McFile.java similarity index 87% rename from modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/BackupFile.java rename to modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/McFile.java index 8fe1271e..5222fe16 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/BackupFile.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/McFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,14 +32,14 @@ @AllArgsConstructor @Getter @ToString(includeFieldNames = true) -public class BackupFile implements Comparable { +public class McFile implements Comparable { private String name; private String canonicalPath; private Long timestamp; private Long size; @Override - public int compareTo(BackupFile file) { + public int compareTo(McFile file) { return this.timestamp.compareTo(file.getTimestamp()); } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/BRCommons.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/BRCommons.java deleted file mode 100644 index a5fa4975..00000000 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/BRCommons.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mycontroller.standalone.backup; - -import java.io.File; - -/** - * @author Jeeva Kandasamy (jkandasa) - * @since 0.0.3 - */ -public class BRCommons { - public static final String DATABASE_FILENAME = "database_backup.zip"; - public static final String APP_PROPERTIES_FILENAME = "mycontroller.properties"; - public static final String APP_CONF_LOCATION = "../conf/"; - public static final String RESOURCES_LOCATION = "resources" + File.separator; - public static final String FILE_NAME_IDENTITY = "_mc_backup"; - - private static boolean isbackupRestoreRunning = false; - - public static synchronized boolean isBackupRestoreRunning() { - return isbackupRestoreRunning; - } - - public static synchronized void setBackupRestoreRunning(boolean isRunning) { - BRCommons.isbackupRestoreRunning = isRunning; - } - -} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java index 620edf92..b39afa44 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,6 @@ import org.mycontroller.standalone.AppProperties.DB_TYPE; import org.mycontroller.standalone.db.DataBaseUtils; import org.mycontroller.standalone.exceptions.McException; -import org.mycontroller.standalone.utils.McUtils; import lombok.extern.slf4j.Slf4j; @@ -38,26 +37,25 @@ */ @Slf4j public class Backup { - private static String KEY_STORE_FILE = null; public static synchronized String backup(String prefix) throws McException, IOException { //backup database //backup configuration file //backup certificates //backup logback xml file - String backupZipFileName = null; - if (BRCommons.isBackupRestoreRunning()) { + if (Commons.IS_BACKUP_RESTORE_RUNNING.get()) { throw new BadRequestException("A backup or restore is running"); } - BRCommons.setBackupRestoreRunning(true); - String applicationBackupDir = AppProperties.getInstance().getBackupSettings().getBackupLocation() - + prefix + BRCommons.FILE_NAME_IDENTITY + "_" + Commons.IS_BACKUP_RESTORE_RUNNING.set(true); + String preZipDirectory = AppProperties.getInstance().getBackupSettings().getBackupLocation() + + prefix + Commons.BACKUP_FILE_NAME_IDENTITY + "_" + AppProperties.getInstance().getDbType().name().toLowerCase() + new SimpleDateFormat("-yyyy_MM_dd-HH_mm_ss").format(new Date()); //Create parent dir if not exist try { - FileUtils.forceMkdir(FileUtils.getFile(applicationBackupDir)); + FileUtils.deleteQuietly(FileUtils.getFile(preZipDirectory)); + FileUtils.forceMkdir(FileUtils.getFile(preZipDirectory)); boolean includeDdBackup = false; if (AppProperties.getInstance().getDbType() == DB_TYPE.H2DB_EMBEDDED) { includeDdBackup = true; @@ -67,62 +65,27 @@ public static synchronized String backup(String prefix) throws McException, IOEx } if (includeDdBackup) { - String databaseBackup = AppProperties.getInstance().getTmpLocation() + BRCommons.DATABASE_FILENAME; + String databaseBackup = AppProperties.getInstance().getTmpLocation() + Commons.BACKUP_DATABASE_FILENAME; if (DataBaseUtils.backupDatabase(databaseBackup)) { //Copy database file FileUtils.moveFile( FileUtils.getFile(databaseBackup), - FileUtils.getFile(applicationBackupDir + File.separator + BRCommons.DATABASE_FILENAME)); + FileUtils.getFile(preZipDirectory + File.separator + Commons.BACKUP_DATABASE_FILENAME)); //copy static files } else { throw new McException("Database backup failed!"); } } - - //copy static files - copyStaticFiles(applicationBackupDir); - _logger.debug("Copied all the files"); - //create zip file - McUtils.createZipFile(applicationBackupDir, applicationBackupDir + ".zip"); - _logger.debug("zip file creation done"); - //clean temporary files - FileUtils.deleteDirectory(FileUtils.getFile(applicationBackupDir)); - return backupZipFileName; - + //copy static files and create zip file + return McFileUtils.copyStaticFilesAndCreateZipFile(preZipDirectory); } catch (IOException ex) { _logger.error("Exception,", ex); throw ex; } finally { - BRCommons.setBackupRestoreRunning(false); + Commons.IS_BACKUP_RESTORE_RUNNING.set(false); } } - private static void copyStaticFiles(String applicationBackupDir) { - //Copy mycontroller.properties file - try { - FileUtils.copyFile( - FileUtils.getFile(System.getProperty("mc.conf.file")), - FileUtils.getFile(applicationBackupDir + File.separator + BRCommons.APP_PROPERTIES_FILENAME), - true); - if (AppProperties.getInstance().isWebHttpsEnabled()) { - KEY_STORE_FILE = applicationBackupDir + File.separator - + FileUtils.getFile(AppProperties.getInstance().getWebSslKeystoreFile()).getName(); - FileUtils.copyFile( - FileUtils.getFile(AppProperties.getInstance().getWebSslKeystoreFile()), - FileUtils.getFile(KEY_STORE_FILE), - true); - } - //Copy resources directory - FileUtils.copyDirectory( - FileUtils.getFile(AppProperties.getInstance().getResourcesLocation()), - FileUtils.getFile(applicationBackupDir + File.separator + BRCommons.RESOURCES_LOCATION), - true); - - } catch (IOException ex) { - _logger.error("Static file backup failed!", ex); - } - } - } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java new file mode 100644 index 00000000..52b9abda --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java @@ -0,0 +1,286 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.mycontroller.standalone.db.DaoUtils; +import org.mycontroller.standalone.db.tables.ExternalServerResourceMap; +import org.mycontroller.standalone.db.tables.ExternalServerTable; +import org.mycontroller.standalone.db.tables.Firmware; +import org.mycontroller.standalone.db.tables.FirmwareData; +import org.mycontroller.standalone.db.tables.FirmwareType; +import org.mycontroller.standalone.db.tables.FirmwareVersion; +import org.mycontroller.standalone.db.tables.ForwardPayload; +import org.mycontroller.standalone.db.tables.GatewayTable; +import org.mycontroller.standalone.db.tables.MetricsBatteryUsage; +import org.mycontroller.standalone.db.tables.MetricsBinaryTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsCounterTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsDoubleTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsGPSTypeDevice; +import org.mycontroller.standalone.db.tables.Node; +import org.mycontroller.standalone.db.tables.OperationRuleDefinitionMap; +import org.mycontroller.standalone.db.tables.OperationTable; +import org.mycontroller.standalone.db.tables.OperationTimerMap; +import org.mycontroller.standalone.db.tables.Resource; +import org.mycontroller.standalone.db.tables.ResourcesGroup; +import org.mycontroller.standalone.db.tables.ResourcesLogs; +import org.mycontroller.standalone.db.tables.Role; +import org.mycontroller.standalone.db.tables.RoleGatewayMap; +import org.mycontroller.standalone.db.tables.RoleMqttMap; +import org.mycontroller.standalone.db.tables.RoleNodeMap; +import org.mycontroller.standalone.db.tables.RoleSensorMap; +import org.mycontroller.standalone.db.tables.RoleUserMap; +import org.mycontroller.standalone.db.tables.Room; +import org.mycontroller.standalone.db.tables.RuleDefinitionTable; +import org.mycontroller.standalone.db.tables.Sensor; +import org.mycontroller.standalone.db.tables.SensorVariable; +import org.mycontroller.standalone.db.tables.SensorsVariablesMap; +import org.mycontroller.standalone.db.tables.Settings; +import org.mycontroller.standalone.db.tables.Timer; +import org.mycontroller.standalone.db.tables.UidTag; +import org.mycontroller.standalone.db.tables.User; +import org.mycontroller.standalone.db.tables.UserSettings; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 0.0.3 + */ +public class Commons { + + // common + public static final String APP_PROPERTIES_FILENAME = "mycontroller.properties"; + public static final String APP_CONF_LOCATION = "../conf/"; + public static final String RESOURCES_LOCATION = "resources" + File.separator; + + // backup + public static final String BACKUP_DATABASE_FILENAME = "database_backup.zip"; + public static final String BACKUP_FILE_NAME_IDENTITY = "_mc_backup"; + public static final AtomicBoolean IS_BACKUP_RESTORE_RUNNING = new AtomicBoolean(false); + + // export + public static final String DATABASE_FILES = "database_tables"; + public static final String EXPORT_FILE_NAME_IDENTITY = "_mc_export"; + public static final AtomicBoolean IS_IMPORT_EXPORT_RUNNING = new AtomicBoolean(false); + public static final Map EXPORT_MAP = new HashMap<>(); + static { + EXPORT_MAP.put( + "01_role", + ExportMap.get("role_data", + Role.class, + DaoUtils.getRoleDao())); + EXPORT_MAP.put( + "02_user", + ExportMap.get("user_data", + User.class, + DaoUtils.getUserDao())); + EXPORT_MAP.put( + "03_user_settings", + ExportMap.get("user_settings_data", + UserSettings.class, + DaoUtils.getUserSettingsDao())); + EXPORT_MAP.put( + "04_role_user_map", + ExportMap.get("role_user_map_data", + RoleUserMap.class, + DaoUtils.getRoleUserMapDao(), + RoleUserMap.KEY_ROLE_ID)); + EXPORT_MAP.put( + "05_gateway", + ExportMap.get("gateway_data", + GatewayTable.class, + DaoUtils.getGatewayDao())); + EXPORT_MAP.put( + "06_node", + ExportMap.get("node_data", + Node.class, + DaoUtils.getNodeDao())); + EXPORT_MAP.put( + "07_sensor", + ExportMap.get("sensor_data", + Sensor.class, + DaoUtils.getSensorDao())); + EXPORT_MAP.put( + "08_sensor_variable", + ExportMap.get("sensor_variable_data", + SensorVariable.class, + DaoUtils.getSensorVariableDao())); + EXPORT_MAP.put( + "09_sensor_variable_map", + ExportMap.get("sensor_variable_map_data", + SensorsVariablesMap.class, + DaoUtils.getSensorsVariablesMapDao())); + EXPORT_MAP.put( + "10_ext_server", + ExportMap.get("external_server_data", + ExternalServerTable.class, + DaoUtils.getExternalServerTableDao())); + EXPORT_MAP.put( + "11_ext_server_resource_map", + ExportMap.get("external_server_resource_map_data", + ExternalServerResourceMap.class, + DaoUtils.getExternalServerResourceMapDao(), + ExternalServerResourceMap.KEY_RESOURCE_ID)); + EXPORT_MAP.put( + "12_firmware_type", + ExportMap.get("firmware_type_data", + FirmwareType.class, + DaoUtils.getFirmwareTypeDao())); + EXPORT_MAP.put( + "13_firmware_version", + ExportMap.get("firmware_version_data", + FirmwareVersion.class, + DaoUtils.getFirmwareVersionDao())); + EXPORT_MAP.put( + "14_firmware", + ExportMap.get("firmware_data", + Firmware.class, + DaoUtils.getFirmwareDao())); + EXPORT_MAP.put( + "15_firmware_bytes", + ExportMap.get("firmware_bytes_data", + FirmwareData.class, + DaoUtils.getFirmwareDataDao())); + EXPORT_MAP.put( + "16_forward_payload", + ExportMap.get("forward_payload_data", + ForwardPayload.class, + DaoUtils.getForwardPayloadDao())); + EXPORT_MAP.put( + "17_operation", + ExportMap.get("operation_data", + OperationTable.class, + DaoUtils.getOperationDao())); + EXPORT_MAP.put( + "18_rule_definition", + ExportMap.get("rule_definition_data", + RuleDefinitionTable.class, + DaoUtils.getRuleDefinitionDao())); + EXPORT_MAP.put( + "19_timer", + ExportMap.get("timer_data", + Timer.class, + DaoUtils.getTimerDao())); + EXPORT_MAP.put( + "20_operation_rule_def_map", + ExportMap.get("operation_rule_definition_map_data", + OperationRuleDefinitionMap.class, + DaoUtils.getOperationRuleDefinitionMapDao(), + OperationRuleDefinitionMap.KEY_OPERATION_ID)); + EXPORT_MAP.put( + "21_operation_timer_map", + ExportMap.get("operation_timer_map_data", + OperationTimerMap.class, + DaoUtils.getOperationTimerMapDao(), + OperationTimerMap.KEY_OPERATION_ID)); + EXPORT_MAP.put( + "22_resource", + ExportMap.get("resource_data", + Resource.class, + DaoUtils.getResourceDao())); + EXPORT_MAP.put( + "23_resource_group", + ExportMap.get("resources_group_data", + ResourcesGroup.class, + DaoUtils.getResourcesGroupDao())); + EXPORT_MAP.put( + "24_resource_group-map", + ExportMap.get("resources_group_map_table", + ResourcesGroup.class, + DaoUtils.getResourcesGroupMapDao())); + EXPORT_MAP.put( + "25_resource_logs", + ExportMap.get("resources_logs_data", + ResourcesLogs.class, + DaoUtils.getResourcesLogsDao())); + EXPORT_MAP.put( + "26_role_gateway_map", + ExportMap.get("role_gateway_map_data", + RoleGatewayMap.class, + DaoUtils.getRoleGatewayMapDao(), + RoleGatewayMap.KEY_ROLE_ID)); + EXPORT_MAP.put( + "27_role_mqtt_map", + ExportMap.get("role_mqtt_map_data", + RoleMqttMap.class, + DaoUtils.getRoleMqttMapDao(), + RoleMqttMap.KEY_ROLE_ID)); + EXPORT_MAP.put( + "28_role_node_map", + ExportMap.get("role_node_map_data", + RoleNodeMap.class, + DaoUtils.getRoleNodeMapDao(), + RoleNodeMap.KEY_ROLE_ID)); + EXPORT_MAP.put( + "29_role_sensor_map", + ExportMap.get("role_sensor_map_data", + RoleSensorMap.class, + DaoUtils.getRoleSensorMapDao(), + RoleSensorMap.KEY_ROLE_ID)); + EXPORT_MAP.put( + "30_room", + ExportMap.get("room_data", + Room.class, + DaoUtils.getRoomDao())); + EXPORT_MAP.put( + "31_settings", + ExportMap.get("settings_data", + Settings.class, + DaoUtils.getSettingsDao())); + EXPORT_MAP.put( + "32_uid_tag", + ExportMap.get("uid_tag_data", + UidTag.class, + DaoUtils.getUidTagDao())); + EXPORT_MAP.put( + "33_metrics_battery_usage", + ExportMap.get("metrics_battery_usage_data", + MetricsBatteryUsage.class, + DaoUtils.getMetricsBatteryUsageDao(), + MetricsBatteryUsage.KEY_TIMESTAMP)); + + EXPORT_MAP.put( + "34_metrics_binary_type", + ExportMap.get("metrics_binary_type_data", + MetricsBinaryTypeDevice.class, + DaoUtils.getMetricsBinaryTypeDeviceDao(), + MetricsBinaryTypeDevice.KEY_TIMESTAMP)); + EXPORT_MAP.put( + "35_metrics_counter_type", + ExportMap.get("metrics_counter_type_data", + MetricsCounterTypeDevice.class, + DaoUtils.getMetricsCounterTypeDeviceDao(), + MetricsCounterTypeDevice.KEY_TIMESTAMP)); + EXPORT_MAP.put( + "36_metrics_double_type", + ExportMap.get("metrics_double_type_data", + MetricsDoubleTypeDevice.class, + DaoUtils.getMetricsDoubleTypeDeviceDao(), + MetricsDoubleTypeDevice.KEY_TIMESTAMP)); + EXPORT_MAP.put( + "37_metrics_gps_type", + ExportMap.get("metrics_gps_type_data", + MetricsGPSTypeDevice.class, + DaoUtils.getMetricsGPSTypeDeviceDao(), + MetricsGPSTypeDevice.KEY_TIMESTAMP)); + + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Export.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Export.java new file mode 100644 index 00000000..b302dfb8 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Export.java @@ -0,0 +1,131 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.api.SystemApi; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Slf4j +public class Export implements Runnable { + + private static final long ROW_LIMIT = 1000; + + private long rowLimit; + private String prefix; + + public Export(String prefix) { + this.prefix = prefix; + rowLimit = ROW_LIMIT; + } + + public Export(String prefix, Long rowLimit) { + this.prefix = prefix; + if (rowLimit == null) { + this.rowLimit = ROW_LIMIT; + } else { + this.rowLimit = rowLimit; + } + } + + private String startExport() throws IOException { + String preZipDirectory = AppProperties.getInstance().getExportSettings().getExportLocation() + + prefix + Commons.EXPORT_FILE_NAME_IDENTITY + "_" + + new SimpleDateFormat("yyyy_MM_dd-HH_mm_ss").format(new Date()); + //Create parent dir if not exist + FileUtils.deleteQuietly(FileUtils.getFile(preZipDirectory)); + FileUtils.forceMkdir(FileUtils.getFile(preZipDirectory)); + + // copy version details + copyVersionDetails(preZipDirectory); + + // copy database data as json + copyDatabaseData(preZipDirectory, rowLimit); + + //copy static files + return McFileUtils.copyStaticFilesAndCreateZipFile(preZipDirectory); + } + + private void jsonDump(Object data, String preZipDirectory, String fileName) { + JsonUtils.dumps(data, preZipDirectory, Commons.DATABASE_FILES, fileName); + } + + private void copyDatabaseData(String preZipDirectory, long rowLimit) { + try { + for (String key : Commons.EXPORT_MAP.keySet()) { + ExportMap item = Commons.EXPORT_MAP.get(key); + try { + // get total count + long total = item.getDao().countOf(); + long startRow = 0; + int iteration = 1; + if (total > rowLimit) { + do { + String fileName = String.format("%s_%d_%d.json", item.getFileName(), rowLimit, iteration); + //dump(item.getDao().getAll(item.getOrderBy(), startRow, rowLimit), fileName); + jsonDump(item.getDao().getAll(null, startRow, rowLimit), preZipDirectory, fileName); + startRow = startRow + rowLimit; + iteration++; + } while (startRow < total); + } else { + jsonDump(item.getDao().getAll(), preZipDirectory, item.getFileName() + ".json"); + } + _logger.debug("Completed for: {}, {}", key, item.getFileName()); + } catch (Exception ex) { + _logger.error("Exception, item:{}", item, ex); + } + } + } catch (Exception exM) { + _logger.error("Exception,", exM); + } + } + + private void copyVersionDetails(String preZipDirectory) { + JsonUtils.dumps(new SystemApi().getAbout(), preZipDirectory, "version.json"); + } + + @Override + public void run() { + if (Commons.IS_IMPORT_EXPORT_RUNNING.get()) { + _logger.warn("Another instance of import or export job is in progress."); + return; + } + Commons.IS_IMPORT_EXPORT_RUNNING.set(true); + try { + long startTime = System.currentTimeMillis(); + String fileName = this.startExport(); + _logger.debug("Export job completed in {}ms, filename: {}", + System.currentTimeMillis() - startTime, fileName); + } catch (Exception ex) { + _logger.error("Exception,", ex); + } finally { + Commons.IS_IMPORT_EXPORT_RUNNING.set(false); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java new file mode 100644 index 00000000..a25db7dc --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import org.mycontroller.standalone.db.dao.BaseDao; + +import lombok.Getter; +import lombok.Builder; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Builder +@Getter +public class ExportMap { + private String fileName; + private Class clazz; + @SuppressWarnings("rawtypes") + private BaseDao dao; + private String orderBy; + + @SuppressWarnings("rawtypes") + public static ExportMap get(String fileName, Class clazz, BaseDao dao) { + return get(fileName, clazz, dao, "id"); + } + + @SuppressWarnings("rawtypes") + public static ExportMap get(String fileName, Class clazz, BaseDao dao, String orderBy) { + return ExportMap.builder() + .fileName(fileName) + .clazz(clazz) + .dao(dao) + .orderBy(orderBy) + .build(); + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Import.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Import.java new file mode 100644 index 00000000..a06f4cb5 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Import.java @@ -0,0 +1,153 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import javax.ws.rs.BadRequestException; + +import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.StartApp; +import org.mycontroller.standalone.api.jaxrs.model.McFile; +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; + +import com.fasterxml.jackson.databind.JavaType; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Slf4j +public class Import implements Runnable { + + private McFile sourceFile; + + public Import(McFile sourceFile) { + this.sourceFile = sourceFile; + } + + private void startImport() throws IOException { + if (!sourceFile.getName().contains(Commons.EXPORT_FILE_NAME_IDENTITY)) { + throw new BadRequestException("export file name should contain '" + Commons.EXPORT_FILE_NAME_IDENTITY + + "'. Your input:" + + sourceFile.getName()); + } + + _logger.info("About to restore a export, {}", sourceFile); + + String extractedLocation = AppProperties.getInstance().getTmpLocation() + + sourceFile.getName().replaceAll(".zip", ""); + + try { + //Extract zip file + _logger.debug("Zip file:{}", sourceFile.getCanonicalPath()); + + McFileUtils.extractZipFile(sourceFile.getCanonicalPath(), extractedLocation); + _logger.debug("All the files extracted to '{}'", extractedLocation); + + //Validate required files + if (!FileUtils.getFile(extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME).exists()) { + _logger.error("Unable to continue restore opration! selected file not found! File:{}", + extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME); + return; + } + + // import database files + importFiles(extractedLocation + File.separator + Commons.DATABASE_FILES); + + //Stop all services + StartApp.stopServices(false); + + // DO NOT RESTORE PROPERTIES FILE AND CERTIFICATES. But it is available on the export zip + + //Restore resources directory + McFileUtils.restoreResourceFiles(extractedLocation); + _logger.info("Export completed successfully. Start '{}' server manually", AppProperties.APPLICATION_NAME); + } finally { + //clean tmp file + FileUtils.deleteQuietly(FileUtils.getFile(extractedLocation)); + _logger.debug("Tmp location[{}] clean success", extractedLocation); + } + // stop the application + System.exit(0); + } + + private void importFiles(String directoryLocation) { + long startTime = System.currentTimeMillis(); + _logger.info("Import data job started..."); + // get list of files + List dataFiles = Arrays.asList( + FileUtils.getFile(directoryLocation).listFiles()); + for (String key : Commons.EXPORT_MAP.keySet()) { + ExportMap item = Commons.EXPORT_MAP.get(key); + try { + loadFile(dataFiles, item); + _logger.debug("Completed for: {}, {}", key, item.getFileName()); + + } catch (Exception ex) { + _logger.error("Exception,", ex); + } + } + _logger.info("Import data job completed in {} ms", System.currentTimeMillis() - startTime); + + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + private void loadFile(List dataFiles, ExportMap item) { + _logger.info("Processing import for the file: {}*.json", item.getFileName()); + int deletedItemCount = item.getDao().deleteAll(); + _logger.info("Removed existing data from the table. Deleted count: {}", deletedItemCount); + for (File file : dataFiles) { + if (file.getName().startsWith(item.getFileName())) { + Object data = JsonUtils.loads(getType(List.class, item.getClazz()), file); + int createdCount = item.getDao().createBulk((List) data); + _logger.info("Insertion data completed for the file: {}, records count: {}", + file.getName(), createdCount); + } + } + } + + private JavaType getType(@SuppressWarnings("rawtypes") Class collectionClazz, Class clazz) { + JavaType clazzType = RestUtils.getObjectMapper().getTypeFactory().constructType(clazz); + return RestUtils.getObjectMapper().getTypeFactory().constructCollectionType(collectionClazz, clazzType); + } + + @Override + public void run() { + if (Commons.IS_IMPORT_EXPORT_RUNNING.get()) { + _logger.warn("Another instance of import or export job is in progress."); + return; + } + Commons.IS_IMPORT_EXPORT_RUNNING.set(true); + try { + this.startImport(); + } catch (IOException ex) { + _logger.error("Exception,", ex); + } finally { + Commons.IS_IMPORT_EXPORT_RUNNING.set(false); + StartApp.stopServices(); + System.exit(0); + } + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/JsonUtils.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/JsonUtils.java new file mode 100644 index 00000000..6d58b65f --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/JsonUtils.java @@ -0,0 +1,162 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import java.io.File; +import java.io.IOException; + +import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.backup.mixins.MixinExternalServerResourceMap; +import org.mycontroller.standalone.backup.mixins.MixinFirmware; +import org.mycontroller.standalone.backup.mixins.MixinFirmwareType; +import org.mycontroller.standalone.backup.mixins.MixinFirmwareVersion; +import org.mycontroller.standalone.backup.mixins.MixinForwardPayload; +import org.mycontroller.standalone.backup.mixins.MixinMetricsBatteryUsage; +import org.mycontroller.standalone.backup.mixins.MixinMetricsData; +import org.mycontroller.standalone.backup.mixins.MixinNode; +import org.mycontroller.standalone.backup.mixins.MixinOperationRuleDefinitionMap; +import org.mycontroller.standalone.backup.mixins.MixinOperationTable; +import org.mycontroller.standalone.backup.mixins.MixinOperationTimerMap; +import org.mycontroller.standalone.backup.mixins.MixinResource; +import org.mycontroller.standalone.backup.mixins.MixinResourcesLogs; +import org.mycontroller.standalone.backup.mixins.MixinRoleGatewayMap; +import org.mycontroller.standalone.backup.mixins.MixinRoleMqttMap; +import org.mycontroller.standalone.backup.mixins.MixinRoleNodeMap; +import org.mycontroller.standalone.backup.mixins.MixinRoleSensorMap; +import org.mycontroller.standalone.backup.mixins.MixinRoleUserMap; +import org.mycontroller.standalone.backup.mixins.MixinRoom; +import org.mycontroller.standalone.backup.mixins.MixinSensor; +import org.mycontroller.standalone.backup.mixins.MixinSensorVariable; +import org.mycontroller.standalone.backup.mixins.MixinTimer; +import org.mycontroller.standalone.backup.mixins.MixinUidTag; +import org.mycontroller.standalone.backup.mixins.MixinUser; +import org.mycontroller.standalone.db.tables.ExternalServerResourceMap; +import org.mycontroller.standalone.db.tables.Firmware; +import org.mycontroller.standalone.db.tables.FirmwareType; +import org.mycontroller.standalone.db.tables.FirmwareVersion; +import org.mycontroller.standalone.db.tables.ForwardPayload; +import org.mycontroller.standalone.db.tables.MetricsBatteryUsage; +import org.mycontroller.standalone.db.tables.MetricsBinaryTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsCounterTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsDoubleTypeDevice; +import org.mycontroller.standalone.db.tables.MetricsGPSTypeDevice; +import org.mycontroller.standalone.db.tables.Node; +import org.mycontroller.standalone.db.tables.OperationRuleDefinitionMap; +import org.mycontroller.standalone.db.tables.OperationTable; +import org.mycontroller.standalone.db.tables.OperationTimerMap; +import org.mycontroller.standalone.db.tables.Resource; +import org.mycontroller.standalone.db.tables.ResourcesLogs; +import org.mycontroller.standalone.db.tables.RoleGatewayMap; +import org.mycontroller.standalone.db.tables.RoleMqttMap; +import org.mycontroller.standalone.db.tables.RoleNodeMap; +import org.mycontroller.standalone.db.tables.RoleSensorMap; +import org.mycontroller.standalone.db.tables.RoleUserMap; +import org.mycontroller.standalone.db.tables.Room; +import org.mycontroller.standalone.db.tables.Sensor; +import org.mycontroller.standalone.db.tables.SensorVariable; +import org.mycontroller.standalone.db.tables.Timer; +import org.mycontroller.standalone.db.tables.UidTag; +import org.mycontroller.standalone.db.tables.User; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@Slf4j +public class JsonUtils { + private static final String ENCODING = "UTF-8"; + private static final ObjectMapper MAPPER = new ObjectMapper(); + static { + MAPPER.configure(SerializationFeature.INDENT_OUTPUT, true); + MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + MAPPER.addMixIn(User.class, MixinUser.class); + MAPPER.addMixIn(Resource.class, MixinResource.class); + MAPPER.addMixIn(Node.class, MixinNode.class); + MAPPER.addMixIn(MetricsBinaryTypeDevice.class, MixinMetricsData.class); + MAPPER.addMixIn(MetricsDoubleTypeDevice.class, MixinMetricsData.class); + MAPPER.addMixIn(MetricsCounterTypeDevice.class, MixinMetricsData.class); + MAPPER.addMixIn(MetricsGPSTypeDevice.class, MixinMetricsData.class); + MAPPER.addMixIn(MetricsBatteryUsage.class, MixinMetricsBatteryUsage.class); + MAPPER.addMixIn(ExternalServerResourceMap.class, MixinExternalServerResourceMap.class); + MAPPER.addMixIn(Firmware.class, MixinFirmware.class); + MAPPER.addMixIn(FirmwareType.class, MixinFirmwareType.class); + MAPPER.addMixIn(FirmwareVersion.class, MixinFirmwareVersion.class); + MAPPER.addMixIn(ForwardPayload.class, MixinForwardPayload.class); + MAPPER.addMixIn(OperationTable.class, MixinOperationTable.class); + MAPPER.addMixIn(OperationRuleDefinitionMap.class, MixinOperationRuleDefinitionMap.class); + MAPPER.addMixIn(OperationTimerMap.class, MixinOperationTimerMap.class); + MAPPER.addMixIn(ResourcesLogs.class, MixinResourcesLogs.class); + MAPPER.addMixIn(RoleGatewayMap.class, MixinRoleGatewayMap.class); + MAPPER.addMixIn(RoleMqttMap.class, MixinRoleMqttMap.class); + MAPPER.addMixIn(RoleNodeMap.class, MixinRoleNodeMap.class); + MAPPER.addMixIn(RoleSensorMap.class, MixinRoleSensorMap.class); + MAPPER.addMixIn(RoleUserMap.class, MixinRoleUserMap.class); + MAPPER.addMixIn(Room.class, MixinRoom.class); + MAPPER.addMixIn(Sensor.class, MixinSensor.class); + MAPPER.addMixIn(SensorVariable.class, MixinSensorVariable.class); + MAPPER.addMixIn(Timer.class, MixinTimer.class); + MAPPER.addMixIn(UidTag.class, MixinUidTag.class); + } + + public static void dumps(Object data, String... names) { + try { + String stringData = MAPPER.writeValueAsString(data); + File file = FileUtils.getFile(names); + FileUtils.write(file, stringData, ENCODING); + _logger.trace("Json saved: {}", file.getAbsolutePath()); + } catch (IOException ex) { + _logger.error("Exception, fileName:{}", names, ex); + } + } + + public static Object loads(Class clazz, String... names) { + return loads(clazz, FileUtils.getFile(names)); + } + + public static Object loads(Class clazz, File file) { + try { + String content = FileUtils.readFileToString(file, ENCODING); + return MAPPER.readValue(content, clazz); + } catch (IOException ex) { + _logger.error("Exception when loading {}", file.getAbsolutePath(), ex); + } + return null; + } + + public static Object loads(JavaType javaType, String... names) { + return loads(javaType, FileUtils.getFile(names)); + } + + public static Object loads(JavaType javaType, File file) { + try { + String content = FileUtils.readFileToString(file, ENCODING); + return MAPPER.readValue(content, javaType); + } catch (IOException ex) { + _logger.error("Exception when loading {}", file.getAbsolutePath(), ex); + } + return null; + } +} \ No newline at end of file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java new file mode 100644 index 00000000..fd59ac55 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java @@ -0,0 +1,292 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOCase; +import org.apache.commons.io.filefilter.FileFilterUtils; +import org.apache.commons.io.filefilter.IOFileFilter; +import org.apache.commons.io.filefilter.SuffixFileFilter; +import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.api.jaxrs.model.McFile; +import org.mycontroller.standalone.api.jaxrs.model.Query; +import org.mycontroller.standalone.api.jaxrs.model.QueryResponse; +import org.mycontroller.standalone.exceptions.McBadRequestException; +import org.mycontroller.standalone.utils.McUtils; + +import lombok.extern.slf4j.Slf4j; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class McFileUtils { + public static final String KEY_NAME = "name"; + public static final String[] MC_FILE_SUFFIX_FILTER = { "zip", "ZIP" }; + + public static void removeOldFiles(String prefix, int retainMax) throws IOException { + String[] filter = { "zip" }; + Collection zipFiles = FileUtils.listFiles( + FileUtils.getFile(AppProperties.getInstance().getBackupSettings().getBackupLocation()), + filter, true); + + List backupFiles = new ArrayList(); + for (File zipFile : zipFiles) { + if (zipFile.getName().startsWith(prefix)) {//Filter with file name + backupFiles.add(McFile.builder() + .name(zipFile.getName()) + .size(zipFile.length()) + .timestamp(zipFile.lastModified()) + .canonicalPath(zipFile.getCanonicalPath()) + .build()); + } + } + //Do order reverse + Collections.sort(backupFiles, Collections.reverseOrder()); + + if (backupFiles.size() > retainMax) { + _logger.debug("Available files:{}, Maximum files to retain:{}", backupFiles.size(), retainMax); + for (int deleteIndex = retainMax; deleteIndex < backupFiles.size(); deleteIndex++) { + try { + FileUtils.forceDelete(FileUtils.getFile(backupFiles.get(deleteIndex).getCanonicalPath())); + _logger.debug("File deleted, {}", backupFiles.get(deleteIndex)); + } catch (Exception ex) { + _logger.error("File deletion failed", ex); + } + } + } else { + _logger.debug("Available files count:{}", backupFiles.size()); + } + } + + public static String copyStaticFilesAndCreateZipFile(String applicationBackupDir) throws IOException { + //Copy mycontroller.properties file + FileUtils.copyFile( + FileUtils.getFile(System.getProperty("mc.conf.file")), + FileUtils.getFile(applicationBackupDir + File.separator + Commons.APP_PROPERTIES_FILENAME), + true); + FileUtils.copyFile( + FileUtils.getFile(System.getProperty("logback.configurationFile")), + FileUtils.getFile(applicationBackupDir + File.separator + "logback.xml"), + true); + if (AppProperties.getInstance().isWebHttpsEnabled()) { + String KEY_STORE_FILE = applicationBackupDir + File.separator + + FileUtils.getFile(AppProperties.getInstance().getWebSslKeystoreFile()).getName(); + FileUtils.copyFile( + FileUtils.getFile(AppProperties.getInstance().getWebSslKeystoreFile()), + FileUtils.getFile(KEY_STORE_FILE), + true); + } + //Copy resources directory + FileUtils.copyDirectory( + FileUtils.getFile(AppProperties.getInstance().getResourcesLocation()), + FileUtils.getFile(applicationBackupDir + File.separator + Commons.RESOURCES_LOCATION), + true); + _logger.debug("Copied all the files"); + //create zip file + String zipFileName = applicationBackupDir + ".zip"; + McUtils.createZipFile(applicationBackupDir, zipFileName); + _logger.debug("zip file creation done"); + //clean temporary files + FileUtils.deleteDirectory(FileUtils.getFile(applicationBackupDir)); + return zipFileName; + } + + public static void extractZipFile(String zipFileName, String destination) + throws FileNotFoundException, IOException { + _logger.info("Files, zip:{}, des:{}", zipFileName, destination); + ZipFile zipFile = new ZipFile(zipFileName); + Enumeration enu = zipFile.entries(); + //create destination if not exists + FileUtils.forceMkdir(FileUtils.getFile(destination)); + while (enu.hasMoreElements()) { + ZipEntry zipEntry = (ZipEntry) enu.nextElement(); + String name = zipEntry.getName(); + long size = zipEntry.getSize(); + long compressedSize = zipEntry.getCompressedSize(); + _logger.debug("name:{} | size:{} | compressed size:{}", name, size, compressedSize); + File file = FileUtils.getFile(destination + File.separator + name); + //Create destination if it's not available + if (name.endsWith(File.separator)) { + file.mkdirs(); + continue; + } + + File parent = file.getParentFile(); + if (parent != null) { + parent.mkdirs(); + } + + InputStream is = zipFile.getInputStream(zipEntry); + FileOutputStream fos = new FileOutputStream(file); + byte[] bytes = new byte[1024]; + int length; + while ((length = is.read(bytes)) >= 0) { + fos.write(bytes, 0, length); + } + is.close(); + fos.close(); + } + zipFile.close(); + } + + public static void restoreResourceFiles(String extractedLocation) throws IOException { + //Restore resources directory + //Remove old files + FileUtils.deleteQuietly(FileUtils.getFile(AppProperties.getInstance().getResourcesLocation())); + //restore resources directory, if exists + File resourcesDir = FileUtils.getFile(extractedLocation + File.separator + Commons.RESOURCES_LOCATION); + if (resourcesDir.exists()) { + FileUtils.copyDirectory( + resourcesDir, FileUtils.getFile(AppProperties.getInstance().getResourcesLocation()), true); + } + } + + public static McFile getMcFile(String fileLocation, String suppliedFileName) throws IOException, + McBadRequestException { + if (suppliedFileName == null) { + throw new McBadRequestException("File can not be null"); + } + String backupCanonicalPath = FileUtils.getFile(fileLocation).getCanonicalPath(); + String fileFullName = fileLocation + suppliedFileName; + if (McUtils.isInScope(backupCanonicalPath, fileFullName)) { + File bkpFile = FileUtils.getFile(fileFullName); + return McFile.builder() + .name(bkpFile.getName()) + .canonicalPath(bkpFile.getCanonicalPath()) + .timestamp(bkpFile.lastModified()) + .size(bkpFile.length()) + .build(); + } else { + throw new McBadRequestException("Trying to access file from outside specified scope"); + } + } + + public static void deleteMcFiles(String mcFileLocation, List mcFiles) throws IOException { + String fileLocation = McUtils.getDirectoryLocation(FileUtils.getFile(mcFileLocation).getCanonicalPath()); + for (String mcFile : mcFiles) { + String fileFullPath = fileLocation + mcFile; + if (McUtils.isInScope(fileLocation, fileFullPath)) { + if (FileUtils.deleteQuietly(FileUtils.getFile(fileFullPath))) { + _logger.debug("File deleted successfully! {}", fileFullPath); + } else { + _logger.warn("File deletion failed! {}", fileFullPath); + } + } else { + _logger.warn("Trying to delete file from outside scope! Filepath:{}, CanonicalPath:{}", + fileFullPath, FileUtils.getFile(fileFullPath).getCanonicalPath()); + } + } + } + + public static QueryResponse getMcFiles(String baseLocation, String fileNameIdentity, + HashMap filters) + throws IOException { + Query query = Query.get(filters); + String locationCanonicalPath = McUtils + .getDirectoryLocation(FileUtils.getFile(baseLocation).getCanonicalPath()); + + if (FileUtils.getFile(locationCanonicalPath).exists()) { + List files = new ArrayList(); + + //Filters + //Extension filter + SuffixFileFilter extensionFilter = new SuffixFileFilter(MC_FILE_SUFFIX_FILTER, IOCase.INSENSITIVE); + + //name filter + IOFileFilter nameFileFilter = null; + @SuppressWarnings("unchecked") + List fileNames = (List) query.getFilters().get(KEY_NAME); + if (fileNames == null) { + fileNames = new ArrayList(); + } + fileNames.add(fileNameIdentity); + + if (fileNames != null && !fileNames.isEmpty()) { + for (String fileName : fileNames) { + if (nameFileFilter == null) { + nameFileFilter = FileFilterUtils.and( + new WildcardFileFilter("*" + fileName + "*", IOCase.INSENSITIVE)); + } else { + nameFileFilter = FileFilterUtils.and(nameFileFilter, + new WildcardFileFilter("*" + fileName + "*", IOCase.INSENSITIVE)); + } + } + } + //Combine all filters + IOFileFilter finalFileFilter = null; + if (nameFileFilter != null) { + finalFileFilter = FileFilterUtils.and(extensionFilter, nameFileFilter); + } else { + finalFileFilter = extensionFilter; + } + List mcFiles = new ArrayList(FileUtils.listFiles(FileUtils.getFile(locationCanonicalPath), + finalFileFilter, TrueFileFilter.INSTANCE)); + query.setFilteredCount((long) mcFiles.size()); + //Get total items without filter + query.setTotalItems((long) FileUtils.listFiles(FileUtils.getFile(locationCanonicalPath), + extensionFilter, TrueFileFilter.INSTANCE).size()); + int fileFrom; + int fileTo; + if (query.getPageLimit() == -1) { + fileTo = mcFiles.size(); + fileFrom = 0; + } else { + fileFrom = query.getStartingRow().intValue(); + fileTo = (int) (query.getPage() * query.getPageLimit()); + } + for (File mcFile : mcFiles) { + String name = mcFile.getCanonicalPath().replace(locationCanonicalPath, ""); + files.add(McFile.builder() + .name(name) + .size(mcFile.length()) + .timestamp(mcFile.lastModified()) + .canonicalPath(mcFile.getCanonicalPath()) + .build()); + } + + if (!files.isEmpty()) { + //Do order reverse + Collections.sort(files, Collections.reverseOrder()); + if (fileFrom < files.size()) { + files = files.subList(Math.max(0, fileFrom), Math.min(fileTo, files.size())); + } + } + return QueryResponse.builder().data(files).query(query).build(); + + } else { + throw new FileNotFoundException("File location not found: " + locationCanonicalPath); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java index 942d8f0c..c339ed48 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,13 +17,7 @@ package org.mycontroller.standalone.backup; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; import javax.ws.rs.BadRequestException; @@ -31,7 +25,7 @@ import org.mycontroller.standalone.AppProperties; import org.mycontroller.standalone.AppProperties.DB_TYPE; import org.mycontroller.standalone.StartApp; -import org.mycontroller.standalone.api.jaxrs.model.BackupFile; +import org.mycontroller.standalone.api.jaxrs.model.McFile; import org.mycontroller.standalone.db.DataBaseUtils; import org.mycontroller.standalone.utils.McUtils; @@ -43,9 +37,9 @@ */ @Slf4j public class Restore implements Runnable { - private BackupFile backupFile; + private McFile backupFile; - public Restore(BackupFile backupFile) { + public Restore(McFile backupFile) { this.backupFile = backupFile; } @@ -53,18 +47,17 @@ private static void loadDefaultProperties() { StartApp.loadInitialProperties(System.getProperty("mc.conf.file")); } - public static void restore(BackupFile backupFile) throws IOException { - if (BRCommons.isBackupRestoreRunning()) { + public static void restore(McFile backupFile) throws IOException { + if (Commons.IS_BACKUP_RESTORE_RUNNING.get()) { throw new BadRequestException("A backup or restore is running"); } - if (!backupFile.getName().contains(BRCommons.FILE_NAME_IDENTITY)) { - throw new BadRequestException("backup file name should contain '" + BRCommons.FILE_NAME_IDENTITY - + "'. Your input:" - + backupFile.getName()); + if (!backupFile.getName().contains(Commons.BACKUP_FILE_NAME_IDENTITY)) { + throw new BadRequestException("backup file name should contain '" + Commons.BACKUP_FILE_NAME_IDENTITY + + "'. Your input:" + backupFile.getName()); } - BRCommons.setBackupRestoreRunning(true); + Commons.IS_BACKUP_RESTORE_RUNNING.set(true); _logger.info("About to restore a backup, {}", backupFile); @@ -74,22 +67,20 @@ public static void restore(BackupFile backupFile) throws IOException { //Extract zip file _logger.debug("Zip file:{}", backupFile.getCanonicalPath()); - extractZipFile(backupFile.getCanonicalPath(), extractedLocation); + McFileUtils.extractZipFile(backupFile.getCanonicalPath(), extractedLocation); _logger.debug("All the files extracted to '{}'", extractedLocation); - //Validate required files - if (!FileUtils.getFile(extractedLocation + File.separator + BRCommons.APP_PROPERTIES_FILENAME).exists()) { + if (!FileUtils.getFile(extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME).exists()) { _logger.error("Unable to continue restore opration! selected file not found! File:{}", - extractedLocation + File.separator + BRCommons.APP_PROPERTIES_FILENAME); + extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME); return; } //Load initial properties - if (!StartApp - .loadInitialProperties(extractedLocation + File.separator + BRCommons.APP_PROPERTIES_FILENAME)) { + if (!StartApp.loadInitialProperties(extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME)) { loadDefaultProperties(); _logger.error("Failed to load properties file from '{}'", extractedLocation + File.separator - + BRCommons.APP_PROPERTIES_FILENAME); + + Commons.APP_PROPERTIES_FILENAME); return; } boolean executeDbBackup = false; @@ -102,24 +93,24 @@ public static void restore(BackupFile backupFile) throws IOException { if (executeDbBackup) { //Validate required files - if (!FileUtils.getFile(extractedLocation + File.separator + BRCommons.DATABASE_FILENAME).exists()) { + if (!FileUtils.getFile(extractedLocation + File.separator + Commons.BACKUP_DATABASE_FILENAME).exists()) { _logger.error("Unable to continue restore opration! selected file not found! File:{}", - extractedLocation + File.separator + BRCommons.DATABASE_FILENAME); + extractedLocation + File.separator + Commons.BACKUP_DATABASE_FILENAME); loadDefaultProperties(); return; } } //Stop all services - StartApp.stopServices(); + StartApp.stopServices(false); //Restore properties file //Remove old properties file - FileUtils - .deleteQuietly(FileUtils.getFile(BRCommons.APP_CONF_LOCATION + BRCommons.APP_PROPERTIES_FILENAME)); + FileUtils.deleteQuietly(FileUtils.getFile(Commons.APP_CONF_LOCATION + Commons.APP_PROPERTIES_FILENAME)); + FileUtils.copyFile( - FileUtils.getFile(extractedLocation + File.separator + BRCommons.APP_PROPERTIES_FILENAME), - FileUtils.getFile(BRCommons.APP_CONF_LOCATION + BRCommons.APP_PROPERTIES_FILENAME)); + FileUtils.getFile(extractedLocation + File.separator + Commons.APP_PROPERTIES_FILENAME), + FileUtils.getFile(Commons.APP_CONF_LOCATION + Commons.APP_PROPERTIES_FILENAME)); if (AppProperties.getInstance().isWebHttpsEnabled()) { //Remove old files @@ -131,20 +122,13 @@ public static void restore(BackupFile backupFile) throws IOException { FileUtils.getFile(AppProperties.getInstance().getWebSslKeystoreFile())); } - //Restore resources directory - //Remove old files - FileUtils.deleteQuietly(FileUtils.getFile(AppProperties.getInstance().getResourcesLocation())); - //restore resources directory, if exists - File resourcesDir = FileUtils.getFile(extractedLocation + File.separator + BRCommons.RESOURCES_LOCATION); - if (resourcesDir.exists()) { - FileUtils.copyDirectory( - resourcesDir, FileUtils.getFile(AppProperties.getInstance().getResourcesLocation()), true); - } + McFileUtils.restoreResourceFiles(extractedLocation); if (executeDbBackup) { //restore database - if (!DataBaseUtils.restoreDatabase(extractedLocation + File.separator + BRCommons.DATABASE_FILENAME)) { + if (!DataBaseUtils.restoreDatabase(extractedLocation + File.separator + + Commons.BACKUP_DATABASE_FILENAME)) { _logger.error("Database restore failed:{}", extractedLocation + File.separator - + BRCommons.DATABASE_FILENAME); + + Commons.BACKUP_DATABASE_FILENAME); return; } } else { @@ -155,49 +139,12 @@ public static void restore(BackupFile backupFile) throws IOException { //clean tmp file FileUtils.deleteQuietly(FileUtils.getFile(extractedLocation)); _logger.debug("Tmp location[{}] clean success", extractedLocation); - BRCommons.setBackupRestoreRunning(false); + Commons.IS_BACKUP_RESTORE_RUNNING.set(false); } //Stop application System.exit(0); } - private static void extractZipFile(String zipFileName, String destination) - throws FileNotFoundException, IOException { - ZipFile zipFile = new ZipFile(zipFileName); - Enumeration enu = zipFile.entries(); - //create destination if not exists - FileUtils.forceMkdir(FileUtils.getFile(destination)); - while (enu.hasMoreElements()) { - ZipEntry zipEntry = (ZipEntry) enu.nextElement(); - String name = zipEntry.getName(); - long size = zipEntry.getSize(); - long compressedSize = zipEntry.getCompressedSize(); - _logger.debug("name:{} | size:{} | compressed size:{}", name, size, compressedSize); - File file = FileUtils.getFile(destination + File.separator + name); - //Create destination if it's not available - if (name.endsWith(File.separator)) { - file.mkdirs(); - continue; - } - - File parent = file.getParentFile(); - if (parent != null) { - parent.mkdirs(); - } - - InputStream is = zipFile.getInputStream(zipEntry); - FileOutputStream fos = new FileOutputStream(file); - byte[] bytes = new byte[1024]; - int length; - while ((length = is.read(bytes)) >= 0) { - fos.write(bytes, 0, length); - } - is.close(); - fos.close(); - } - zipFile.close(); - } - @Override public void run() { try { diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinExternalServerResourceMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinExternalServerResourceMap.java new file mode 100644 index 00000000..49da753d --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinExternalServerResourceMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.ExternalServerTable; +import org.mycontroller.standalone.db.tables.Resource; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinExternalServerResourceMap { + + @JsonSerialize(using = SerializerSimpleResource.class) + public abstract Resource getResource(); + + @JsonSerialize(using = SerializerSimpleExternalServerTable.class) + public abstract ExternalServerTable getExternalServerTable(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmware.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmware.java new file mode 100644 index 00000000..0d259855 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmware.java @@ -0,0 +1,39 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.FirmwareType; +import org.mycontroller.standalone.db.tables.FirmwareVersion; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "fileString", "fileBytes", "fileType", "blockSize", "firmwareName" }) +public abstract class MixinFirmware { + + @JsonSerialize(using = SerializerSimpleFirmwareType.class) + public abstract FirmwareType getType(); + + @JsonSerialize(using = SerializerSimpleFirmwareVersion.class) + public abstract FirmwareVersion getVersion(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareType.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareType.java new file mode 100644 index 00000000..5a44c5b0 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareType.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "newId" }) +public abstract class MixinFirmwareType { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareVersion.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareVersion.java new file mode 100644 index 00000000..6d69ac47 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinFirmwareVersion.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "newId" }) +public abstract class MixinFirmwareVersion { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinForwardPayload.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinForwardPayload.java new file mode 100644 index 00000000..5df9c9e5 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinForwardPayload.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.SensorVariable; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinForwardPayload { + + @JsonSerialize(using = SerializerSimpleSensorVariable.class) + public abstract SensorVariable getSource(); + + @JsonSerialize(using = SerializerSimpleSensorVariable.class) + public abstract SensorVariable getDestination(); + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsBatteryUsage.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsBatteryUsage.java new file mode 100644 index 00000000..ecc9c842 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsBatteryUsage.java @@ -0,0 +1,36 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Node; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "start", "end" }) +public abstract class MixinMetricsBatteryUsage { + + @JsonSerialize(using = SerializerSimpleNode.class) + public abstract Node getNode(); + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsData.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsData.java new file mode 100644 index 00000000..09ebc118 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinMetricsData.java @@ -0,0 +1,36 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.SensorVariable; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "start", "end" }) +public abstract class MixinMetricsData { + + @JsonSerialize(using = SerializerSimpleSensorVariable.class) + public abstract SensorVariable getSensorVariable(); + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinNode.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinNode.java new file mode 100644 index 00000000..2b28ec2e --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinNode.java @@ -0,0 +1,39 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Firmware; +import org.mycontroller.standalone.db.tables.GatewayTable; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "permissions", "allowedResources" }) +public abstract class MixinNode { + + @JsonSerialize(using = SerializerSimpleGatewayTable.class) + public abstract GatewayTable getGatewayTable(); + + @JsonSerialize(using = SerializerSimpleFirmware.class) + public abstract Firmware getFirmware(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationRuleDefinitionMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationRuleDefinitionMap.java new file mode 100644 index 00000000..aa71ba67 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationRuleDefinitionMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.ExternalServerTable; +import org.mycontroller.standalone.db.tables.Resource; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinOperationRuleDefinitionMap { + + @JsonSerialize(using = SerializerSimpleRuleDefinitionTable.class) + public abstract Resource getRuleDefinitionTable(); + + @JsonSerialize(using = SerializerSimpleOperationTable.class) + public abstract ExternalServerTable getOperationTable(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTable.java new file mode 100644 index 00000000..132edbcb --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTable.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.User; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinOperationTable { + + @JsonSerialize(using = SerializerSimpleUser.class) + public abstract User getUser(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTimerMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTimerMap.java new file mode 100644 index 00000000..b568fcca --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinOperationTimerMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.ExternalServerTable; +import org.mycontroller.standalone.db.tables.Resource; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinOperationTimerMap { + + @JsonSerialize(using = SerializerSimpleTimer.class) + public abstract Resource getTimer(); + + @JsonSerialize(using = SerializerSimpleOperationTable.class) + public abstract ExternalServerTable getOperationTable(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResource.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResource.java new file mode 100644 index 00000000..6897c395 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResource.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "externalServers", "externalServersList", "resourceName" }) +public abstract class MixinResource { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourceGroupMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourceGroupMap.java new file mode 100644 index 00000000..37fa7159 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourceGroupMap.java @@ -0,0 +1,34 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.ResourcesGroup; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinResourceGroupMap { + + @JsonSerialize(using = SerializerSimpleResourceGroup.class) + public abstract ResourcesGroup getResourcesGroup(); + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourcesLogs.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourcesLogs.java new file mode 100644 index 00000000..cb31b586 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinResourcesLogs.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "resource" }) +public abstract class MixinResourcesLogs { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleGatewayMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleGatewayMap.java new file mode 100644 index 00000000..4e01318f --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleGatewayMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.GatewayTable; +import org.mycontroller.standalone.db.tables.Role; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinRoleGatewayMap { + + @JsonSerialize(using = SerializerSimpleRole.class) + public abstract Role getRole(); + + @JsonSerialize(using = SerializerSimpleGatewayTable.class) + public abstract GatewayTable getGatewayTable(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleMqttMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleMqttMap.java new file mode 100644 index 00000000..f5d129a7 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleMqttMap.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Role; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinRoleMqttMap { + + @JsonSerialize(using = SerializerSimpleRole.class) + public abstract Role getRole(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleNodeMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleNodeMap.java new file mode 100644 index 00000000..69988146 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleNodeMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Node; +import org.mycontroller.standalone.db.tables.Role; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinRoleNodeMap { + + @JsonSerialize(using = SerializerSimpleRole.class) + public abstract Role getRole(); + + @JsonSerialize(using = SerializerSimpleNode.class) + public abstract Node getNode(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleSensorMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleSensorMap.java new file mode 100644 index 00000000..5fd603e9 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleSensorMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Role; +import org.mycontroller.standalone.db.tables.Sensor; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinRoleSensorMap { + + @JsonSerialize(using = SerializerSimpleRole.class) + public abstract Role getRole(); + + @JsonSerialize(using = SerializerSimpleSensor.class) + public abstract Sensor getSensor(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleUserMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleUserMap.java new file mode 100644 index 00000000..10ab036a --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoleUserMap.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Role; +import org.mycontroller.standalone.db.tables.User; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public abstract class MixinRoleUserMap { + + @JsonSerialize(using = SerializerSimpleRole.class) + public abstract Role getRole(); + + @JsonSerialize(using = SerializerSimpleUser.class) + public abstract User getUser(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoom.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoom.java new file mode 100644 index 00000000..5d13af95 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinRoom.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "fullPath" }) +public abstract class MixinRoom { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensor.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensor.java new file mode 100644 index 00000000..463c33ee --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensor.java @@ -0,0 +1,39 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Node; +import org.mycontroller.standalone.db.tables.Room; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "variableTypes" }) +public abstract class MixinSensor { + + @JsonSerialize(using = SerializerSimpleNode.class) + public abstract Node getNode(); + + @JsonSerialize(using = SerializerSimpleRoom.class) + public abstract Room getRoom(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensorVariable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensorVariable.java new file mode 100644 index 00000000..b4a6367c --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinSensorVariable.java @@ -0,0 +1,35 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import org.mycontroller.standalone.db.tables.Sensor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "metricsGraph", "name" }) +public abstract class MixinSensorVariable { + + @JsonSerialize(using = SerializerSimpleSensor.class) + public abstract Sensor getSensor(); +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinTimer.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinTimer.java new file mode 100644 index 00000000..1065bca6 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinTimer.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "operationIds", "targetClass", "timerDataString", "operations", "validityString" }) +public abstract class MixinTimer { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUidTag.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUidTag.java new file mode 100644 index 00000000..99f14087 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUidTag.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "resourceName" }) +public abstract class MixinUidTag { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUser.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUser.java new file mode 100644 index 00000000..cda5ef89 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/MixinUser.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.mycontroller.standalone.backup.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +@JsonIgnoreProperties({ "permissions", "allowedResources" }) +public abstract class MixinUser { + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleExternalServerTable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleExternalServerTable.java new file mode 100644 index 00000000..6fda68de --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleExternalServerTable.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.ExternalServerTable; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleExternalServerTable extends JsonSerializer { + + @Override + public void serialize(ExternalServerTable item, JsonGenerator jgen, SerializerProvider provider) + throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmware.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmware.java new file mode 100644 index 00000000..860abf5b --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmware.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Firmware; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleFirmware extends JsonSerializer { + + @Override + public void serialize(Firmware item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareType.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareType.java new file mode 100644 index 00000000..9856022c --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareType.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.FirmwareType; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleFirmwareType extends JsonSerializer { + + @Override + public void serialize(FirmwareType item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareVersion.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareVersion.java new file mode 100644 index 00000000..94565c78 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleFirmwareVersion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.FirmwareVersion; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleFirmwareVersion extends JsonSerializer { + + @Override + public void serialize(FirmwareVersion item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleGatewayTable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleGatewayTable.java new file mode 100644 index 00000000..27ecd839 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleGatewayTable.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.GatewayTable; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleGatewayTable extends JsonSerializer { + + @Override + public void serialize(GatewayTable item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleNode.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleNode.java new file mode 100644 index 00000000..7243d69f --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleNode.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Node; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleNode extends JsonSerializer { + + @Override + public void serialize(Node item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleOperationTable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleOperationTable.java new file mode 100644 index 00000000..bf1f9520 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleOperationTable.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.OperationTable; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleOperationTable extends JsonSerializer { + + @Override + public void serialize(OperationTable item, JsonGenerator jgen, SerializerProvider provider) + throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResource.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResource.java new file mode 100644 index 00000000..4a065ae5 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResource.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Resource; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleResource extends JsonSerializer { + + @Override + public void serialize(Resource item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResourceGroup.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResourceGroup.java new file mode 100644 index 00000000..c40a92ec --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleResourceGroup.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Timer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleResourceGroup extends JsonSerializer { + + @Override + public void serialize(Timer item, JsonGenerator jgen, SerializerProvider provider) + throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRole.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRole.java new file mode 100644 index 00000000..6353a5d7 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRole.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Role; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleRole extends JsonSerializer { + + @Override + public void serialize(Role item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRoom.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRoom.java new file mode 100644 index 00000000..bae55db7 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRoom.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Room; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleRoom extends JsonSerializer { + + @Override + public void serialize(Room item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRuleDefinitionTable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRuleDefinitionTable.java new file mode 100644 index 00000000..c8fce389 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleRuleDefinitionTable.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.RuleDefinitionTable; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleRuleDefinitionTable extends JsonSerializer { + + @Override + public void serialize(RuleDefinitionTable item, JsonGenerator jgen, SerializerProvider provider) + throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensor.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensor.java new file mode 100644 index 00000000..b66b469a --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensor.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Sensor; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleSensor extends JsonSerializer { + + @Override + public void serialize(Sensor item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensorVariable.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensorVariable.java new file mode 100644 index 00000000..91f136d7 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleSensorVariable.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.SensorVariable; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleSensorVariable extends JsonSerializer { + + @Override + public void serialize(SensorVariable item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleTimer.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleTimer.java new file mode 100644 index 00000000..77e2f9c1 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleTimer.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.Timer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleTimer extends JsonSerializer { + + @Override + public void serialize(Timer item, JsonGenerator jgen, SerializerProvider provider) + throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleUser.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleUser.java new file mode 100644 index 00000000..abb4d889 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleUser.java @@ -0,0 +1,50 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.backup.mixins; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; +import org.mycontroller.standalone.db.tables.User; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ + +public class SerializerSimpleUser extends JsonSerializer { + + @Override + public void serialize(User item, JsonGenerator jgen, SerializerProvider provider) throws IOException, + JsonProcessingException { + if (item != null) { + Map data = new HashMap(); + data.put("id", item.getId()); + RestUtils.getObjectMapper().writeValue(jgen, data); + } else { + jgen.writeNull(); + } + } + +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseAbstractDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseAbstractDaoImpl.java index 9aeb8bbd..ebde46d7 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseAbstractDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseAbstractDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -531,4 +531,40 @@ protected void updatePurgeCondition(Where where, String key, Object v } } + public int deleteAll() { + DeleteBuilder deleteBuilder = this.getDao().deleteBuilder(); + int count = 0; + try { + count = deleteBuilder.delete(); + _logger.debug("Deleted, {} records", count); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return count; + } + + public int createBulk(List items) { + Integer count = 0; + try { + count = this.getDao().create(items); + _logger.debug("Create count:{}", count); + } catch (SQLException ex) { + _logger.error("Exception", ex); + } + return count; + } + + public List getAll(String orderBy, long startRow, long limit) { + QueryBuilder queryBuilder = this.getDao().queryBuilder(); + try { + if (orderBy != null) { + queryBuilder.orderBy(orderBy, true); + } + return queryBuilder.offset(startRow).limit(limit).query(); + } catch (SQLException ex) { + _logger.error("Exception,", ex); + } + return new ArrayList(); + } + } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseDao.java index 3aea23db..dd980d16 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/BaseDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,6 +33,10 @@ public interface BaseDao { void createOrUpdate(Tdao tdao); + int createBulk(List items); + + int deleteAll(); + void delete(Tdao tdao); void deleteById(Tid id); @@ -51,6 +55,8 @@ public interface BaseDao { List getAll(); + List getAll(String orderBy, long startRow, long limit); + Tdao get(Tdao tdao); Tdao getById(Tid id); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java index 508747d2..31384abf 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/MetricsDoubleTypeDeviceDaoImpl.java @@ -22,6 +22,7 @@ import org.mycontroller.standalone.api.jaxrs.model.ResourcePurgCondition; import org.mycontroller.standalone.api.jaxrs.model.ResourcePurgeConf; import org.mycontroller.standalone.db.DB_TABLES; +import org.mycontroller.standalone.db.migration.ClientBase; import org.mycontroller.standalone.db.tables.MetricsDoubleTypeDevice; import org.mycontroller.standalone.exceptions.McDatabaseException; import org.mycontroller.standalone.metrics.MetricsUtils.AGGREGATION_TYPE; @@ -200,14 +201,17 @@ public List getAggregationRequiredVariableIds(AGGREGATI public MetricsDoubleTypeDevice getMinMaxAvg(MetricsDoubleTypeDevice metric) { StringBuilder query = new StringBuilder(); StringBuilder queryTimestamp = new StringBuilder(); + + ClientBase client = new ClientBase(); + //timestamp from / to if (metric.getStart() != null) { - queryTimestamp.append(" AND ").append(MetricsDoubleTypeDevice.KEY_TIMESTAMP).append(" > ") - .append(metric.getStart()); + queryTimestamp.append(" AND ").append(client.getColumnName(MetricsDoubleTypeDevice.KEY_TIMESTAMP)) + .append(" > ").append(metric.getStart()); } if (metric.getEnd() != null) { - queryTimestamp.append(" AND ").append(MetricsDoubleTypeDevice.KEY_TIMESTAMP).append(" <= ") - .append(metric.getEnd()); + queryTimestamp.append(" AND ").append(client.getColumnName(MetricsDoubleTypeDevice.KEY_TIMESTAMP)) + .append(" <= ").append(metric.getEnd()); } try { //Query sample @@ -217,19 +221,20 @@ public MetricsDoubleTypeDevice getMinMaxAvg(MetricsDoubleTypeDevice metric) { //Query to get minumum query.append("SELECT MIN(MINREF) AS MIN FROM (SELECT MIN(MIN) AS MINREF FROM ") - .append(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE).append(" WHERE ") - .append(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID).append("=") + .append(client.getTableName(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE)).append(" WHERE ") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)).append("=") .append(metric.getSensorVariable().getId()); if (queryTimestamp.length() > 0) { query.append(queryTimestamp); } query.append(" UNION ") - .append("SELECT MIN(AVG) AS MINREF FROM ").append(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE) + .append("SELECT MIN(AVG) AS MINREF FROM ") + .append(client.getTableName(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE)) .append(" WHERE ") - .append(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID).append("=") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)).append("=") .append(metric.getSensorVariable().getId()) - .append(" AND ").append(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE).append("=") - .append(AGGREGATION_TYPE.RAW.ordinal()); + .append(" AND ").append(client.getColumnName(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE)) + .append("=").append(AGGREGATION_TYPE.RAW.ordinal()); if (queryTimestamp.length() > 0) { query.append(queryTimestamp); @@ -253,19 +258,20 @@ public MetricsDoubleTypeDevice getMinMaxAvg(MetricsDoubleTypeDevice metric) { //Query to get maximum query.append("SELECT MAX(MAXREF) AS MAX FROM (SELECT MAX(MAX) AS MAXREF FROM ") - .append(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE).append(" WHERE ") - .append(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID).append("=") + .append(client.getTableName(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE)).append(" WHERE ") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)).append("=") .append(metric.getSensorVariable().getId()); if (queryTimestamp.length() > 0) { query.append(queryTimestamp); } query.append(" UNION ") - .append("SELECT MAX(AVG) AS MAXREF FROM ").append(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE) + .append("SELECT MAX(AVG) AS MAXREF FROM ") + .append(client.getTableName(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE)) .append(" WHERE ") - .append(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID).append("=") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)).append("=") .append(metric.getSensorVariable().getId()) - .append(" AND ").append(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE).append("=") - .append(AGGREGATION_TYPE.RAW.ordinal()); + .append(" AND ").append(client.getColumnName(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE)) + .append("=").append(AGGREGATION_TYPE.RAW.ordinal()); //timestamp from / to if (queryTimestamp.length() > 0) { query.append(queryTimestamp); @@ -288,11 +294,12 @@ public MetricsDoubleTypeDevice getMinMaxAvg(MetricsDoubleTypeDevice metric) { //WHERE sensorVariableId=7 AND timestamp > fromTime AND timestamp <= toTime) AS MASTER_TABLE //Query to get average - query.append("SELECT ROUND(SUM(").append(MetricsDoubleTypeDevice.KEY_AVG).append(" * ") - .append(MetricsDoubleTypeDevice.KEY_SAMPLES).append(") / SUM(") - .append(MetricsDoubleTypeDevice.KEY_SAMPLES).append("), 2) AS AVG FROM ") - .append(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE).append(" WHERE ") - .append(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID).append("=") + query.append("SELECT SUM(") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_AVG)).append(" * ") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SAMPLES)).append(") / SUM(") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SAMPLES)).append(") AS AVG FROM ") + .append(client.getTableName(DB_TABLES.METRICS_DOUBLE_TYPE_DEVICE)).append(" WHERE ") + .append(client.getColumnName(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)).append("=") .append(metric.getSensorVariable().getId()); //timestamp from / to if (queryTimestamp.length() > 0) { diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDao.java index 3a7854b5..96255a01 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,7 @@ * @author Jeeva Kandasamy (jkandasa) * @since 0.0.1 */ -public interface ResourcesGroupMapDao { +public interface ResourcesGroupMapDao extends BaseDao { void create(ResourcesGroupMap resourcesGroupMap); void createOrUpdate(ResourcesGroupMap resourcesGroupMap); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDaoImpl.java index c856f46e..ea7e48c4 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesGroupMapDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -221,4 +221,16 @@ public QueryResponse getAll(Query query) { throw new McDatabaseException(ex); } } + + @Override + public ResourcesGroupMap get(ResourcesGroupMap tdao) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List getAll(List ids) { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDao.java index a490fc89..880afbc2 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,7 +27,7 @@ * @author Jeeva Kandasamy (jkandasa) * @since 0.0.1 */ -public interface ResourcesLogsDao { +public interface ResourcesLogsDao extends BaseDao { void add(ResourcesLogs resourcesLogs); void delete(ResourcesLogs resourcesLogs); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDaoImpl.java index 3c7e1c35..f642f8df 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/ResourcesLogsDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -236,4 +236,16 @@ public void delete(List ids) { } } + + @Override + public ResourcesLogs get(ResourcesLogs tdao) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List getAll(List ids) { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDao.java index d437e8d7..61ff313e 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,7 @@ * @author Jeeva Kandasamy (jkandasa) * @since 0.0.2 */ -public interface SensorsVariablesMapDao { +public interface SensorsVariablesMapDao extends BaseDao { void create(SensorsVariablesMap sensorsVariablesMap); void create(MESSAGE_TYPE_PRESENTATION sensorType, MESSAGE_TYPE_SET_REQ variableType); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDaoImpl.java index db0a4a56..dbfc70af 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/SensorsVariablesMapDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -145,4 +145,10 @@ private void nodeIdSensorIdnullCheck(MESSAGE_TYPE_PRESENTATION sensorType, MESSA + sensorType + ",variableType:" + variableType); } } + + @Override + public List getAll(List ids) { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDao.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDao.java index 0a5817f7..6c0a9f78 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDao.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDao.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +25,7 @@ * @author Jeeva Kandasamy (jkandasa) * @since 0.0.1 */ -public interface UserSettingsDao { +public interface UserSettingsDao extends BaseDao { void create(UserSettings userSettings); void createOrUpdate(UserSettings userSettings); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDaoImpl.java b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDaoImpl.java index c2ff9324..431ed23d 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDaoImpl.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/dao/UserSettingsDaoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -143,4 +143,10 @@ public UserSettings get(User user, String key) { throw new McDatabaseException(ex); } } + + @Override + public List getAll(List ids) { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/SensorVariable.java b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/SensorVariable.java index 37214759..514362e5 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/SensorVariable.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/SensorVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -176,7 +176,11 @@ public void setProperties(HashMap properties) { public MetricsGraph getMetricsGraph() { if (getProperties().get(KEY_GP_USE_GLOBAL) == null || (boolean) getProperties().get(KEY_GP_USE_GLOBAL)) { - return AppProperties.getInstance().getMetricsGraphSettings().getMetric(variableType.getText()); + if (variableType != null) { + return AppProperties.getInstance().getMetricsGraphSettings().getMetric(variableType.getText()); + } else { + return MetricsGraph.get(properties); + } } else { return MetricsGraph.get(properties); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/externalserver/config/ExternalServerConfig.java b/modules/core/src/main/java/org/mycontroller/standalone/externalserver/config/ExternalServerConfig.java index f63d44d3..45759dde 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/externalserver/config/ExternalServerConfig.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/externalserver/config/ExternalServerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,7 +54,11 @@ public void update(ExternalServerTable externalServerTable) { name = externalServerTable.getName(); type = externalServerTable.getType(); keyFormat = externalServerTable.getKeyFormat(); - keyCase = (ALPHABETICAL_CASE) externalServerTable.getProperties().get(KEY_ALPHABETICAL_CASE); + if (externalServerTable.getProperties().get(KEY_ALPHABETICAL_CASE) != null) { + keyCase = Enum.valueOf(ALPHABETICAL_CASE.class, + String.valueOf(externalServerTable.getProperties().get(KEY_ALPHABETICAL_CASE))); + } + } @JsonIgnore diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java index 20524530..a7ace11f 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,11 +95,11 @@ public void updateGateway(GatewayTable gatewayTable) { state = gatewayTable.getState(); statusMessage = gatewayTable.getStatusMessage(); statusSince = gatewayTable.getStatusSince(); - txDelay = (Long) gatewayTable.getProperty(KEY_TX_DELAY, 0L); + txDelay = Long.valueOf(String.valueOf(gatewayTable.getProperty(KEY_TX_DELAY, 0L))); ackEnabled = (Boolean) gatewayTable.getProperty(KEY_ACK_ENABLED, false); streamAckEnabled = (Boolean) gatewayTable.getProperty(KEY_STREAM_ACK_ENABLED, false); failedRetryCount = (Integer) gatewayTable.getProperty(KEY_FAILED_RETRY_COUNT, 3); - ackWaitTime = (Long) gatewayTable.getProperty(KEY_ACK_WAIT_TIME, 500L); + ackWaitTime = Long.valueOf(String.valueOf(gatewayTable.getProperty(KEY_ACK_WAIT_TIME, 500L))); reconnectDelay = (Integer) gatewayTable.getProperty(KEY_RECONNECT_DELAY, 120); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemBackupJob.java b/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemBackupJob.java index 85beafb3..0e6d3a7f 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemBackupJob.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemBackupJob.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,19 +16,13 @@ */ package org.mycontroller.standalone.jobs; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.io.FileUtils; import org.knowm.sundial.Job; import org.knowm.sundial.exceptions.JobInterruptException; import org.mycontroller.standalone.AppProperties; -import org.mycontroller.standalone.api.jaxrs.model.BackupFile; import org.mycontroller.standalone.backup.Backup; +import org.mycontroller.standalone.backup.McFileUtils; import org.mycontroller.standalone.settings.BackupSettings; import lombok.extern.slf4j.Slf4j; @@ -39,60 +33,26 @@ */ @Slf4j public class SystemBackupJob extends Job { - private static boolean isBackupRunning = false; - - private void removeOldFiles(BackupSettings backupSettings) throws IOException { - String[] filter = { "zip" }; - Collection zipFiles = FileUtils.listFiles( - FileUtils.getFile(AppProperties.getInstance().getBackupSettings().getBackupLocation()), - filter, true); - - List backupFiles = new ArrayList(); - for (File zipFile : zipFiles) { - if (zipFile.getName().startsWith(backupSettings.getPrefix())) {//Filter with file name - backupFiles.add(BackupFile.builder() - .name(zipFile.getName()) - .size(zipFile.length()) - .timestamp(zipFile.lastModified()) - .canonicalPath(zipFile.getCanonicalPath()) - .build()); - } - } - //Do order reverse - Collections.sort(backupFiles, Collections.reverseOrder()); - - if (backupFiles.size() > backupSettings.getRetainMax()) { - _logger.debug("Available backup files:{}, Maximum files retain:{}", backupFiles.size(), - backupSettings.getRetainMax()); - for (int deleteIndex = backupSettings.getRetainMax(); deleteIndex < backupFiles.size(); deleteIndex++) { - try { - FileUtils.forceDelete(FileUtils.getFile(backupFiles.get(deleteIndex).getCanonicalPath())); - _logger.debug("Backup file deleted, {}", backupFiles.get(deleteIndex)); - } catch (Exception ex) { - _logger.error("Backup file deletion failed", ex); - } - } - } else { - _logger.debug("Available backup files:{}", backupFiles.size()); - } - } + private static final AtomicBoolean IS_RUNNING = new AtomicBoolean(false); @Override public void doRun() throws JobInterruptException { - if (isBackupRunning) { + if (IS_RUNNING.get()) { _logger.warn("A backup already running."); return; } try { - isBackupRunning = true; + IS_RUNNING.set(true); _logger.debug("Backup job triggered"); - Backup.backup(AppProperties.getInstance().getBackupSettings().getPrefix()); - removeOldFiles(AppProperties.getInstance().getBackupSettings());//Retain max backup + BackupSettings settings = AppProperties.getInstance().getBackupSettings(); + Backup.backup(settings.getPrefix()); + // Retain max backup + McFileUtils.removeOldFiles(settings.getPrefix(), settings.getRetainMax()); _logger.debug("Backup job completed"); } catch (Exception ex) { _logger.error("Exception, ", ex); } finally { - isBackupRunning = false; + IS_RUNNING.set(false); } } } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemExportJob.java b/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemExportJob.java new file mode 100644 index 00000000..40102d74 --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/jobs/SystemExportJob.java @@ -0,0 +1,91 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.jobs; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.knowm.sundial.Job; +import org.knowm.sundial.exceptions.JobInterruptException; +import org.mycontroller.standalone.AppProperties; +import org.mycontroller.standalone.api.jaxrs.model.McFile; +import org.mycontroller.standalone.backup.Export; +import org.mycontroller.standalone.settings.ExportSettings; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 1.5.0 + */ +@Slf4j +public class SystemExportJob extends Job { + private void removeOldFiles(ExportSettings exportSettings) throws IOException { + String[] filter = { "zip" }; + Collection zipFiles = FileUtils.listFiles( + FileUtils.getFile(exportSettings.getExportLocation()), + filter, true); + + List backupFiles = new ArrayList(); + for (File zipFile : zipFiles) { + if (zipFile.getName().startsWith(exportSettings.getPrefix())) {//Filter with file name + backupFiles.add(McFile.builder() + .name(zipFile.getName()) + .size(zipFile.length()) + .timestamp(zipFile.lastModified()) + .canonicalPath(zipFile.getCanonicalPath()) + .build()); + } + } + //Do order reverse + Collections.sort(backupFiles, Collections.reverseOrder()); + + if (backupFiles.size() > exportSettings.getRetainMax()) { + _logger.debug("Available export files:{}, Maximum files retain:{}", backupFiles.size(), + exportSettings.getRetainMax()); + for (int deleteIndex = exportSettings.getRetainMax(); deleteIndex < backupFiles.size(); deleteIndex++) { + try { + FileUtils.forceDelete(FileUtils.getFile(backupFiles.get(deleteIndex).getCanonicalPath())); + _logger.debug("Export file deleted, {}", backupFiles.get(deleteIndex)); + } catch (Exception ex) { + _logger.error("Export file deletion failed", ex); + } + } + } else { + _logger.debug("Available backup files:{}", backupFiles.size()); + } + } + + @Override + public void doRun() throws JobInterruptException { + try { + _logger.debug("Export auto job triggered"); + ExportSettings settings = AppProperties.getInstance().getExportSettings(); + Export export = new Export(settings.getPrefix(), settings.getRowLimit()); + export.run(); + removeOldFiles(settings);//Retain max backup + _logger.debug("Export auto job completed"); + } catch (Exception ex) { + _logger.error("Exception, ", ex); + } + } +} diff --git a/modules/core/src/main/java/org/mycontroller/standalone/operation/model/OperationSendPayload.java b/modules/core/src/main/java/org/mycontroller/standalone/operation/model/OperationSendPayload.java index 54bc8f7a..6aba3443 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/operation/model/OperationSendPayload.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/operation/model/OperationSendPayload.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,7 +81,7 @@ public void updateOperation(OperationTable operationTable) { resourceType = RESOURCE_TYPE.fromString((String) operationTable.getProperties().get(KEY_RESOURCE_TYPE)); resourceId = (Integer) operationTable.getProperties().get(KEY_RESOURCE_ID); payload = (String) operationTable.getProperties().get(KEY_PAYLOAD); - delayTime = (Long) operationTable.getProperties().get(KEY_DELAY_TIME); + delayTime = Long.valueOf(String.valueOf(operationTable.getProperties().get(KEY_DELAY_TIME))); if (delayTime == null) { delayTime = 0L; } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/rule/model/DampeningActiveTime.java b/modules/core/src/main/java/org/mycontroller/standalone/rule/model/DampeningActiveTime.java index 68a413f9..f4c1b4fe 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/rule/model/DampeningActiveTime.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/rule/model/DampeningActiveTime.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,9 +50,11 @@ public void updateRuleDefinitionTable(RuleDefinitionTable ruleDefinitionTable) { @Override public void updateDampening(RuleDefinitionTable ruleDefinitionTable) { super.setType(ruleDefinitionTable.getDampeningType()); - this.activeTime = (Long) ruleDefinitionTable.getDampeningProperties().get(KEY_ACTIVE_TIME); + this.activeTime = Long.valueOf(String.valueOf(ruleDefinitionTable.getDampeningProperties() + .get(KEY_ACTIVE_TIME))); this.activeFrom = ruleDefinitionTable.getDampeningProperties().get(KEY_ACTIVE_FROM) == null ? - ACTIVE_FROM_RESET_VALUE : (long) ruleDefinitionTable.getDampeningProperties().get(KEY_ACTIVE_FROM); + ACTIVE_FROM_RESET_VALUE : + Long.valueOf(String.valueOf(ruleDefinitionTable.getDampeningProperties().get(KEY_ACTIVE_FROM))); } @Override diff --git a/modules/core/src/main/java/org/mycontroller/standalone/settings/ExportSettings.java b/modules/core/src/main/java/org/mycontroller/standalone/settings/ExportSettings.java new file mode 100644 index 00000000..d35d2f0f --- /dev/null +++ b/modules/core/src/main/java/org/mycontroller/standalone/settings/ExportSettings.java @@ -0,0 +1,152 @@ +/* + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.mycontroller.standalone.settings; + +import java.io.IOException; + +import org.apache.commons.io.FileUtils; +import org.mycontroller.standalone.jobs.SystemExportJob; +import org.mycontroller.standalone.scheduler.SchedulerUtils; +import org.mycontroller.standalone.timer.TimerSimple; +import org.mycontroller.standalone.utils.McUtils; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +/** + * @author Jeeva Kandasamy (jkandasa) + * @since 0.0.3 + */ + +@Builder +@ToString(includeFieldNames = true) +@Getter +@NoArgsConstructor +@AllArgsConstructor +@Slf4j +public class ExportSettings { + + private static final String JOB_NAME = "myController-export-job"; + public static final String KEY_EXPORT = "export_data"; + public static final String SKEY_ENABLED = "enabled"; + public static final String SKEY_PREFIX = "prefix"; + public static final String SKEY_INTERVAL = "interval"; + public static final String SKEY_RETAIN_MAX = "retainMax"; + public static final String SKEY_EXPORT_LOCATION = "exportLocation"; + public static final String SKEY_ROW_LIMIT = "rowLimit"; + + private Boolean enabled; + private String prefix; + private Long interval; + private Integer retainMax; + private String exportLocation; + private Long rowLimit; + + public String getExportLocation() { + if (exportLocation == null) { + exportLocation = "../export/"; + } else if (!exportLocation.endsWith("/")) { + exportLocation = exportLocation + "/"; + } + //Create backup location + if (!FileUtils.getFile(exportLocation).exists()) { + try { + FileUtils.forceMkdir(FileUtils.getFile(exportLocation)); + _logger.debug("export location created."); + } catch (IOException e) { + _logger.error("Unable to create export location"); + } + } + + return exportLocation; + } + + public Boolean getEnabled() { + if (enabled == null) { + return false; + } + return enabled; + } + + public Long getNextFire() { + if (getEnabled()) { + return SchedulerUtils.nextFireTime(JOB_NAME, null); + } + return null; + } + + public static ExportSettings get() { + ExportSettings _settings = ExportSettings.builder() + .enabled(McUtils.getBoolean(getValue(SKEY_ENABLED))) + .prefix(getValue(SKEY_PREFIX)) + .interval(McUtils.getLong(getValue(SKEY_INTERVAL))) + .retainMax(McUtils.getInteger(getValue(SKEY_RETAIN_MAX))) + .exportLocation(getValue(SKEY_EXPORT_LOCATION)) + .rowLimit(McUtils.getLong(getValue(SKEY_ROW_LIMIT))) + .build(); + return _settings; + } + + public void save() { + if (enabled != null) { + updateValue(SKEY_ENABLED, enabled); + } + if (prefix != null) { + updateValue(SKEY_PREFIX, prefix.trim()); + } + if (interval != null) { + //Should not allow to take backup less than a minute frequency + if (interval < McUtils.ONE_MINUTE) { + interval = McUtils.ONE_MINUTE; + } + updateValue(SKEY_INTERVAL, interval); + } + if (retainMax != null) { + updateValue(SKEY_RETAIN_MAX, retainMax); + } + if (exportLocation != null) { + updateValue(SKEY_EXPORT_LOCATION, exportLocation); + } + if (rowLimit != null) { + updateValue(SKEY_ROW_LIMIT, rowLimit); + } + } + + private static String getValue(String subKey) { + return SettingsUtils.getValue(KEY_EXPORT, subKey); + } + + private void updateValue(String subKey, Object value) { + SettingsUtils.updateValue(KEY_EXPORT, subKey, value); + } + + public static void reloadJob() { + ExportSettings settings = get(); + TimerSimple timerSimple = new TimerSimple( + JOB_NAME,//Job Name + settings.getEnabled(), + SystemExportJob.class.getName(), + settings.getInterval(), + -1//Repeat count + ); + SchedulerUtils.reloadTimerJob(timerSimple.getTimer()); + } +} From c3d5794404e0af4262f80431e0a8b3950b9771a6 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Thu, 10 Oct 2019 16:09:59 +0530 Subject: [PATCH 08/12] fix checkstyle issue --- .../src/main/java/org/mycontroller/standalone/StartApp.java | 2 +- .../main/java/org/mycontroller/standalone/api/BackupApi.java | 2 +- .../main/java/org/mycontroller/standalone/backup/Backup.java | 3 ++- .../main/java/org/mycontroller/standalone/backup/Commons.java | 2 +- .../java/org/mycontroller/standalone/backup/ExportMap.java | 2 +- .../java/org/mycontroller/standalone/backup/McFileUtils.java | 2 +- .../main/java/org/mycontroller/standalone/backup/Restore.java | 3 ++- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java index ca2255ae..c87082e2 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/StartApp.java @@ -32,11 +32,11 @@ import org.mycontroller.standalone.api.jaxrs.AuthenticationHandler; import org.mycontroller.standalone.api.jaxrs.BackupHandler; import org.mycontroller.standalone.api.jaxrs.DashboardHandler; +import org.mycontroller.standalone.api.jaxrs.ExportHandler; import org.mycontroller.standalone.api.jaxrs.ExternalServerHandler; import org.mycontroller.standalone.api.jaxrs.FirmwareHandler; import org.mycontroller.standalone.api.jaxrs.ForwardPayloadHandler; import org.mycontroller.standalone.api.jaxrs.GatewayHandler; -import org.mycontroller.standalone.api.jaxrs.ExportHandler; import org.mycontroller.standalone.api.jaxrs.MetricsHandler; import org.mycontroller.standalone.api.jaxrs.MyControllerHandler; import org.mycontroller.standalone.api.jaxrs.NodeHandler; diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java b/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java index 87a1af56..daed4009 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/BackupApi.java @@ -24,8 +24,8 @@ import org.mycontroller.standalone.McThreadPoolFactory; import org.mycontroller.standalone.api.jaxrs.model.McFile; import org.mycontroller.standalone.api.jaxrs.model.QueryResponse; -import org.mycontroller.standalone.backup.Commons; import org.mycontroller.standalone.backup.Backup; +import org.mycontroller.standalone.backup.Commons; import org.mycontroller.standalone.backup.McFileUtils; import org.mycontroller.standalone.backup.Restore; import org.mycontroller.standalone.exceptions.McBadRequestException; diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java index b39afa44..39b3b417 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Backup.java @@ -65,7 +65,8 @@ public static synchronized String backup(String prefix) throws McException, IOEx } if (includeDdBackup) { - String databaseBackup = AppProperties.getInstance().getTmpLocation() + Commons.BACKUP_DATABASE_FILENAME; + String databaseBackup = AppProperties.getInstance().getTmpLocation() + + Commons.BACKUP_DATABASE_FILENAME; if (DataBaseUtils.backupDatabase(databaseBackup)) { //Copy database file diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java index 52b9abda..bdd0444f 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Commons.java @@ -75,7 +75,7 @@ public class Commons { public static final String BACKUP_FILE_NAME_IDENTITY = "_mc_backup"; public static final AtomicBoolean IS_BACKUP_RESTORE_RUNNING = new AtomicBoolean(false); - // export + // export public static final String DATABASE_FILES = "database_tables"; public static final String EXPORT_FILE_NAME_IDENTITY = "_mc_export"; public static final AtomicBoolean IS_IMPORT_EXPORT_RUNNING = new AtomicBoolean(false); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java index a25db7dc..24e911c4 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/ExportMap.java @@ -18,8 +18,8 @@ import org.mycontroller.standalone.db.dao.BaseDao; -import lombok.Getter; import lombok.Builder; +import lombok.Getter; /** * @author Jeeva Kandasamy (jkandasa) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java index fd59ac55..3b8ec446 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/McFileUtils.java @@ -44,9 +44,9 @@ import org.mycontroller.standalone.exceptions.McBadRequestException; import org.mycontroller.standalone.utils.McUtils; -import lombok.extern.slf4j.Slf4j; import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java b/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java index c339ed48..2938a588 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/backup/Restore.java @@ -93,7 +93,8 @@ public static void restore(McFile backupFile) throws IOException { if (executeDbBackup) { //Validate required files - if (!FileUtils.getFile(extractedLocation + File.separator + Commons.BACKUP_DATABASE_FILENAME).exists()) { + if (!FileUtils.getFile( + extractedLocation + File.separator + Commons.BACKUP_DATABASE_FILENAME).exists()) { _logger.error("Unable to continue restore opration! selected file not found! File:{}", extractedLocation + File.separator + Commons.BACKUP_DATABASE_FILENAME); loadDefaultProperties(); From 9a29548becf70a8bee66e5b73fafe6266d410e0b Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 11 Dec 2019 04:53:36 +0530 Subject: [PATCH 09/12] locale update --- .../www/languages/mc_locale_gui-cs_cz.json | 2 +- .../www/languages/mc_locale_gui-ru_ru.json | 124 +++++++++--------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json b/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json index d6847cb5..94702622 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-cs_cz.json @@ -404,7 +404,7 @@ "NETWORK": "Síť", "NETWORK_TYPE": "Typ sítě", "NEVER": "Nikdy", - "NEW": "New", + "NEW": "Nový", "NEW_DASHBOARD": "Nový panel", "NEW_PASSWORD": "Nové heslo", "NEXT_EXECUTION": "Next execution", diff --git a/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json b/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json index 456b9f33..1bf9db86 100644 --- a/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json +++ b/dist/src/main/package/www/languages/mc_locale_gui-ru_ru.json @@ -6,15 +6,15 @@ "ACCESS_TOKEN": "Ключ доступа", "ACK": "Ack", "ACKNOWLEDGE": "Подтверждение", - "ACK_ENABLED": "Ack enabled", + "ACK_ENABLED": "Ack включен", "ACK_REQUEST": "Ack запрос", "ACK_RESPONSE": "Ack ответ", - "ACK_WAIT_TIME": "Ack wait time", + "ACK_WAIT_TIME": "Ack время ожидания", "ACTIONS": "Действия", "ACTION_BOARD": "Панель действий", "ACTIVE": "Включен", "ADD": "Добавить", - "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load", + "ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Дополнительные модули AngularJS для загрузки", "ADD_AN_ENTRY": "Добавить запись", "ADD_EXTERNAL_SERVER": "Добавить внешний сервер", "ADD_FIRMWARE": "Добавить прошивку", @@ -52,11 +52,11 @@ "AUTH_ID_SID": "id/sid авторизации", "AUTH_TOKEN": "Токен авторизации", "AUTOMATIC_BACKUP_SETTINGS": "Настройки автоматического резервного копирования", - "AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings", + "AUTOMATIC_EXPORT_SETTINGS": "Настройки автоматического экспорта", "AUTORIZED_USER": "Авторизованный пользователь", "AUTO_GENERATE": "Автогенерация", "AVAILABLE_PROCESS": "Доступные процессы", - "AVERAGE_TIME": "Average time", + "AVERAGE_TIME": "Среднее время", "BACKUP": "Резервное копирование", "BACKUPS_DETAIL": "Детали резервных копий", "BACKUP_COMPLETED_SUCCESSFULLY": "Резервное копирование завершено успешно.", @@ -76,12 +76,12 @@ "BINARY_DATA": "Двоичные данные", "BIND_ADDRESS": "Слушать адрес", "BLOCKS": "Блоки", - "BLOCKS_SENT": "Blocks sent", + "BLOCKS_SENT": "Блоки отправлены", "BOTTOM": "Низ", "BROKET_HOST": "Хост Брокера", "BUILD_JDK": "Сборка JDK", "BUILD_TOOL": "Сборка утилит", - "BUILT_ON": "Построен на", + "BUILT_ON": "Дата сборки", "BUNDLE": "Пакет", "BUTTON_SETTINGS": "Настройки кнопок:", "CANCEL": "Отмена", @@ -90,14 +90,14 @@ "CARDINAL_OPEN": "Кардинал, основное состояние - открыто", "CHANNEL_TAGS": "Значок канала (ов)", "CHANNEL_TAGS_COMMA_SEPARATED": "Теги канала через запятую", - "CHANNEL_USERNAME": "Channel username", + "CHANNEL_USERNAME": "Имя пользователя канала", "CLASS_LOADING_DETAILS": "Подробнее загруженные классы", "CLIENT_ID": "Идентификатор клиента", "CLONE": "Копировать", "COLLECTION_COUNT": "Количество счетчиков", "COLLECTION_TIME": "Время сбора", "COLOR": "Цвет", - "COMMAND": "Command", + "COMMAND": "Команда", "COMMITTED": "Фиксировать", "COMMITTED_VIRTUAL_MEMORY_SIZE": "Размер выделенной виртуальной памяти", "CONDITION": "Условие", @@ -114,14 +114,14 @@ "CURRENT_PASSWORD": "Текущий пароль", "CUSTOM_MESSAGE": "Свое сообщение", "DAEMON": "Демон", - "DAILY_ONCE_JOB": "Daily once", + "DAILY_ONCE_JOB": "Ежедневно, один раз", "DAMPENING": "Усреднить", "DAMPENING_TYPE": "Тип усреднения", "DASHBOARDS": "Панель управления", "DASHBOARD_LIMIT": "Максимальное кол-во панелей", "DATA": "Дата", "DATABASE": "База данных", - "DATABASE_SCHEMA_REVISION": "Просмотр схемы базы данных", + "DATABASE_SCHEMA_REVISION": "Версия схемы базы данных", "DATABASE_TYPE": "Тип базы данных", "DATABASE_VERSION": "Версия базы данных", "DATA_RETENTION_SETTINGS": "Параметры хранения данных", @@ -164,7 +164,7 @@ "EMAIL_ADDRESSES_COMMA_SEPARATED": "Почтовые ящики разделенные запятой", "ENABLE": "Включить", "ENABLED": "Включен", - "ENABLE_CONFIRMATION": "Enable confirmation", + "ENABLE_CONFIRMATION": "Включить подтверждение", "ENABLE_DEFAULT_ON_NO_FIRMWARE": "Использовать прошивку по умолчанию", "ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP": "Когда эта опция включена, используется прошивка по умолчанию, если другая прошивка не доступна системе", "ENABLE_EDIT_MODE": "Включить режим редактирования", @@ -182,21 +182,21 @@ "EUI": "EUI", "EVALUATIONS": "Оценки", "EXECUTE_DISCOVER_INTERVAL": "Интервал поиска", - "EXPORT": "Export", - "EXPORTS_DETAIL": "Exports detail", - "EXPORT_EVERY": "Export every", - "EXPORT_FILE_PREFIX": "Export file prefix", - "EXPORT_LOCATION": "Export location", - "EXPORT_ON": "Exported on", - "EXPORT_ROW_LIMIT": "Row limit / per file", - "EXPORT_SETTINGS": "Export settings", - "EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.", + "EXPORT": "Экспорт", + "EXPORTS_DETAIL": "Детали экспорта", + "EXPORT_EVERY": "Экспортировать каждый", + "EXPORT_FILE_PREFIX": "Префикс файла экспорта", + "EXPORT_LOCATION": "Место экспорта", + "EXPORT_ON": "Экспортируется на", + "EXPORT_ROW_LIMIT": "Предел строк / на файл", + "EXPORT_SETTINGS": "Настройки экспорта", + "EXPORT_TRIGGERED_SUCCESSFULLY": "Экспорт успешно запущен.", "EXTENSION": "Расширения", "EXTENSIONS": "Расширения", "EXTERNAL_SERVERS": "Внешние серверы", "EXTERNAL_SERVERS_DETAIL": "Детали внешних серверов", - "FAILED_RETRY_COUNT": "Failed retry count", - "FAILURE_COUNT": "Failure count", + "FAILED_RETRY_COUNT": "Ошибка повторной попытки", + "FAILURE_COUNT": "Счетчик ошибок", "FILE": "Файл", "FILE_NAME": "Имя файла", "FILE_SIZE": "Размер файла", @@ -249,13 +249,13 @@ "FIRMWARE": "Прошивка", "FIRMWARES": "Прошивки", "FIRMWARES_DETAIL": "Детали прошивок", - "FIRMWARE_OTA_STATUS": "Firmware OTA status", + "FIRMWARE_OTA_STATUS": "Статус прошивки OTA", "FIRMWARE_TYPES_DETAIL": "Типы прошивок", "FIRMWARE_TYPE_NAME": "Тип прошивки", "FIRMWARE_UPLOAD_INITIATED": "Инициализирована загрузка прошивки для выбранных узлов", "FIRMWARE_VERSION": "Версия прошивки", "FIRMWARE_VERSIONS_DETAIL": "Подробнее о версии прошивки", - "FIRST_NAME": "Firstname", + "FIRST_NAME": "Имя", "FIVE_MINUTES_DATA": "Данные за пять минут", "FORUM": "Форум", "FORWARD_PAYLOAD": "Переслать пакет", @@ -297,10 +297,10 @@ "IGNORE_CASE": "Игнорировать регистр", "IGNORE_DUPLICATE": "Игнорировать дубликаты", "IMPERIAL": "Имперская система измерения", - "IMPORT": "Import", - "IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.
    Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!
    Click 'Import' to proceed.
    NOTE: After successful import you have to start the server manually from command line", - "IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'", - "IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.", + "IMPORT": "Импорт", + "IMPORT_CONFIRMATION_MESSAGE": "Вы собираетесь импортировать файл данных и изменить состояние системы на '{{name}}'.
    При импорте текущие данные удаляются полностью (не затрагивает ваш файл mycontroller.properties), и система переходит в состояние '{{name}}'!
    Для продолжения нажмите 'Импорт'.
    ПРИМЕЧАНИЕ. После успешного импорта вы должны запустить сервер вручную из командной строки.", + "IMPORT_CONFIRMATION_TITLE": "Запустить процесс импорта данных и переместить состояние системы в '{{name}}'", + "IMPORT_INITIATED_SUCCESSFULLY": "Импорт успешно запущен.", "INCLUDE_THRESHOLD_HIGH": "Включая верхний порог", "INCLUDE_THRESHOLD_LOW": "Включая нижний порог", "INDIVIDUAL_SETTINGS": "Индивидуальные параметры настройки", @@ -310,7 +310,7 @@ "INTERVAL_IN_SECONDS": "Интервал в секундах", "INVALID_USERNAME_OR_PASSWORD": "Неправильное имя пользователя или пароль!", "IN_RANGE": "В диапазоне", - "IS_BOT": "Is bot", + "IS_BOT": "Бот", "ITEMS_DELETED_SUCCESSFULLY": "Объект(ы), успешно удален(ы)", "ITEMS_DISABLED_SUCCESSFULLY": "Объект(ы), успешно отключен(ы)", "ITEMS_ENABLED_SUCCESSFULLY": "Объекты(ы), успешно включен(ы)", @@ -333,9 +333,9 @@ "LAST_FIRED": "В последний раз запущенный", "LAST_GARBAGECOLLECTOR_DURATION": "Последняя продолжительность GC", "LAST_HOUR": "Последний час", - "LAST_MESSAGE": "Last message", - "LAST_MINUTE_AVERAGE": "Last minute average", - "LAST_MINUTE_RATE": "Last minute rate", + "LAST_MESSAGE": "Последнее сообщение", + "LAST_MINUTE_AVERAGE": "Среднее за минуту", + "LAST_MINUTE_RATE": "Частота последней минуты", "LAST_MODIFIED": "Последние изменения", "LAST_MONTH": "Последний месяц", "LAST_SEEN": "Последний раз присутствовал", @@ -369,19 +369,19 @@ "MAX": "Максимум", "MAXIMUM_BLOCK_SIZE": "Максимальный размер блока", "MEASUREMENT": "Измерение", - "MERGE_STATIONS": "Merge stations", + "MERGE_STATIONS": "Слияние станций", "MESSAGE": "Сообщение", - "MESSAGES_IN_QUEUE": "Messages in queue", + "MESSAGES_IN_QUEUE": "Сообщений в очереди", "MESSAGE_CONTAINS": "Сообщение содержит", "MESSAGE_TYPE": "Тип сообщения", "METRIC": "Метрическая система измерения", "METRICS": "Графики", - "METRICS_AGGREGATION_JOB": "Metrics aggregation", + "METRICS_AGGREGATION_JOB": "Агрегация метрик", "METRIC_ENGINE": "Метрическая система", "METRIC_ENGINE_DIALOG_CONFIRMATION_MSG": "Вы собираетесь изменить настройки ядра базы данных показателей.
    Это действие приведет к потере данных. Подробнее см. Руководство пользователя.
    MyController не будет импортировать / экспортировать метрические данные при переключении метрического движка!\n.2", "METRIC_TYPE": "Тип метрики", "MILLISECONDS": "Миллисекунды", - "MILLISECONDS_SHORT": "ms", + "MILLISECONDS_SHORT": "мс", "MINIMUM_HEIGHT": "Минимальная высота", "MINIMUM_WIDTH": "Минимальная ширина", "MINUTES": "Минут", @@ -389,12 +389,12 @@ "MODIFIY_SENSOR_VARIABLES_MAPPING": "Измененить сенсор и привязку переменных", "MONOTONE": "Монотонный", "MQTT_BROKER": "MQTT брокер", - "MQTT_BROKER_DISABLED_BACKEND": "MQTT broker has been disabled on the back-end. You shold enable it on the file: conf/mycontroller.properties and restart MyController server.", + "MQTT_BROKER_DISABLED_BACKEND": "Брокер MQTT был отключен на сервере. Вы должны включить его в файле: conf/mycontroller.properties и перезапустить сервер MyController.", "MQTT_BROKER_EDIT_CONFIRMATION_MSG": "Вы собираетесь изменить настройки брокера MQTT.
    Это действие привет к перезапуску MQTT брокера с новыми параметрами.", "MQTT_BROKER_EDIT_DIALOG": "Настройки MQTT брокера", "MQTT_BROKER_HOST_EXAMPLE": "Пример: tcp://localhost:1883", "MQTT_CLIENT_ID_EXAMPLE": "Пример: mycontroller-mqtt-client", - "MQTT_PORT": "MQTT port", + "MQTT_PORT": "MQTT порт", "MQTT_TOPIC_PUBLISH_EXAMPLE": "Пример: mygateway-in", "MQTT_TOPIC_SUBSCRIBE_EXAMPLE": "Пример: mygateway-out", "MYCONTROLLER_SERVER_LOG": "MyController логи сервера", @@ -407,7 +407,7 @@ "NEW": "Новый", "NEW_DASHBOARD": "Новая панель управления", "NEW_PASSWORD": "Новый пароль", - "NEXT_EXECUTION": "Next execution", + "NEXT_EXECUTION": "Следующее выполнение", "NO": "Нет", "NODE": "Узел", "NODES": "Узлы", @@ -426,7 +426,7 @@ "NO_ACK": "нет ack", "NO_BACKUPS_SETUP": "Никаких резервных копий не создано.", "NO_DATA_AVAILABLE": "Нет данных", - "NO_EXPORTS_SETUP": "No export files available.", + "NO_EXPORTS_SETUP": "Нет доступных файлов для экспорта.", "NO_EXTERNAL_SERVERS_SETUP": "Не настроенны внешние сервера", "NO_FIRMWARES_SETUP": "Никаких прошивок не установлено.", "NO_FIRMWARE_TYPES_SETUP": "Нет настройки типов прошивки.", @@ -462,12 +462,12 @@ "OPERATIONS_DETAIL": "Детали Операций", "OPERATION_NAME": "Имя операции", "OPERATION_TYPE": "Тип операции", - "OS_COMMAND_EXECTION_CONFIRMATION_MESSAGE": "Would you like to execute the following command on MyController server base Operating System?", - "OS_COMMAND_EXECTION_CONFIRMATION_TITLE": "Execute Operating System command", + "OS_COMMAND_EXECTION_CONFIRMATION_MESSAGE": "Вы хотите выполнить следующую команду в операционной системе сервера MyController?", + "OS_COMMAND_EXECTION_CONFIRMATION_TITLE": "Выполнить команду операционной системы", "OTHERS": "Разное", "PARENT": "Родитель", "PARENT_NODE_EUI": "Родительский узел EUI", - "PARSE_MODE": "Parse mode", + "PARSE_MODE": "Режим разбора", "PASSWORD": "Пароль", "PATTERN": "Шаблон", "PAYLOAD": "Значение", @@ -500,7 +500,7 @@ "PURGE_EXISTING_DATA": "Очистить существующие данные", "PURGE_RESOURCES_LOGS": "Очистить логи ресурсов", "PURGE_SENSOR_VARIABLE": "Очистить переменные датчика", - "PURGE_VALUE_RANGE_EXAMPLE": "Example: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(purge only avg)", + "PURGE_VALUE_RANGE_EXAMPLE": "Пример: min>=45.6,max>=78.2,avg>=56.3 or min>=45.6 or >=56.3(чистить только в среднем)", "PURGE_WARNING": "ВНИМАНИЕ: Если вы не выбрать ни один параметр, этот процесс удалит все!", "PURGING": "Очистка", "PUSHBULLET": "Pushbullet", @@ -515,7 +515,7 @@ "REBOOT_CONFIRMATION_MESSAGE": "Вы собираетесь перезагрузить выбранные элементы
    Нажмите \"Reboot\", чтобы продолжить", "REBOOT_CONFIRMATION_TITLE": "Перезагрузка", "REBOOT_INITIATED": "Началась перезагрузка выбранных элементов", - "RECONNECT_DELAY": "Reconnect delay", + "RECONNECT_DELAY": "Задержка переподключения", "RECORDS_LIMIT": "Ограничение записей", "REFRESH": "Обновить", "REFRESH_NODES_INFO": "Обновить информацию нод", @@ -532,7 +532,7 @@ "RESOURCES_DATA_DETAIL": "Детали ресурсов данных", "RESOURCES_GROUPS": "Ресурсы группы", "RESOURCES_LOGS": "Журнал логов", - "RESOURCES_LOGS_AGGREGATION_JOB": "ResourcesLogs Aggregation", + "RESOURCES_LOGS_AGGREGATION_JOB": "Агрегация журналов", "RESOURCES_LOGS_DETAIL": "Детали логов", "RESOURCES_LOG_LEVEL": "Уровень логов", "RESOURCES_LOG_RETENTION_DURATION": "Ресурсы регистрирует срок хранения", @@ -561,13 +561,13 @@ "ROOM_NAME": "Имя комнаты", "RULES": "Правила", "RULES_DETAIL": "Детали событий", - "RULE_DEFINITION_ENGINE_JOB": "Rule definition engine", - "RULE_DEFINITION_RE_ENABLE_JOB": "Rule definition re-enable", + "RULE_DEFINITION_ENGINE_JOB": "Правило определения движка", + "RULE_DEFINITION_RE_ENABLE_JOB": "Повторное включение определения правила", "RULE_NAME": "Имя события", "RUN": "Запустить", "RUNNING": "Исполняется", "RUN_BACKUP": "Выполнить резервное копирование", - "RUN_EXPORT": "Run export", + "RUN_EXPORT": "Запустить экспорт", "RUN_GARBAGE_COLLECTION": "Выполнить сборку мусора", "RUN_NOW": "Выполнить сейчас", "SAVE": "Сохранить", @@ -596,8 +596,8 @@ "SENSOR_TYPE": "Тип сенсора", "SENSOR_VARIABLE": "Переменная сенсора", "SENSOR_VARIABLES": "Переменные сенсора", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Would you like to send the following payload to the selected resource?", - "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Send payload confirmation", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_MESSAGE": "Вы хотите отправить следующие полезные данные на выбранный ресурс?", + "SENSOR_VARIABLE_SUBMIT_CONFIRMATION_TITLE": "Отправить подтверждение полезной нагрузки", "SENSOR_VARIABLE_TYPE": "Тип датчика", "SERIAL_BAUD_RATE_EXAMPLE": "Пример: 115200", "SERIAL_PORT_NAME_EXAMPLE": "Пример: /dev/ttyUSB0", @@ -621,13 +621,13 @@ "STACKED_AREA_CHART": "Область ячейки диаграммы", "STATION_ID": "ИД станции", "STATION_PASSWORD": "Пароль станции", - "STATISTICS": "Statistics", + "STATISTICS": "Статистика", "STATUS": "Статус", "STATUS_MESSAGE": "Сообщение о состоянии", "STATUS_SINCE": "Начиная с", "STEP_AFTER": "Шаг после", "STEP_BEFORE": "Шаг перед", - "STREAM_ACK_ENABLED": "Stream ack enabled", + "STREAM_ACK_ENABLED": "Подтверждение трансляции включено", "SUBJECT": "Предмет", "SUB_TYPE": "Подтип", "SUNRISE": "Восход", @@ -638,16 +638,16 @@ "SYNTAX_ERROR": "Ошибка синтаксиса", "SYSTEM": "Система", "SYSTEM_CPU_LOAD": "Загрузка CPU", - "SYSTEM_JOBS": "System jobs", - "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "You are about to change system internal jobs. This cron expression is a bit different than Linux cron expression.
    This action may lead to incorrect schedule, poor performance, etc., Read user manual for further details.
    It is highly recommend a system backup before moving forward!
    Cron expression documentation", - "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "Read carefully before moving forward", + "SYSTEM_JOBS": "Системные задания", + "SYSTEM_JOBS_EDIT_CONFIRMATION_MSG": "Вы собираетесь изменить внутренние рабочие места системы. Это выражение cron немного отличается от выражения cron в Linux.
    Это действие может привести к неправильному расписанию, плохой производительности и т. Д. Для получения дополнительной информации прочтите руководство пользователя.
    Настоятельно рекомендуется выполнить резервное копирование системы, прежде чем двигаться вперед!
    Документация Cron", + "SYSTEM_JOBS_EDIT_CONFIRMATION_TITLE": "Внимательно прочитайте, прежде чем двигаться вперед", "SYSTEM_LOAD_AVERAGE": "Средняя загрузка системы", "SYSTEM_STATUS": "Состояние системы", "S_VARIABLE_DIALOG_CONFIRMATION_MSG": "Вы собираетесь обновить конфигурации 'Переменные сенсоров'.
    При обновлении конфигурации, если происходит изменение в 'Типе метрик', все существующие данные будут удалены из 'Переменные сенсоров'!", "S_VARIABLE_DIALOG_TITLE": "Обновление конфигурации 'Переменные сенсора'", "TABLE_ROWS_LIMIT": "Максимум строк таблицы", "TAGS": "Теги", - "TELEGRAM_BOT": "Telegram bot", + "TELEGRAM_BOT": "Телеграм бот", "TEMPLATE": "Шаблон", "TEMPLATES": "Шаблоны", "TEMPLATES_DETAIL": "Детали шаблона", @@ -655,7 +655,7 @@ "TENANT": "Арендатор", "TESTING": "Тестирование...", "TEST_CONNECTION": "Тест соединения", - "TEXT": "Text", + "TEXT": "Текст", "THREADS_COUNT": "Счетчик нитей", "THRESHOLD_VALUE": "Пороговое значение", "THRESHOLD_VALUE_HIGH": "Верхнее пороговое значение", @@ -669,10 +669,10 @@ "TIME_HH_MM_SS": "Время (HH:mm:ss)", "TIME_OFFSET_HH_MM_SS": "Время смещения (HH:mm:ss)", "TIME_RANGE": "Диапазон времени", - "TIME_TAKEN_LAST_UPDATE": "Last update(time taken)", + "TIME_TAKEN_LAST_UPDATE": "Последнее обновление (время заняло)", "TITLE": "Заголовок", "TO": "То", - "TOKEN": "Token", + "TOKEN": "Токен", "TOP": "Верх", "TOPICS_PUBLISH": "Публикация топиков", "TOPICS_SUBSCRIBE": "Подписаться на топики", @@ -682,7 +682,7 @@ "TOTAL": "Всего", "TOTAL_LOADED": "Всего загруженно", "TOTAL_STARTED": "Всего начались", - "TRANSMIT_DELAY": "Transmit delay", + "TRANSMIT_DELAY": "Задержка передачи", "TRIGGER_WHEN": "Запустить при", "TRUST_HOST": "Доверенный хост", "TURN_OFF": "Выключить", From dd0020b49beaa14c8b02da39b77485ac5162ece2 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 11 Dec 2019 11:07:16 +0530 Subject: [PATCH 10/12] disable import feature --- dist/src/main/package/www/partials/export/export-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/src/main/package/www/partials/export/export-list.html b/dist/src/main/package/www/partials/export/export-list.html index 4c5c0a91..7a37d834 100644 --- a/dist/src/main/package/www/partials/export/export-list.html +++ b/dist/src/main/package/www/partials/export/export-list.html @@ -40,7 +40,7 @@

    From e0ab7c9bc6add25d3edb03f9788bb63bbe1a8f75 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 11 Dec 2019 11:07:50 +0530 Subject: [PATCH 11/12] udated convert Long function --- .../org/mycontroller/standalone/api/jaxrs/model/Query.java | 4 +++- .../java/org/mycontroller/standalone/db/tables/Node.java | 6 +++--- .../mycontroller/standalone/db/tables/ResourcesLogs.java | 3 ++- .../standalone/gateway/config/GatewayConfig.java | 5 +++-- .../standalone/gateway/config/GatewayConfigEthernet.java | 3 ++- .../standalone/gateway/config/GatewayConfigPhantIO.java | 5 +++-- .../gateway/config/GatewayConfigWunderground.java | 5 +++-- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java index 1d48f9bc..6b61bec1 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java @@ -19,6 +19,8 @@ import java.util.HashMap; import java.util.Map; +import org.mycontroller.standalone.utils.McUtils; + import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Builder; @@ -100,7 +102,7 @@ public static Query get(Map filters) { .order(filters.get(ORDER) != null ? (String) filters.get(ORDER) : ORDER_ASC) .orderBy(filters.get(ORDER_BY) != null ? (String) filters.get(ORDER_BY) : KEY_ID) .filters(filters) - .pageLimit(filters.get(PAGE_LIMIT) != null ? (Long) filters.get(PAGE_LIMIT) : MAX_ITEMS_PER_PAGE) + .pageLimit(filters.get(PAGE_LIMIT) != null ? McUtils.getLong(filters.get(PAGE_LIMIT)) : MAX_ITEMS_PER_PAGE) .page(filters.get(PAGE) != null ? (long) filters.get(PAGE) : 1L) .isAndQuery(true) .idColumn(KEY_ID) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java index 0ebf3378..9b1e4fcc 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java @@ -201,7 +201,7 @@ public Long getLastHeartbeatTxTime() { return 0L; } else { try { - return (Long) getProperty(KEY_HEARTBEAT_LAST_TX_TIME); + return McUtils.getLong(getProperty(KEY_HEARTBEAT_LAST_TX_TIME)); } catch (Exception ex) { return 0L; } @@ -218,8 +218,8 @@ public boolean isNameLocked() { } public void firmwareUpdateFinished() { - Long startTime = (Long) this.getProperty(KEY_FW_OPERATION_FIRST); - Long endTime = (Long) this.getProperty(KEY_FW_OPERATION_LAST); + Long startTime = McUtils.getLong(this.getProperty(KEY_FW_OPERATION_FIRST)); + Long endTime = McUtils.getLong(this.getProperty(KEY_FW_OPERATION_LAST)); if (startTime != null && endTime != null) { this.getProperties().put(KEY_FW_OPERATION_LAST_DURATION, endTime - startTime); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java index c6fb96c6..6993cb10 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java @@ -24,6 +24,7 @@ import org.mycontroller.standalone.db.ResourcesLogsUtils.LOG_LEVEL; import org.mycontroller.standalone.message.McMessageUtils.MESSAGE_TYPE; import org.mycontroller.standalone.model.ResourceModel; +import org.mycontroller.standalone.utils.McUtils; import com.j256.ormlite.field.DataType; import com.j256.ormlite.field.DatabaseField; @@ -98,7 +99,7 @@ public static ResourcesLogs get(HashMap filters) { .messageType(MESSAGE_TYPE.fromString((String) filters.get(KEY_MESSAGE_TYPE))) .logDirection(LOG_DIRECTION.fromString((String) filters.get(KEY_LOG_DIRECTION))) .message((String) filters.get(KEY_MESSAGE)) - .timestamp((Long) filters.get(KEY_TIMESTAMP)) + .timestamp(McUtils.getLong(filters.get(KEY_TIMESTAMP))) .build(); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java index a7ace11f..1c955b11 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfig.java @@ -23,6 +23,7 @@ import org.mycontroller.standalone.db.DaoUtils; import org.mycontroller.standalone.db.tables.GatewayTable; import org.mycontroller.standalone.gateway.GatewayUtils.GATEWAY_TYPE; +import org.mycontroller.standalone.utils.McUtils; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -95,11 +96,11 @@ public void updateGateway(GatewayTable gatewayTable) { state = gatewayTable.getState(); statusMessage = gatewayTable.getStatusMessage(); statusSince = gatewayTable.getStatusSince(); - txDelay = Long.valueOf(String.valueOf(gatewayTable.getProperty(KEY_TX_DELAY, 0L))); + txDelay = McUtils.getLong(gatewayTable.getProperty(KEY_TX_DELAY, 0L)); ackEnabled = (Boolean) gatewayTable.getProperty(KEY_ACK_ENABLED, false); streamAckEnabled = (Boolean) gatewayTable.getProperty(KEY_STREAM_ACK_ENABLED, false); failedRetryCount = (Integer) gatewayTable.getProperty(KEY_FAILED_RETRY_COUNT, 3); - ackWaitTime = Long.valueOf(String.valueOf(gatewayTable.getProperty(KEY_ACK_WAIT_TIME, 500L))); + ackWaitTime = McUtils.getLong(gatewayTable.getProperty(KEY_ACK_WAIT_TIME, 500L)); reconnectDelay = (Integer) gatewayTable.getProperty(KEY_RECONNECT_DELAY, 120); } diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java index 1ccb8b3a..04c4ee24 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java @@ -17,6 +17,7 @@ package org.mycontroller.standalone.gateway.config; import org.mycontroller.standalone.db.tables.GatewayTable; +import org.mycontroller.standalone.utils.McUtils; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -64,7 +65,7 @@ public void updateGateway(GatewayTable gatewayTable) { super.updateGateway(gatewayTable); host = (String) gatewayTable.getProperties().get(KEY_HOST); port = (Integer) gatewayTable.getProperties().get(KEY_PORT); - aliveFrequency = (Long) gatewayTable.getProperties().get(KEY_ALIVE_FREQUENCY); + aliveFrequency = McUtils.getLong(gatewayTable.getProperties().get(KEY_ALIVE_FREQUENCY)); } @Override diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java index 8a13121a..884a0b52 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java @@ -19,6 +19,7 @@ import org.mycontroller.restclient.core.TRUST_HOST_TYPE; import org.mycontroller.standalone.db.DaoUtils; import org.mycontroller.standalone.db.tables.GatewayTable; +import org.mycontroller.standalone.utils.McUtils; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -83,8 +84,8 @@ public void updateGateway(GatewayTable gatewayTable) { publicKey = (String) gatewayTable.getProperty(KEY_PUBLIC_KEY); privateKey = (String) gatewayTable.getProperty(KEY_PRIVATE_KEY); pollFrequency = (Integer) gatewayTable.getProperty(KEY_POLL_FREQUENCY, 120); - recordsLimit = (Long) gatewayTable.getProperty(KEY_RECORDS_LIMIT, 10L); - lastUpdate = (Long) gatewayTable.getProperty(KEY_LAST_UPDATE); + recordsLimit = McUtils.getLong(gatewayTable.getProperty(KEY_RECORDS_LIMIT, 10L)); + lastUpdate = McUtils.getLong(gatewayTable.getProperty(KEY_LAST_UPDATE)); } @Override diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java index db609cd3..6a8670ff 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java @@ -19,6 +19,7 @@ import org.mycontroller.restclient.core.TRUST_HOST_TYPE; import org.mycontroller.standalone.db.DaoUtils; import org.mycontroller.standalone.db.tables.GatewayTable; +import org.mycontroller.standalone.utils.McUtils; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -93,8 +94,8 @@ public void updateGateway(GatewayTable gatewayTable) { geoIp = null; } pollFrequency = (Integer) gatewayTable.getProperty(KEY_POLL_FREQUENCY, 120); - lastUpdate = (Long) gatewayTable.getProperty(KEY_LAST_UPDATE); - lastObservationTime = (Long) gatewayTable.getProperty(KEY_LAST_OBSERVATION_TIME); + lastUpdate = McUtils.getLong(gatewayTable.getProperty(KEY_LAST_UPDATE)); + lastObservationTime = McUtils.getLong(gatewayTable.getProperty(KEY_LAST_OBSERVATION_TIME)); } @Override From 2aba10341bd2a46d9fe9d5ebcd349bac3270cce9 Mon Sep 17 00:00:00 2001 From: Jeeva Kandasamy Date: Wed, 11 Dec 2019 11:22:05 +0530 Subject: [PATCH 12/12] release 1.5.0 version and updated error fmt --- dist/pom.xml | 4 ++-- .../main/package/www/partials/export/export-list.html | 2 +- modules/core/pom.xml | 2 +- .../mycontroller/standalone/api/jaxrs/model/Query.java | 9 ++++++--- .../java/org/mycontroller/standalone/db/tables/Node.java | 2 +- .../mycontroller/standalone/db/tables/ResourcesLogs.java | 2 +- .../standalone/gateway/config/GatewayConfigEthernet.java | 2 +- .../standalone/gateway/config/GatewayConfigPhantIO.java | 2 +- .../gateway/config/GatewayConfigWunderground.java | 2 +- pom.xml | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dist/pom.xml b/dist/pom.xml index da10bf27..3ffe7979 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -21,7 +21,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.5.0-SNAPSHOT + 1.5.0 mycontroller-dist @@ -32,7 +32,7 @@ ${project.artifactId}-standalone-${project.version} ${mc.dist.finalName}-single - 29 + 30 diff --git a/dist/src/main/package/www/partials/export/export-list.html b/dist/src/main/package/www/partials/export/export-list.html index 7a37d834..b22c2005 100644 --- a/dist/src/main/package/www/partials/export/export-list.html +++ b/dist/src/main/package/www/partials/export/export-list.html @@ -40,7 +40,7 @@ diff --git a/modules/core/pom.xml b/modules/core/pom.xml index de158639..8c0dc874 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -24,7 +24,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.5.0-SNAPSHOT + 1.5.0 ../../pom.xml diff --git a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java index 6b61bec1..aa766eb2 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -98,11 +98,14 @@ public Map getFilters() { } public static Query get(Map filters) { - Query query = Query.builder() + Query query = Query + .builder() .order(filters.get(ORDER) != null ? (String) filters.get(ORDER) : ORDER_ASC) .orderBy(filters.get(ORDER_BY) != null ? (String) filters.get(ORDER_BY) : KEY_ID) .filters(filters) - .pageLimit(filters.get(PAGE_LIMIT) != null ? McUtils.getLong(filters.get(PAGE_LIMIT)) : MAX_ITEMS_PER_PAGE) + .pageLimit( + filters.get(PAGE_LIMIT) != null ? McUtils.getLong(filters.get(PAGE_LIMIT)) + : MAX_ITEMS_PER_PAGE) .page(filters.get(PAGE) != null ? (long) filters.get(PAGE) : 1L) .isAndQuery(true) .idColumn(KEY_ID) diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java index 9b1e4fcc..7a9f2eb1 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/Node.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java index 6993cb10..c83bc0e3 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/db/tables/ResourcesLogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java index 04c4ee24..b81f54a0 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigEthernet.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java index 884a0b52..62a2e664 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigPhantIO.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java index 6a8670ff..d28c9134 100644 --- a/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java +++ b/modules/core/src/main/java/org/mycontroller/standalone/gateway/config/GatewayConfigWunderground.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com) + * Copyright 2015-2019 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/pom.xml b/pom.xml index 8209f5d1..d20fdc2c 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.mycontroller.standalone mycontroller-standalone-parent - 1.5.0-SNAPSHOT + 1.5.0 https://github.com/mycontroller-org 2015 pom