From d47864db8a1c86544cdb9c9451dc1aaa632dc7c9 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 27 Sep 2016 21:46:59 +0530 Subject: [PATCH] Fixing invalid invoker util URLs --- .../device-view.js | 8 ++++++-- .../device-view.js | 8 ++++++-- .../device-view.js | 8 ++++++-- .../device-view.js | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.device-view/device-view.js b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.device-view/device-view.js index a6f8a6ad..efaeb4fa 100644 --- a/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.device-view/device-view.js +++ b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.device-view/device-view.js @@ -21,14 +21,18 @@ function onRequest(context) { var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); var autoCompleteParams = [ - {"name" : "deviceId", "value" : deviceId} + {"name": "deviceId", "value": deviceId} ]; if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/device.js").deviceModule; var device = deviceModule.viewDevice(deviceType, deviceId); if (device && device.status != "error") { - return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; + return { + "device": device.content, + "backendApiUri": devicemgtProps["httpsURL"] + "/" + deviceType + "/", + "autoCompleteParams": autoCompleteParams + }; } else { response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); exit(); diff --git a/modules/samples/doormanager/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.doormanager.device-view/device-view.js b/modules/samples/doormanager/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.doormanager.device-view/device-view.js index bb16e9d5..efaeb4fa 100644 --- a/modules/samples/doormanager/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.doormanager.device-view/device-view.js +++ b/modules/samples/doormanager/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.doormanager.device-view/device-view.js @@ -21,14 +21,18 @@ function onRequest(context) { var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); var autoCompleteParams = [ - {"name" : "deviceId", "value" : deviceId} + {"name": "deviceId", "value": deviceId} ]; if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/device.js").deviceModule; var device = deviceModule.viewDevice(deviceType, deviceId); if (device && device.status != "error") { - return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; + return { + "device": device.content, + "backendApiUri": devicemgtProps["httpsURL"] + "/" + deviceType + "/", + "autoCompleteParams": autoCompleteParams + }; } else { response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); exit(); diff --git a/modules/samples/droneanalyzer/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone.device-view/device-view.js b/modules/samples/droneanalyzer/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone.device-view/device-view.js index a6f8a6ad..efaeb4fa 100644 --- a/modules/samples/droneanalyzer/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone.device-view/device-view.js +++ b/modules/samples/droneanalyzer/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone.device-view/device-view.js @@ -21,14 +21,18 @@ function onRequest(context) { var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); var autoCompleteParams = [ - {"name" : "deviceId", "value" : deviceId} + {"name": "deviceId", "value": deviceId} ]; if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/device.js").deviceModule; var device = deviceModule.viewDevice(deviceType, deviceId); if (device && device.status != "error") { - return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; + return { + "device": device.content, + "backendApiUri": devicemgtProps["httpsURL"] + "/" + deviceType + "/", + "autoCompleteParams": autoCompleteParams + }; } else { response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); exit(); diff --git a/modules/samples/geolocationTracker/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.geolocationTracker.device-view/device-view.js b/modules/samples/geolocationTracker/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.geolocationTracker.device-view/device-view.js index bb16e9d5..efaeb4fa 100644 --- a/modules/samples/geolocationTracker/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.geolocationTracker.device-view/device-view.js +++ b/modules/samples/geolocationTracker/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.geolocationTracker.device-view/device-view.js @@ -21,14 +21,18 @@ function onRequest(context) { var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); var autoCompleteParams = [ - {"name" : "deviceId", "value" : deviceId} + {"name": "deviceId", "value": deviceId} ]; if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/device.js").deviceModule; var device = deviceModule.viewDevice(deviceType, deviceId); if (device && device.status != "error") { - return {"device": device.content, "backendApiUri" : "/"+deviceType+"/", "autoCompleteParams" : autoCompleteParams}; + return { + "device": device.content, + "backendApiUri": devicemgtProps["httpsURL"] + "/" + deviceType + "/", + "autoCompleteParams": autoCompleteParams + }; } else { response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); exit();