From 67864cb76212aca213ee7e22a721395175a25b7f Mon Sep 17 00:00:00 2001 From: shamalka Date: Tue, 15 Aug 2023 12:48:58 +0530 Subject: [PATCH 1/3] Add deviceinfo config beans --- .../config/ui/DeviceInfoConfigurations.java | 36 ++++++++++ .../mgt/core/config/ui/DeviceInfoItem.java | 56 +++++++++++++++ .../mgt/core/config/ui/UIConfiguration.java | 11 +++ .../src/main/resources/conf/mdm-ui-config.xml | 70 +++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoConfigurations.java create mode 100644 components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoItem.java diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoConfigurations.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoConfigurations.java new file mode 100644 index 0000000000..0e37753018 --- /dev/null +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoConfigurations.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you 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 io.entgra.device.mgt.core.device.mgt.core.config.ui; + +import javax.xml.bind.annotation.XmlElement; +import java.util.List; + +class DeviceInfoConfigurations { + + private List deviceInfoItems; + + @XmlElement(name = "DeviceInfoItem") + public List getDeviceInfoItems() { + return deviceInfoItems; + } + + public void setDeviceInfoItems(List deviceInfoItems) { + this.deviceInfoItems = deviceInfoItems; + } +} diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoItem.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoItem.java new file mode 100644 index 0000000000..0f02669a49 --- /dev/null +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/DeviceInfoItem.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you 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 io.entgra.device.mgt.core.device.mgt.core.config.ui; + +import javax.xml.bind.annotation.XmlElement; + +class DeviceInfoItem { + + private String definedValue; + private String displayValue; + + private String type; + + @XmlElement(name = "DefinedValue") + public String getDefinedValue() { + return definedValue; + } + + public void setDefinedValue(String definedValue) { + this.definedValue = definedValue; + } + + @XmlElement(name = "DisplayValue") + public String getDisplayValue() { + return displayValue; + } + + public void setDisplayValue(String displayValue) { + this.displayValue = displayValue; + } + + @XmlElement(name = "Type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfiguration.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfiguration.java index 844c4039d2..6e71d17072 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfiguration.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfiguration.java @@ -36,6 +36,8 @@ public class UIConfiguration { private Billing billing; private HubspotChat hubspotChat; + private DeviceInfoConfigurations deviceInfoConfigurations; + @XmlElement(name = "AppRegistration", required=true) public AppRegistration getAppRegistration() { return appRegistration; @@ -98,4 +100,13 @@ public class UIConfiguration { public void setLoginCacheCapacity(int loginCacheCapacity) { this.loginCacheCapacity = loginCacheCapacity; } + + @XmlElement(name = "DeviceInfoConfigurations", required = true) + public DeviceInfoConfigurations getDeviceInfoConfigurations() { + return deviceInfoConfigurations; + } + + public void setDeviceInfoConfigurations(DeviceInfoConfigurations deviceInfoConfigurations) { + this.deviceInfoConfigurations = deviceInfoConfigurations; + } } diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index 30c9e55f57..d289c60da6 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -40,6 +40,76 @@ false true + + + FIRMWARE_VERSION + Firmware version + + + FIRMWARE_APP_VERSION + App version + + + name + Device + default + + + type + Type + default + + + owner + Owner + default + + + serial + Serial Number + default + + + ownership + Ownership + default + + + status + Status + default + + + dateOfLastUpdate + Last Updated + default + + + actions + Actions + default + + + batteryLevel + Battery Level + deviceInfo + + + deviceModel + Device Model + deviceInfo + + + osVersion + OS Version + deviceInfo + + + vendor + Vendor + deviceInfo + + analytics_management From d8691596257f3fd9cfb8ba50eeb28761d1a03406 Mon Sep 17 00:00:00 2001 From: shamalka Date: Tue, 15 Aug 2023 15:17:27 +0530 Subject: [PATCH 2/3] Add missing type params to device info xml --- .../src/main/resources/conf/mdm-ui-config.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index d289c60da6..4407fbd5e4 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -44,10 +44,12 @@ FIRMWARE_VERSION Firmware version + deviceInfo FIRMWARE_APP_VERSION App version + deviceInfo name From 4ab0c77e8e484647af8aa0c893261720c35a44b9 Mon Sep 17 00:00:00 2001 From: shamalka Date: Thu, 17 Aug 2023 01:20:40 +0530 Subject: [PATCH 3/3] Add i8n support --- .../src/main/resources/conf/mdm-ui-config.xml | 88 ++++++++++++++++--- 1 file changed, 74 insertions(+), 14 deletions(-) diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index 4407fbd5e4..f60b9cca6a 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -43,72 +43,132 @@ FIRMWARE_VERSION - Firmware version + label_firmware_version deviceInfo FIRMWARE_APP_VERSION - App version + label_app_version deviceInfo name - Device + label_device default type - Type + label_type default owner - Owner + label_owner default serial - Serial Number + label_serialNumber default ownership - Ownership + label_ownership default status - Status + label_status default dateOfLastUpdate - Last Updated + label_last_updated default actions - Actions + label_actions default batteryLevel - Battery Level + label_battery_leve deviceInfo deviceModel - Device Model + label_deviceModel deviceInfo osVersion - OS Version + label_os_version deviceInfo vendor - Vendor + label_vendor + deviceInfo + + + availableRAMMemory + label_available_ram_memory + deviceInfo + + + connectionType + label_connection_type + deviceInfo + + + cpuUsage + label_cpu_usage + deviceInfo + + + externalAvailableMemory + label_external_available_memory + deviceInfo + + + externalTotalMemory + label_external_tot_memory + deviceInfo + + + internalAvailableMemory + label_internal_available_memory + deviceInfo + + + internalTotalMemory + label_internal_tot_memory + deviceInfo + + + osBuildDate + label_os_build_date + deviceInfo + + + pluggedIn + label_plugged_in + deviceInfo + + + ssid + label_ssid + deviceInfo + + + totalRAMMemory + label_tot_ram_memory + deviceInfo + + + updatedTime + label_updated_time deviceInfo