Merge pull request #11 from dulichan/master

Fixes
revert-dabc3590
Lakshitha Harshan 10 years ago
commit 99abc5fafd

@ -17,7 +17,7 @@
*/ */
function identifierFormatter(value, row, index) { function identifierFormatter(value, row, index) {
return [ return [
'<a class="like" href="/cdm/devices/' + row["deviceType"] + '/' + value + '" title="Like">', '<a class="like" href="/cdm/devices/' + row["deviceType"] + '/' + escape(value) + '" title="Like">',
value, value,
'</a>' '</a>'
].join(''); ].join('');
@ -27,7 +27,7 @@ var currentDeviceOperation;
var currentDevice; var currentDevice;
var currentDeviceType; var currentDeviceType;
function performOperation(){ function performOperation(){
currentDevice = $("#deviceMain").data("deviceid"); currentDevice = escape($("#deviceMain").data("deviceid"));
currentDeviceType = $("#deviceMain").data("devicetype"); currentDeviceType = $("#deviceMain").data("devicetype");
$.post("/cdm/api/operation/"+currentDeviceType+"/"+currentDevice+"/"+currentDeviceOperation,function(){ $.post("/cdm/api/operation/"+currentDeviceType+"/"+currentDevice+"/"+currentDeviceOperation,function(){
$('#confirmModel').modal('hide'); $('#confirmModel').modal('hide');

@ -26,6 +26,14 @@ var ArrayList = Packages.java.util.ArrayList;
var log = new Log(); var log = new Log();
var deviceManagementService = utility.getDeviceManagementService(); var deviceManagementService = utility.getDeviceManagementService();
var unspecifiedFilter = function(prop){
if(prop==null){
return "Unspecified";
}else{
return prop;
}
}
var listDevices = function () { var listDevices = function () {
var devices = deviceManagementService.getAllDevices("android"); var devices = deviceManagementService.getAllDevices("android");
var deviceList = []; var deviceList = [];
@ -34,14 +42,14 @@ var listDevices = function () {
var propertiesList = DeviceManagerUtil.convertPropertiesToMap(device.getProperties()); var propertiesList = DeviceManagerUtil.convertPropertiesToMap(device.getProperties());
deviceList.push({ deviceList.push({
"identifier": device.getDeviceIdentifier(), "identifier": unspecifiedFilter(device.getDeviceIdentifier()),
"name": device.getName(), "name": unspecifiedFilter(device.getName()),
"ownership": device.getOwnership(), "ownership": unspecifiedFilter(device.getOwnership()),
"owner": device.getOwner(), "owner": unspecifiedFilter(device.getOwner()),
"deviceType": device.getType(), "deviceType": unspecifiedFilter(device.getType()),
"vendor": propertiesList.get("vendor"), "vendor": unspecifiedFilter(propertiesList.get("vendor")),
"model": propertiesList.get("model"), "model": unspecifiedFilter(propertiesList.get("model")),
"osVersion": propertiesList.get("osVersion") "osVersion": unspecifiedFilter(propertiesList.get("osVersion"))
}); });
} }
return deviceList; return deviceList;
@ -94,17 +102,17 @@ var viewDevice = function(type, deviceId){
var entry = iterator.next(); var entry = iterator.next();
var key = entry.getKey(); var key = entry.getKey();
var value = entry.getValue(); var value = entry.getValue();
properties[key]= value; properties[key]= unspecifiedFilter(value);
} }
return { return {
"identifier": device.getDeviceIdentifier(), "identifier": unspecifiedFilter(device.getDeviceIdentifier()),
"name": device.getName(), "name": unspecifiedFilter(device.getName()),
"ownership": device.getOwnership(), "ownership": unspecifiedFilter(device.getOwnership()),
"owner": device.getOwner(), "owner": unspecifiedFilter(device.getOwner()),
"deviceType": device.getType(), "deviceType": unspecifiedFilter(device.getType()),
"vendor": propertiesList.get("vendor"), "vendor": unspecifiedFilter(propertiesList.get("vendor")),
"model": propertiesList.get("model"), "model": unspecifiedFilter(propertiesList.get("model")),
"osVersion": propertiesList.get("osVersion"), "osVersion": unspecifiedFilter(propertiesList.get("osVersion")),
"properties": properties "properties": properties
}; };
} }

@ -1,7 +1,6 @@
<module name="sso" expose="true" xmlns="http://wso2.org/projects/jaggery/module.xml"> <module name="sso" xmlns="http://wso2.org/projects/jaggery/module.xml">
<hostObject> <script>
<className>org.wso2.carbon.hostobjects.sso.SAMLSSORelyingPartyObject</className> <name>client</name>
<name>SSORelyingParty</name> <path>scripts/sso.client.js</path>
</hostObject> </script>
</module> </module>
Loading…
Cancel
Save