context: function handleRefreshNodesResponse(data) {	var str = '';	if(data.success) {		str = data.content;		var tmpStr=str.substring(0,REFRESH_ACTION.length+2);		if(tmpStr==REFRESH_ACTION+"OK"){			str=str.substring(REFRESH_ACTION.length+2,str.length);		} else {    	    	alert('Refresh failed!');		menuSvgDocument.getElementById("RefreshingText").getStyle().setProperty('display', 'none');		enableMenu();		startRefreshNodesTime();		return;		}	} else {        alert('Refresh failed!');		menuSvgDocument.getElementById("RefreshingText").getStyle().setProperty('display', 'none');		enableMenu();		startRefreshNodesTime();		return;	}	var st = str.split("&");	map.clearLinks();	//alert("links cleared!");				for(var k=1;k<st.length;k++){		var nodeToken = st[k];		var nodeST = nodeToken.split("+");		var counter=0;		//Manage errors		if (nodeST.length == 1) {			var iderror;			while(counter< nodeST.length){				var tmp = nodeST[counter];				if(counter==0) 				{					iderror=tmp;				}				counter++;				// manage loop found error				//loopfound				var tmpStr=iderror.substring(0,9);				if(tmpStr=="loopfound"){					alert("Add Map As Node: Found Loop Adding SubMap with ID " + iderror.substring(9));				}			}					}		//MapElement		if (nodeST.length > 2) {			var id,iconName=DEFAULT_ICON,labelText="",avail=100,status=0,severity=0;						while(counter< nodeST.length){				var tmp = nodeST[counter];								//read the information of the map (id, name, ecc.)							if(counter==0) 				{					id=tmp;				}				if(counter==1)					{					if(tmp!="null")						iconName=tmp;					}				if(counter==2)					{					if(tmp!="null")						labelText=tmp;					}				if(counter==3)					{					if(tmp!="null")						avail=tmp;					}									if(counter==4)					{					if(tmp!="null")						status=tmp;					}								if(counter==5)					{					if(tmp!="null")						severity=tmp;					}									//alert(counter);					counter++;			}			var semaphoreColor=getSemaphoreColorForNode(severity,avail,status);			var semaphoreFlash = getSemaphoreFlash(severity,avail);			//alert("add element " + id);			var mapElem = map.mapElements[id];			var deleted = map.deleteMapElement(id);			var x = mapElem.x;			var y = mapElem.y;			if (deleted){				map.addMapElement(new MapElement(id,iconName, labelText, semaphoreColor, semaphoreFlash, x, y, mapElemDimension, status, avail,severity));			}					}		// Links		if (nodeST.length == 2) {			var id1,id2;						while(counter< nodeST.length){				var tmp = nodeST[counter];								//read the information of the map (id, name, ecc.)							if(counter==0) 				{					id1=tmp;				}				if(counter==1)				{					id2=tmp;				}				counter++;			}			//alert(id1+" " +id2);			map.addLink(id1,id2,"green",1);		}		//map.render();			}	map.render();	//reloadGrid();	menuSvgDocument.getElementById("RefreshingText").getStyle().setProperty('display', 'none');	savedMapString=getMapString();	enableMenu();			startRefreshNodesTime();}
meta: 8692	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8692/82a1d6d395363ccb5adb8bb6b70ef505088ed576/ApplicationMap.js/clean/opennms-webapp/src/main/webapp/map/ApplicationMap.js