From 201ff62664ff35f5a3bccc227b63b8498d5e4b74 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 23 Jul 2015 16:01:07 +0530 Subject: [PATCH] fixing getowner() according to cdmf device object refactoring --- .../repository/jaggeryapps/iotserver/modules/device.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js index 5b1b6b52..935d4071 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js @@ -36,7 +36,7 @@ deviceModule = function () { var deviceManagementDAOFactory = Packages.org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; var deviceManagementService = utility.getDeviceManagementService(); - + var publicMethods = {}; var privateMethods = {}; @@ -179,7 +179,7 @@ deviceModule = function () { var data = {}; //XMLHTTPRequest's POST //log.info(updateDeviceEndpoint+ "?name="+device.name); - return post(updateDeviceEndpoint+ "?name="+encodeURIComponent(device.name), data, "text"); + return post(updateDeviceEndpoint + "?name=" + encodeURIComponent(device.name), data, "text"); }; /* @@ -257,8 +257,8 @@ deviceModule = function () { var deviceObject = {}; deviceObject[constants.DEVICE_IDENTIFIER] = device.getDeviceIdentifier(); deviceObject[constants.DEVICE_NAME] = privateMethods.validateAndReturn(device.getName()); - deviceObject[constants.DEVICE_OWNERSHIP] = privateMethods.validateAndReturn(device.getOwnership()); - deviceObject[constants.DEVICE_OWNER] = device.getOwner(); + deviceObject[constants.DEVICE_OWNERSHIP] = privateMethods.validateAndReturn(device.getEnrolmentInfo().getOwnership()); + deviceObject[constants.DEVICE_OWNER] = device.getEnrolmentInfo().getOwner(); deviceObject[constants.DEVICE_TYPE] = device.getType(); if (device.getType() == constants.PLATFORM_IOS) { properties[constants.DEVICE_MODEL] = properties[constants.DEVICE_PRODUCT]; @@ -266,7 +266,7 @@ deviceModule = function () { properties[constants.DEVICE_VENDOR] = constants.VENDOR_APPLE; } deviceObject[constants.DEVICE_PROPERTIES] = properties; - deviceObject[constants.DEVICE_ENROLLMENT] = device.getDateOfEnrolment(); + deviceObject[constants.DEVICE_ENROLLMENT] = device.getEnrolmentInfo().getDateOfEnrolment(); return deviceObject; } };