From b6f7998db7e292fb23e0dbec463a793a9f789e86 Mon Sep 17 00:00:00 2001 From: Dulitha Wijewantha Date: Tue, 27 Jan 2015 21:17:56 +0530 Subject: [PATCH 1/2] Fixing encoding issue --- .../src/repository/jaggeryapps/cdm/client/javascript/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js b/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js index af57503dac..4a690dd2ab 100644 --- a/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js +++ b/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js @@ -17,7 +17,7 @@ */ function identifierFormatter(value, row, index) { return [ - '', + '', value, '' ].join(''); From e76608187b70c1eb5808dcebd34773f3a9bdc8a0 Mon Sep 17 00:00:00 2001 From: Dulitha Wijewantha Date: Tue, 27 Jan 2015 23:21:13 +0530 Subject: [PATCH 2/2] * Fixed issue in escape * Added unspecified filter * Reverting back to old sso module --- .../jaggeryapps/cdm/client/javascript/main.js | 2 +- .../jaggeryapps/cdm/modules/device.js | 42 +++++++++++-------- .../src/repository/modules/sso/module.xml | 11 +++-- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js b/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js index 4a690dd2ab..70b835187c 100644 --- a/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js +++ b/product/modules/distribution/src/repository/jaggeryapps/cdm/client/javascript/main.js @@ -27,7 +27,7 @@ var currentDeviceOperation; var currentDevice; var currentDeviceType; function performOperation(){ - currentDevice = $("#deviceMain").data("deviceid"); + currentDevice = escape($("#deviceMain").data("deviceid")); currentDeviceType = $("#deviceMain").data("devicetype"); $.post("/cdm/api/operation/"+currentDeviceType+"/"+currentDevice+"/"+currentDeviceOperation,function(){ $('#confirmModel').modal('hide'); diff --git a/product/modules/distribution/src/repository/jaggeryapps/cdm/modules/device.js b/product/modules/distribution/src/repository/jaggeryapps/cdm/modules/device.js index 59fd1ba0c5..49e6ef945e 100644 --- a/product/modules/distribution/src/repository/jaggeryapps/cdm/modules/device.js +++ b/product/modules/distribution/src/repository/jaggeryapps/cdm/modules/device.js @@ -26,6 +26,14 @@ var ArrayList = Packages.java.util.ArrayList; var log = new Log(); var deviceManagementService = utility.getDeviceManagementService(); +var unspecifiedFilter = function(prop){ + if(prop==null){ + return "Unspecified"; + }else{ + return prop; + } +} + var listDevices = function () { var devices = deviceManagementService.getAllDevices("android"); var deviceList = []; @@ -34,14 +42,14 @@ var listDevices = function () { var propertiesList = DeviceManagerUtil.convertPropertiesToMap(device.getProperties()); deviceList.push({ - "identifier": device.getDeviceIdentifier(), - "name": device.getName(), - "ownership": device.getOwnership(), - "owner": device.getOwner(), - "deviceType": device.getType(), - "vendor": propertiesList.get("vendor"), - "model": propertiesList.get("model"), - "osVersion": propertiesList.get("osVersion") + "identifier": unspecifiedFilter(device.getDeviceIdentifier()), + "name": unspecifiedFilter(device.getName()), + "ownership": unspecifiedFilter(device.getOwnership()), + "owner": unspecifiedFilter(device.getOwner()), + "deviceType": unspecifiedFilter(device.getType()), + "vendor": unspecifiedFilter(propertiesList.get("vendor")), + "model": unspecifiedFilter(propertiesList.get("model")), + "osVersion": unspecifiedFilter(propertiesList.get("osVersion")) }); } return deviceList; @@ -94,17 +102,17 @@ var viewDevice = function(type, deviceId){ var entry = iterator.next(); var key = entry.getKey(); var value = entry.getValue(); - properties[key]= value; + properties[key]= unspecifiedFilter(value); } return { - "identifier": device.getDeviceIdentifier(), - "name": device.getName(), - "ownership": device.getOwnership(), - "owner": device.getOwner(), - "deviceType": device.getType(), - "vendor": propertiesList.get("vendor"), - "model": propertiesList.get("model"), - "osVersion": propertiesList.get("osVersion"), + "identifier": unspecifiedFilter(device.getDeviceIdentifier()), + "name": unspecifiedFilter(device.getName()), + "ownership": unspecifiedFilter(device.getOwnership()), + "owner": unspecifiedFilter(device.getOwner()), + "deviceType": unspecifiedFilter(device.getType()), + "vendor": unspecifiedFilter(propertiesList.get("vendor")), + "model": unspecifiedFilter(propertiesList.get("model")), + "osVersion": unspecifiedFilter(propertiesList.get("osVersion")), "properties": properties }; } \ No newline at end of file diff --git a/product/modules/distribution/src/repository/modules/sso/module.xml b/product/modules/distribution/src/repository/modules/sso/module.xml index 15682e7284..b32a0fea8d 100644 --- a/product/modules/distribution/src/repository/modules/sso/module.xml +++ b/product/modules/distribution/src/repository/modules/sso/module.xml @@ -1,7 +1,6 @@ - - - org.wso2.carbon.hostobjects.sso.SAMLSSORelyingPartyObject - SSORelyingParty - - + + \ No newline at end of file