function saveConfigMapping()

in web/js/resources/config.js [715:754]


function saveConfigMapping() {
	var errobj = dojo.byId('addeditcfgmapdlgerrmsg');
	if(! checkValidatedObj('config', errobj))
		return;
	var maptype = dijit.byId('maptype').get('displayedValue');
	if((maptype == 'Image' && ! checkValidatedObj('image', errobj)) ||
	   (maptype == 'OS Type' && ! checkValidatedObj('ostype', errobj)) ||
	   (maptype == 'OS' && ! checkValidatedObj('os', errobj)) ||
	   (maptype == 'Config' && ! checkValidatedObj('mapconfig', errobj)) ||
	   (maptype == 'Subimage' && ! checkValidatedObj('configsubimage', errobj)) ||
	   (maptype == 'Management Node' && ! checkValidatedObj('managementnode', errobj)))
		return;
	if(! checkValidatedObj('affil', errobj) ||
	   ! checkValidatedObj('stage', errobj))
		return;

	var data = {configmapid: dojo.byId('editcfgmapid').value,
	            configid: dijit.byId('config').get('value'),
	            maptypeid: dijit.byId('maptype').get('value'),
	            affiliationid: dijit.byId('affil').get('value'),
	            stageid: dijit.byId('stage').get('value')};
	if(dijit.byId('addeditcfgmapbtn').get('label') == 'Add Config Mapping')
		data.continuation = dojo.byId('addcfgmapcont').value;
	else
		data.continuation = dojo.byId('savecfgmapcont').value;
	if(maptype == 'Image')
		data.subid = dijit.byId('image').get('value');
	else if(maptype == 'OS Type')
		data.subid = dijit.byId('ostype').get('value');
	else if(maptype == 'OS')
		data.subid = dijit.byId('os').get('value');
	else if(maptype == 'Config')
		data.subid = dijit.byId('mapconfig').get('value');
	else if(maptype == 'Subimage')
		data.subid = dijit.byId('configsubimage').get('value');
	else if(maptype == 'Management Node')
		data.subid = dijit.byId('managementnode').get('value');
	dijit.byId('addeditcfgmapbtn').set('disabled', true);
	RPCwrapper(data, saveConfigMappingCB, 1);
}