|
|
@ -20,6 +20,7 @@ function onRequest(context) {
|
|
|
|
var log = new Log("device-view.js");
|
|
|
|
var log = new Log("device-view.js");
|
|
|
|
var deviceType = context.uriParams.deviceType;
|
|
|
|
var deviceType = context.uriParams.deviceType;
|
|
|
|
var deviceId = request.getParameter("id");
|
|
|
|
var deviceId = request.getParameter("id");
|
|
|
|
|
|
|
|
var owner = request.getParameter("owner");
|
|
|
|
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
|
|
|
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
|
|
|
var autoCompleteParams = [
|
|
|
|
var autoCompleteParams = [
|
|
|
|
{"name" : "deviceId", "value" : deviceId}
|
|
|
|
{"name" : "deviceId", "value" : deviceId}
|
|
|
@ -27,7 +28,7 @@ function onRequest(context) {
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
|
|
|
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
|
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") {
|
|
|
|
if (device && device.status != "error") {
|
|
|
|
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}};
|
|
|
|
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}};
|
|
|
|
var viewObject = {};
|
|
|
|
var viewObject = {};
|
|
|
|