src/sap.ui.support/src/sap/ui/support/supportRules/ui/controllers/Analysis.controller.js
function (tempLib, treeTable) {
			var library,
				rule,
				oTempLibCopy,
				bSelected,
				aRules,
				iIndex,
				fnFilter = function (oRule) {
					return oRule.id === rule.id;
				};

			for (var i in treeTable) {

				library = treeTable[i];
				oTempLibCopy =  treeTable[i].nodes;

				if (library.name !== Constants.TEMP_RULESETS_NAME) {
					continue;
				}
				//reset the model to add the temp rules
				treeTable[i].nodes = [];
				for (var ruleIndex in tempLib.rules) {

					rule = tempLib.rules[ruleIndex];
					bSelected = oTempLibCopy[ruleIndex] !== undefined ?  oTempLibCopy[ruleIndex].selected : true;

					// syncs selection of temporary rules from local storage
					if (this.tempRulesFromStorage) {
						aRules = this.tempRulesFromStorage.filter(fnFilter);

						if (aRules.length > 0) {
							bSelected = aRules[0].selected;
							iIndex = this.tempRulesFromStorage.indexOf(aRules[0]);
							this.tempRulesFromStorage.splice(iIndex, 1);

							if (bSelected === false) {
								library.selected = false;
							}
						}

						if (this.tempRulesFromStorage.length === 0) {
							this.tempRulesFromStorage.length = null;
						}
					}

					library.nodes.push({
						name: rule.title,
						description: rule.description,
						id: rule.id,
						audiences: rule.audiences.toString(),
						categories: rule.categories.toString(),
						minversion: rule.minversion,
						resolution: rule.resolution,
						title: rule.title,
						selected: bSelected,
						libName: library.name,
						check: rule.check
					});
				}

				this.model.setProperty("/treeModel", treeTable);
				return library;
			}
		}
function (tempLib, treeTable) {
			var library,
				rule,
				oTempLibCopy,
				bSelected,
				aRules,
				iIndex,
				fnFilter = function (oRule) {
					return oRule.id === rule.id;
				};

			for (var i in treeTable) {

				library = treeTable[i];
				oTempLibCopy =  treeTable[i].nodes;

				if (library.name !== Constants.TEMP_RULESETS_NAME) {
					continue;
				}
				//reset the model to add the temp rules
				treeTable[i].nodes = [];
				for (var ruleIndex in tempLib.rules) {

					rule = tempLib.rules[ruleIndex];
					bSelected = oTempLibCopy[ruleIndex] !== undefined ?  oTempLibCopy[ruleIndex].selected : true;

					// syncs selection of temporary rules from local storage
					if (this.tempRulesFromStorage) {
						aRules = this.tempRulesFromStorage.filter(fnFilter);

						if (aRules.length > 0) {
							bSelected = aRules[0].selected;
							iIndex = this.tempRulesFromStorage.indexOf(aRules[0]);
							this.tempRulesFromStorage.splice(iIndex, 1);

							if (bSelected === false) {
								library.selected = false;
							}
						}

						if (this.tempRulesFromStorage.length === 0) {
							this.tempRulesFromStorage.length = null;
						}
					}

					library.nodes.push({
						name: rule.title,
						description: rule.description,
						id: rule.id,
						audiences: rule.audiences.toString(),
						categories: rule.categories.toString(),
						minversion: rule.minversion,
						resolution: rule.resolution,
						title: rule.title,
						selected: bSelected,
						libName: library.name,
						check: rule.check
					});
				}

				this.model.setProperty("/treeModel", treeTable);
				return library;
			}
		}
function ( tempLib , treeTable ) { var library , rule , oTempLibCopy , bSelected , aRules , iIndex , fnFilter = function ( oRule ) { return oRule . id === rule . id ; } ; for ( var i in treeTable ) { library = treeTable [ i ] ; oTempLibCopy = treeTable [ i ] . nodes ; if ( library . name !== Constants . TEMP_RULESETS_NAME ) { continue ; } //reset the model to add the temp rules treeTable [ i ] . nodes = [ ] ; for ( var ruleIndex in tempLib . rules ) { rule = tempLib . rules [ ruleIndex ] ; bSelected = oTempLibCopy [ ruleIndex ] !== undefined ? oTempLibCopy [ ruleIndex ] . selected : true ; // syncs selection of temporary rules from local storage if ( this . tempRulesFromStorage ) { aRules = this . tempRulesFromStorage . filter ( fnFilter ) ; if ( aRules . length > 0 ) { bSelected = aRules [ 0 ] . selected ; iIndex = this . tempRulesFromStorage . indexOf ( aRules [ 0 ] ) ; this . tempRulesFromStorage . splice ( iIndex , 1 ) ; if ( bSelected === false ) { library . selected = false ; } } if ( this . tempRulesFromStorage . length === 0 ) { this . tempRulesFromStorage . length = null ; } } library . nodes . push ( { name : rule . title , description : rule . description , id : rule . id , audiences : rule . audiences . toString ( ) , categories : rule . categories . toString ( ) , minversion : rule . minversion , resolution : rule . resolution , title : rule . title , selected : bSelected , libName : library . name , check : rule . check } ) ; } this . model . setProperty ( "/treeModel" , treeTable ) ; return library ; } }
Keeps in sync the TreeViewModel for temporary library that we use for visualisation of sap.m.TreeTable and the model that we use in the Suppport Assistant
@param {Object} tempLib  temporary library model from Support Assistant
@param {Object} treeTable Model for sap.m.TreeTable visualization
@returns {Object} The temp library
Keeps in sync the TreeViewModel for temporary library that we use for visualisation of sap . m . TreeTable and the model that we use in the Suppport Assistant