diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml index 7bf9fa5b4..5b616be0f 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml index e55e7044c..401202687 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml index 9bf13c824..b31d89f2b 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml index 90a7e3464..4489beec5 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/pom.xml b/components/analytics/iot-analytics/pom.xml index b2450080f..c63fc5d23 100644 --- a/components/analytics/iot-analytics/pom.xml +++ b/components/analytics/iot-analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins analytics - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/analytics/pom.xml b/components/analytics/pom.xml index 1e477a37e..54ee35916 100644 --- a/components/analytics/pom.xml +++ b/components/analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml index 44eaeea96..06038edec 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml @@ -21,7 +21,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml index 928069331..7bfd1988e 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml @@ -3,7 +3,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml index 9163f3474..35896f2eb 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml @@ -22,7 +22,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/androidsense-plugin/pom.xml b/components/device-types/androidsense-plugin/pom.xml index 84b3567ef..99a5e4ccb 100644 --- a/components/device-types/androidsense-plugin/pom.xml +++ b/components/device-types/androidsense-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml index cc5f1b22b..b9f1d9fe3 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml index 8130d9bf7..03ab960d4 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml index 913902e45..f9c7b5651 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml @@ -23,7 +23,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/pom.xml b/components/device-types/arduino-plugin/pom.xml index 3fc1381a5..8d1714139 100644 --- a/components/device-types/arduino-plugin/pom.xml +++ b/components/device-types/arduino-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/pom.xml b/components/device-types/pom.xml index 527693af4..1e03380f7 100644 --- a/components/device-types/pom.xml +++ b/components/device-types/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml index 0e2d8d10a..60bba3a40 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml index 2bb260a13..cb880e23e 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml index 9242f9040..a8329d6f3 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml @@ -23,7 +23,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/pom.xml b/components/device-types/raspberrypi-plugin/pom.xml index f875b1ece..4e99a7405 100644 --- a/components/device-types/raspberrypi-plugin/pom.xml +++ b/components/device-types/raspberrypi-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml index e9eec010c..1df8d968f 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml index 37a9fa819..a0a23989c 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml @@ -21,7 +21,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml index 2a05f85c2..96b3fabbd 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml @@ -21,7 +21,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml index e527e9b1f..5cb6b3402 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/device-types/virtual-fire-alarm-plugin/pom.xml b/components/device-types/virtual-fire-alarm-plugin/pom.xml index 058474f40..5af071695 100644 --- a/components/device-types/virtual-fire-alarm-plugin/pom.xml +++ b/components/device-types/virtual-fire-alarm-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml index 23e58a8ef..3ffc53b9e 100644 --- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml +++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.devicemgt-plugins appm-connector - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml index fd63a5a15..6d622157f 100644 --- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml +++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.devicemgt-plugins appm-connector - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/appm-connector/pom.xml b/components/extensions/appm-connector/pom.xml index c3aaf7dc1..3851bf2ca 100644 --- a/components/extensions/appm-connector/pom.xml +++ b/components/extensions/appm-connector/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml index 92e07cb95..001ee4ee6 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml index 0be550984..8e428b04d 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml index ee559e289..1d6dc6577 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml index c408444ec..b00f49aef 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.thrift/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml index 50971ac96..6f66ff9c7 100644 --- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml +++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml index 7cfd2af68..72427aa6b 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.http/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml index 51da258b1..9213a8435 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml index 00661bd7e..b452ba199 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml index 7034e36de..060e80d4d 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml index 1bdc189d5..c4f6380f3 100644 --- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml +++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins cdmf-transport-adapters - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/cdmf-transport-adapters/pom.xml b/components/extensions/cdmf-transport-adapters/pom.xml index 7dd674636..a115a177a 100644 --- a/components/extensions/cdmf-transport-adapters/pom.xml +++ b/components/extensions/cdmf-transport-adapters/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml index f23ff5b55..50a10d99e 100644 --- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml +++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mb-extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml index c1e259506..2441b407c 100644 --- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml +++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mb-extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/mb-extensions/pom.xml b/components/extensions/mb-extensions/pom.xml index 907259f0e..65a64dbfd 100644 --- a/components/extensions/mb-extensions/pom.xml +++ b/components/extensions/mb-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/pom.xml b/components/extensions/pom.xml index 220aff7a6..1c3f6fc1f 100644 --- a/components/extensions/pom.xml +++ b/components/extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml b/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml index ad80164f2..a3cea526a 100644 --- a/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml +++ b/components/extensions/pull-notification-listeners/org.wso2.carbon.device.mgt.mqtt.notification.listener/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins pull-notification-listeners - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/pull-notification-listeners/pom.xml b/components/extensions/pull-notification-listeners/pom.xml index 2cffcb9b9..1b5c5186b 100644 --- a/components/extensions/pull-notification-listeners/pom.xml +++ b/components/extensions/pull-notification-listeners/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml index 35102a8bf..774f4f402 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session.endpoint/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins remote-session-extension - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml index 2e1f739a7..55b171d01 100644 --- a/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml +++ b/components/extensions/remote-session-extension/org.wso2.carbon.device.mgt.extensions.remote.session/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins remote-session-extension - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/remote-session-extension/pom.xml b/components/extensions/remote-session-extension/pom.xml index 6f90acd94..ebed1a789 100644 --- a/components/extensions/remote-session-extension/pom.xml +++ b/components/extensions/remote-session-extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml index 5cedf04be..e0757b485 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/test/java/org/wso2/extension/siddhi/device/test/util/TestDeviceManagementService.java b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/test/java/org/wso2/extension/siddhi/device/test/util/TestDeviceManagementService.java index 429a9b335..883cdf71f 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/test/java/org/wso2/extension/siddhi/device/test/util/TestDeviceManagementService.java +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.device/src/test/java/org/wso2/extension/siddhi/device/test/util/TestDeviceManagementService.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, 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 org.wso2.extension.siddhi.device.test.util; @@ -23,6 +40,7 @@ import org.wso2.carbon.device.mgt.common.InitialOperationConfig; import org.wso2.carbon.device.mgt.common.MonitoringOperation; import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.ProvisioningConfig; +import org.wso2.carbon.device.mgt.common.StartupOperationConfig; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.general.GeneralConfig; @@ -30,6 +48,7 @@ import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; +import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypePlatformDetails; import java.util.ArrayList; import java.util.List; @@ -100,6 +119,11 @@ public class TestDeviceManagementService implements DeviceManagementService { return null; } + @Override + public StartupOperationConfig getStartupOperationConfig() { + return null; + } + @Override public PullNotificationSubscriber getPullNotificationSubscriber() { return null; @@ -114,4 +138,7 @@ public class TestDeviceManagementService implements DeviceManagementService { public GeneralConfig getGeneralConfig() { return null; } + + @Override + public DeviceTypePlatformDetails getDeviceTypePlatformDetails() { return null; } } diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml index 33b124344..b64972ab1 100644 --- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml index ce0b3e242..3cb63c856 100644 --- a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins siddhi-extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/org.wso2.orbit.org.geotools.gt-geojson/pom.xml b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/org.wso2.orbit.org.geotools.gt-geojson/pom.xml index 2fa31c7b5..dc71eafad 100644 --- a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/org.wso2.orbit.org.geotools.gt-geojson/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/org.wso2.orbit.org.geotools.gt-geojson/pom.xml @@ -57,7 +57,6 @@ org.apache.felix maven-bundle-plugin - 2.3.7 true diff --git a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/pom.xml b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/pom.xml index 46ce208cb..707f05a5e 100644 --- a/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/pom.xml +++ b/components/extensions/siddhi-extensions/org.wso2.gpl.siddhi.extension.geo.script/src/main/resources/scripts/gpl-siddhi-geo-extention/pom.xml @@ -203,7 +203,6 @@ org.apache.felix maven-bundle-plugin - 2.3.7 true diff --git a/components/extensions/siddhi-extensions/pom.xml b/components/extensions/siddhi-extensions/pom.xml index 75b06905f..a257654bc 100644 --- a/components/extensions/siddhi-extensions/pom.xml +++ b/components/extensions/siddhi-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins extensions - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml index 693870fce..17088e6c4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml @@ -21,7 +21,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java index e7061ae91..b38a8b802 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java @@ -27,9 +27,20 @@ import java.io.Serializable; description = "This class represents notification frequency configuration.") public class NotifierFrequency extends AndroidOperation implements Serializable { + @ApiModelProperty(name = "type", value = "Notification type", required = true) + private int type; + @ApiModelProperty(name = "value", value = "Notification polling frequency", required = true) private int value; + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + public int getValue() { return value; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java index d8039f8cc..385460e7c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java @@ -134,6 +134,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati try { configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); List configs = configuration.getConfiguration(); + NotifierFrequency notifierFrequency = new NotifierFrequency(); for (ConfigurationEntry entry : configs) { if (AndroidConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) { License license = new License(); @@ -145,30 +146,18 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); licenseEntry = entry; } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { - List deviceList = AndroidAPIUtils. - getDeviceManagementService(). - getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); - List deviceIdList = new ArrayList<>(); - for (Device device : deviceList) { - if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { - deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); - } + if (entry.getValue() != null) { + notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); + } else { + return Response.status(Response.Status.BAD_REQUEST) + .entity("No value specified for notifierFrequency.").build(); } - if (!deviceIdList.isEmpty()) { - if (entry.getValue() != null) { - NotifierFrequency notifierFrequency = new NotifierFrequency(); - notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); - ProfileOperation operation = new ProfileOperation(); - operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); - operation.setPayLoad(notifierFrequency.toJSON()); - operation.setEnabled(true); - AndroidAPIUtils.getDeviceManagementService().addOperation( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, - operation, deviceIdList); - } else { - return Response.status(Response.Status.BAD_REQUEST) - .entity("No value specified for notifierFrequency.").build(); - } + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_TYPE.equals(entry.getName())) { + if (entry.getValue() != null) { + notifierFrequency.setType(Integer.parseInt(entry.getValue().toString())); + } else { + return Response.status(Response.Status.BAD_REQUEST) + .entity("No value specified for notifierType.").build(); } } } @@ -178,6 +167,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati } configuration.setConfiguration(configs); AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); + notifyDevices(notifierFrequency); } catch (DeviceManagementException e) { msg = "Error occurred while modifying configuration settings of Android platform"; log.error(msg, e); @@ -203,6 +193,27 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati .entity("Android platform configuration has been updated successfully.").build(); } + private void notifyDevices(NotifierFrequency notifierFrequency) throws DeviceManagementException, + OperationManagementException, InvalidDeviceException { + List deviceList = AndroidAPIUtils. + getDeviceManagementService(). + getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); + List deviceIdList = new ArrayList<>(); + for (Device device : deviceList) { + if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { + deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); + } + } + if (!deviceIdList.isEmpty()) { + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); + operation.setPayLoad(notifierFrequency.toJSON()); + operation.setEnabled(true); + AndroidAPIUtils.getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + operation, deviceIdList); + } + } @GET @Path("/license") diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java index 9db77c7f4..42712d987 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java @@ -160,6 +160,7 @@ public final class AndroidConstants { public static final String LANGUAGE_US = "en_US"; public static final String CONTENT_TYPE_TEXT = "text"; public static final String NOTIFIER_FREQUENCY = "notifierFrequency"; + public static final String NOTIFIER_TYPE = "notifierType"; public static final String SERVER_VERSION = "serverVersion"; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 14af0b940..255a25d45 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -26,6 +26,7 @@ import org.wso2.carbon.device.mgt.common.MonitoringOperation; import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; +import org.wso2.carbon.device.mgt.common.StartupOperationConfig; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; @@ -40,6 +41,7 @@ import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationExecu import org.wso2.carbon.device.mgt.common.push.notification.NotificationStrategy; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.core.dto.DeviceType; +import org.wso2.carbon.device.mgt.core.dto.DeviceTypeVersion; import org.wso2.carbon.device.mgt.core.geo.GeoCluster; import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; @@ -126,6 +128,15 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv } } + @Override + public Device getDevice(String s, boolean b) throws DeviceManagementException { + if (TestUtils.getDeviceId().equals(s)) { + return TestUtils.getDevice(); + } else { + return null; + } + } + @Override public Device getDevice(DeviceIdentifier deviceIdentifier, String s, boolean b) throws DeviceManagementException { return null; @@ -141,6 +152,14 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return null; } + @Override + public Device getDevice(String s, Date date, boolean b) throws DeviceManagementException { + if (TestUtils.getDeviceId().equals(s)) { + return TestUtils.getDevice(); + } else { + return null; + } } + @Override public Device getDevice(DeviceIdentifier deviceIdentifier, String s, Date date, boolean b) throws DeviceManagementException { @@ -338,6 +357,11 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return TestUtils.getDeviceId().equals(deviceIdentifier.getId()); } + @Override + public boolean deleteDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException { + return false; + } + @Override public boolean isEnrolled(DeviceIdentifier deviceIdentifier) throws DeviceManagementException { return false; @@ -509,6 +533,11 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return null; } + @Override + public List getStartupOperations(String s) { + return null; + } + @Override public int getDeviceMonitoringFrequency(String s) { return 0; @@ -519,6 +548,11 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return null; } + @Override + public StartupOperationConfig getStartupOperationConfig(String s) { + return null; + } + @Override public boolean isDeviceMonitoringEnabled(String s) { return false; @@ -588,4 +622,26 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv public boolean updateEnrollment(String owner, List deviceIdentifiers) { return false; } + + @Override public boolean addDeviceTypeVersion(DeviceTypeVersion deviceTypeVersion) + throws DeviceManagementException { + return false; + } + + @Override public List getDeviceTypeVersions(String s) throws DeviceManagementException { + return null; + } + + @Override public boolean updateDeviceTypeVersion(DeviceTypeVersion deviceTypeVersion) + throws DeviceManagementException { + return false; + } + + @Override public boolean isDeviceTypeVersionChangeAuthorized(String s, String s1) throws DeviceManagementException { + return false; + } + + @Override public DeviceTypeVersion getDeviceTypeVersion(String s, String s1) throws DeviceManagementException { + return null; + } } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml index f499fbd74..97ad9fb66 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.emulator/pom.xml @@ -21,7 +21,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/build.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/build.xml index a7c8ca4ff..605ff3f52 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/build.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/build.xml @@ -31,6 +31,9 @@ + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml index 5aed08f28..521e395b4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml @@ -23,16 +23,29 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.ui - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Mobile Android UI pom + + + io.entgra.emm + io.entgra.emm.android.agent.release + apk + + + io.entgra.emm + io.entgra.emm.android.agent.debug + apk + + + @@ -56,6 +69,24 @@ JavaApp.jar + + io.entgra.emm + io.entgra.emm.android.agent.release + apk + ${android.agent.version} + true + ${project.basedir}/target/ + android-agent.apk + + + io.entgra.emm + io.entgra.emm.android.agent.debug + apk + ${android.agent.version} + true + ${project.basedir}/target/ + client-debug.apk + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/assembly/src.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/assembly/src.xml index 789a0e681..65d67813e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/assembly/src.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/assembly/src.xml @@ -42,5 +42,13 @@ 755 + + + ${basedir}/target/android-agent.apk + + /devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/assets/ + + 755 + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/android-tryit/resources/client-debug.apk b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/android-tryit/resources/client-debug.apk deleted file mode 100644 index 46d45da13..000000000 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/android-tryit/resources/client-debug.apk and /dev/null differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs index b814fc2a7..09c6fe7e4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs @@ -16,7 +16,7 @@ data-type="{{device.type}}" data-ownership="{{device.ownership}}" data-owner="{{device.owner}}" - data-status="{{device.status}}" + data-status="{{devicamera-enabledce.status}}" data-deviceinfoservice="{{device.deviceInfoServiceAPI}}" data-devicelocationservice="{{device.deviceLocationServiceAPI}}"> {{device.owner}}'s {{device.name}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs index 9bf60dd44..df84b7e50 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs @@ -101,9 +101,9 @@ {{#equal this.type "select"}}
{{/equal}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index 56fc63621..3482f2da5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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. + */ + /* * On operation click function. * @param selection: Selected operation @@ -115,41 +133,41 @@ function submitForm(formId) { $('#' + formId + " .lbl-execution").removeClass("hidden"); var form = $("#" + formId); var uri = form.attr("action"); - var deviceId = form.data("device-id"); + var deviceIdList = form.data("device-id"); var contentType = form.data("content-type"); var operationCode = form.data("operation-code"); - var uriencodedQueryStr = ""; - var uriencodedFormStr = ""; + var uriEncodedQueryStr = ""; + var uriEncodedFormStr = ""; var payload = {}; form.find("input").each(function () { var input = $(this); - if (input.data("param-type") == "path") { + var prefix; + if (input.data("param-type") === "path") { uri = uri.replace("{" + input.attr("id") + "}", input.val()); - } else if (input.data("param-type") == "query") { - var prefix = (uriencodedQueryStr == "") ? "?" : "&"; - uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val(); - } else if (input.data("param-type") == "form") { - var prefix = (uriencodedFormStr == "") ? "" : "&"; - uriencodedFormStr += prefix + input.attr("id") + "=" + input.val(); - if (input.attr("type") == "text" || input.attr("type") == "password") { + } else if (input.data("param-type") === "query") { + prefix = !uriEncodedQueryStr ? "?" : "&"; + uriEncodedQueryStr += prefix + input.attr("id") + "=" + input.val(); + } else if (input.data("param-type") === "form") { + prefix = !uriEncodedFormStr ? "" : "&"; + uriEncodedFormStr += prefix + input.attr("id") + "=" + input.val(); + if (input.attr("type") === "text" || input.attr("type") === "password") { payload[input.attr("id")] = input.val(); - } else if (input.attr("type") == "checkbox") { + } else if (input.attr("type") === "checkbox") { payload[input.attr("id")] = input.is(":checked"); - } else if (input.attr("type") == "radio") { + } else if (input.attr("type") === "radio") { payload[input.attr("id")] = input.is(":checked"); } } }); - uri += uriencodedQueryStr; + uri += uriEncodedQueryStr; var httpMethod = form.attr("method").toUpperCase(); - //var contentType = form.attr("enctype"); - var validaterString = validatePayload(operationCode, payload); + var validateString = validatePayload(operationCode, payload); - if (validaterString == "OK") { + if (validateString === "OK") { - if (contentType == undefined || contentType == "") { + if (!contentType) { contentType = "application/x-www-form-urlencoded"; - payload = uriencodedFormStr; + payload = uriEncodedFormStr; } //setting responses callbacks @@ -179,7 +197,7 @@ function submitForm(formId) { // console.log(response); title.html("An Error Occurred!"); statusIcon.attr("class", defaultStatusClasses + " fw-error"); - var reason = (response.responseText == "null") ? response.statusText : response.responseText; + var reason = (response.responseText === "null") ? response.statusText : response.responseText; try { reason = JSON.parse(reason).message; } catch (err) { @@ -191,15 +209,15 @@ function submitForm(formId) { $(modalPopupContent).html(content.html()); }; //executing http request - if (httpMethod == "GET") { + if (httpMethod === "GET") { invokerUtil.get(uri, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "POST") { - var deviceList = [deviceId]; + } else if (httpMethod === "POST") { + var deviceList = deviceIdList.split(","); payload = generatePayload(operationCode, payload, deviceList); invokerUtil.post(uri, payload, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "PUT") { + } else if (httpMethod === "PUT") { invokerUtil.put(uri, payload, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "DELETE") { + } else if (httpMethod === "DELETE") { invokerUtil.delete(uri, successCallBack, errorCallBack, contentType); } else { title.html("An Error Occurred!"); @@ -210,7 +228,7 @@ function submitForm(formId) { } } else { resetLoader(formId); - $(".modal #operation-error-msg span").text(validaterString); + $(".modal #operation-error-msg span").text(validateString); $(".modal #operation-error-msg").removeClass("hidden"); } } @@ -337,7 +355,15 @@ var generatePayload = function (operationCode, operationData, deviceList) { "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], - "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"] + "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"], + "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], + "DISALLOW_SET_USER_ICON": operationData["disallowSetUserIcon"], + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], + "DISALLOW_AUTOFILL": operationData["disallowAutoFill"], + "DISALLOW_BLUETOOTH": operationData["disallowBluetooth"], + "DISALLOW_BLUETOOTH_SHARING": operationData["disallowBluetoothSharing"], + "DISALLOW_REMOVE_USER": operationData["disallowRemoveUser"], + "DISALLOW_DATA_ROAMING": operationData["disallowDataRoaming"] } }; break; @@ -468,7 +494,7 @@ var generatePayload = function (operationCode, operationData, deviceList) { break; case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]: operationType = operationTypeConstants["PROFILE"]; - if (operationData["cosuSystemUpdatePolicyType"] != "window") { + if (operationData["cosuSystemUpdatePolicyType"] !== "window") { payload = { "operation": { "type": operationData["cosuSystemUpdatePolicyType"] @@ -508,7 +534,7 @@ var generatePayload = function (operationCode, operationData, deviceList) { payload = deviceList; } - if (operationType == operationTypeConstants["PROFILE"] && deviceList) { + if (operationType === operationTypeConstants["PROFILE"] && deviceList) { payload["deviceIDs"] = deviceList; } return payload; @@ -565,5 +591,13 @@ var androidOperationConstants = { "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", "KIOSK_APPS_CODE": "KIOSK_APPS", "FILE_TRANSFER": "FILE_TRANSFER", - "APP_RESTRICTION_OPERATION_CODE": "REMOTE_APP_CONFIG" + "APP_RESTRICTION_OPERATION_CODE": "REMOTE_APP_CONFIG", + "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", + "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", + "DISALLOW_AUTOFILL": "DISALLOW_AUTOFILL", + "DISALLOW_BLUETOOTH": "DISALLOW_BLUETOOTH", + "DISALLOW_BLUETOOTH_SHARING": "DISALLOW_BLUETOOTH_SHARING", + "DISALLOW_REMOVE_USER": "DISALLOW_REMOVE_USER", + "DISALLOW_DATA_ROAMING": "DISALLOW_DATA_ROAMING" }; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/templates/operation-bar.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/templates/operation-bar.hbs new file mode 100644 index 000000000..2fd7b7990 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/templates/operation-bar.hbs @@ -0,0 +1,184 @@ +{{! + Copyright (c) 2019, 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. +}} +{{#if controlOperations}} +
+ + {{#each controlOperations}} + + {{#if iconFont}} + + {{else}} + {{#if icon}} + + {{else}} + + {{/if}} + {{/if}} + {{name}} + + +
+
+ +
+
+

+ + + + + {{name}} +
+

+

+ {{description}} +
+

+ + + + + +
+
+ {{#each params.0.pathParams}} + +
+ {{/each}} + {{#each params.0.formParams}} + +
+ {{/each}} + {{#each params.0.queryParams}} + +
+ {{/each}} + {{#each uiParams}} + {{#equal this.type "select"}} +
+ +
+ {{/equal}} + {{#equal this.type "radio"}} + + {{this.value}} + {{/equal}} + {{#equal this.type "checkbox"}} + + {{this.label}} +
+ {{/equal}} + {{#equal this.type "password"}} + +
+ {{/equal}} + {{#equal this.type "text"}} + +
+ {{/equal}} + {{#equal this.type "info"}} +
+ + {{this.value}} + +
+ {{/equal}} + {{/each}} + + + + +
+
+
+
+
+
+ {{/each}} +
+{{/if}} + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index 866e7efd1..81fa182a8 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -100,7 +100,16 @@ var androidOperationModule = function () { "COSU_PROFILE_CONFIGURATION_OPERATION": "cosu-profile-configuration", "COSU_PROFILE_CONFIGURATION_OPERATION_CODE": "COSU_PROFILE", "ENROLLMENT_APP_INSTALL": "enrollment-app-install", - "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL" + "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL", + "DISALLOW_SET_WALLPAPER": "DISALLOW_SET_WALLPAPER", + "DISALLOW_SET_USER_ICON": "DISALLOW_SET_USER_ICON", + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": "DISALLOW_REMOVE_MANAGEMENT_PROFILE", + "DISALLOW_AUTOFILL": "DISALLOW_AUTOFILL", + "DISALLOW_BLUETOOTH": "DISALLOW_BLUETOOTH", + "DISALLOW_BLUETOOTH_SHARING": "DISALLOW_BLUETOOTH_SHARING", + "DISALLOW_REMOVE_USER": "DISALLOW_REMOVE_USER", + "DISALLOW_DATA_ROAMING": "DISALLOW_DATA_ROAMING", + "CERT_ADD_OPERATION_CODE": "INSTALL_CERT" }; /** @@ -300,6 +309,17 @@ var androidOperationModule = function () { "enrollmentAppInstall": operationPayload["enrollmentAppInstall"] }; break; + case androidOperationConstants["CERT_ADD_OPERATION_CODE"]: + var certList = operationPayload["CERT_LIST"]; + var listNew = []; + certList.forEach(function (element) { + element["CERT_CONTENT_VIEW"] = element["CERT_NAME"] + " File"; + listNew.push(element); + }); + payload = { + "CERT_LIST": listNew + }; + break; } return payload; }; @@ -345,7 +365,14 @@ var androidOperationModule = function () { "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], "AUTO_TIME": operationData["enableAutoTime"], "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], - "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"] + "DISALLOW_SET_WALLPAPER": operationData["disallowSetWallpaper"], + "DISALLOW_SET_USER_ICON": operationData["disallowSetWallpaper"], + "DISALLOW_REMOVE_MANAGEMENT_PROFILE": operationData["disallowRemoveManagedProfile"], + "DISALLOW_AUTOFILL": operationData["disallowAutoFill"], + "DISALLOW_BLUETOOTH": operationData["disallowBluetooth"], + "DISALLOW_BLUETOOTH_SHARING": operationData["disallowBluetoothSharing"], + "DISALLOW_REMOVE_USER": operationData["disallowRemoveUser"], + "DISALLOW_DATA_ROAMING": operationData["disallowDataRoaming"] } }; break; @@ -653,6 +680,14 @@ var androidOperationModule = function () { } }; break; + case androidOperationConstants["CERT_ADD_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "CERT_LIST": operationData["CERT_LIST"] + } + }; + break; default: // If the operation is neither of above, it is a command operation operationType = operationTypeConstants["COMMAND"]; @@ -1202,6 +1237,30 @@ var androidOperationModule = function () { } else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]) { restrictions["disableStatusBar"] = restriction["enabled"]; continue; + }else if (featureCode == androidOperationConstants["DISALLOW_SET_WALLPAPER"]) { + restrictions["disallowSetWallpaper"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_SET_USER_ICON"]) { + restrictions["disallowSetUserIcon"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_MANAGEMENT_PROFILE"]) { + restrictions["disallowRemoveManagedProfile"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_AUTOFILL"]) { + restrictions["disallowAutoFill"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_BLUETOOTH"]) { + restrictions["disallowBluetooth"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_BLUETOOTH_SHARING"]) { + restrictions["disallowBluetoothSharing"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_USER"]) { + restrictions["disallowRemoveUser"] = restriction["enabled"]; + continue; + }else if (featureCode == androidOperationConstants["DISALLOW_DATA_ROAMING"]) { + restrictions["disallowDataRoaming"] = restriction["enabled"]; + continue; } //push the feature-code to the configuration array configuredOperations.push(featureCode); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.platform.configuration/configuration.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.platform.configuration/configuration.hbs index 0b4931295..3f2fac78e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.platform.configuration/configuration.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.platform.configuration/configuration.hbs @@ -91,7 +91,7 @@
- ( ex: org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver ) + ( ex: io.entgra.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver ) @@ -132,6 +132,22 @@ +
+ + +
+
+
-
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
-
+
+
+ +
+
{{/unless}} @@ -1306,6 +1426,107 @@ + +
+
+ +
+
+ + +
+ +
+ + + + + + + Add Certificate + +
+ + + + + + + + + + + + + + +
No:Certificate NameCertificate File
+ No entries added yet . +
+ + + + + + + + + + +
+
+
+
+
+ +
+

@@ -747,6 +757,109 @@

+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
{{/unless}} @@ -2202,6 +2315,104 @@ + +
+ + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js index 5ae4076b3..ba52e44e6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/js/android-policy-operations.js @@ -55,7 +55,8 @@ var androidOperationConstants = { "COSU_PROFILE_CONFIGURATION_OPERATION": "cosu-profile-configuration", "COSU_PROFILE_CONFIGURATION_OPERATION_CODE": "COSU_PROFILE", "ENROLLMENT_APP_INSTALL": "enrollment-app-install", - "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL" + "ENROLLMENT_APP_INSTALL_CODE": "ENROLLMENT_APP_INSTALL", + "CERTIFICATE_INSTALL": "INSTALL_CERT" }; /** @@ -114,6 +115,30 @@ var ovpnConfigUploaded = function () { } }; + +var certConfigUploaded = function (val) { + var certFileInput = document.getElementById("cert-file-field"); + if ('files' in certFileInput) { + if (certFileInput.files.length === 1) { + var reader = new FileReader(); + reader.onload = function(progressEvent){ + var txt = ""; + var lines = this.result.split('\n'); + for(var line = 0; line < lines.length; line++){ + console.log(lines[line]); + if (lines[line].charAt(0) !== '#') { + txt += lines[line] + '\n'; + } + } + //document.getElementById ("cert-config").value = txt; + //console.log(document.getElementById ("cert-config").value); + $(val).next().val(txt); + }; + reader.readAsText(certFileInput.files[0]); + } + } +}; + /** * Validates policy profile operations for the windows platform. * @@ -761,6 +786,32 @@ var validatePolicyProfile = function () { } validationStatusArray.push(validationStatus); } + if ($.inArray(androidOperationConstants["CERTIFICATE_INSTALL"], configuredOperations) != -1) { + //If enrollment app install configured + let isErrorsFound = false; + operation = androidOperationConstants["CERTIFICATE_INSTALL"]; + var certList = $("#cert-list").find(".child-input"); + for (let j = 0; j < certList.length; j++) { + if ($(certList[j]).val().trim() === "") { + isErrorsFound = true; + break; + } + } + if (isErrorsFound) { + validationStatus = { + "error": true, + "subErrorMsg": "Certificates are not selected to be installed.", + "erroneousFeature": operation + }; + validationStatusArray.push(validationStatus); + } else { + validationStatus = { + "error": false, + "okFeature": operation + }; + validationStatusArray.push(validationStatus); + } + } } // ending validation process diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs index 36ed7b995..cd1837cd9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard/public/templates/android-policy-operations.hbs @@ -76,6 +76,15 @@ + + + + + Secure Certificate + + + + {{#unless iscloud}} @@ -506,6 +515,98 @@
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
    @@ -558,6 +659,7 @@
+

+
+ +
+
{{/unless}} @@ -2225,6 +2339,109 @@ + + +
+
+ +
+
+ + +
+ +
+ + + + + + + Add Certificate + +
+ + + + + + + + + + + + + + +
No:Certificate NameCertificate File
+ No entries added yet . +
+ + + + + + + + + + +
+
+
+
+
+ +
android-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml @@ -46,7 +46,6 @@ org.apache.felix maven-bundle-plugin - 1.4.0 true diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java index f81dfb833..5e7f0ac28 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java @@ -14,6 +14,22 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl; @@ -25,6 +41,7 @@ import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.ProvisioningConfig; import org.wso2.carbon.device.mgt.common.InitialOperationConfig; import org.wso2.carbon.device.mgt.common.DeviceStatusTaskPluginConfig; +import org.wso2.carbon.device.mgt.common.StartupOperationConfig; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -34,6 +51,7 @@ import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; +import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypePlatformDetails; import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants; import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder; @@ -123,6 +141,11 @@ public class AndroidDeviceManagementService implements DeviceManagementService { return null; } + @Override + public StartupOperationConfig getStartupOperationConfig() { + return null; + } + @Override public PullNotificationSubscriber getPullNotificationSubscriber() { return null; @@ -138,6 +161,9 @@ public class AndroidDeviceManagementService implements DeviceManagementService { return null; } + @Override + public DeviceTypePlatformDetails getDeviceTypePlatformDetails() { return null; } + private String getConfigProperty(List configs, String propertyName) { for (ConfigurationEntry entry : configs) { if (propertyName.equals(entry.getName())) { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java index 957ce5a79..2494d1cd3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidFeatureManager.java @@ -16,8 +16,28 @@ * under the License. * */ + +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.Feature; @@ -32,6 +52,7 @@ import org.wso2.carbon.device.mgt.mobile.android.impl.util.MobileDeviceManagemen import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; public class AndroidFeatureManager implements FeatureManager { @@ -97,14 +118,43 @@ public class AndroidFeatureManager implements FeatureManager { public List getFeatures() throws DeviceManagementException { try { List mobileFeatures = featureDAO.getAllFeatures(); - List featureList = new ArrayList(mobileFeatures.size()); - for (MobileFeature mobileFeature : mobileFeatures) { - featureList.add(MobileDeviceManagementUtil.convertToFeature(mobileFeature)); + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); + } catch (MobileDeviceManagementDAOException e) { + throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + + "Android platform", e); + } + } + + @Override + public List getFeatures(String featureType) throws DeviceManagementException { + if (StringUtils.isEmpty(featureType)) { + return this.getFeatures(); + } + try { + List mobileFeatures = featureDAO.getFeaturesByFeatureType(featureType); + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); + } catch (MobileDeviceManagementDAOException e) { + throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + + "Android platform", e); + } + } + + @Override + public List getFeatures(String featureType, boolean isHidden) throws DeviceManagementException { + try { + List mobileFeatures; + if (StringUtils.isNotEmpty(featureType)) { + mobileFeatures = featureDAO.getFeaturesByFeatureType(featureType, isHidden); + } else { + mobileFeatures = featureDAO.getAllFeatures(isHidden); } - return featureList; + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); } catch (MobileDeviceManagementDAOException e) { throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + - "Android platform", e); + "Android platform", e); } } @@ -469,6 +519,54 @@ public class AndroidFeatureManager implements FeatureManager { feature.setDescription("Unlock the device"); supportedFeatures.add(feature); + feature = new Feature(); + feature.setCode("DISALLOW_SET_WALLPAPER"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_SET_USER_ICON"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_REMOVE_MANAGEMENT_PROFILE"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_AUTOFILL"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_BLUETOOTH"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_BLUETOOTH_SHARING"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_REMOVE_USER"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + + feature = new Feature(); + feature.setCode("DISALLOW_DATA_ROAMING"); + feature.setName("Device Unlock"); + feature.setDescription("Unlock the device"); + supportedFeatures.add(feature); + return supportedFeatures; } } \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileFeatureDAO.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileFeatureDAO.java index b9a4d72af..aba4c13b3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileFeatureDAO.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileFeatureDAO.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl.dao; import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileFeature; @@ -107,4 +125,32 @@ public interface MobileFeatureDAO { * @throws MobileDeviceManagementDAOException */ List getAllFeatures() throws MobileDeviceManagementDAOException; + + /** + * Get all the MobileFeatures by a given ui visibility + * + * @param isHidden Whether the operation is hidden from UI or not. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getAllFeatures(boolean isHidden) throws MobileDeviceManagementDAOException; + + /** + * Retrieve all MobileFeatures of a given feature type + * + * @param featureType Feature type. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getFeaturesByFeatureType(String featureType) throws MobileDeviceManagementDAOException; + + /** + * Retrieve all MobileFeatures of a given feature type and ui visibility + * + * @param featureType Feature type. + * @param isHidden Whether the operation is hidden from UI or not. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getFeaturesByFeatureType(String featureType, boolean isHidden) throws MobileDeviceManagementDAOException; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidFeatureDAOImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidFeatureDAOImpl.java index 7a6de77b5..2d9fe21d0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidFeatureDAOImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidFeatureDAOImpl.java @@ -16,6 +16,25 @@ * under the License. * */ + +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; import org.apache.commons.logging.Log; @@ -51,17 +70,19 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = AndroidDAOFactory.getConnection(); - String sql = "INSERT INTO AD_FEATURE(CODE, NAME, DESCRIPTION) VALUES (?, ?, ?)"; + String sql = "INSERT INTO AD_FEATURE(CODE, NAME, TYPE, HIDDEN, DESCRIPTION) VALUES (?, ?, ?, ?, ?)"; stmt = conn.prepareStatement(sql); stmt.setString(1, mobileFeature.getCode()); stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); + stmt.setString(3, mobileFeature.getType()); + stmt.setBoolean(4, mobileFeature.isHidden()); + stmt.setString(5, mobileFeature.getDescription()); stmt.executeUpdate(); status = true; } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while adding android feature '" + - mobileFeature.getName() + "' into the metadata repository", e); + mobileFeature.getName() + "' into the metadata repository", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); } @@ -71,28 +92,27 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { @Override public boolean addFeatures(List mobileFeatures) throws MobileDeviceManagementDAOException { PreparedStatement stmt = null; - MobileFeature mobileFeature; - boolean status = false; Connection conn; try { conn = AndroidDAOFactory.getConnection(); - stmt = conn.prepareStatement("INSERT INTO AD_FEATURE(CODE, NAME, DESCRIPTION) VALUES (?, ?, ?)"); - for (int i = 0; i < mobileFeatures.size(); i++) { - mobileFeature = mobileFeatures.get(i); + stmt = conn.prepareStatement("INSERT INTO AD_FEATURE(CODE, NAME, TYPE, HIDDEN, DESCRIPTION) " + + "VALUES (?, ?, ?, ?, ?)"); + for (MobileFeature mobileFeature : mobileFeatures) { stmt.setString(1, mobileFeature.getCode()); stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); + stmt.setString(3, mobileFeature.getType()); + stmt.setBoolean(4, mobileFeature.isHidden()); + stmt.setString(5, mobileFeature.getDescription()); stmt.addBatch(); } stmt.executeBatch(); - status = true; + return true; } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while adding android features into the metadata repository", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); } - return status; } @Override @@ -103,25 +123,27 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { try { conn = AndroidDAOFactory.getConnection(); String updateDBQuery = - "UPDATE AD_FEATURE SET NAME = ?, DESCRIPTION = ?" + - "WHERE CODE = ?"; + "UPDATE AD_FEATURE SET NAME = ?, TYPE = ?, HIDDEN = ? ,DESCRIPTION = ?" + + "WHERE CODE = ?"; stmt = conn.prepareStatement(updateDBQuery); stmt.setString(1, mobileFeature.getName()); - stmt.setString(2, mobileFeature.getDescription()); - stmt.setString(3, mobileFeature.getCode()); + stmt.setString(2, mobileFeature.getType()); + stmt.setBoolean(3, mobileFeature.isHidden()); + stmt.setString(4, mobileFeature.getDescription()); + stmt.setString(5, mobileFeature.getCode()); int rows = stmt.executeUpdate(); if (rows > 0) { status = true; if (log.isDebugEnabled()) { log.debug("Android Feature " + mobileFeature.getCode() + " data has been " + - "modified."); + "modified."); } } } catch (SQLException e) { String msg = "Error occurred while updating the Android Feature '" + - mobileFeature.getCode() + "' to the Android db."; + mobileFeature.getCode() + "' to the Android db."; log.error(msg, e); throw new AndroidFeatureManagementDAOException(msg, e); } finally { @@ -146,7 +168,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while deleting android feature '" + - mblFeatureId + "' from Android database.", e); + mblFeatureId + "' from Android database.", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); } @@ -156,7 +178,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { @Override public boolean deleteFeatureByCode(String mblFeatureCode) throws MobileDeviceManagementDAOException { PreparedStatement stmt = null; - boolean status = false; + boolean status; Connection conn; try { conn = AndroidDAOFactory.getConnection(); @@ -168,7 +190,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while deleting android feature '" + - mblFeatureCode + "' from Android database.", e); + mblFeatureCode + "' from Android database.", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); } @@ -182,7 +204,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = AndroidDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM AD_FEATURE WHERE ID = ?"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM AD_FEATURE WHERE ID = ?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, mblFeatureId); rs = stmt.executeQuery(); @@ -193,8 +215,10 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { mobileFeature.setId(rs.getInt(AndroidPluginConstants.ANDROID_FEATURE_ID)); mobileFeature.setCode(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_CODE)); mobileFeature.setName(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_NAME)); + mobileFeature.setType(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_TYPE)); + mobileFeature.setHidden(rs.getBoolean(AndroidPluginConstants.ANDROID_FEATURE_HIDDEN)); mobileFeature.setDescription(rs.getString(AndroidPluginConstants. - ANDROID_FEATURE_DESCRIPTION)); + ANDROID_FEATURE_DESCRIPTION)); mobileFeature.setDeviceType( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); } @@ -202,7 +226,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while retrieving android feature '" + - mblFeatureId + "' from the Android database.", e); + mblFeatureId + "' from the Android database.", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); AndroidDAOFactory.closeConnection(); @@ -217,27 +241,20 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { try { conn = AndroidDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM AD_FEATURE WHERE CODE = ?"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM AD_FEATURE WHERE CODE = ?"; stmt = conn.prepareStatement(sql); stmt.setString(1, mblFeatureCode); rs = stmt.executeQuery(); MobileFeature mobileFeature = null; if (rs.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(rs.getInt(AndroidPluginConstants.ANDROID_FEATURE_ID)); - mobileFeature.setCode(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_CODE)); - mobileFeature.setName(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_NAME)); - mobileFeature.setDescription(rs.getString(AndroidPluginConstants. - ANDROID_FEATURE_DESCRIPTION)); - mobileFeature.setDeviceType( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + mobileFeature = populateMobileFeature(rs); } return mobileFeature; } catch (SQLException e) { throw new AndroidFeatureManagementDAOException( "Error occurred while retrieving android feature '" + - mblFeatureCode + "' from the Android database.", e); + mblFeatureCode + "' from the Android database.", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); AndroidDAOFactory.closeConnection(); @@ -258,28 +275,123 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO { List features = new ArrayList<>(); try { conn = AndroidDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM AD_FEATURE"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM AD_FEATURE"; stmt = conn.prepareStatement(sql); rs = stmt.executeQuery(); - MobileFeature mobileFeature = null; while (rs.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(rs.getInt(AndroidPluginConstants.ANDROID_FEATURE_ID)); - mobileFeature.setCode(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_CODE)); - mobileFeature.setName(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_NAME)); - mobileFeature.setDescription(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_DESCRIPTION)); - mobileFeature.setDeviceType( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - features.add(mobileFeature); + features.add(populateMobileFeature(rs)); } return features; } catch (SQLException e) { - throw new AndroidFeatureManagementDAOException("Error occurred while retrieving all " + - "android features from the android database.", e); + throw new AndroidFeatureManagementDAOException("Error occurred while retrieving all android features " + + "from the android database.", e); } finally { MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); AndroidDAOFactory.closeConnection(); } } + + @Override + public List getAllFeatures(boolean isHidden) throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn = null; + List features = new ArrayList<>(); + try { + conn = AndroidDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM AD_FEATURE WHERE HIDDEN = ?"; + stmt = conn.prepareStatement(sql); + stmt.setBoolean(1, isHidden); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new AndroidFeatureManagementDAOException("Error occurred while retrieving all android features " + + "from the android database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + AndroidDAOFactory.closeConnection(); + } + } + + @Override + public List getFeaturesByFeatureType(String featureType) throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn; + List features = new ArrayList<>(); + try { + conn = AndroidDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM AD_FEATURE WHERE TYPE = ?"; + stmt = conn.prepareStatement(sql); + stmt.setString(1, featureType); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new AndroidFeatureManagementDAOException("Error occurred while retrieving all android features of " + + "type " + featureType + " from the android database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + AndroidDAOFactory.closeConnection(); + } + } + + @Override + public List getFeaturesByFeatureType(String featureType, boolean isHidden) throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn; + List features = new ArrayList<>(); + try { + conn = AndroidDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION " + + "FROM AD_FEATURE " + + "WHERE TYPE = ? AND HIDDEN = ?"; + stmt = conn.prepareStatement(sql); + stmt.setString(1, featureType); + stmt.setBoolean(2, isHidden); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new AndroidFeatureManagementDAOException("Error occurred while retrieving all android features of " + + "[type: " + featureType + " & hidden: " + isHidden + "] from the android database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + AndroidDAOFactory.closeConnection(); + } + } + + /** + * Generate {@link MobileFeature} from the SQL {@link ResultSet} + * + * @param rs Result set + * @return populated {@link MobileFeature} + * @throws SQLException if unable to extract data from {@link ResultSet} + */ + private MobileFeature populateMobileFeature(ResultSet rs) throws SQLException { + MobileFeature mobileFeature = new MobileFeature(); + mobileFeature.setId(rs.getInt(AndroidPluginConstants.ANDROID_FEATURE_ID)); + mobileFeature.setCode(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_CODE)); + mobileFeature.setName(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_NAME)); + mobileFeature.setDescription(rs.getString(AndroidPluginConstants. + ANDROID_FEATURE_DESCRIPTION)); + mobileFeature.setType(rs.getString(AndroidPluginConstants.ANDROID_FEATURE_TYPE)); + mobileFeature.setHidden(rs.getBoolean(AndroidPluginConstants.ANDROID_FEATURE_HIDDEN)); + mobileFeature.setDeviceType( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + + return mobileFeature; + } } \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/MobileFeatureDAOImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/MobileFeatureDAOImpl.java deleted file mode 100644 index eeade1e6a..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/MobileFeatureDAOImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. 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 org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.MobileDeviceManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.MobileFeatureDAO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.util.MobileDeviceManagementDAOUtil; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileFeature; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -/** - * Implementation of MobileFeatureDAO. - */ -public class MobileFeatureDAOImpl implements MobileFeatureDAO { - - private DataSource dataSource; - private static final Log log = LogFactory.getLog(MobileFeatureDAOImpl.class); - - public MobileFeatureDAOImpl(DataSource dataSource) { - this.dataSource = dataSource; - } - - @Override - public boolean addFeature(MobileFeature mobileFeature) - throws MobileDeviceManagementDAOException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = this.getConnection(); - String createDBQuery = - "INSERT INTO AD_FEATURE(CODE, NAME, DESCRIPTION, DEVICE_TYPE) VALUES (?, ?, ?, ?)"; - - stmt = conn.prepareStatement(createDBQuery); - stmt.setString(1, mobileFeature.getCode()); - stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); - stmt.setString(4, mobileFeature.getDeviceType()); - int rows = stmt.executeUpdate(); - if (rows > 0) { - if (log.isDebugEnabled()) { - log.debug("Added a new MobileFeature " + mobileFeature.getCode() + " to the MDM database."); - } - status = true; - } - } catch (SQLException e) { - String msg = "Error occurred while adding feature code - '" + - mobileFeature.getCode() + "' to feature table"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null); - } - return status; - } - - @Override - public boolean addFeatures(List mobileFeatures) throws MobileDeviceManagementDAOException { - return false; - } - - @Override - public boolean updateFeature(MobileFeature mobileFeature) - throws MobileDeviceManagementDAOException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = this.getConnection(); - String updateDBQuery = - "UPDATE AD_FEATURE SET CODE = ?, NAME = ?, DESCRIPTION = ?, DEVICE_TYPE = ?" + - " WHERE ID = ?"; - stmt = conn.prepareStatement(updateDBQuery); - stmt.setString(1, mobileFeature.getCode()); - stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); - stmt.setString(4, mobileFeature.getDeviceType()); - stmt.setInt(5, mobileFeature.getId()); - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Updated MobileFeature " + mobileFeature.getCode()); - } - } - } catch (SQLException e) { - String msg = "Error occurred while updating the feature with feature code - '" + - mobileFeature.getId() + "'"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null); - } - return status; - } - - @Override - public boolean deleteFeatureByCode(String mblFeatureCode) - throws MobileDeviceManagementDAOException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = this.getConnection(); - String deleteDBQuery = - "DELETE FROM AD_FEATURE WHERE CODE = ?"; - stmt = conn.prepareStatement(deleteDBQuery); - stmt.setString(1, mblFeatureCode); - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Deleted MobileFeature code " + mblFeatureCode + " from the MDM database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while deleting feature with code - " + mblFeatureCode; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null); - } - return status; - } - - @Override - public boolean deleteFeatureById(int mblFeatureId) - throws MobileDeviceManagementDAOException { - boolean status = false; - Connection conn = null; - PreparedStatement stmt = null; - try { - conn = this.getConnection(); - String deleteDBQuery = - "DELETE FROM AD_FEATURE WHERE ID = ?"; - stmt = conn.prepareStatement(deleteDBQuery); - stmt.setInt(1, mblFeatureId); - int rows = stmt.executeUpdate(); - if (rows > 0) { - status = true; - if (log.isDebugEnabled()) { - log.debug("Deleted MobileFeature id " + mblFeatureId + " from the MDM database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while deleting feature with id - " + mblFeatureId; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, null); - } - return status; - } - - @Override - public MobileFeature getFeatureByCode(String mblFeatureCode) - throws MobileDeviceManagementDAOException { - Connection conn = null; - PreparedStatement stmt = null; - MobileFeature mobileFeature = null; - ResultSet resultSet = null; - try { - conn = this.getConnection(); - String selectDBQuery = - "SELECT ID, CODE, NAME, DESCRIPTION, DEVICE_TYPE FROM AD_FEATURE " + - "WHERE CODE = ?"; - stmt = conn.prepareStatement(selectDBQuery); - stmt.setString(1, mblFeatureCode); - resultSet = stmt.executeQuery(); - if (resultSet.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(resultSet.getInt(1)); - mobileFeature.setCode(resultSet.getString(2)); - mobileFeature.setName(resultSet.getString(3)); - mobileFeature.setDescription(resultSet.getString(4)); - mobileFeature.setDeviceType(resultSet.getString(5)); - if (log.isDebugEnabled()) { - log.debug("Fetched MobileFeature " + mblFeatureCode + " from the MDM database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while fetching feature code - '" + mblFeatureCode + "'"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, resultSet); - } - return mobileFeature; - } - - @Override - public MobileFeature getFeatureById(int mblFeatureId) - throws MobileDeviceManagementDAOException { - Connection conn = null; - PreparedStatement stmt = null; - MobileFeature mobileFeature = null; - ResultSet resultSet = null; - try { - conn = this.getConnection(); - String selectDBQuery = - "SELECT ID, CODE, NAME, DESCRIPTION, DEVICE_TYPE FROM AD_FEATURE" + - " WHERE ID = ?"; - stmt = conn.prepareStatement(selectDBQuery); - stmt.setInt(1, mblFeatureId); - resultSet = stmt.executeQuery(); - if (resultSet.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(resultSet.getInt(1)); - mobileFeature.setCode(resultSet.getString(2)); - mobileFeature.setName(resultSet.getString(3)); - mobileFeature.setDescription(resultSet.getString(4)); - mobileFeature.setDeviceType(resultSet.getString(5)); - if (log.isDebugEnabled()) { - log.debug("Fetched MobileFeatureId" + mblFeatureId + " from the MDM database."); - } - } - } catch (SQLException e) { - String msg = "Error occurred while fetching feature id - '" + mblFeatureId + "'"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, resultSet); - } - return mobileFeature; - } - - @Override - public List getAllFeatures() throws MobileDeviceManagementDAOException { - Connection conn = null; - PreparedStatement stmt = null; - MobileFeature mobileFeature; - List mobileFeatures = new ArrayList(); - ResultSet resultSet = null; - try { - conn = this.getConnection(); - String selectDBQuery = - "SELECT ID, CODE, NAME, DESCRIPTION, DEVICE_TYPE FROM AD_FEATURE"; - stmt = conn.prepareStatement(selectDBQuery); - resultSet = stmt.executeQuery(); - while (resultSet.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(resultSet.getInt(1)); - mobileFeature.setCode(resultSet.getString(2)); - mobileFeature.setName(resultSet.getString(3)); - mobileFeature.setDescription(resultSet.getString(4)); - mobileFeature.setDeviceType(resultSet.getString(5)); - mobileFeatures.add(mobileFeature); - } - if (log.isDebugEnabled()) { - log.debug("Fetched all MobileFeatures from the MDM database."); - } - return mobileFeatures; - } catch (SQLException e) { - String msg = "Error occurred while fetching all features.'"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, resultSet); - } - } - - @Override - public List getFeatureByDeviceType(String deviceType) throws MobileDeviceManagementDAOException { - Connection conn = null; - PreparedStatement stmt = null; - MobileFeature mobileFeature; - List mobileFeatures = new ArrayList<>(); - ResultSet resultSet = null; - try { - conn = this.getConnection(); - String selectDBQuery = - "SELECT ID, CODE, NAME, DESCRIPTION, DEVICE_TYPE FROM AD_FEATURE" + - " WHERE DEVICE_TYPE = ?"; - stmt = conn.prepareStatement(selectDBQuery); - stmt.setString(1, deviceType); - resultSet = stmt.executeQuery(); - while (resultSet.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(resultSet.getInt(1)); - mobileFeature.setCode(resultSet.getString(2)); - mobileFeature.setName(resultSet.getString(3)); - mobileFeature.setDescription(resultSet.getString(4)); - mobileFeature.setDeviceType(resultSet.getString(5)); - mobileFeatures.add(mobileFeature); - } - if (log.isDebugEnabled()) { - log.debug("Fetched all MobileFeatures of type " + deviceType + " from the MDM" + - " database."); - } - return mobileFeatures; - } catch (SQLException e) { - String msg = "Error occurred while fetching all features.'"; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } finally { - MobileDeviceManagementDAOUtil.cleanupResources(conn, stmt, resultSet); - } - } - - private Connection getConnection() throws MobileDeviceManagementDAOException { - try { - return dataSource.getConnection(); - } catch (SQLException e) { - String msg = "Error occurred while obtaining a connection from the mobile specific " + - "datasource."; - log.error(msg, e); - throw new MobileDeviceManagementDAOException(msg, e); - } - } - -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java index 6568c9d5c..1778f8560 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl.dto; import java.io.Serializable; @@ -29,6 +47,8 @@ public class MobileFeature implements Serializable { private String deviceType; private String code; private String name; + private String type; + private boolean hidden; private String description; public int getId() { @@ -55,6 +75,22 @@ public class MobileFeature implements Serializable { this.name = name; } + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + public String getDescription() { return description; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java index 09b278e2c..a0c7a332d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl.util; /** @@ -43,6 +61,8 @@ public final class AndroidPluginConstants { public static final String ANDROID_FEATURE_ID = "ID"; public static final String ANDROID_FEATURE_CODE = "CODE"; public static final String ANDROID_FEATURE_NAME = "NAME"; + public static final String ANDROID_FEATURE_TYPE = "TYPE"; + public static final String ANDROID_FEATURE_HIDDEN = "HIDDEN"; public static final String ANDROID_FEATURE_DESCRIPTION = "DESCRIPTION"; public static final class NotifierType { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java index b56e70d88..be7be45b5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.android.impl.util; import org.apache.commons.logging.Log; @@ -42,7 +60,13 @@ import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; /** * Provides utility methods required by the mobile device management bundle. @@ -202,6 +226,8 @@ public class MobileDeviceManagementUtil { mobileFeature.setCode(feature.getCode()); mobileFeature.setDescription(feature.getDescription()); mobileFeature.setDeviceType(feature.getDeviceType()); + mobileFeature.setType(feature.getType()); + mobileFeature.setHidden(feature.isHidden()); return mobileFeature; } @@ -211,6 +237,8 @@ public class MobileDeviceManagementUtil { feature.setDeviceType(mobileFeature.getDeviceType()); feature.setCode(mobileFeature.getCode()); feature.setName(mobileFeature.getName()); + feature.setType(mobileFeature.getType()); + feature.setHidden(mobileFeature.isHidden()); return feature; } diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index 2f5bf0640..47f0b2874 100644 --- a/components/mobile-plugins/android-plugin/pom.xml +++ b/components/mobile-plugins/android-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/pom.xml b/components/mobile-plugins/pom.xml index 64c5a0590..ac7d0ba7d 100644 --- a/components/mobile-plugins/pom.xml +++ b/components/mobile-plugins/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 4b9c840bf..9fa78dec0 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -21,7 +21,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml index 26c008fee..1896294d6 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml @@ -23,13 +23,13 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.windows.ui - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Mobile Windows UI pom diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs index b2adb105b..f1951c492 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.hbs @@ -46,7 +46,7 @@

Device Operations

- {{unit "cdmf.unit.device.type.windows.new.operation-bar" device=device + {{unit "cdmf.unit.device.type.windows.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}}
{{/if}} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.js deleted file mode 100644 index 30a8d397f..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. 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. - */ - -function onRequest(context) { - var log = new Log("operation.js"); - var operationModule = require("/app/modules/business-controllers/operation.js")["operationModule"]; - var device = context.unit.params.device; - var autoCompleteParams = context.unit.params.autoCompleteParams; - var encodedFeaturePayloads=context.unit.params.encodedFeaturePayloads; - var controlOperations = operationModule.getControlOperations(device); - var queryParams = []; - var formParams = []; - var pathParams = []; - for (var i = 0; i < controlOperations.length; i++) { - var currentParamList = controlOperations[i]["params"]; - var uiParamList = controlOperations[i]["uiParams"]; - for (var j = 0; j < currentParamList.length; j++) { - var currentParam = currentParamList[j]; - currentParamList[j]["formParams"] = processParams(currentParam["formParams"], autoCompleteParams); - currentParamList[j]["queryParams"] = processParams(currentParam["queryParams"], autoCompleteParams); - currentParamList[j]["pathParams"] = processParams(currentParam["pathParams"], autoCompleteParams); - } - controlOperations[i]["uiParams"] = uiParamList; - if (encodedFeaturePayloads) { - controlOperations[i]["payload"] = getPayload(encodedFeaturePayloads, controlOperations[i]["operation"]); - } - } - return {"control_operations": controlOperations, "device": device}; -} - -function processParams(paramsList, autoCompleteParams) { - for (var i = 0; i < paramsList.length; i++) { - var paramName = paramsList[i]; - var paramValue = ""; - var paramType = "text"; - for (var k = 0; k < autoCompleteParams.length; k++) { - if (paramName == autoCompleteParams[k].name) { - paramValue = autoCompleteParams[k].value; - paramType = "hidden"; - } - } - paramsList[i] = {"name": paramName, "value": paramValue, "type": paramType}; - } - return paramsList; -} - -function getPayload(featuresPayload, featureCode){ - var featuresJSONPayloads = JSON.parse(featuresPayload); - return featuresJSONPayloads[featureCode]; -} \ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.json b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.json deleted file mode 100644 index 688e93980..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "1.0.0" -} \ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/public/js/operation-bar.js deleted file mode 100644 index aa3d69f68..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/public/js/operation-bar.js +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. 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. - */ - -/* - * On operation click function. - * @param selection: Selected operation - */ -function operationSelect(selection) { - $(modalPopupContent).addClass("operation-data"); - $(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html()); - $(modalPopupContent).data("operation-code", selection); - showPopup(); -} - -function submitForm(formId) { - var form = $("#" + formId); - var uri = form.attr("action"); - var deviceId = form.data("device-id"); - var contentType = form.data("content-type"); - var operationCode = form.data("operation-code"); - var uriencodedQueryStr = ""; - var uriencodedFormStr = ""; - var payload = {}; - form.find("input").each(function () { - var input = $(this); - if (input.data("param-type") == "path") { - uri = uri.replace("{" + input.attr("id") + "}", input.val()); - } else if (input.data("param-type") == "query") { - var prefix = (uriencodedQueryStr == "") ? "?" : "&"; - uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val(); - } else if (input.data("param-type") == "form") { - var prefix = (uriencodedFormStr == "") ? "" : "&"; - uriencodedFormStr += prefix + input.attr("id") + "=" + input.val(); - if(input.attr("type") == "text"){ - payload[input.attr("id")] = input.val(); - } else if(input.attr("type") == "checkbox"){ - payload[input.attr("id")] = input.is(":checked"); - } - } - }); - uri += uriencodedQueryStr; - var httpMethod = form.attr("method").toUpperCase(); - //var contentType = form.attr("enctype"); - - if (contentType == undefined || contentType == "") { - contentType = "application/x-www-form-urlencoded"; - payload = uriencodedFormStr; - } - - //setting responses callbacks - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#operation-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var description = content.find("#description"); - description.html(""); - var successCallBack = function (response) { - var res = response; - try { - res = JSON.parse(response).messageFromServer; - } catch (err) { - //do nothing - } - title.html("Operation Triggered!"); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - description.html(res); - console.log("success!"); - $(modalPopupContent).html(content.html()); - }; - var errorCallBack = function (response) { - console.log(response); - title.html("An Error Occurred!"); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - var reason = (response.responseText == "null")?response.statusText:response.responseText; - try { - reason = JSON.parse(reason).message; - } catch (err) { - //do nothing - } - description.html(reason); - console.log("Error!"); - $(modalPopupContent).html(content.html()); - }; - //executing http request - if (httpMethod == "GET") { - invokerUtil.get(uri, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "POST") { - var deviceList = [deviceId]; - payload = generatePayload(operationCode, payload, deviceList); - invokerUtil.post(uri, payload, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "PUT") { - invokerUtil.put(uri, payload, successCallBack, errorCallBack, contentType); - } else if (httpMethod == "DELETE") { - invokerUtil.delete(uri, successCallBack, errorCallBack, contentType); - } else { - title.html("An Error Occurred!"); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - description.html("This operation requires http method: " + httpMethod + " which is not supported yet!"); - $(modalPopupContent).html(content.html()); - } -} - -$(document).on('submit', 'form', function (e) { - cosole.log("darn!!"); - e.preventDefault(); - var postOperationRequest = $.ajax({ - url: $(this).attr("action") + '&' + $(this).serialize(), - method: "post" - }); - - var btnSubmit = $('#btnSend', this); - btnSubmit.addClass('hidden'); - - var lblSending = $('#lblSending', this); - lblSending.removeClass('hidden'); - - var lblSent = $('#lblSent', this); - postOperationRequest.done(function (data) { - lblSending.addClass('hidden'); - lblSent.removeClass('hidden'); - setTimeout(function () { - hidePopup(); - }, 3000); - }); - - postOperationRequest.fail(function (jqXHR, textStatus) { - lblSending.addClass('hidden'); - lblSent.addClass('hidden'); - }); -}); - -// Constants to define operation types available -var operationTypeConstants = { - "PROFILE": "profile", - "CONFIG": "config", - "COMMAND": "command" -}; - - -var generatePayload = function (operationCode, operationData, deviceList) { - var payload; - var operationType; - switch (operationCode) { - case windowsOperationConstants["CAMERA_OPERATION_CODE"]: - operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "enabled": operationData["cameraEnabled"] - } - }; - break; - case windowsOperationConstants["CHANGE_LOCK_CODE_OPERATION_CODE"]: - operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "lockCode": operationData["lockCode"] - } - }; - break; - case windowsOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"]: - operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "encrypted": operationData["encryptStorageEnabled"] - } - }; - break; - case windowsOperationConstants["NOTIFICATION_OPERATION_CODE"]: - operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "message": operationData["message"] - } - }; - break; - case windowsOperationConstants["PASSCODE_POLICY_OPERATION_CODE"]: - operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "allowSimple": operationData["passcodePolicyAllowSimple"], - "requireAlphanumeric": operationData["passcodePolicyRequireAlphanumeric"], - "minLength": operationData["passcodePolicyMinLength"], - "minComplexChars": operationData["passcodePolicyMinComplexChars"], - "maxPINAgeInDays": operationData["passcodePolicyMaxPasscodeAgeInDays"], - "pinHistory": operationData["passcodePolicyPasscodeHistory"], - "maxFailedAttempts": operationData["passcodePolicyMaxFailedAttempts"] - } - }; - break; - default: - // If the operation is neither of above, it is a command operation - operationType = operationTypeConstants["COMMAND"]; - // Operation payload of a command operation is simply an array of device IDs - payload = deviceList; - } - - if (operationType == operationTypeConstants["PROFILE"] && deviceList) { - payload["deviceIDs"] = deviceList; - } - - return payload; -}; - - -// Constants to define Windows Operation Constants -var windowsOperationConstants = { - "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY", - "CAMERA_OPERATION_CODE": "CAMERA", - "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE", - "NOTIFICATION_OPERATION_CODE": "NOTIFICATION", - "CHANGE_LOCK_CODE_OPERATION_CODE": "CHANGE_LOCK_CODE" -}; \ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.hbs index fa79c9270..9c836a537 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.hbs +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.hbs @@ -15,18 +15,132 @@ specific language governing permissions and limitations under the License. }} +{{#if control_operations}} +
+ + {{#each control_operations}} + + {{#if iconFont}} + + {{else}} + {{#if icon}} + + {{else}} + + {{/if}} + {{/if}} + {{name}} + + +
+
+
+
+

+ + + + + {{name}} +
+

+

+ {{description}} +
+

+ +
+ {{#each params.0.pathParams}} + +
+ {{/each}} + {{#each params.0.formParams}} + +
+ {{/each}} + {{#each params.0.queryParams}} + +
+ {{/each}} + {{#each uiParams}} + {{#equal this.type "checkbox"}} + + {{this.label}} +
+ {{/equal}} + {{#equal this.type "text"}} + +
+ {{/equal}} + {{/each}} + + + +
+
+
+
+
+ {{/each}}
-{{/zone}} +{{else}} +
+

+ Operations Loading Failed!

+
+{{/if}} + + {{#zone "bottomJs"}} - - {{js "js/operation-bar.js"}} -{{/zone}} \ No newline at end of file +{{/zone}} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.js index 242cb4874..30a8d397f 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/operation-bar.js @@ -17,90 +17,49 @@ */ function onRequest(context) { - var log = new Log("cdmf.unit.device.type.windows.operation-bar"); - var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; - var viewModel = {}; - var permissions = {}; + var log = new Log("operation.js"); + var operationModule = require("/app/modules/business-controllers/operation.js")["operationModule"]; + var device = context.unit.params.device; + var autoCompleteParams = context.unit.params.autoCompleteParams; + var encodedFeaturePayloads=context.unit.params.encodedFeaturePayloads; + var controlOperations = operationModule.getControlOperations(device); + var queryParams = []; + var formParams = []; + var pathParams = []; + for (var i = 0; i < controlOperations.length; i++) { + var currentParamList = controlOperations[i]["params"]; + var uiParamList = controlOperations[i]["uiParams"]; + for (var j = 0; j < currentParamList.length; j++) { + var currentParam = currentParamList[j]; + currentParamList[j]["formParams"] = processParams(currentParam["formParams"], autoCompleteParams); + currentParamList[j]["queryParams"] = processParams(currentParam["queryParams"], autoCompleteParams); + currentParamList[j]["pathParams"] = processParams(currentParam["pathParams"], autoCompleteParams); + } + controlOperations[i]["uiParams"] = uiParamList; + if (encodedFeaturePayloads) { + controlOperations[i]["payload"] = getPayload(encodedFeaturePayloads, controlOperations[i]["operation"]); + } + } + return {"control_operations": controlOperations, "device": device}; +} - // adding android operations related permission checks - permissions["android"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/ring")) { - permissions["android"].push("DEVICE_RING"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/lock")) { - permissions["android"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/unlock")) { - permissions["android"].push("DEVICE_UNLOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/location")) { - permissions["android"].push("DEVICE_LOCATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/clear-password")) { - permissions["android"].push("CLEAR_PASSWORD"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/reboot")) { - permissions["android"].push("DEVICE_REBOOT"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/upgrade-firmware")) { - permissions["android"].push("UPGRADE_FIRMWARE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/mute")) { - permissions["android"].push("DEVICE_MUTE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/send-notification")) { - permissions["android"].push("NOTIFICATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/change-lock-code")) { - permissions["android"].push("CHANGE_LOCK_CODE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/enterprise-wipe")) { - permissions["android"].push("ENTERPRISE_WIPE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/wipe")) { - permissions["android"].push("WIPE_DATA"); - } - - // adding ios operations related permission checks - permissions["ios"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/ios/lock")) { - permissions["ios"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/ios/location")) { - permissions["ios"].push("LOCATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/ios/enterprise-wipe")) { - permissions["ios"].push("ENTERPRISE_WIPE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/ios/notification")) { - permissions["ios"].push("NOTIFICATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/ios/ring")) { - permissions["ios"].push("RING"); - } - - // adding windows operations related permission checks - permissions["windows"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/windows/lock")) { - permissions["windows"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/disenroll/windows")) { - permissions["windows"].push("DISENROLL"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/windows/wipe")) { - permissions["windows"].push("WIPE_DATA"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/windows/ring")) { - permissions["windows"].push("DEVICE_RING"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/windows/lock-reset")) { - permissions["windows"].push("LOCK_RESET"); - } - - viewModel["permissions"] = stringify(permissions); - - viewModel["deviceType"] = context.unit.params.deviceType; - viewModel["ownership"] = context.unit.params.ownership; +function processParams(paramsList, autoCompleteParams) { + for (var i = 0; i < paramsList.length; i++) { + var paramName = paramsList[i]; + var paramValue = ""; + var paramType = "text"; + for (var k = 0; k < autoCompleteParams.length; k++) { + if (paramName == autoCompleteParams[k].name) { + paramValue = autoCompleteParams[k].value; + paramType = "hidden"; + } + } + paramsList[i] = {"name": paramName, "value": paramValue, "type": paramType}; + } + return paramsList; +} - return viewModel; +function getPayload(featuresPayload, featureCode){ + var featuresJSONPayloads = JSON.parse(featuresPayload); + return featuresJSONPayloads[featureCode]; } \ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/js/operation-bar.js index 90ce9ce4a..64d736076 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/js/operation-bar.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -17,232 +17,227 @@ */ /* - * Setting-up global variables. - */ - -var operations = '.wr-operations', - modalPopup = '.modal', - modalPopupContent = modalPopup + ' .modal-content', - navHeight = $('#nav').height(), - headerHeight = $('header').height(), - offset = (headerHeight + navHeight), - deviceSelection = '.device-select', - platformTypeConstants = { - "ANDROID": "android", - "IOS": "ios", - "WINDOWS": "windows" - }, - ownershipTypeConstants = { - "BYOD": "BYOD", - "COPE": "COPE" - }, - operationBarModeConstants = { - "BULK": "BULK_OPERATION_MODE", - "SINGLE": "SINGLE_OPERATION_MODE" - }; - -/* - * Function to get selected devices ID's + * Copyright (c) 2019, 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. */ -function getSelectedDeviceIds() { - var deviceIdentifierList = []; - $(deviceSelection).each(function (index) { - var device = $(this); - var deviceId = device.data('deviceid'); - var deviceType = device.data('type'); - deviceIdentifierList.push({ - "id": deviceId, - "type": deviceType - }); - }); - if (deviceIdentifierList.length == 0) { - var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable(); - thisTable.api().rows().every(function () { - if ($(this.node()).hasClass('DTTT_selected')) { - var deviceId = $(thisTable.api().row(this).node()).data('deviceid'); - var deviceType = $(thisTable.api().row(this).node()).data('devicetype'); - deviceIdentifierList.push({ - "id": deviceId, - "type": deviceType - }); - } - }); - } - - return deviceIdentifierList; -} /* * On operation click function. * @param selection: Selected operation */ function operationSelect(selection) { - var deviceIdList = getSelectedDeviceIds(); - if (deviceIdList == 0) { - $(modalPopupContent).html($("#errorOperations").html()); - } else { - $(modalPopupContent).addClass("operation-data"); - $(modalPopupContent).html($(operations + " .operation[data-operation-code=" + selection + "]").html()); - $(modalPopupContent).data("operation-code", selection); - } + $(modalPopupContent).addClass("operation-data"); + $(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html()); + $(modalPopupContent).data("operation-code", selection); showPopup(); } -function getDevicesByTypes(deviceList) { - var deviceTypes = {}; - $.each(deviceList, function (index, item) { - if (!deviceTypes[item.type]) { - deviceTypes[item.type] = []; - } - if (item.type == platformTypeConstants.ANDROID || - item.type == platformTypeConstants.IOS || item.type == platformTypeConstants.WINDOWS) { - deviceTypes[item.type].push(item.id); +function submitForm(formId) { + var form = $("#" + formId); + var uri = form.attr("action"); + var deviceIdList = form.data("device-id"); + var contentType = form.data("content-type"); + var operationCode = form.data("operation-code"); + var uriEncodedQueryStr = ""; + var uriEncodedFormStr = ""; + var payload = {}; + form.find("input").each(function () { + var input = $(this); + var prefix; + if (input.data("param-type") === "path") { + uri = uri.replace("{" + input.attr("id") + "}", input.val()); + } else if (input.data("param-type") === "query") { + prefix = !uriEncodedQueryStr ? "?" : "&"; + uriEncodedQueryStr += prefix + input.attr("id") + "=" + input.val(); + } else if (input.data("param-type") === "form") { + prefix = !uriEncodedFormStr ? "" : "&"; + uriEncodedFormStr += prefix + input.attr("id") + "=" + input.val(); + if(input.attr("type") === "text"){ + payload[input.attr("id")] = input.val(); + } else if(input.attr("type") === "checkbox"){ + payload[input.attr("id")] = input.is(":checked"); + } } }); - return deviceTypes; -} - -//function unloadOperationBar() { -// $("#showOperationsBtn").addClass("hidden"); -// $(".wr-operations").html(""); -//} - -function loadOperationBar(deviceType, ownership, mode) { - var operationBar = $("#operations-bar"); - var operationBarSrc = operationBar.attr("src"); - - $.template("operations-bar", operationBarSrc, function (template) { - var serviceURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/*/features"; - invokerUtil.get( - serviceURL, - // success callback - function (data) { - var permittedOperations = []; - var i; - var permissionList = $("#operations-mod").data("permissions"); - var totalFeatures = JSON.parse(data); - for (i = 0; i < permissionList[deviceType].length; i++) { - var j; - for (j = 0; j < totalFeatures.length; j++) { - if (permissionList[deviceType][i] == totalFeatures[j]["code"]) { - if (deviceType == platformTypeConstants.ANDROID) { - if (totalFeatures[j]["code"] == "DEVICE_UNLOCK") { - if (ownership == ownershipTypeConstants.COPE) { - permittedOperations.push(totalFeatures[j]); - } - } else if (totalFeatures[j]["code"] == "WIPE_DATA") { - if (mode == operationBarModeConstants.BULK) { - if (ownership == ownershipTypeConstants.COPE) { - permittedOperations.push(totalFeatures[j]); - } - } else { - permittedOperations.push(totalFeatures[j]); - } - } else { - permittedOperations.push(totalFeatures[j]); - } - } else { - permittedOperations.push(totalFeatures[j]); - } - } - } - } + uri += uriEncodedQueryStr; + var httpMethod = form.attr("method").toUpperCase(); - var viewModel = {}; - permittedOperations = permittedOperations.filter(function (current) { - var iconName; - switch (deviceType) { - case platformTypeConstants.ANDROID: - iconName = operationModule.getAndroidIconForFeature(current.code); - break; - case platformTypeConstants.WINDOWS: - iconName = operationModule.getWindowsIconForFeature(current.code); - break; - case platformTypeConstants.IOS: - iconName = operationModule.getIOSIconForFeature(current.code); - break; - } - - /* adding ownership in addition to device-type - as it's vital in cases where UI for the same feature should change - according to ownership - */ - if (ownership) { - current.ownership = ownership; - } - - if (iconName) { - current.icon = iconName; - } - - return current; - }); - - viewModel.features = permittedOperations; - var content = template(viewModel); - $(".wr-operations").html(content); - }, - // error callback - function (message) { - $(".wr-operations").html(message); - }); - }); -} - -function runOperation(operationName) { - var deviceIdList = getSelectedDeviceIds(); - var list = getDevicesByTypes(deviceIdList); + if (!contentType) { + contentType = "application/x-www-form-urlencoded"; + payload = uriEncodedFormStr; + } - var successCallback = function (data) { - if (operationName == "NOTIFICATION") { - $(modalPopupContent).html($("#messageSuccess").html()); - } else { - $(modalPopupContent).html($("#operationSuccess").html()); + //setting responses callbacks + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#operation-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var description = content.find("#description"); + description.html(""); + var successCallBack = function (response) { + var res = response; + try { + res = JSON.parse(response).messageFromServer; + } catch (err) { + //do nothing } - showPopup(); + title.html("Operation Triggered!"); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + description.html(res); + console.log("success!"); + $(modalPopupContent).html(content.html()); }; - var errorCallback = function (data) { - $(modalPopupContent).html($("#errorOperationUnexpected").html()); - showPopup(); - }; - - var payload, serviceEndPoint; - if (list[platformTypeConstants.IOS]) { - payload = - operationModule.generatePayload(platformTypeConstants.IOS, operationName, list[platformTypeConstants.IOS]); - serviceEndPoint = operationModule.getIOSServiceEndpoint(operationName); - } else if (list[platformTypeConstants.ANDROID]) { - payload = operationModule - .generatePayload(platformTypeConstants.ANDROID, operationName, list[platformTypeConstants.ANDROID]); - serviceEndPoint = operationModule.getAndroidServiceEndpoint(operationName); - } else if (list[platformTypeConstants.WINDOWS]) { - payload = operationModule.generatePayload(platformTypeConstants.WINDOWS, operationName, - list[platformTypeConstants.WINDOWS]); - serviceEndPoint = operationModule.getWindowsServiceEndpoint(operationName); - } - if (operationName == "NOTIFICATION") { - var errorMsgWrapper = "#notification-error-msg"; - var errorMsg = "#notification-error-msg span"; - var messageTitle = $("#messageTitle").val(); - var messageText = $("#messageText").val(); - if (!(messageTitle && messageText)) { - $(errorMsg).text("Enter a message. It cannot be empty."); - $(errorMsgWrapper).removeClass("hidden"); - } else { - invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback); - $(modalPopupContent).removeData(); - hidePopup(); + var errorCallBack = function (response) { + console.log(response); + title.html("An Error Occurred!"); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + var reason = (response.responseText === "null")?response.statusText:response.responseText; + try { + reason = JSON.parse(reason).message; + } catch (err) { + //do nothing } + description.html(reason); + console.log("Error!"); + $(modalPopupContent).html(content.html()); + }; + //executing http request + if (httpMethod === "GET") { + invokerUtil.get(uri, successCallBack, errorCallBack, contentType); + } else if (httpMethod === "POST") { + var deviceList = deviceIdList.split(","); + payload = generatePayload(operationCode, payload, deviceList); + invokerUtil.post(uri, payload, successCallBack, errorCallBack, contentType); + } else if (httpMethod === "PUT") { + invokerUtil.put(uri, payload, successCallBack, errorCallBack, contentType); + } else if (httpMethod === "DELETE") { + invokerUtil.delete(uri, successCallBack, errorCallBack, contentType); } else { - invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback); - $(modalPopupContent).removeData(); - hidePopup(); + title.html("An Error Occurred!"); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + description.html("This operation requires http method: " + httpMethod + " which is not supported yet!"); + $(modalPopupContent).html(content.html()); } } -/* - * DOM ready functions. - */ -$(document).ready(function () { - $(operations).show(); +$(document).on('submit', 'form', function (e) { + e.preventDefault(); + var postOperationRequest = $.ajax({ + url: $(this).attr("action") + '&' + $(this).serialize(), + method: "post" + }); + + var btnSubmit = $('#btnSend', this); + btnSubmit.addClass('hidden'); + + var lblSending = $('#lblSending', this); + lblSending.removeClass('hidden'); + + var lblSent = $('#lblSent', this); + postOperationRequest.done(function (data) { + lblSending.addClass('hidden'); + lblSent.removeClass('hidden'); + setTimeout(function () { + hidePopup(); + }, 3000); + }); + + postOperationRequest.fail(function (jqXHR, textStatus) { + lblSending.addClass('hidden'); + lblSent.addClass('hidden'); + }); }); + +// Constants to define operation types available +var operationTypeConstants = { + "PROFILE": "profile", + "CONFIG": "config", + "COMMAND": "command" +}; + + +var generatePayload = function (operationCode, operationData, deviceList) { + var payload; + var operationType; + switch (operationCode) { + case windowsOperationConstants["CAMERA_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "enabled": operationData["cameraEnabled"] + } + }; + break; + case windowsOperationConstants["CHANGE_LOCK_CODE_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "lockCode": operationData["lockCode"] + } + }; + break; + case windowsOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "encrypted": operationData["encryptStorageEnabled"] + } + }; + break; + case windowsOperationConstants["NOTIFICATION_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "message": operationData["message"] + } + }; + break; + case windowsOperationConstants["PASSCODE_POLICY_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "allowSimple": operationData["passcodePolicyAllowSimple"], + "requireAlphanumeric": operationData["passcodePolicyRequireAlphanumeric"], + "minLength": operationData["passcodePolicyMinLength"], + "minComplexChars": operationData["passcodePolicyMinComplexChars"], + "maxPINAgeInDays": operationData["passcodePolicyMaxPasscodeAgeInDays"], + "pinHistory": operationData["passcodePolicyPasscodeHistory"], + "maxFailedAttempts": operationData["passcodePolicyMaxFailedAttempts"] + } + }; + break; + default: + // If the operation is neither of above, it is a command operation + operationType = operationTypeConstants["COMMAND"]; + // Operation payload of a command operation is simply an array of device IDs + payload = deviceList; + } + + if (operationType === operationTypeConstants["PROFILE"] && deviceList) { + payload["deviceIDs"] = deviceList; + } + return payload; +}; + + +// Constants to define Windows Operation Constants +var windowsOperationConstants = { + "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY", + "CAMERA_OPERATION_CODE": "CAMERA", + "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE", + "NOTIFICATION_OPERATION_CODE": "NOTIFICATION", + "CHANGE_LOCK_CODE_OPERATION_CODE": "CHANGE_LOCK_CODE" +}; \ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-android.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-android.hbs deleted file mode 100644 index 5bf6fcb99..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-android.hbs +++ /dev/null @@ -1,286 +0,0 @@ -
- -
- - -
-
- -
-
- -
- Configure -
-
-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
- -
- -
- -
- - Configure -
-
-
- - - -
-
- - -
- -
- - - -
- -
- Configure -
- -
- - -
-
- -
- - -
- -
-
- -
- - -
- -
- Install -
-
-
- -
- - -
- -
- - -
- -
- Install -
-
-
- -
- - -
- -
- Uninstall -
-
-
- - - -
-
- -
-
- -
- Configure -
-
-
- -
-
\ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-ios.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-ios.hbs deleted file mode 100644 index c16672f99..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/hidden-operations-ios.hbs +++ /dev/null @@ -1,366 +0,0 @@ -
- -
- - -
-
- -
- -
- -
- -
- -
- - -
- -
-
- - -
-
- - -
- Install -
- -
-
- -
- -
- -
- -
- -
- - -
- -
-
- - -
-
- - -
- Install -
-
-
- -
- -
- -
- Uninstall -
-
-
- - - -
- - -
- -
- -
- - -
- -
- - -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- Configure -
- - - -
- - -
- -
- - - -
-
- -
-
- Path Prefix -
-
-
- - - -
- -
- - - -
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - - -
-
- -
-
- : -
-
-
- - - -
- -
- - - -
- -
- - - -
- -
- -
- - -
-
- - - -
-
- -
-
- -
-
- -
-
- -
-
- -
- Configure -
- - -
- -
- -
- -
- -
AirPlay password -
- -
- Configure -
- -
-
\ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operation-bar.hbs similarity index 95% rename from components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.hbs rename to components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operation-bar.hbs index 9c836a537..f15d531de 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.new.operation-bar/operation-bar.hbs +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operation-bar.hbs @@ -1,7 +1,7 @@ {{! - Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. - WSO2 Inc. licenses this file to you under the Apache License, + 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 @@ -69,7 +69,7 @@
{{#each params.0.pathParams}} @@ -140,7 +140,3 @@
- -{{#zone "bottomJs"}} - {{js "js/operation-bar.js"}} -{{/zone}} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operations.hbs b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operations.hbs deleted file mode 100644 index 2a96b1503..000000000 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar/public/templates/operations.hbs +++ /dev/null @@ -1,249 +0,0 @@ -
- - - -
-
- - - -
-
- - - -
- -
- - - -
-{{#each features}} - - - {{name}} - -
- - - -
-{{/each}} -
\ No newline at end of file diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml index 09dad03cf..2573b4c89 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml @@ -22,7 +22,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml @@ -42,7 +42,6 @@ org.apache.felix maven-bundle-plugin - 1.4.0 true diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManagementService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManagementService.java index c58b790a6..b4a3909db 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManagementService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsDeviceManagementService.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl; @@ -26,6 +43,7 @@ import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; +import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypePlatformDetails; /** * This represents the Windows implementation of DeviceManagerService. @@ -83,6 +101,11 @@ public class WindowsDeviceManagementService implements DeviceManagementService { return null; } + @Override + public StartupOperationConfig getStartupOperationConfig() { + return null; + } + @Override public PullNotificationSubscriber getPullNotificationSubscriber() { return null; @@ -98,4 +121,6 @@ public class WindowsDeviceManagementService implements DeviceManagementService { return null; } + @Override + public DeviceTypePlatformDetails getDeviceTypePlatformDetails() { return null; } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsFeatureManager.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsFeatureManager.java index 516e81d6d..8ff4474ff 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsFeatureManager.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsFeatureManager.java @@ -16,8 +16,28 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl; + +import org.apache.commons.lang.StringUtils; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; @@ -30,6 +50,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.impl.util.MobileDeviceManagemen import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; public class WindowsFeatureManager implements FeatureManager { @@ -95,11 +116,8 @@ public class WindowsFeatureManager implements FeatureManager { try { WindowsDAOFactory.openConnection(); List mobileFeatures = featureDAO.getAllFeatures(); - List featureList = new ArrayList(mobileFeatures.size()); - for (MobileFeature mobileFeature : mobileFeatures) { - featureList.add(MobileDeviceManagementUtil.convertToFeature(mobileFeature)); - } - return featureList; + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); } catch (MobileDeviceManagementDAOException e) { throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + "Windows platform", e); @@ -108,6 +126,44 @@ public class WindowsFeatureManager implements FeatureManager { } } + @Override + public List getFeatures(String featureType) throws DeviceManagementException { + if (StringUtils.isEmpty(featureType)) { + return this.getFeatures(); + } + try { + WindowsDAOFactory.openConnection(); + List mobileFeatures = featureDAO.getFeaturesByFeatureType(featureType); + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); + } catch (MobileDeviceManagementDAOException e) { + throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + + "Android platform", e); + } finally { + WindowsDAOFactory.closeConnection(); + } + } + + @Override + public List getFeatures(String featureType, boolean isHidden) throws DeviceManagementException { + try { + WindowsDAOFactory.openConnection(); + List mobileFeatures; + if (StringUtils.isNotEmpty(featureType)) { + mobileFeatures = featureDAO.getFeaturesByFeatureType(featureType, isHidden); + } else { + mobileFeatures = featureDAO.getAllFeatures(isHidden); + } + return mobileFeatures.stream().map(MobileDeviceManagementUtil::convertToFeature).collect( + Collectors.toList()); + } catch (MobileDeviceManagementDAOException e) { + throw new DeviceManagementException("Error occurred while retrieving the list of features registered for " + + "Android platform", e); + } finally { + WindowsDAOFactory.closeConnection(); + } + } + @Override public boolean removeFeature(String code) throws DeviceManagementException { boolean status; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java index ab81df77c..e76ec4ebd 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java @@ -23,7 +23,7 @@ public class WindowsTokenServiceImpl implements WindowsTokenService { WindowsDAOFactory.beginTransaction(); windowsEnrollmentTokenDAO.addCacheToken(entry); WindowsDAOFactory.commitTransaction(); - } finally { + } finally { WindowsDAOFactory.closeConnection(); } } @@ -51,7 +51,8 @@ public class WindowsTokenServiceImpl implements WindowsTokenService { return cacheEntry; } - @Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) + @Override + public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException { MobileCacheEntry cacheEntry = null; try { diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/MobileFeatureDAO.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/MobileFeatureDAO.java index 9d50a0208..eec43f0e5 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/MobileFeatureDAO.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/MobileFeatureDAO.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl.dao; import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileFeature; @@ -107,4 +125,32 @@ public interface MobileFeatureDAO { * @throws MobileDeviceManagementDAOException */ List getAllFeatures() throws MobileDeviceManagementDAOException; + + /** + * Get all the MobileFeatures by a given ui visibility + * + * @param isHidden Whether the operation is hidden from UI or not. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getAllFeatures(boolean isHidden) throws MobileDeviceManagementDAOException; + + /** + * Retrieve all MobileFeatures of a given feature type + * + * @param featureType Feature type. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getFeaturesByFeatureType(String featureType) throws MobileDeviceManagementDAOException; + + /** + * Retrieve all MobileFeatures of a given feature type and ui visibility + * + * @param featureType Feature type. + * @param isHidden Whether the operation is hidden from UI or not. + * @return {@link MobileFeature} object list. + * @throws MobileDeviceManagementDAOException If an error occurred while retrieving the Feature list + */ + List getFeaturesByFeatureType(String featureType, boolean isHidden) throws MobileDeviceManagementDAOException; } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java index 760a8a5fd..dab36a4b0 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java @@ -20,8 +20,6 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsDeviceDAOImpl; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsFeatureDAOImpl; @@ -77,6 +75,15 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory if (currentConnection.get() == null) { Connection conn; try { + if (dataSource == null) { + try { + String dataSourceName = "jdbc/MobileWindowsDM_DS"; + Context ctx = new InitialContext(); + dataSource = (DataSource) ctx.lookup(dataSourceName); + } catch (NamingException e) { + throw new MobileDeviceManagementDAOException("Error occurred while initializing datasource", e); + } + } conn = dataSource.getConnection(); currentConnection.set(conn); } catch (SQLException e) { diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsFeatureDAOImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsFeatureDAOImpl.java index a65a6266c..a440845c6 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsFeatureDAOImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsFeatureDAOImpl.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl; import org.apache.commons.logging.Log; @@ -54,11 +72,13 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = WindowsDAOFactory.getConnection(); - String sql = "INSERT INTO WIN_FEATURE(CODE, NAME, DESCRIPTION) VALUES (?, ?, ?)"; + String sql = "INSERT INTO WIN_FEATURE(CODE, NAME, TYPE, HIDDEN, DESCRIPTION) VALUES (?, ?, ?, ?, ?)"; stmt = conn.prepareStatement(sql); - stmt.setString(1, mobileFeature.getCode()); - stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); + stmt.setString(1, mobileFeature.getName()); + stmt.setString(2, mobileFeature.getType()); + stmt.setBoolean(3, mobileFeature.isHidden()); + stmt.setString(4, mobileFeature.getDescription()); + stmt.setString(5, mobileFeature.getCode()); stmt.executeUpdate(); status = true; } catch (SQLException e) { @@ -78,11 +98,14 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = WindowsDAOFactory.getConnection(); - stmt = conn.prepareStatement("INSERT INTO WIN_FEATURE(CODE, NAME, DESCRIPTION) VALUES (?, ?, ?)"); + stmt = conn.prepareStatement("INSERT INTO WIN_FEATURE(CODE, NAME, TYPE, HIDDEN, DESCRIPTION) " + + "VALUES (?, ?, ?, ?, ?)"); for (MobileFeature mobileFeature : mobileFeatures) { - stmt.setString(1, mobileFeature.getCode()); - stmt.setString(2, mobileFeature.getName()); - stmt.setString(3, mobileFeature.getDescription()); + stmt.setString(1, mobileFeature.getName()); + stmt.setString(2, mobileFeature.getType()); + stmt.setBoolean(3, mobileFeature.isHidden()); + stmt.setString(4, mobileFeature.getDescription()); + stmt.setString(5, mobileFeature.getCode()); stmt.addBatch(); } stmt.executeBatch(); @@ -104,12 +127,14 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { try { conn = WindowsDAOFactory.getConnection(); String updateDBQuery = - "UPDATE WIN_FEATURE SET NAME = ?, DESCRIPTION = ?" + + "UPDATE WIN_FEATURE SET NAME = ?, TYPE = ?, HIDDEN = ?, DESCRIPTION = ?" + "WHERE CODE = ?"; stmt = conn.prepareStatement(updateDBQuery); stmt.setString(1, mobileFeature.getName()); - stmt.setString(2, mobileFeature.getDescription()); - stmt.setString(3, mobileFeature.getCode()); + stmt.setString(2, mobileFeature.getType()); + stmt.setBoolean(3, mobileFeature.isHidden()); + stmt.setString(4, mobileFeature.getDescription()); + stmt.setString(5, mobileFeature.getCode()); int rows = stmt.executeUpdate(); if (rows > 0) { status = true; @@ -178,19 +203,13 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = WindowsDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM WIN_FEATURE WHERE ID = ?"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM WIN_FEATURE WHERE ID = ?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, mblFeatureId); rs = stmt.executeQuery(); MobileFeature mobileFeature = null; if (rs.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(rs.getInt(WindowsPluginConstants.WINDOWS_FEATURE_ID)); - mobileFeature.setCode(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_CODE)); - mobileFeature.setName(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_NAME)); - mobileFeature.setDescription(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_DESCRIPTION)); - mobileFeature.setDeviceType( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); + mobileFeature = populateMobileFeature(rs); } return mobileFeature; } catch (SQLException e) { @@ -209,19 +228,13 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { Connection conn; try { conn = WindowsDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM WIN_FEATURE WHERE CODE = ?"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM WIN_FEATURE WHERE CODE = ?"; stmt = conn.prepareStatement(sql); stmt.setString(1, mblFeatureCode); rs = stmt.executeQuery(); MobileFeature mobileFeature = null; if (rs.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(rs.getInt(WindowsPluginConstants.WINDOWS_FEATURE_ID)); - mobileFeature.setCode(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_CODE)); - mobileFeature.setName(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_NAME)); - mobileFeature.setDescription(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_DESCRIPTION)); - mobileFeature.setDeviceType( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); + mobileFeature = populateMobileFeature(rs); } return mobileFeature; } catch (SQLException e) { @@ -246,19 +259,11 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { List features = new ArrayList<>(); try { conn = WindowsDAOFactory.getConnection(); - String sql = "SELECT ID, CODE, NAME, DESCRIPTION FROM WIN_FEATURE"; + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM WIN_FEATURE"; stmt = conn.prepareStatement(sql); rs = stmt.executeQuery(); - MobileFeature mobileFeature; while (rs.next()) { - mobileFeature = new MobileFeature(); - mobileFeature.setId(rs.getInt(WindowsPluginConstants.WINDOWS_FEATURE_ID)); - mobileFeature.setCode(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_CODE)); - mobileFeature.setName(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_NAME)); - mobileFeature.setDescription(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_DESCRIPTION)); - mobileFeature.setDeviceType( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); - features.add(mobileFeature); + features.add(populateMobileFeature(rs)); } return features; } catch (SQLException e) { @@ -268,4 +273,107 @@ public class WindowsFeatureDAOImpl implements MobileFeatureDAO { MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); } } + + @Override + public List getAllFeatures(boolean isHidden) throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn = null; + List features = new ArrayList<>(); + try { + conn = WindowsDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM WIN_FEATURE WHERE HIDDEN = ?"; + stmt = conn.prepareStatement(sql); + stmt.setBoolean(1, isHidden); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new WindowsFeatureManagementDAOException("Error occurred while retrieving all windows features " + + "from the android database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + WindowsDAOFactory.closeConnection(); + } + } + + @Override + public List getFeaturesByFeatureType(String featureType) throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn; + List features = new ArrayList<>(); + try { + conn = WindowsDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION FROM WIN_FEATURE WHERE TYPE = ?"; + stmt = conn.prepareStatement(sql); + stmt.setString(1, featureType); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new WindowsFeatureManagementDAOException("Error occurred while retrieving all windows features of " + + "type " + featureType + " from the android database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + WindowsDAOFactory.closeConnection(); + } + } + + @Override + public List getFeaturesByFeatureType(String featureType, boolean isHidden) + throws MobileDeviceManagementDAOException { + PreparedStatement stmt = null; + ResultSet rs = null; + Connection conn; + List features = new ArrayList<>(); + try { + conn = WindowsDAOFactory.getConnection(); + String sql = "SELECT ID, CODE, NAME, TYPE, HIDDEN, DESCRIPTION " + + "FROM WIN_FEATURE " + + "WHERE TYPE = ? AND HIDDEN = ?"; + stmt = conn.prepareStatement(sql); + stmt.setString(1, featureType); + stmt.setBoolean(2, isHidden); + rs = stmt.executeQuery(); + + while (rs.next()) { + features.add(populateMobileFeature(rs)); + } + return features; + } catch (SQLException e) { + throw new WindowsFeatureManagementDAOException("Error occurred while retrieving all android features of " + + "[type: " + featureType + " & hidden: " + isHidden + "] from the windows database.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, rs); + WindowsDAOFactory.closeConnection(); + } + } + + /** + * Generate {@link MobileFeature} from the SQL {@link ResultSet} + * + * @param rs Result set + * @return populated {@link MobileFeature} + * @throws SQLException if unable to extract data from {@link ResultSet} + */ + private MobileFeature populateMobileFeature(ResultSet rs) throws SQLException { + MobileFeature mobileFeature = new MobileFeature(); + mobileFeature.setId(rs.getInt(WindowsPluginConstants.WINDOWS_FEATURE_ID)); + mobileFeature.setCode(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_CODE)); + mobileFeature.setName(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_NAME)); + mobileFeature.setDescription(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_DESCRIPTION)); + mobileFeature.setType(rs.getString(WindowsPluginConstants.WINDOWS_FEATURE_TYPE)); + mobileFeature.setHidden(rs.getBoolean(WindowsPluginConstants.WINDOWS_FEATURE_HIDDEN)); + mobileFeature.setDeviceType( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + + return mobileFeature; + } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileFeature.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileFeature.java index 9702746c1..267039f45 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileFeature.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileFeature.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl.dto; import java.io.Serializable; @@ -29,6 +47,8 @@ public class MobileFeature implements Serializable { private String deviceType; private String code; private String name; + private String type; + private boolean hidden; private String description; public int getId() { @@ -70,4 +90,20 @@ public class MobileFeature implements Serializable { public void setDeviceType(String deviceType) { this.deviceType = deviceType; } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/MobileDeviceManagementUtil.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/MobileDeviceManagementUtil.java index ee3d32f3a..0df29e3ba 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/MobileDeviceManagementUtil.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/MobileDeviceManagementUtil.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl.util; import org.apache.commons.logging.Log; @@ -42,7 +60,13 @@ import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; /** * Provides utility methods required by the mobile device management bundle. @@ -200,6 +224,8 @@ public class MobileDeviceManagementUtil { MobileFeature mobileFeature = new MobileFeature(); mobileFeature.setName(feature.getName()); mobileFeature.setCode(feature.getCode()); + mobileFeature.setType(feature.getType()); + mobileFeature.setHidden(feature.isHidden()); mobileFeature.setDescription(feature.getDescription()); mobileFeature.setDeviceType(feature.getDeviceType()); return mobileFeature; @@ -209,6 +235,8 @@ public class MobileDeviceManagementUtil { Feature feature = new Feature(); feature.setDescription(mobileFeature.getDescription()); feature.setDeviceType(mobileFeature.getDeviceType()); + feature.setType(mobileFeature.getType()); + feature.setHidden(mobileFeature.isHidden()); feature.setCode(mobileFeature.getCode()); feature.setName(mobileFeature.getName()); return feature; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java index a243cc9c4..b65d6438a 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java @@ -16,6 +16,24 @@ * under the License. */ +/* + * Copyright (c) 2019, 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 org.wso2.carbon.device.mgt.mobile.windows.impl.util; /** @@ -43,6 +61,8 @@ public class WindowsPluginConstants { public static final String WINDOWS_FEATURE_CODE = "CODE"; public static final String WINDOWS_FEATURE_NAME = "NAME"; public static final String WINDOWS_FEATURE_DESCRIPTION = "DESCRIPTION"; + public static final String WINDOWS_FEATURE_TYPE = "TYPE"; + public static final String WINDOWS_FEATURE_HIDDEN = "HIDDEN"; public static final String MOBILE_DB_SCRIPTS_FOLDER = "cdm"; public static final String MOBILE_CONFIG_REGISTRY_ROOT = "/_system/config"; diff --git a/components/mobile-plugins/windows-plugin/pom.xml b/components/mobile-plugins/windows-plugin/pom.xml index 674921648..c9e507486 100644 --- a/components/mobile-plugins/windows-plugin/pom.xml +++ b/components/mobile-plugins/windows-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml index 0357fce20..f1e07e8df 100644 --- a/components/test-coverage/pom.xml +++ b/components/test-coverage/pom.xml @@ -22,7 +22,7 @@ carbon-device-mgt-plugins-parent org.wso2.carbon.devicemgt-plugins - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml index ccdfb2c00..eda9fc772 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml index 264700e1e..906672eda 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.analytics.feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml index fb77321d0..5da208b89 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.iot.device.statistics.dashboard.feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml index b699882a6..361061a1a 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/pom.xml b/features/analytics-feature/pom.xml index 0334022df..efd52c189 100644 --- a/features/analytics-feature/pom.xml +++ b/features/analytics-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml index f52de4fb9..c671462b3 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense Analytics Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml index 00f657004..422ae26c0 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.backend.feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense Backend Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml index e7c5c97fc..c3e90d6ed 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml @@ -17,9 +17,27 @@ ~ specific language governing permissions and limitations ~ under the License. --> + + - + Add Keywords Send keywords to the device @@ -28,7 +46,7 @@ - + Add Threshold Send Threshold to the device @@ -37,7 +55,7 @@ - + Remove words Remove Threshold from the device diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml index f0fb084aa..3f5723207 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.androidsense.ui.feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - IoT Server Android Sense UI Feature http://wso2.org diff --git a/features/device-types-feature/androidsense-plugin-feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/pom.xml index cf776eec6..f45498e05 100644 --- a/features/device-types-feature/androidsense-plugin-feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml index 230c8fd39..982a5fc2e 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml index f0abaa6fa..3efc6effc 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml index c651c04e7..7ed7bafb9 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml @@ -17,15 +17,39 @@ ~ specific language governing permissions and limitations ~ under the License. --> + + - + Control Bulb Control Bulb on Arduino Uno - - - state - + diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml index ee2405a0c..d6d882079 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/arduino-plugin-feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/pom.xml index e57c206bd..43bac6bc1 100644 --- a/features/device-types-feature/arduino-plugin-feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/pom.xml b/features/device-types-feature/pom.xml index c9efb0dc6..83653447d 100644 --- a/features/device-types-feature/pom.xml +++ b/features/device-types-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 device-types-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - Device Management IoT Plugins Feature http://wso2.org diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml index ba82801f0..367cf7105 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml index 74e294a15..d45e820c1 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml index 70de5d4f8..a25277135 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml @@ -17,15 +17,39 @@ ~ specific language governing permissions and limitations ~ under the License. --> + + - + Control Bulb Control Bulb on Raspberrypi - - - state - + diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml index 6a7d00ee9..7189cd147 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml index 53e90cc8f..234d887b6 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml index 93502119e..849c14f90 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml index 22ce1914f..8b529c552 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml index 55196f13f..381295b57 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml @@ -17,12 +17,35 @@ ~ specific language governing permissions and limitations ~ under the License. --> + + - + Control buzzer Control buzzer on Virtual Firealarm - + diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml index 739ab606e..bee7eefe6 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml index 27a0b9eab..9885f89e6 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml index b1323b94c..41de5ba03 100644 --- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.api.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml index 0f7c70234..9f7f687d1 100644 --- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml index 12adaf47e..240b4e812 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.osgiconnector.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - App management MDM OSGI Connector http://wso2.org This feature contains the core bundles required for APP management OSGI MDM connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.osgiconnector - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml index 54e3cfddb..049bb4da6 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.restconnector.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - App management MDM REST Connector http://wso2.org This feature contains the core bundles required for APP management MDM REST connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.restconnector - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml index 6eb9e2ed6..c72b83e8b 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.adapter.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Device Management Adapters Feature http://wso2.org This feature contains the adapter bundles required for IoT Server diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml index 2e5f37f33..467436ba8 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.notification.listener.feature/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.notification.listener.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Notification Listener http://wso2.org This feature contains the core bundles required iot core listeners diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml index c9167a661..eb914da87 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.remote.session.feature/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml index 5e99a6c99..a12393fd4 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.device.feature/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml index 84a7b1d8d..1ac3a0297 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml org.wso2.extension.siddhi.execution.json.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Siddhi Execution Extension - Json Feature http://wso2.org This feature contains Siddhi extension feature for changing a json string to individual properties. diff --git a/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml b/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml index f9a53465d..b3fae6af1 100644 --- a/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml +++ b/features/extensions-feature/org.wso2.gpl.siddhi.extension.geo.script.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/pom.xml b/features/extensions-feature/pom.xml index b112c9bfe..9f74d5df8 100644 --- a/features/extensions-feature/pom.xml +++ b/features/extensions-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../../pom.xml 4.0.0 extensions-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - Device Management Extensions http://wso2.org diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml index 15345a361..265d832c9 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins android-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.feature pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Android Device Management Feature http://wso2.org This feature contains the core bundles required for Android Device Management diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/h2.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/h2.sql index 9eed9b2d5..845dbe88e 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/h2.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/h2.sql @@ -26,6 +26,8 @@ CREATE TABLE IF NOT EXISTS `AD_FEATURE` ( `ID` INT NOT NULL AUTO_INCREMENT, `CODE` VARCHAR(45) NOT NULL, `NAME` VARCHAR(100) NULL, + `TYPE` VARCHAR(20) NULL, + `HIDDEN` BOOLEAN DEFAULT FALSE, `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`ID`)); diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql index 2c22d4729..ed7976347 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql @@ -27,6 +27,8 @@ CREATE TABLE AD_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, NAME VARCHAR(100) NULL, + TYPE VARCHAR(20) NULL, + HIDDEN BIT DEFAULT 0, DESCRIPTION VARCHAR(200) NULL, PRIMARY KEY (ID) ); diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mysql.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mysql.sql index b7dcbe73c..655af9948 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mysql.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mysql.sql @@ -26,7 +26,8 @@ CREATE TABLE IF NOT EXISTS `AD_FEATURE` ( `ID` INT NOT NULL AUTO_INCREMENT, `CODE` VARCHAR(45) NOT NULL, `NAME` VARCHAR(100) NULL, + `TYPE` VARCHAR(20) NULL, + `HIDDEN` BIT DEFAULT 0, `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`ID`) - ) ENGINE = InnoDB; - +) ENGINE = InnoDB; diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/oracle.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/oracle.sql index 703757e90..6ad72c41c 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/oracle.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/oracle.sql @@ -27,6 +27,8 @@ CREATE TABLE AD_FEATURE ( ID INT NOT NULL, CODE VARCHAR(45) NOT NULL, NAME VARCHAR(100) NOT NULL, + TYPE VARCHAR(20) NULL, + HIDDEN BIT DEFAULT 0, DESCRIPTION VARCHAR(200) DEFAULT NULL, CONSTRAINT AD_FEATURE PRIMARY KEY (ID) ) diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/postgresql.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/postgresql.sql index 20a014b86..908d1c21f 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/postgresql.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/postgresql.sql @@ -26,5 +26,7 @@ CREATE TABLE IF NOT EXISTS AD_FEATURE ( ID BIGSERIAL NOT NULL PRIMARY KEY, CODE VARCHAR(45) NOT NULL, NAME VARCHAR(100) NULL, + TYPE VARCHAR(20) NULL, + HIDDEN BOOLEAN DEFAULT FALSE, DESCRIPTION VARCHAR(200) NULL ); diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index 27e8e19a2..50a1bd835 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -17,6 +17,24 @@ ~ specific language governing permissions and limitations ~ under the License. --> + + @@ -87,271 +105,533 @@ - + Ring Ring the device - + - + Device Lock Lock the device - + - + Location Request coordinates of device location - + - + Clear Password Clear current password (This functionality is only working with profile owners from Android 7.0 API 24 onwards.) - + - + Reboot Reboot the device - + - + Upgrade Firmware Upgrade Firmware - + - + Mute Enable mute in the device - + - + Message Send message - + - + Change Lock-code Change current lock code (This functionality is only working with profile owners from Android 7.0 API 24 onwards.) - + - + File Transfer Transfer file to the device - + - + Enterprise Wipe Remove enterprise applications - + - + Wipe Data Factory reset the device - + - + Wifi Setting up wifi configuration - + Global Proxy Setting up a network-independent global HTTP proxy on a device. - + Camera Enable or disable camera - + Email Configure email settings - + Device info Request device information - + Application List Request list of current installed applications - + Install App Install App - + Uninstall App Uninstall App - + Blacklist app Blacklist applications - + Encrypt Storage Encrypt storage - + Password Policy Set passcode policy - + Configure VPN Configure VPN settings - + Disallow user to change volume Allow or disallow user to change volume" - + Disallow bluetooth configuration Allow or disallow bluetooth configuration - + Disallow user to change cell broadcast configurations Allow or disallow user to change cell broadcast configurations - + Disallow user to change user credentials Allow or disallow user to change user credentials - + Disallow user to change mobile networks configurations Allow or disallow user to change mobile networks configurations - + Disallow user to change tethering configurations Allow or disallow user to change tethering configurations - + Disallow user to change VPN configurations Allow or disallow user to change VPN configurations - + Disallow user to change WIFI configurations Allow or disallow user to change WIFI configurations - + Disallow user to change app control Allow or disallow user to change app control - + Disallow window creation Allow or disallow window creation - + Disallow user to change app control configurations Allow or disallow user to change app control configurations - + Disallow cross profile copy paste Allow or disallow cross profile copy paste - + Disallow debugging features Allow or disallow debugging features - + Disallow factory reset Allow or disallow factory reset - + Disallow add user Allow or disallow add user - + Disallow install apps Allow or disallow install apps - + Disallow install unknown sources Allow or disallow install unknown sources - + Disallow modify account Allow or disallow modify account - + Disallow mount physical media Allow or disallow mount physical media - + Disallow network reset Allow or disallow network reset - + Disallow outgoing beam Allow or disallow outgoing beam - + Disallow outgoing calls Allow or disallow outgoing calls - + Disallow remove users Allow or disallow remove users - + Disallow safe boot Allow or disallow safe boot - + Disallow share location Allow or disallow share location - + Disallow sms Allow or disallow sms - + Disallow uninstall app Allow or disallow uninstall app - + Disallow unmute mic Allow or disallow unmute mic - + Disallow usb file transfer Allow or disallow usb file transfer - + Disallow parent profile app linking Allow or disallow parent profile app linking - + Disallow ensure verify apps Allow or disallow ensure verify apps - + Disallow auto timing Allow or disallow auto timing - + Remove device owner Remove device owner - + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + Fetch device logcat Fetch device logcat - + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + + Fetch device logcat + Fetch device logcat + + - - Send app restriction - Send remote configurations to app - + + Wipe Data + Factory reset the device + @@ -379,6 +659,9 @@ APPLICATION_LIST DEVICE_LOCATION + + SERVER_VERSION + + + @@ -81,65 +99,107 @@ Disenroll Dis-enrol the device - + Wipe Data Wipe the device - + Ring Ring the device - + Device Lock Lock the device - + Device Lock Reset Lock Reset the device - + Location Request coordinates of device location - + Reboot Reboot the device - + - + Device info Request device information - + Password Policy Set passcode policy - + Camera Enable/Disable Enable/Disable camera - + Encrypt Storage Encrypt the device storage diff --git a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml index b9bfc6504..67223ac40 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT ../pom.xml 4.0.0 windows-plugin-feature - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT pom WSO2 Carbon - Device Management Windows Plugin Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 71442b124..7c3ef65a5 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -1186,6 +1186,18 @@ feign-okhttp ${github.openfeign.version} + + io.entgra.emm + io.entgra.emm.android.agent.release + apk + ${android.agent.version} + + + io.entgra.emm + io.entgra.emm.android.agent.debug + apk + ${android.agent.version} + @@ -1230,7 +1242,7 @@ 1.1.1 - 3.2.5-SNAPSHOT + 3.2.7-SNAPSHOT [3.1.0, 4.0.0) @@ -1238,7 +1250,10 @@ 1.5.5 - 4.2.5-SNAPSHOT + 4.2.7-SNAPSHOT + + + 3.6.0 4.6.21 @@ -1446,7 +1461,7 @@ org.apache.felix maven-bundle-plugin - 2.3.5 + 3.5.0 true NONE