IOTS-296: Moving policy profile generation to android plugin

Policy profile generation part is removed from the CDMF core and moved to plugins as policy profile is dependent on the device type. In this commit, policy profile generation for android device type is implemnted in android plugin.
revert-dabc3590
Madawa Soysa 8 years ago
parent f5a0f97b28
commit 37f0bc396d

@ -55,6 +55,13 @@ var updateGroupedInputVisibility = function (domElement) {
}
};
/**
* Populates policy configuration to the ui elements.
*
* This method will be invoked from the relevant cdmf unit when the edit page gets loaded.
*
* @param configuredOperations selected configurations.
*/
var polulateProfileOperations = function (configuredOperations) {
$(".wr-advance-operations li.grouped-input").each(function () {
updateGroupedInputVisibility(this);
@ -80,6 +87,13 @@ var inputIsValidAgainstRange = function (numberInput, min, max) {
return (numberInput == min || (numberInput > min && numberInput < max) || numberInput == max);
};
/**
* Validates policy profile operations for the windows platform.
*
* This function will be invoked from the relevant cdmf unit at the time of policy creation.
*
* @returns {boolean} whether validation is successful.
*/
var validatePolicyProfile = function () {
var validationStatusArray = [];
var validationStatus;
@ -528,6 +542,30 @@ var validatePolicyProfile = function () {
return wizardIsToBeContinued;
};
/**
* Generates policy profile object which will be saved with the profile.
*
* This function will be invoked from the relevant cdmf unit at the time of policy creation.
*
* @returns {Array} profile payloads
*/
var generatePolicyProfile = function () {
var profilePayloads = [];
// traverses key by key in policy["profile"]
var key;
for (key in policy["profile"]) {
if (policy["profile"].hasOwnProperty(key)) {
profilePayloads.push({
"featureCode": key,
"deviceType": policy["platform"],
"content": policy["profile"][key]
});
}
}
return profilePayloads;
};
// Start of HTML embedded invoke methods
var showAdvanceOperation = function (operation, button) {
$(button).addClass('selected');

@ -67,6 +67,13 @@ var inputIsValidAgainstRange = function (numberInput, min, max) {
return (numberInput == min || (numberInput > min && numberInput < max) || numberInput == max);
};
/**
* Validates policy profile operations for the windows platform.
*
* This function will be invoked from the relevant cdmf unit at the time of policy creation.
*
* @returns {boolean} whether validation is successful.
*/
var validatePolicyProfile = function () {
var validationStatusArray = [];
var validationStatus;
@ -515,6 +522,30 @@ var validatePolicyProfile = function () {
return wizardIsToBeContinued;
};
/**
* Generates policy profile object which will be saved with the profile.
*
* This function will be invoked from the relevant cdmf unit at the time of policy creation.
*
* @returns {Array} profile payloads
*/
var generatePolicyProfile = function () {
var profilePayloads = [];
// traverses key by key in policy["profile"]
var key;
for (key in policy["profile"]) {
if (policy["profile"].hasOwnProperty(key)) {
profilePayloads.push({
"featureCode": key,
"deviceType": policy["platform"],
"content": policy["profile"][key]
});
}
}
return profilePayloads;
};
// Start of HTML embedded invoke methods
var showAdvanceOperation = function (operation, button) {
$(button).addClass('selected');

Loading…
Cancel
Save