From 2e6ba042b8e2ae960e9b401b745e50f7cdda0aad Mon Sep 17 00:00:00 2001 From: Harshan Liyanage Date: Wed, 13 Sep 2017 14:23:47 +0530 Subject: [PATCH] Fixes related to wso2/product-iots#1348 --- .../device-view.js | 3 ++- .../cdmf.unit.device.type.android.device-view/device-view.js | 3 ++- .../cdmf.unit.device.type.windows.device-view/device-view.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js index 438936c90..49b35cf50 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.js @@ -20,6 +20,7 @@ function onRequest(context) { var log = new Log("device-view.js"); var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); + var owner = request.getParameter("owner"); var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var autoCompleteParams = [ {"name" : "deviceId", "value" : deviceId} @@ -27,7 +28,7 @@ function onRequest(context) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; - var device = deviceModule.viewDevice(deviceType, deviceId); + var device = deviceModule.viewDevice(deviceType, deviceId, owner); if (device && device.status != "error") { var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}}; var viewObject = {}; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js index 76b097605..51eacbc50 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js @@ -20,12 +20,13 @@ function onRequest(context) { // var log = new Log("device-view.js"); var deviceType = context["uriParams"]["deviceType"]; var deviceId = request.getParameter("id"); + var owner = request.getParameter("owner"); var deviceViewData = {}; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; if (deviceType && deviceId) { var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; - var response = deviceModule.viewDevice(deviceType, deviceId); + var response = deviceModule.viewDevice(deviceType, deviceId, owner); if (response["status"] == "success") { deviceViewData["deviceFound"] = true; deviceViewData["isAuthorized"] = true; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js index 42c90e23c..4986c18e2 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view/device-view.js @@ -20,11 +20,12 @@ function onRequest(context) { // var log = new Log("device-view.js"); var deviceType = context["uriParams"]["deviceType"]; var deviceId = request.getParameter("id"); + var owner = request.getParameter("owner"); var deviceViewData = {}; if (deviceType && deviceId) { var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; - var response = deviceModule.viewDevice(deviceType, deviceId); + var response = deviceModule.viewDevice(deviceType, deviceId, owner); if (response["status"] == "success") { deviceViewData["deviceFound"] = true; deviceViewData["isAuthorized"] = true;