function ConfigureServicesUtil() {
var passwordsArray = [];
function generateDivForService (option, type, service, property, unit, displayAttributes, isReconfigure) {
var unitClass = (unit != null) ? 'unit' : '';
var unitLabel = (unit != null && unit != 'int') ? unit : '';
// default: if this is reconfiguration, default to NOT editable
// if this is not reconfiguration (original config), default to editable
var readOnlyFlag = isReconfigure;
if (displayAttributes != null) {
if (isReconfigure && displayAttributes.reconfigurable != null && displayAttributes.reconfigurable) {
readOnlyFlag = false;
} else if (!isReconfigure && displayAttributes.editable != null && !displayAttributes.editable) {
readOnlyFlag = true;
}
}
var checked = (type === 'checkbox' && option.value === 'true') ? 'checked' : '';
var retString = '
' +
'' +
'' +
'
' + option.description + '
' +
'' +
'
';
if (type == "password") {
retString += '
' +
'' +
'' +
'
' + option.description + '
' +
'' +
'
';
/// Put it in the global passwd array
passwordsArray[passwordsArray.length] = {
"passwordDivId" : property,
"verificationDivId" : property + 'SecretService'
};
// globalYui.log("Global Passwords Array: " + globalYui.Lang.dump(passwordsArray));
}
return retString;
}
/**
* isReconfigure: true if this is for reconfiguring parameters on services; false if this is on "Advanced Config" page
*/
this.getOptionsSummaryMarkup = function(optionsInfo, isReconfigure) {
/* Reset passwordsArray at the beginning of each render cycle to
* avoid using stale data from the last run - this isn't a problem on the
* Configure Services page, but it bites us on the Manage Services page
* there is re-use of this module of code within the same JS memory.
*/
passwordsArray = [];
var optionsSummary = "";
for (servicesKey in optionsInfo['services']) {
if (optionsInfo['services'][servicesKey]["isEnabled"] == true) {
var serviceNeedsRender = false;
var propertiesRendering = "";
for (property in optionsInfo['services'][servicesKey]["properties"]) {
// service has configs, so needs render
var type = convertDisplayType(optionsInfo['services'][servicesKey]['properties'][property]['type']);
// globalYui.log("TYPE: " + type + "Property: " + property);
if (type == "NODISPLAY") {
continue;
}
serviceNeedsRender = true;
var unit = optionsInfo['services'][servicesKey]['properties'][property]['unit'];
var displayAttributes = null;
if (optionsInfo['services'][servicesKey]['properties'][property]['displayAttributes']) {
displayAttributes = optionsInfo['services'][servicesKey]['properties'][property]['displayAttributes'];
}
propertiesRendering += generateDivForService(optionsInfo['services'][servicesKey]["properties"][property], type, servicesKey, property, unit, displayAttributes, isReconfigure);
}
if (serviceNeedsRender) {
optionsSummary += "