diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml index dd1289610..dbba14a7a 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml @@ -21,7 +21,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml index cf300d71f..44012911e 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml @@ -3,7 +3,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/pom.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/pom.xml index 4db7fb928..b3783530e 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/pom.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.plugin/pom.xml @@ -14,7 +14,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml index 0c9a1bb8f..590e2cf47 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml @@ -22,7 +22,7 @@ androidsense-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/androidsense-plugin/pom.xml b/components/iot-plugins/androidsense-plugin/pom.xml index ddb92a25d..2dbca779a 100644 --- a/components/iot-plugins/androidsense-plugin/pom.xml +++ b/components/iot-plugins/androidsense-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml index bb3d290bb..07b66192f 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml index d142cc2d7..b9af5d701 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/pom.xml b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/pom.xml index 004510699..f380a4084 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/pom.xml +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.plugin/pom.xml @@ -22,7 +22,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml index 2845be1a1..f392ad22a 100644 --- a/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml +++ b/components/iot-plugins/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml @@ -23,7 +23,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/arduino-plugin/pom.xml b/components/iot-plugins/arduino-plugin/pom.xml index 7a6a67741..4fdefbac9 100644 --- a/components/iot-plugins/arduino-plugin/pom.xml +++ b/components/iot-plugins/arduino-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml b/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml index db31ff6d3..c97bae7ca 100644 --- a/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml +++ b/components/iot-plugins/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-analytics/pom.xml b/components/iot-plugins/iot-analytics/pom.xml index 2cb5b2208..1d62112e3 100644 --- a/components/iot-plugins/iot-analytics/pom.xml +++ b/components/iot-plugins/iot-analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.extension/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.extension/pom.xml index a06ba749f..128a31014 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.extension/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.extension/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.http/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.http/pom.xml index bd412cf3c..136ceb55a 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.http/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.http/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.mqtt/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.mqtt/pom.xml index 1a30d14b4..197fc984e 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.mqtt/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.xmpp/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.xmpp/pom.xml index 9dfe4dbcd..8a44a8faf 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.xmpp/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/pom.xml index 451008b1a..2b3b47faf 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui.endpoint/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui.endpoint/pom.xml index adeaf950b..5ada50ce1 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui.endpoint/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui.endpoint/pom.xml @@ -22,7 +22,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui/pom.xml index e6c9ea4f6..550035ef1 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.ui/pom.xml @@ -21,7 +21,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/pom.xml index cfcd24dc1..7caf73c67 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/pom.xml @@ -20,7 +20,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.ui/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.ui/pom.xml index 4a608c903..e071c7ce0 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.ui/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.ui/pom.xml @@ -23,7 +23,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/pom.xml b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/pom.xml index 16920ce32..b0ad60343 100644 --- a/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/pom.xml +++ b/components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot/pom.xml @@ -23,7 +23,7 @@ iot-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/iot-base-plugin/pom.xml b/components/iot-plugins/iot-base-plugin/pom.xml index e6106747c..41fb775f7 100644 --- a/components/iot-plugins/iot-base-plugin/pom.xml +++ b/components/iot-plugins/iot-base-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/pom.xml b/components/iot-plugins/pom.xml index cdecf7880..24e3130f3 100644 --- a/components/iot-plugins/pom.xml +++ b/components/iot-plugins/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../../pom.xml diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml index 4bc830bda..df98b9ddb 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml index 0b7fa4274..a8d66b58f 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/pom.xml b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/pom.xml index fe35e7ed9..772629669 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/pom.xml +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.plugin/pom.xml @@ -23,7 +23,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml index e5fe47138..721f86f52 100644 --- a/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml +++ b/components/iot-plugins/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml @@ -23,7 +23,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/raspberrypi-plugin/pom.xml b/components/iot-plugins/raspberrypi-plugin/pom.xml index f6190ce64..335c04d63 100644 --- a/components/iot-plugins/raspberrypi-plugin/pom.xml +++ b/components/iot-plugins/raspberrypi-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml index 912a03c37..02b463171 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml index 2c5bc830b..927736e6b 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml +++ b/components/iot-plugins/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 - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml index 59e9335c1..ceb82b40a 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml +++ b/components/iot-plugins/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 - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/pom.xml index 75a26147f..8fc4a004f 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/pom.xml +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/pom.xml @@ -23,7 +23,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.scep.api/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.scep.api/pom.xml index 7e84b0c7e..8beac1bf0 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.scep.api/pom.xml +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.scep.api/pom.xml @@ -21,7 +21,7 @@ virtual-fire-alarm-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml index 48314c3f3..5e86f18eb 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml +++ b/components/iot-plugins/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 - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/pom.xml b/components/iot-plugins/virtual-fire-alarm-plugin/pom.xml index a233421ad..f0cfcdc20 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/pom.xml +++ b/components/iot-plugins/virtual-fire-alarm-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins iot-plugins - 2.1.3-SNAPSHOT + 2.2.1-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 e49cc981d..b7215e4b8 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 - 2.1.3-SNAPSHOT + 2.2.1-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/ApplicationUninstallation.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/ApplicationUninstallation.java index 45b98b47d..5c078f87d 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/ApplicationUninstallation.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/ApplicationUninstallation.java @@ -43,9 +43,6 @@ public class ApplicationUninstallation extends AndroidOperation implements Seria @Pattern(regexp = "^[A-Za-z]*$") private String type; - @ApiModelProperty(name = "url", value = "The URL of the application.", required = true) - private String url; - @ApiModelProperty(name = "name", value = "The name of the application.", required = true) @Size(min = 2, max = 45) private String name; @@ -66,14 +63,6 @@ public class ApplicationUninstallation extends AndroidOperation implements Seria this.type = type; } - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - public String getName() { return name; } 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/DeviceManagementAdminService.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/DeviceManagementAdminService.java index d923e49bd..ac46bbc1f 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/DeviceManagementAdminService.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/DeviceManagementAdminService.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.services; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.mdm.services.android.bean.wrapper.*; @@ -92,7 +93,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new lock operation.") }) - @Scope(key = "device:android:operation:lock", name = "Lock device", description = "") + @Permission(name = "Lock Device", permission = "/device-mgt/devices/owning/operations/android/lock") Response configureDeviceLock( @ApiParam(name = "deviceLockBeanWrapper", value = "Device lock configurations with device IDs") DeviceLockBeanWrapper deviceLockBeanWrapper); @@ -146,7 +147,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new un-lock operation.") }) - @Scope(key = "device:android:operation:unlock", name = "Unlock device", description = "") + @Permission(name = "Unlock Device", permission = "/device-mgt/devices/owning/operations/android/unlock") Response configureDeviceUnlock( @ApiParam(name = "deviceIDs", value = "DeviceIds to be enable device unlock operation") List deviceIDs); @@ -199,7 +200,7 @@ public interface DeviceManagementAdminService { code = 500, message = "Internal Server Error. \n " + "Server error occurred while adding a new get-location operation.")}) - @Scope(key = "device:android:operation:location", name = "Get device location", description = "") + @Permission(name = "Get Device Location", permission = "/device-mgt/devices/owning/operations/android/location") Response getDeviceLocation( @ApiParam(name = "deviceIDs", value = "DeviceIDs to be requested to get device location") List deviceIDs); @@ -252,7 +253,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new clear password operation.") }) - @Scope(key = "device:android:operation:clear-password", name = "Clear password of device", description = "") + @Permission(name = "Clear Password of Device", permission = "/device-mgt/devices/owning/operations/android/clear-password") Response removePassword( @ApiParam(name = "deviceIDs", value = "DeviceIds to be requested to remove password") List deviceIDs); @@ -305,7 +306,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new control camera operation.") }) - @Scope(key = "device:android:operation:camera", name = "Enable/Disable camera", description = "") + @Permission(name = "Manage Camera", permission = "/device-mgt/devices/owning/operations/android/camera") Response configureCamera( @ApiParam(name = "cameraBeanWrapper", value = "Camera enable/disable configurations with device IDs") CameraBeanWrapper cameraBeanWrapper); @@ -361,19 +362,19 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new device info operation.") }) - @Scope(key = "device:android:operation:info", name = "Get device information", description = "") + @Permission(name = "Get Device Information", permission = "/device-mgt/devices/owning/operations/android/info") Response getDeviceInformation( @ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device information") List deviceIDs); @POST - @Path("/info") + @Path("/logcat") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "POST", - value = "Requesting Information from Android Devices", - notes = "Using this REST API you are able to request for Android device details. Once this REST API is" + + value = "Requesting logcat from Android Devices", + notes = "Using this REST API you are able to request for Android device log details. Once this REST API is" + " executed it will be in the Android operation queue until the device calls the server to retrieve " + "the list of operations that needs to be executed on the device", response = Activity.class, @@ -417,6 +418,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new device logcat operation.") }) + @Permission(name = "Get Logs", permission = "/device-mgt/devices/owning/operations/android/logcat") Response getDeviceLogcat( @ApiParam(name = "deviceIds", value = "Device IDs to be requested to get device logcat") List deviceIDs); @@ -470,7 +472,7 @@ public interface DeviceManagementAdminService { code = 500, message = "Internal Server Error. \n " + "Server error occurred while adding a enterprise wipe operation.")}) - @Scope(key = "device:android:operation:enterprise-wipe", name = "Enterprise wipe", description = "") + @Permission(name = "Enterprise Wipe", permission = "/device-mgt/devices/owning/operations/android/enterprise-wipe") Response wipeDevice(@ApiParam(name = "deviceIDs", value = "Device IDs to be requested to do enterprise-wipe") List deviceIDs); @@ -522,7 +524,7 @@ public interface DeviceManagementAdminService { code = 500, message = "Internal Server Error. \n " + "Server error occurred while adding a device wipe operation.")}) - @Scope(key = "device:android:operation:wipe", name = "Factory reset device", description = "") + @Permission(name = "Factory Reset", permission = "/device-mgt/devices/owning/operations/android/wipe") Response wipeData( @ApiParam(name = "wipeDataBeanWrapper", value = "Configurations and DeviceIds needed to do wipe-data") WipeDataBeanWrapper wipeDataBeanWrapper); @@ -579,7 +581,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new get-applications operation.") }) - @Scope(key = "device:android:operation:applications", name = "Get installed applications", description = "") + @Permission(name = "Get Installed Application", permission = "/device-mgt/devices/owning/operations/android/applications") Response getApplications( @ApiParam(name = "deviceIDs", value = "Device Ids needed to get applications that are already installed") List deviceIDs); @@ -632,7 +634,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new device ring operation.") }) - @Scope(key = "device:android:operation:ring", name = "Ring device", description = "") + @Permission(name = "Ring Device", permission = "/device-mgt/devices/owning/operations/android/ring") Response ringDevice( @ApiParam(name = "deviceIDs", value = "Device Ids needed for ring") List deviceIDs); @@ -685,7 +687,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new device reboot operation.") }) - @Scope(key = "device:android:operation:reboot", name = "Reboot device", description = "") + @Permission(name = "Reboot Device", permission = "/device-mgt/devices/owning/operations/android/reboot") Response rebootDevice( @ApiParam(name = "deviceIDs", value = "Device Ids needed for reboot.") List deviceIDs); @@ -738,7 +740,7 @@ public interface DeviceManagementAdminService { "Server error occurred while adding a new device mute operation.") }) @Path("/mute") - @Scope(key = "device:android:operation:mute", name = "Mute device", description = "") + @Permission(name = "Mute Device", permission = "/device-mgt/devices/owning/operations/android/mute") Response muteDevice( @ApiParam(name = "deviceIDs", value = "DeviceIDs need to be muted") List deviceIDs); @@ -794,7 +796,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new install-application operation.") }) - @Scope(key = "device:android:operation:install-app", name = "Install applications", description = "") + @Permission(name = "Install Applications", permission = "/device-mgt/devices/owning/operations/android/install-app") Response installApplication( @ApiParam(name = "applicationInstallationBeanWrapper", value = "Properties of installed apps and device IDs") ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); @@ -850,7 +852,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new update-application operation.") }) - @Scope(key = "device:android:operation:update-app", name = "Update installed applications", description = "") + @Permission(name = "Update installed applications", permission = "/device-mgt/devices/owning/operations/android/update-app") Response updateApplication( @ApiParam(name = "applicationUpdateBeanWrapper", value = "Properties of updated apps and device IDs") ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); @@ -903,7 +905,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new uninstall-application operation.") }) - @Scope(key = "device:android:operation:uninstall-app", name = "Uninstall applications", description = "") + @Permission(name = "Uninstall Applications", permission = "/device-mgt/devices/owning/operations/android/uninstall-app") Response uninstallApplication( @ApiParam(name = "applicationUninstallationBeanWrapper", value = "applicationUninstallationConfigs and Device Ids") @@ -958,7 +960,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new blacklist-applications operation.") }) - @Scope(key = "device:android:operation:blacklist-app", name = "Blacklist applications", description = "") + @Permission(name = "Blacklist Applications", permission = "/device-mgt/devices/owning/operations/android/blacklist-app") Response blacklistApplications( @ApiParam(name = "blacklistApplicationsBeanWrapper", value = "BlacklistApplications " + "Configuration and DeviceIds") @@ -1013,7 +1015,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new upgrade firmware operation.") }) - @Scope(key = "device:android:operation:upgrade", name = "Upgrade firmware", description = "") + @Permission(name = "Upgrade Firmware", permission = "/device-mgt/devices/owning/operations/android/upgrade") Response upgradeFirmware( @ApiParam(name = "upgradeFirmwareBeanWrapper", value = "Firmware upgrade configuration and DeviceIds") @@ -1068,7 +1070,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new configure VPN operation.") }) - @Scope(key = "device:android:operation:vpn", name = "Add VPN profiles", description = "") + @Permission(name = "Add VPN", permission = "/device-mgt/devices/owning/operations/android/vpn") Response configureVPN( @ApiParam(name = "vpnBeanWrapper", value = "VPN configuration and DeviceIds") @@ -1122,7 +1124,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new send notification operation.") }) - @Scope(key = "device:android:operation:notification", name = "Send notifications", description = "") + @Permission(name = "Send Notifications", permission = "/device-mgt/devices/owning/operations/android/notification") Response sendNotification( @ApiParam(name = "notificationBeanWrapper", value = "Notification Configurations and device Ids") @@ -1176,7 +1178,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new configure wifi operation.") }) - @Scope(key = "device:android:operation:wifi", name = "Add WiFi configurations", description = "") + @Permission(name = "Add Wifi Configuration", permission = "/device-mgt/devices/owning/operations/android/wifi") Response configureWifi( @ApiParam(name = "wifiBeanWrapper", value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper); @@ -1229,7 +1231,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new encrypt storage operation.") }) - @Scope(key = "device:android:operation:encrypt", name = "Encrypt device", description = "") + @Permission(name = "Encrypt Device", permission = "/device-mgt/devices/owning/operations/android/encrypt") Response encryptStorage( @ApiParam(name = "encryptionBeanWrapper", value = "Configurations and deviceIds need to be done data encryption") @@ -1283,7 +1285,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new change lock code operation.") }) - @Scope(key = "device:android:operation:change-lock", name = "Change password of device", description = "") + @Permission(name = "Change Password of Device", permission = "/device-mgt/devices/owning/operations/android/change-lock") Response changeLockCode( @ApiParam(name = "lockCodeBeanWrapper", value = "Configurations and device Ids need to be done change lock code") @@ -1337,7 +1339,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new set password policy operation.") }) - @Scope(key = "device:android:operation:password-policy", name = "Set password policy", description = "") + @Permission(name = "Set Password Policy", permission = "/device-mgt/devices/owning/operations/android/password-policy") Response setPasswordPolicy( @ApiParam(name = "passwordPolicyBeanWrapper", value = "Password Policy Configurations and Device Ids") @@ -1391,7 +1393,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n " + "Server error occurred while adding a new set webclip operation.") }) - @Scope(key = "device:android:operation:webclip", name = "Add webclips", description = "") + @Permission(name = "Add Webclips", permission = "/device-mgt/devices/owning/operations/android/webclip") Response setWebClip( @ApiParam(name = "webClipBeanWrapper", value = "Configurations to need set web clip on device and device Ids") 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/DeviceManagementService.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/DeviceManagementService.java index 71fcdba84..c582886e9 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/DeviceManagementService.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/DeviceManagementService.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.services; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; @@ -87,7 +88,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n " + "Server error occurred while updating the application list.") }) - @Scope(key = "device:android:enroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response updateApplicationList( @ApiParam( name = "id", @@ -141,7 +142,7 @@ public interface DeviceManagementService { code = 500, message = "Internal Server Error. \n Server error occurred while fetching policies.") }) - @Scope(key = "device:android:enroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response getPendingOperations( @ApiParam( name = "id", @@ -206,7 +207,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n " + "Server error occurred while adding a new policy.") }) - + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response enrollDevice(@ApiParam(name = "device", value = "Device Information to be enroll") @Valid AndroidDevice device); @@ -245,7 +246,7 @@ public interface DeviceManagementService { code = 500, message = "Internal Server Error. \n Server error occurred while fetching the enrollment status of the Android device.") }) - @Scope(key = "device:android:enroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response isEnrolled( @ApiParam( name = "id", @@ -299,7 +300,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n " + "Server error occurred while updating the device enrollment.") }) - @Scope(key = "device:android:enroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response modifyEnrollment( @ApiParam( name = "id", @@ -329,7 +330,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n " + "Server error occurred while dis-enrolling the device.") }) - @Scope(key = "device:android:disenroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response disEnrollDevice( @ApiParam( name = "id", 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/DeviceTypeConfigurationService.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/DeviceTypeConfigurationService.java index 44d915028..5b24c62be 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/DeviceTypeConfigurationService.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/DeviceTypeConfigurationService.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.services; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; @@ -81,7 +82,7 @@ public interface DeviceTypeConfigurationService { code = 500, message = "Internal Server Error. \n Server error occurred while fetching Android platform configuration.") }) - @Scope(key = "configuration:view", name = "View configurations", description = "") + @Permission(name = "View Configurations", permission = "/device-mgt/configurations/view") Response getConfiguration( @ApiParam( name = "If-Modified-Since", @@ -131,7 +132,7 @@ public interface DeviceTypeConfigurationService { message = "Internal Server Error. \n " + "Server error occurred while modifying Android platform configuration.") }) - @Scope(key = "configuration:manage", name = "Add configurations", description = "") + @Permission(name = "Manage Configurations", permission = "/device-mgt/configurations/manage") Response updateConfiguration( @ApiParam(name = "configuration", value = "AndroidPlatformConfiguration") @@ -152,7 +153,7 @@ public interface DeviceTypeConfigurationService { @ApiResponse( code = 200, message = "OK. \n Successfully fetched Android license configuration.", - response = PlatformConfiguration.class, + response = String.class, responseHeaders = { @ResponseHeader( name = "Content-Type", @@ -179,7 +180,7 @@ public interface DeviceTypeConfigurationService { code = 500, message = "Internal Server Error. \n Server error occurred while fetching Android license configuration.") }) - @Scope(key = "device:android:enroll", name = "Enroll Android device", description = "") + @Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android") Response getLicense( @ApiParam( name = "If-Modified-Since", 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/EventReceiverService.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/EventReceiverService.java index 03058282d..2b2dd0d1e 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/EventReceiverService.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/EventReceiverService.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.services; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.mdm.services.android.bean.DeviceState; import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; @@ -90,7 +91,7 @@ public interface EventReceiverService { message = "Internal Server Error. \n " + "Server error occurred while publishing events.") }) - @Scope(key = "device:android:event:manage", name = "Publish events to DAS", description = "") + @Permission(name = "Publish Events to DAS", permission = "/device-mgt/devices/enroll/android") Response publishEvents( @ApiParam( name = "eventBeanWrapper", @@ -140,7 +141,7 @@ public interface EventReceiverService { code = 500, message = "Error occurred while getting published events for specific device.") }) - @Scope(key = "device:android:event:read", name = "View events", description = "") + @Permission(name = "Publish Events to DAS", permission = "/device-mgt/devices/enroll/android") Response retrieveAlerts( @ApiParam( name = "id", 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/DeviceManagementAdminServiceImpl.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/DeviceManagementAdminServiceImpl.java index 8f80defe7..11840a669 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/DeviceManagementAdminServiceImpl.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/DeviceManagementAdminServiceImpl.java @@ -20,14 +20,45 @@ package org.wso2.carbon.mdm.services.android.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.json.JSONException; +import org.json.JSONObject; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; -import org.wso2.carbon.mdm.services.android.bean.*; -import org.wso2.carbon.mdm.services.android.bean.wrapper.*; +import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; +import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; +import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; +import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; +import org.wso2.carbon.mdm.services.android.bean.Camera; +import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; +import org.wso2.carbon.mdm.services.android.bean.DeviceLock; +import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.mdm.services.android.bean.LockCode; +import org.wso2.carbon.mdm.services.android.bean.Notification; +import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; +import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; +import org.wso2.carbon.mdm.services.android.bean.Vpn; +import org.wso2.carbon.mdm.services.android.bean.WebClip; +import org.wso2.carbon.mdm.services.android.bean.Wifi; +import org.wso2.carbon.mdm.services.android.bean.WipeData; +import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; import org.wso2.carbon.mdm.services.android.exception.BadRequestException; import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; import org.wso2.carbon.mdm.services.android.services.DeviceManagementAdminService; @@ -41,10 +72,15 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.Map; @Path("/admin/devices") @Produces(MediaType.APPLICATION_JSON) @@ -492,19 +528,60 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe try { if (applicationInstallationBeanWrapper == null || applicationInstallationBeanWrapper.getOperation() == - null) { + null) { String errorMessage = "The payload of the application installing operation is incorrect"; log.error(errorMessage); throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } + ApplicationInstallation applicationInstallation = applicationInstallationBeanWrapper.getOperation(); + JSONObject payload = new JSONObject(applicationInstallation.toJSON()); + + try { + URL url = new URL(payload.getString("url")); + URLConnection conn = url.openConnection(); + + //get all headers + Map> headerFields = conn.getHeaderFields(); + boolean isFile = false; + for (Map.Entry> entry : headerFields.entrySet()) { + if ("Content-Type".equals(entry.getKey()) && entry.getValue() != null + && entry.getValue().size() > 0 && "application/octet-stream".equals(entry.getValue().get(0))) { + isFile = true; + break; + } + } + if (!isFile) { + String errorMessage = "URL is not pointed to a downloadable file."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + validateType(payload); + } catch (MalformedURLException e) { + String errorMessage = "Malformed application url."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } catch (IOException e) { + String errorMessage = "Invalid application url."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + ProfileOperation operation = new ProfileOperation(); operation.setCode(AndroidConstants.OperationCodes.INSTALL_APPLICATION); operation.setType(Operation.Type.PROFILE); - operation.setPayLoad(applicationInstallation.toJSON()); + operation.setPayLoad(payload.toString()); return AndroidAPIUtils.getOperationResponse(applicationInstallationBeanWrapper.getDeviceIDs(), - operation); + operation); + } catch (JSONException e) { + String errorMessage = "Invalid payload for the operation."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } catch (InvalidDeviceException e) { String errorMessage = "Invalid Device Identifiers found."; log.error(errorMessage, e); @@ -581,6 +658,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } ApplicationUninstallation applicationUninstallation = applicationUninstallationBeanWrapper.getOperation(); + JSONObject payload = new JSONObject(applicationUninstallation.toJSON()); + validateType(payload); + ProfileOperation operation = new ProfileOperation(); operation.setCode(AndroidConstants.OperationCodes.UNINSTALL_APPLICATION); operation.setType(Operation.Type.PROFILE); @@ -606,6 +686,25 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe } } + private void validateType(JSONObject payload) { + if (payload.has("type")) { + String type = payload.getString("type"); + if (!"enterprise".equalsIgnoreCase(type) + && !"public".equalsIgnoreCase(type) + && !"webapp".equalsIgnoreCase(type)) { + String errorMessage = "Invalid application type."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + } else { + String errorMessage = "Application type is missing."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + } + @POST @Path("/blacklist-applications") @Override 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 effbd6876..c6b343215 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 @@ -52,15 +52,15 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati public Response getConfiguration( @HeaderParam("If-Modified-Since") String ifModifiedSince) { String msg; - PlatformConfiguration PlatformConfiguration; + PlatformConfiguration platformConfiguration; List configs; try { - PlatformConfiguration = AndroidAPIUtils.getDeviceManagementService(). + platformConfiguration = AndroidAPIUtils.getDeviceManagementService(). getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - if (PlatformConfiguration != null) { - configs = PlatformConfiguration.getConfiguration(); + if (platformConfiguration != null) { + configs = platformConfiguration.getConfiguration(); } else { - PlatformConfiguration = new PlatformConfiguration(); + platformConfiguration = new PlatformConfiguration(); configs = new ArrayList<>(); } ConfigurationEntry entry = new ConfigurationEntry(); @@ -73,7 +73,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); entry.setValue(license.getText()); configs.add(entry); - PlatformConfiguration.setConfiguration(configs); + platformConfiguration.setConfiguration(configs); } } catch (DeviceManagementException e) { msg = "Error occurred while retrieving the Android tenant configuration"; @@ -81,14 +81,13 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); } - return Response.status(Response.Status.OK).entity(PlatformConfiguration).build(); + return Response.status(Response.Status.OK).entity(platformConfiguration).build(); } @PUT @Override public Response updateConfiguration(@Valid AndroidPlatformConfiguration androidPlatformConfiguration) { String msg; - Message responseMsg = new Message(); ConfigurationEntry licenseEntry = null; PlatformConfiguration configuration = new PlatformConfiguration(); if (androidPlatformConfiguration == null) { @@ -120,16 +119,13 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati configuration.setConfiguration(configs); AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); //AndroidAPIUtils.getGCMService().resetTenantConfigCache(); - Response.status(Response.Status.ACCEPTED); - responseMsg.setResponseMessage("Android platform configuration has been updated successfully."); - responseMsg.setResponseCode(Response.Status.ACCEPTED.toString()); } catch (DeviceManagementException e) { msg = "Error occurred while modifying configuration settings of Android platform"; log.error(msg, e); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); } - return Response.status(Response.Status.CREATED).entity(responseMsg).build(); + return Response.status(Response.Status.OK).entity("Android platform configuration has been updated successfully.").build(); } 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/AndroidAPIUtils.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/AndroidAPIUtils.java index cb65fc6f0..f068b8884 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/AndroidAPIUtils.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/AndroidAPIUtils.java @@ -122,17 +122,16 @@ public class AndroidAPIUtils { throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } - DeviceIdentifier deviceIdentifier = new DeviceIdentifier(); - List deviceids = new ArrayList<>(); + DeviceIdentifier deviceIdentifier; + List deviceIdentifiers = new ArrayList<>(); for (String deviceId : deviceIDs) { + deviceIdentifier = new DeviceIdentifier(); deviceIdentifier.setId(deviceId); deviceIdentifier.setType(AndroidConstants.DEVICE_TYPE_ANDROID); - deviceids.add(deviceIdentifier); + deviceIdentifiers.add(deviceIdentifier); } - Activity activity = null; - activity = getDeviceManagementService().addOperation( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, deviceids); - + Activity activity = getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, deviceIdentifiers); // if (activity != null) { // GCMService gcmService = getGCMService(); // if (gcmService.isGCMEnabled()) { @@ -144,7 +143,6 @@ public class AndroidAPIUtils { // getGCMService().sendNotification(operation.getCode(), devices); // } // } - return Response.status(Response.Status.CREATED).entity(activity).build(); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml index d85ab6971..1ed463398 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml @@ -55,7 +55,7 @@ Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /configuration/license GET @@ -66,42 +66,42 @@ Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices POST Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices/* DELETE Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices/* PUT Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices/*/applications PUT Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices/*/pending-operations PUT Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /devices/*/status GET @@ -112,7 +112,7 @@ Enroll - /device-mgt/user/device/android/enroll + /device-mgt/user/device/enroll/android /events/publish POST 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 f11525b8b..bf9650bba 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,13 +23,13 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.ui - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT WSO2 Carbon - Mobile Android UI pom 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.type-view/public/asset/android-agent.apk 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.type-view/public/asset/android-agent.apk index a1d4ebfdb..71b0f1337 100644 Binary files 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.type-view/public/asset/android-agent.apk and 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.type-view/public/asset/android-agent.apk differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml index 406bd9711..b06afc8d2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml @@ -22,7 +22,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml 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 aadd3783f..bed25a980 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 @@ -18,17 +18,20 @@ package org.wso2.carbon.device.mgt.mobile.android.impl; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.ProvisioningConfig; -import org.wso2.carbon.device.mgt.common.app.mgt.Application; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; -import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; 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.mobile.android.impl.util.AndroidPluginConstants; +import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder; +import java.util.HashMap; import java.util.List; /** @@ -36,9 +39,13 @@ import java.util.List; */ public class AndroidDeviceManagementService implements DeviceManagementService { + private static final Log log = LogFactory.getLog(AndroidDeviceManagementService.class); private DeviceManager deviceManager; public static final String DEVICE_TYPE_ANDROID = "android"; private static final String SUPER_TENANT_DOMAIN = "carbon.super"; + private static final String NOTIFIER_PROPERTY = "notifierType"; + private static final String GCM_API_KEY = "gcmAPIKey"; + private static final String GCM_SENDER_ID = "gcmSenderId"; @Override public String getType() { @@ -67,7 +74,37 @@ public class AndroidDeviceManagementService implements DeviceManagementService { @Override public PushNotificationConfig getPushNotificationConfig() { + try { + DeviceManagementService deviceManagementService = AndroidDeviceManagementDataHolder.getInstance(). + getAndroidDeviceManagementService(); + if (deviceManagementService != null && deviceManagementService.getDeviceManager() != null) { + PlatformConfiguration androidConfig = deviceManagementService.getDeviceManager().getConfiguration(); + if (androidConfig != null) { + List configuration = androidConfig.getConfiguration(); + String notifierValue = this.getConfigProperty(configuration, NOTIFIER_PROPERTY); + if (notifierValue != null && !notifierValue.isEmpty()) { + int notifierType = Integer.parseInt(notifierValue); + if (notifierType == 2) { + HashMap config = new HashMap<>(); + config.put(GCM_API_KEY, this.getConfigProperty(configuration, GCM_API_KEY)); + config.put(GCM_SENDER_ID, this.getConfigProperty(configuration, GCM_SENDER_ID)); + return new PushNotificationConfig(AndroidPluginConstants.NotifierType.GCM, config); + } + } + } + } + } catch (DeviceManagementException e) { + log.error("Unable to get the Android platform configuration from registry."); + } return null; } + private String getConfigProperty(List configs, String propertyName) { + for (ConfigurationEntry entry : configs) { + if (propertyName.equals(entry.getName())) { + return entry.getValue().toString(); + } + } + return null; + } } 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 31fea9d5d..376932449 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 @@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.android.impl.util; /** * Defines constants used by android plugin. */ -public class AndroidPluginConstants { +public final class AndroidPluginConstants { //Properties related to AD_DEVICE table public static final String DEVICE_ID = "DEVICE_ID"; @@ -45,4 +45,12 @@ public class AndroidPluginConstants { public static final String ANDROID_FEATURE_NAME = "NAME"; public static final String ANDROID_FEATURE_DESCRIPTION = "DESCRIPTION"; -} + public static final class NotifierType { + private NotifierType() { + throw new AssertionError(); + } + + public static final String GCM = "GCM"; + public static final String LOCAL = "LOCAL"; + } +} \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index 8eceada19..04b7f063d 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 - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml index 4282bbc87..28dd02b15 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml @@ -23,7 +23,7 @@ mobile-base-plugin org.wso2.carbon.devicemgt-plugins - 2.1.3-SNAPSHOT + 2.2.1-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/assembly/src.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/assembly/src.xml index 2797034e0..a73a3edaa 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/assembly/src.xml +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/assembly/src.xml @@ -29,7 +29,12 @@ ${basedir}/src/main/resources/jaggeryapps/devicemgt - / + /devicemgt + true + + + ${basedir}/src/main/resources/jaggeryapps/emm-web-agent + /emm-web-agent true diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs index ab6f5902b..2026ed97a 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.hbs @@ -1,17 +1,35 @@ +{{! + 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. +}} + {{unit "cdmf.unit.lib.qrcode"}} {{unit "mdm.unit.device.qr-modal"}} {{#zone "content"}} - {{#if permissions.VIEW_DASHBOARD}} - {{#if permissions.LIST_DEVICES}} -
-
-
-
Devices
-
-
-
- Loading... + {{#if permissions.LIST_DEVICES}} +
+ - {{/if}} - {{# if permissions.LIST_POLICIES}} -
-
-
Policies
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_POLICIES}} +
+
+
Policies
+
+
+
+ Loading... + @@ -48,6 +69,7 @@ View + {{#if permissions.ADD_POLICY}} @@ -58,20 +80,21 @@ {{/if}} -
- {{/if}} - {{# if permissions.LIST_USERS}} -
-
-
Users
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_USERS}} +
+
+
Users
+
+
+
+ Loading... + @@ -79,6 +102,7 @@ View + {{#if permissions.ADD_USER}} @@ -89,20 +113,21 @@ {{/if}} -
- {{/if}} - {{# if permissions.LIST_ROLES}} -
-
-
Roles
-
-
-
- Loading... +
+ {{/if}} + {{# if permissions.LIST_ROLES}} +
+
+
Roles
+
+
+
+ Loading... + @@ -111,6 +136,7 @@ View {{#if permissions.ADD_ROLE}} + @@ -120,14 +146,11 @@ {{/if}} -
- {{/if}} - {{else}} - Permission denied +
{{/if}} {{/zone}} {{#zone "bottomJs"}} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js index e9b07a654..e1480d31c 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js @@ -20,10 +20,19 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var generalConfig = context.app.conf["generalConfig"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; - var viewModel = {}; - viewModel.permissions = userModule.getUIPermissions(); - new Log().debug("## Permissions : " + stringify(userModule.getUIPermissions())); + var permissions = {}; + permissions.LIST_DEVICES = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); + permissions.LIST_POLICIES = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); + permissions.LIST_ROLES = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); + permissions.LIST_USERS = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); + permissions.ADD_POLICY = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); + permissions.ADD_ROLE = userModule.isAuthorized("/permission/admin/device-mgt/roles/manage"); + permissions.ADD_USER = userModule.isAuthorized("/permission/admin/device-mgt/users/manage"); + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/ios") | userModule.isAuthorized("/permission/admin/devices/enroll/android") | userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/windows") ){ + permissions.ENROLL_DEVICE = true; + } + viewModel.permissions = permissions; //TODO: Move enrollment URL into app-conf.json viewModel.enrollmentURL = mdmProps.generalConfig.host + mdmProps.enrollmentDir; return viewModel; diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.hbs index ab7bf0fce..1f166ffbf 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.hbs @@ -26,6 +26,7 @@
  • + Devices @@ -38,7 +39,15 @@ {{/zone}} {{#zone "content"}} - {{unit "cdmf.unit.lib.data-table"}} - {{unit "cdmf.unit.device.operation-mod"}} - {{unit "cdmf.unit.device.view"}} + {{#if isAuthorized}} + {{unit "cdmf.unit.lib.data-table"}} + {{unit "cdmf.unit.device.operation-mod"}} + {{unit "cdmf.unit.device.view"}} + {{else}} +

    + Permission Denied +

    +
    + You are not authorized to view any enrolled device in the system. + {{/if}} {{/zone}} \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js index 21ce99302..1f7e9c088 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.device.view/view.js @@ -17,17 +17,24 @@ */ function onRequest(context){ - var utility = require("/app/modules/utility.js").utility; - context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) { - if (arguments.length < 3) - throw new Error("Handlebars Helper equal needs 2 parameters"); - if( lvalue!=rvalue ) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + var viewModel = {}; - var deviceType = context.uriParams.deviceType; - return {"deviceViewUnitName": utility.getTenantedDeviceUnitName(deviceType, "device-view")}; + // permission checks + // [1] checking viewing devices permission + viewModel["isAuthorized"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); + + if (viewModel["isAuthorized"]) { + context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) { + if (arguments.length < 3) + throw new Error("Handlebars Helper equal needs 2 parameters"); + if( lvalue!=rvalue ) { + return options.inverse(this); + } else { + return options.fn(this); + } + }); + } + + return viewModel; } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs index 21917011c..b56d066f1 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.hbs @@ -28,6 +28,7 @@
  • + Devices @@ -35,132 +36,137 @@ {{/zone}} {{#zone "navbarActions"}} -{{!-- #if permissions.enroll --}} -
  • - - - - - - - - - - - Enroll Device - -
  • - {{!-- /if --}} -
  • - - - - - - - - - - - Advanced Search - -
  • + {{#if permissions.ENROLL_DEVICE}} +
  • + + + + + + + + + + +   Enroll Device + +
  • + {{/if}} + {{#if permissions.ADVANCED_SEARCH}} +
  • + + + + + + + + + + +   Advanced Search + +
  • + {{/if}} {{/zone}} {{#zone "content"}} - -
    - -     - Loading devices . . . + {{#if permissions.VIEW_DEVICES}} +
    + +     + Loading devices . . . +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    By Device NameBy OwnerBy StatusBy PlatformBy Ownership
    +
    +
    + + + {{else}} +

    + Permission Denied +


    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    By Device NameBy OwnerBy StatusBy PlatformBy Ownership
    -
    -
    - - + You are not authorized to view any enrolled device in the system. + {{/if}} {{/zone}} {{#zone "bottomJs"}} - - {{js "js/device-listing.js"}} + {{#if permissions.VIEW_DEVICES}} + {{js "js/device-listing.js"}} + {{/if}} {{/zone}} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.js index f1339b9e4..6cfeebd7e 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/devices.js @@ -15,26 +15,29 @@ * specific language governing permissions and limitations * under the License. */ -function onRequest(context){ - var userModule = require("/app/modules/business-controllers/user.js").userModule; + +function onRequest() { + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var constants = require("/app/modules/constants.js"); var viewModel = {}; - var permissions = []; - if(userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/devices/list")){ - permissions.push("LIST_DEVICES"); - if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/devices/view")) { - permissions.push("VIEW_DEVICES"); - } - }else if(userModule.isAuthorized("/permission/admin/device-mgt/user/devices/list")){ - permissions.push("LIST_OWN_DEVICES"); - if (userModule.isAuthorized("/permission/admin/device-mgt/user/devices/view")) { - permissions.push("VIEW_OWN_DEVICES"); - } - }else if(userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/policies/list")){ - permissions.push("LIST_POLICIES"); - } - var currentUser = session.get(constants.USER_SESSION_KEY); - viewModel.permissions = stringify(permissions); - viewModel.currentUser = currentUser; + var permissions = {}; + + // permission checks + // [1] checking enrollment permissions + permissions["ENROLL_DEVICE"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/android") || + userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/ios") || + userModule.isAuthorized("/permission/admin/device-mgt/devices/enroll/windows"); + + // [2] checking advanced device search permissions + permissions["ADVANCED_SEARCH"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); + + // [3] checking device viewing permission + permissions["VIEW_DEVICES"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/view"); + + var currentUser = session.get(constants["USER_SESSION_KEY"]); + + viewModel["permissions"] = permissions; + viewModel["currentUser"] = currentUser; + return viewModel; } \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/TemperatureController.png b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/TemperatureController.png deleted file mode 100644 index e16b48d8e..000000000 Binary files a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/TemperatureController.png and /dev/null differ diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/android.png b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/android.png deleted file mode 100755 index 7fee78a64..000000000 Binary files a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/android.png and /dev/null differ diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/ios.png b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/ios.png deleted file mode 100644 index 4b09796f8..000000000 Binary files a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/images/ios.png and /dev/null differ diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js index da5d4182c..98b2ab00d 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js @@ -28,8 +28,6 @@ function InitiateViewOption(url) { } (function () { - var cache = {}; - var permissionSet = {}; var validateAndReturn = function (value) { return (value == undefined || value == null) ? "Unspecified" : value; }; @@ -44,105 +42,15 @@ function InitiateViewOption(url) { }, {}); } }); - - //This method is used to setup permission for device listing - $.setPermission = function (permission) { - permissionSet[permission] = true; - }; - - $.hasPermission = function (permission) { - return permissionSet[permission]; - }; })(); /* * Setting-up global variables. */ var deviceCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']"; -var assetContainer = "#ast-container"; - -/* - * DOM ready functions. - */ -$(document).ready(function () { - /* Adding selected class for selected devices */ - $(deviceCheckbox).each(function () { - addDeviceSelectedClass(this); - }); - - var i; - var permissionList = $("#permission").data("permission"); - for (i = 0; i < permissionList.length; i++) { - $.setPermission(permissionList[i]); - } - - /* for device list sorting drop down */ - $(".ctrl-filter-type-switcher").popover({ - html : true, - content : function () { - return $("#content-filter-types").html(); - } - }); - - $(".ast-container").on("click", ".claim-btn", function(e){ - e.stopPropagation(); - var deviceId = $(this).data("deviceid"); - var deviceListing = $("#device-listing"); - var currentUser = deviceListing.data("current-user"); - var serviceURL = "/temp-controller-agent/enrollment/claim?username=" + currentUser; - var deviceIdentifier = {id: deviceId, type: "TemperatureController"}; - invokerUtil.put(serviceURL, deviceIdentifier, function(message){ - console.log(message); - }, function(message){ - console.log(message.content); - }); - }); -}); - -/* - * On Select All Device button click function. - * - * @param button: Select All Device button - */ -function selectAllDevices(button) { - if(!$(button).data('select')){ - $(deviceCheckbox).each(function(index){ - $(this).prop('checked', true); - addDeviceSelectedClass(this); - }); - $(button).data('select', true); - $(button).html('Deselect All Devices'); - }else{ - $(deviceCheckbox).each(function(index){ - $(this).prop('checked', false); - addDeviceSelectedClass(this); - }); - $(button).data('select', false); - $(button).html('Select All Devices'); - } -} - -/* - * On listing layout toggle buttons click function. - * - * @param view: Selected view type - * @param selection: Selection button - */ -function changeDeviceView(view, selection) { - $(".view-toggle").each(function() { - $(this).removeClass("selected"); - }); - $(selection).addClass("selected"); - if (view == "list") { - $(assetContainer).addClass("list-view"); - } else { - $(assetContainer).removeClass("list-view"); - } -} /* * Add selected style class to the parent element function. - * * @param checkbox: Selected checkbox */ function addDeviceSelectedClass(checkbox) { @@ -153,30 +61,10 @@ function addDeviceSelectedClass(checkbox) { } } -function toTitleCase(str) { - return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); -} - -function loadDevices(searchType, searchParam){ +function loadDevices() { var deviceListing = $("#device-listing"); var currentUser = deviceListing.data("currentUser"); - var serviceURL; - if ($.hasPermission("LIST_DEVICES")) { - //serviceURL = "/mdm-admin/devices"; - serviceURL = "/api/device-mgt/v1.0/devices"; - } else if ($.hasPermission("LIST_OWN_DEVICES")) { - //Get authenticated users devices - serviceURL = "/api/device-mgt/v1.0/devices?user="+currentUser; - //serviceURL = "/mdm-admin/users/devices?username="+currentUser; - } else { - $("#loading-content").remove(); - $('#device-table').addClass('hidden'); - $('#device-listing-status-msg').text('Permission denied.'); - $("#device-listing-status").removeClass(' hidden'); - return; - } - function getPropertyValue(deviceProperties, propertyName) { var property; for (var i =0; i < deviceProperties.length; i++) { @@ -188,30 +76,30 @@ function loadDevices(searchType, searchParam){ return {}; } - var fnCreatedRow = function( nRow, aData, iDataIndex ) { + var fnCreatedRow = function (nRow) { $(nRow).attr('data-type', 'selectable'); - $(nRow).attr('data-deviceid', aData.deviceIdentifier); - $(nRow).attr('data-devicetype', aData.deviceType); - } + }; var columns = [ { class : 'remove-padding icon-only content-fill viewEnabledIcon', data : 'icon', - render: function (data, type, row, meta) { + render: function (data, type, row) { var deviceType = row.deviceType; var deviceIdentifier = row.deviceIdentifier; var url = "#"; if (status != 'REMOVED') { url = "device/" + deviceType + "?id=" + deviceIdentifier; } - return '
    ' + return '
    ' + + '
    ' } - },{ + }, + { class: 'fade-edge', data: 'name', - render: function ( name, type, row, meta ) { + render: function (name, type, row) { var model = row.model; var vendor = row.vendor; var html = '

    Device ' + name + '

    '; @@ -220,16 +108,18 @@ function loadDevices(searchType, searchParam){ } return html; } - },{ + }, + { class: 'fade-edge remove-padding-top', - data: 'owner', - render: function ( owner, type, row, meta ) { - return '
    ' + owner + '
    '; + data: 'user', + render: function (user) { + return '
    ' + user + '
    '; } - },{ + }, + { class: 'fade-edge remove-padding-top', data: 'status', - render: function ( status, type, row, meta ) { + render: function (status) { var html; switch (status) { case 'ACTIVE' : @@ -245,35 +135,37 @@ function loadDevices(searchType, searchParam){ html = ' Removed'; break; } - return '
    '+html+'
    '; + return '
    ' + html + '
    '; } - },{ + }, + { className: 'fade-edge remove-padding-top', data: 'deviceType', - render: function ( deviceType, type, row, meta ) { + render: function (deviceType) { return '
    ' + deviceType + '
    '; } - },{ + }, + { className: 'fade-edge remove-padding-top', data: 'ownership', - render: function ( ownership, type, row, meta ) { + render: function (ownership) { return '
    ' + ownership + '
    '; } } ]; - var dataFilter = function(data){ + var dataFilter = function (data) { data = JSON.parse(data); var objects = []; - $(data.devices).each(function( index ) { + $(data.devices).each(function (index) { objects.push( { - model: getPropertyValue(data.devices[index].properties, 'DEVICE_MODEL'), - vendor: getPropertyValue(data.devices[index].properties, 'VENDOR'), - owner: data.devices[index].enrolmentInfo.owner, + model: getPropertyValue(data.devices[index].properties, "DEVICE_MODEL"), + vendor: getPropertyValue(data.devices[index].properties, "VENDOR"), + user: data.devices[index].enrolmentInfo.owner, status: data.devices[index].enrolmentInfo.status, ownership: data.devices[index].enrolmentInfo.ownership, deviceType: data.devices[index].type, @@ -283,135 +175,29 @@ function loadDevices(searchType, searchParam){ ); }); - json = { + var json = { "recordsTotal": data.count, "recordsFiltered": data.count, "data": objects }; - return JSON.stringify( json ); + return JSON.stringify(json); }; - - $('#device-grid').datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/devices', dataFilter, columns, fnCreatedRow, - function( oSettings ) { + $('#device-grid').datatables_extended_serverside_paging( + null, + "/api/device-mgt/v1.0/devices", + dataFilter, + columns, + fnCreatedRow, + function () { $(".icon .text").res_text(0.2); $('#device-grid').removeClass('hidden'); $("#loading-content").remove(); }, { - "placeholder": "Search By Device Name", + "placeholder" : "Search By Device Name", "searchKey" : "name" }); - // $('#device-grid').datatables_extended({ - // serverSide: true, - // processing: false, - // searching: true, - // ordering: false, - // filter: false, - // pageLength : 16, - // ajax: { url : '/emm/api/devices', data : {url : serviceURL}, - // dataSrc: function (json) { - // $('#device-grid').removeClass('hidden'); - // $("#loading-content").remove(); - // var $list = $("#device-table :input[type='search']"); - // $list.each(function(){ - // $(this).addClass("hidden"); - // }); - // return json.devices; - // } - // }, - // columnDefs: [ - // { targets: 0, data: 'name', className: 'remove-padding icon-only content-fill viewEnabledIcon' , render: function ( data, type, row, meta ) { - // var deviceType = row.type; - // var deviceIdentifier = row.deviceIdentifier; - // var url = "#"; - // if (status != 'REMOVED') { - // url = "devices/view?type=" + deviceType + "&id=" + deviceIdentifier; - // } - // return '
    '; - // }}, - // { targets: 1, data: 'name', className: 'fade-edge' , render: function ( name, type, row, meta ) { - // var model = getPropertyValue(row.properties, 'DEVICE_MODEL'); - // var vendor = getPropertyValue(row.properties, 'VENDOR'); - // var html = '

    Device ' + name + '

    '; - // if (model) { - // html += '
    (' + vendor + '-' + model + ')
    '; - // } - // return html; - // }}, - // { targets: 2, data: 'enrolmentInfo.owner', className: 'fade-edge remove-padding-top'}, - // { targets: 3, data: 'enrolmentInfo.status', className: 'fade-edge remove-padding-top' , - // render: function ( status, type, row, meta ) { - // var html; - // switch (status) { - // case 'ACTIVE' : - // html = ' Active'; - // break; - // case 'INACTIVE' : - // html = ' Inactive'; - // break; - // case 'BLOCKED' : - // html = ' Blocked'; - // break; - // case 'REMOVED' : - // html = ' Removed'; - // break; - // } - // return html; - // }}, - // { targets: 4, data: 'type' , className: 'fade-edge remove-padding-top' }, - // { targets: 5, data: 'enrolmentInfo.ownership' , className: 'fade-edge remove-padding-top' }, - // { targets: 6, data: 'enrolmentInfo.status' , className: 'text-right content-fill text-left-on-grid-view no-wrap' , - // render: function ( status, type, row, meta ) { - // var deviceType = row.type; - // var deviceIdentifier = row.deviceIdentifier; - // var html = ''; - // return html; - // }} - // ], - // "createdRow": function( row, data, dataIndex ) { - // $(row).attr('data-type', 'selectable'); - // $(row).attr('data-deviceid', data.deviceIdentifier); - // $(row).attr('data-devicetype', data.type); - // var model = getPropertyValue(data.properties, 'DEVICE_MODEL'); - // var vendor = getPropertyValue(data.properties, 'VENDOR'); - // var owner = data.enrolmentInfo.owner; - // var status = data.enrolmentInfo.status; - // var ownership = data.enrolmentInfo.ownership; - // var deviceType = data.type; - // $.each($('td', row), function (colIndex) { - // switch(colIndex) { - // case 1: - // $(this).attr('data-search', model + ',' + vendor); - // $(this).attr('data-display', model); - // break; - // case 2: - // $(this).attr('data-grid-label', "Owner"); - // $(this).attr('data-search', owner); - // $(this).attr('data-display', owner); - // break; - // case 3: - // $(this).attr('data-grid-label', "Status"); - // $(this).attr('data-search', status); - // $(this).attr('data-display', status); - // break; - // case 4: - // $(this).attr('data-grid-label', "Type"); - // $(this).attr('data-search', deviceType); - // $(this).attr('data-display', deviceType); - // break; - // case 5: - // $(this).attr('data-grid-label', "Ownership"); - // $(this).attr('data-search', ownership); - // $(this).attr('data-display', ownership); - // break; - // } - // }); - // }, - // "fnDrawCallback": function( oSettings ) { - // $(".icon .text").res_text(0.2); - // } - // }); $(deviceCheckbox).click(function () { addDeviceSelectedClass(this); }); @@ -420,8 +206,7 @@ function loadDevices(searchType, searchParam){ /* * Setting-up global variables. */ -var deviceCheckbox = "#ast-container .ctrl-wr-asset .itm-select input[type='checkbox']"; -var assetContainer = "#ast-container"; +//var assetContainer = "#ast-container"; function openCollapsedNav(){ $('.wr-hidden-nav-toggle-btn').addClass('active'); @@ -434,27 +219,25 @@ function openCollapsedNav(){ function initPage() { var currentUser = $("#device-listing").data("currentUser"); - var serviceURL; - if ($.hasPermission("LIST_DEVICES")) { - serviceURL ="/api/device-mgt/v1.0/devices" - } else if ($.hasPermission("LIST_OWN_DEVICES")) { - //Get authenticated users devices - serviceURL = "/api/device-mgt/v1.0/devices?user=" + currentUser; - } + var serviceURL = "/api/device-mgt/v1.0/devices"; + invokerUtil.get( serviceURL, function (data) { if (data) { data = JSON.parse(data); if (data.devices.length > 0) { + $(".bulk-action-row").removeClass('hidden'); loadDevices(); } else { $("#loading-content").remove(); $("#device-table").remove(); - $("#no-device-view").removeClass(' hidden'); + $("#no-device-view").removeClass('hidden'); + $("#advanced-search-btn").addClass('hidden'); + $("#enroll-btn").addClass('hidden'); } } - }, function (message) { + }, function () { initPage(); } ); @@ -471,12 +254,6 @@ $(document).ready(function () { addDeviceSelectedClass(this); }); - var i; - var permissionList = $("#permission").data("permission"); - for (i = 0; i < permissionList.length; i++) { - $.setPermission(permissionList[i]); - } - /* for device list sorting drop down */ $(".ctrl-filter-type-switcher").popover({ html : true, @@ -485,36 +262,14 @@ $(document).ready(function () { } }); - $(".ast-container").on("click", ".claim-btn", function(e){ - e.stopPropagation(); - var deviceId = $(this).data("deviceid"); - var deviceListing = $("#device-listing"); - var currentUser = deviceListing.data("current-user"); - var serviceURL = "/temp-controller-agent/enrollment/claim?username=" + currentUser; - var deviceIdentifier = {id: deviceId, type: "TemperatureController"}; - invokerUtil.put(serviceURL, deviceIdentifier, function(message){ - console.log(message); - }, function(message){ - console.log(message.content); - }); - }); - /* for data tables*/ $('[data-toggle="tooltip"]').tooltip(); $("[data-toggle=popover]").popover(); - $(".ctrl-filter-type-switcher").popover({ - html : true, - content: function() { - return $('#content-filter-types').html(); - } - }); - $('#nav').affix({ offset: { top: $('header').height() } }); - }); diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/templates/device-listing.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/templates/device-listing.hbs deleted file mode 100644 index 8e5f2d2f8..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/templates/device-listing.hbs +++ /dev/null @@ -1,42 +0,0 @@ - {{#each devices}} - {{deviceMap this}} - - -
    - -
    - - -

    Device {{name}}

    - {{#if properties.DEVICE_MODEL}} -
    ({{properties.VENDOR}} - {{properties.DEVICE_MODEL}})
    - {{/if}} - - {{enrolmentInfo.owner}} - - {{#equal enrolmentInfo.status "ACTIVE"}} Active{{/equal}} - {{#equal enrolmentInfo.status "INACTIVE"}} Inactive{{/equal}} - {{#equal enrolmentInfo.status "BLOCKED"}} Blocked{{/equal}} - {{#equal enrolmentInfo.status "REMOVED"}} Removed{{/equal}} - - {{type}} - {{enrolmentInfo.ownership}} - - - - - {{/each}} \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs index 54c837ab7..5737957bd 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs @@ -174,8 +174,8 @@ -
    - +
    +
    -
    -
    -
    -

    Do you really want to remove the selected policy(s)?

    + + +
    +
    -
    -
    -
    -

    Done. Selected policy was successfully removed.

    + + +
    +
    -
    -
    -
    -

    An unexpected error occurred. Please try again later.

    + + +
    +
    -
    -
    -
    -

    - You cannot remove policies that have been already applied to devices. - Please deselect active policies from your selection and try again. -

    - - -
    + + +
    -
    -
    -
    -

    Do you really want to publish the selected policy(s)?

    - -
    - Yes - No -
    -
    + + +
    -
    -
    -
    -

    Done. Selected policy was successfully published.

    - - -
    + + +
    -
    -
    -
    -

    An unexpected error occurred. Please try again later.

    - - -
    + + +
    -
    -
    -
    -

    Do you really want to unpublish the selected policy(s)?

    + + +
    -
    -
    -
    -

    Done. Selected policy was successfully unpublished.

    - - -
    + + +
    -
    -
    -
    -

    An unexpected error occurred. Please try again later.

    - - -
    + + +
    -
    -
    -
    -

    Done. New Policy priorities were successfully updated.

    - - -
    + + +
    -
    -
    -
    -

    An unexpected error occurred. Please try again later.

    -

    - - -
    + + +
    -
    -
    -
    -

    Do you really want to apply changes to all policies?

    + + +
    -
    -
    -
    -

    Done. Changes applied successfully.

    - - -
    + + +
    -
    -
    -
    -

    An unexpected error occurred. Please try again later.

    - - -
    + + +
    -
    -
    -
    -

    - + + Action cannot be performed ! +

    + +
    + +
    -
    -
    -
    -

    - + + Action cannot be performed ! +

    + +
    + +
    -
    -
    -
    -

    - + + Action cannot be performed ! +

    + +
    + +
    -
    -
    -
    -

    - + + Action cannot be performed ! +

    + +
    + +
    -
    -
    -
    -

    - + + Action cannot be performed ! +

    + +
    + +
    diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/public/js/policy-list.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/public/js/policy-list.js index 978d6f0bd..e6eb9bf04 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/public/js/policy-list.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/public/js/policy-list.js @@ -61,9 +61,9 @@ function InitiateViewOption() { * Modal related stuff are as follows. */ -var modalPopup = ".wr-modalpopup"; -var modalPopupContainer = modalPopup + " .modalpopup-container"; -var modalPopupContent = modalPopup + " .modalpopup-content"; +var modalPopup = ".modal"; +var modalPopupContainer = modalPopup + " .modal-content"; +var modalPopupContent = modalPopup + " .modal-content"; var body = "body"; /* @@ -81,8 +81,7 @@ function setPopupMaxHeight() { * show popup function. */ function showPopup() { - $(modalPopup).show(); - setPopupMaxHeight(); + $(modalPopup).modal('show'); } /* @@ -90,7 +89,9 @@ function showPopup() { */ function hidePopup() { $(modalPopupContent).html(''); - $(modalPopup).hide(); + $(modalPopup).modal('hide'); + $('body').removeClass('modal-open').css('padding-right','0px'); + $('.modal-backdrop').remove(); } /* @@ -215,7 +216,7 @@ $(document).ready(function () { // on-click function for policy un-publishing "yes" button $("a#unpublish-policy-yes-link").click(function () { - invokerUtil.put( + invokerUtil.post( serviceURL, policyList, // on success @@ -268,7 +269,7 @@ $(document).ready(function () { // on-click function for policy removing "yes" button $("a#publish-policy-yes-link").click(function () { - invokerUtil.put( + invokerUtil.post( serviceURL, policyList, // on success diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs index e4a17d8f0..fc4b7fefb 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs @@ -15,13 +15,15 @@ specific language governing permissions and limitations under the License. }} + {{#zone "content"}} -
    +
    {{unit "mdm.unit.device.operation-mod"}}
    {{/zone}} {{#zone "bottomJs"}} + {{js "js/operation-bar.js"}} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js new file mode 100644 index 000000000..d8e8b8405 --- /dev/null +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js @@ -0,0 +1,71 @@ +/* + * 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("mdm.unit.device.operation-bar"); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + var viewModel = {}; + var permissions = {}; + + // adding android operations related permission checks + permissions["android"] = []; + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/ring")) { + permissions["android"].push("DEVICE_RING"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/lock-devices")) { + permissions["android"].push("DEVICE_LOCK"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/unlock-devices")) { + permissions["android"].push("DEVICE_UNLOCK"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/location")) { + permissions["android"].push("DEVICE_LOCATION"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/clear-password")) { + permissions["android"].push("CLEAR_PASSWORD"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/reboot")) { + permissions["android"].push("DEVICE_REBOOT"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/upgrade-firmware")) { + permissions["android"].push("UPGRADE_FIRMWARE"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/mute")) { + permissions["android"].push("DEVICE_MUTE"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/send-notification")) { + permissions["android"].push("NOTIFICATION"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/change-lock-code")) { + permissions["android"].push("CHANGE_LOCK_CODE"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/enterprise-wipe")) { + permissions["android"].push("ENTERPRISE_WIPE"); + } + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning/operations/android/wipe")) { + permissions["android"].push("WIPE_DATA"); + } + + // adding ios operations related permission checks + + // adding windows operations related permission checks + + viewModel["permissions"] = stringify(permissions); + + return viewModel; +} \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js index 0485b20e0..a3186092a 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/js/operation-bar.js @@ -108,8 +108,21 @@ function loadOperationBar(deviceType) { //var serviceURL = "/mdm-admin/features/" + platformType; var serviceURL = "/api/device-mgt/v1.0/devices/" + platformType + "/*/features"; var successCallback = 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"]) { + permittedOperations.push(totalFeatures[j]); + } + } + } + var viewModel = {}; - data = JSON.parse(data).filter(function (current) { + permittedOperations = permittedOperations.filter(function (current) { var iconName; switch (deviceType) { case platformTypeConstants.ANDROID: @@ -129,7 +142,8 @@ function loadOperationBar(deviceType) { return current; } }); - viewModel.features = data; + + viewModel.features = permittedOperations; var content = template(viewModel); $(".wr-operations").html(content); }; diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs index 27d0d4062..43a601915 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs @@ -1,85 +1,87 @@
    -
    -
    -
    -

    - - - - - Operation cannot be performed ! -

    -

    - Please select a device or a list of devices to perform an operation. -

    -
    - Ok -
    -
    + + +
    -
    -
    -
    -

    - - - - - Operation cannot be performed ! -

    -

    - Unexpected error occurred. Please Try again later. -

    -
    - Ok -
    -
    + + +
    -
    -
    -
    -

    - - - - - Operation queued successfully ! -

    -

    - Operation has been queued successfully to be sent to the device. -

    -
    - Ok -
    -
    + + +
    -
    -
    -
    -

    - + + Message sent successfully ! +

    + +
    + +
    @@ -89,107 +91,127 @@ {{name}}
    -
    -
    -
    -

    - - - - - {{name}} -
    -

    -

    - {{#equal code "WIPE_DATA"}} - {{#equal type "android"}} - Enter PIN code (Optional - This is required only if the device type is BYOD). -

    -
    - -
    -
    - {{/equal}} - {{/equal}} - {{#equal code "NOTIFICATION"}} - Type your message below. + +

    +
    +
    +
    {{/each}}
    \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js index 3f1219765..a7002bb7f 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js @@ -80,7 +80,9 @@ var operationModule = function () { "AUTO_TIME" : "AUTO_TIME", "SET_SCREEN_CAPTURE_DISABLED" : "SET_SCREEN_CAPTURE_DISABLED", "SET_STATUS_BAR_DISABLED" : "SET_STATUS_BAR_DISABLED", - "APPLICATION_OPERATION_CODE":"APP-RESTRICTION" + "APPLICATION_OPERATION_CODE":"APP-RESTRICTION", + "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", + "KIOSK_APPS_CODE": "KIOSK_APPS" }; // Constants to define Windows Operation Constants @@ -115,8 +117,8 @@ var operationModule = function () { var featureMap = { "DEVICE_LOCK": "lock", "VPN": "vpn", - "PER_APP_VPN": "perappvpn", - "APP_TO_PER_APP_VPN_MAPPING": "apptoperappvpnmapping", + "PER_APP_VPN": "per-app-vpn", + "APP_TO_PER_APP_VPN_MAPPING": "app-to-per-app-vpn-mapping", "RING": "ring", "LOCATION": "location", "NOTIFICATION": "notification", @@ -124,12 +126,12 @@ var operationModule = function () { "RESTRICTION": "restriction", "CELLULAR": "cellular", "WIFI": "wifi", - "INSTALL_STORE_APPLICATION": "storeapplication", - "INSTALL_ENTERPRISE_APPLICATION": "enterpriseapplication", - "REMOVE_APPLICATION": "removeapplication", - "ENTERPRISE_WIPE": "enterprisewipe" + "INSTALL_STORE_APPLICATION": "store-application", + "INSTALL_ENTERPRISE_APPLICATION": "enterprise-application", + "REMOVE_APPLICATION": "remove-application", + "ENTERPRISE_WIPE": "enterprise-wipe" }; - return "/ios/operation/" + featureMap[operationCode]; + return "/api/device-mgt/ios/v1.0/admin/devices/" + featureMap[operationCode]; }; /** @@ -1012,6 +1014,24 @@ var operationModule = function () { } }; break; + case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "type": operationData["cosuSystemUpdateType"], + "startTime": operationData["cosuWindowStartTime"], + "endTime": operationData["cosuWindowEndTime"] + } + }; + break; + case androidOperationConstants["KIOSK_APPS_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "whitelistedApplications": operationData["cosuWhitelistedApplications"] + } + }; + break; default: // If the operation is neither of above, it is a command operation operationType = operationTypeConstants["COMMAND"]; @@ -1276,6 +1296,8 @@ var operationModule = function () { value = operationDataObj.val(); } else if (operationDataObj.is(":checkbox")) { value = operationDataObj.is(":checked"); + } else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) { + value = operationDataObj.val(); } else if (operationDataObj.is("select")) { value = operationDataObj.find("option:selected").attr("value"); } else if (operationDataObj.hasClass("grouped-array-input")) { diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.qr-modal/qr-modal.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.qr-modal/qr-modal.hbs index d1c3e40a1..5da7c3427 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.qr-modal/qr-modal.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.qr-modal/qr-modal.hbs @@ -17,20 +17,27 @@ }} {{#zone "content"}}