<commit_before>/*This is the wrapper function over show_calendar() that allows to select the date only if the operator is Not 'ANY'
opratorListId : Id of the date-operators list box
formNameAndDateFieldId : A string that contains the form name & date field's id
isSecondDateField : A boolean variable that tells whether the date field is first or second
*/
function onDate(operatorListId,formNameAndDateFieldId,isSecondDateField)
{
var dateCombo = document.getElementById(operatorListId);

if(dateCombo.options[dateCombo.selectedIndex].value != "Any")
{
	if(!isSecondDateField)
	{
		show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY')
	}
	else
	{
		if(dateCombo.options[dateCombo.selectedIndex].value == "Between" || dateCombo.options[dateCombo.selectedIndex].value == "Not Between")
		{
			show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY');
		}
	}
}
}
function operatorChanged(rowId,dataType)
{

var textBoxId = rowId+"_textBox1";
var calendarId1 = rowId+"_calendar1";
var textBoxId0 = rowId+"_textBox";
var calendarId0 = "calendarImg";
var opId =  rowId+"_combobox";
if(document.all) {
		// IE.
		var op = document.getElementById(opId).value;
	} else if(document.layers) {
		// Netspace 4
	var op = document.getElementById(opId).value;
	} else {
		// Mozilla
		op = document.forms['categorySearchForm'].elements[opId].value;
	}	
	if(op == "Is Null" || op== "Is Not Null")
	{
		document.getElementById(textBoxId0).value = "";
			document.getElementById(textBoxId0).disabled = true;
			if(dataType == "true")
			{
				document.getElementById(calendarId0).disabled = true;
			}	
	} else
	{
			document.getElementById(textBoxId0).disabled = false;
			if(dataType == "true")
			{
				document.getElementById(calendarId0).disabled = false;
			}	
	}
if(op == "Between")
{
	if(document.all) {
		// IE.
		document.getElementById(textBoxId).style.display="block";		
		if(dataType == "true")
		{
			document.getElementById(calendarId1).style.display="block";		
		}
	} else if(document.layers) {
		// Netspace 4
		document.elements[textBoxId].visibility="visible";
	} else {
		// Mozilla
		var textBoxId1 = document.getElementById(textBoxId);
		textBoxId1.style.display="block";
		if(dataType == "true")
		{
			var calId = document.getElementById(calendarId1);
			calId.style.display="block";
		}
	}	
}
else 
{
	if(document.all) {
		// IE.
		document.getElementById(textBoxId).style.display="none";		
			if(dataType == "true")
		{
		document.getElementById(calendarId1).style.display="none";		
		}
	} else if(document.layers) {
		// Netspace 4
		document.elements[textBoxId].visibility="none";
	} else {
		// Mozilla
		var textBoxId1 = document.getElementById(textBoxId);
		textBoxId1.style.display="none";
		if(dataType == "true")
		{
			var calId = document.getElementById(calendarId1);
			calId.style.display="none";
		}
	}	
}
}
function expand()
{			
	switchObj = document.getElementById('image');
	dataObj = document.getElementById('collapsableTable');
	resultSetDivObj = document.getElementById('resultSetDiv');

	if(dataObj.style.display != 'none') //Clicked on - image
	{
		dataObj.style.display = 'none';				
		switchObj.innerHTML = '<img src="images/nolines_plus.gif" border="0"/>';
		resultSetDivObj.height = 400;
	}
	else  							   //Clicked on + image
	{
		if(navigator.appName == "Microsoft Internet Explorer")
		{					
			dataObj.style.display = 'block';
		}
		else
		{
			dataObj.style.display = 'table-row';
			dataObj.style.display = 'block';
		}
		switchObj.innerHTML = '<img src="images/nolines_minus.gif" border="0"/>';
		resultSetDivObj.height = 320;
	}
}

function retriveSearchedEntities(url,nameOfFormToPost) 
{
	var request = newXMLHTTPReq();				
	var actionURL;
	var handlerFunction = getReadyStateHandler(request,onResponseUpdate,true);
	
	var textFieldValue = document.forms[0].textField.value;

	var classCheckStatus = document.forms[0].classChecked.checked;
	var attributeCheckStatus = document.forms[0].attributeChecked.checked;
	var permissibleValuesCheckStatus = document.forms[0].permissibleValuesChecked.checked;
	var radioCheckStatus;

	request.onreadystatechange = handlerFunction;
			
	if(document.forms[0].selected[0].checked)
		radioCheckStatus = "rb1";
	if(document.forms[0].selected[1].checked)
		radioCheckStatus = "rb2";

	actionURL = "textField=" + textFieldValue + "&attributeChecked=" + attributeCheckStatus + "&classChecked=" + classCheckStatus + "&permissibleValuesChecked=" + permissibleValuesCheckStatus + "&selected=" + radioCheckStatus;

	if(!(classCheckStatus || attributeCheckStatus || permissibleValuesCheckStatus) ) 
	{
		alert("Please select any of the checkbox ");
		onResponseUpdate(" ");
	}
	else if(textFieldValue == "")
	{
		alert("Please Enter the String to search.");
		onResponseUpdate(" ");
	}
	else if(radioCheckStatus == null)
	{
		alert("Please select any of the radio button : 'based on' criteria");
		onResponseUpdate(" ");
	}
		
	else
	{
		//<!-- Open connection to servlet -->
		request.open("POST",url,true);	
		request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");	
		request.send(actionURL);
	}
//	showEntityInformation("");
	//onProduceQueryUpdate("");
}

function onResponseUpdate(text)
{
	if(text == "")
	{
		alert("No results found.");
	}
	var element = document.getElementById('resultSet');
	var allElementsArray = text.split(";");
	var row ='<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="0" cellpadding="0">';
	var isBuildNewTree=allElementsArray[0];			
	if(isBuildNewTree=="false")
	{
		for(i=1; i<allElementsArray.length; i++)
		{
			var lastIndex = allElementsArray[i].lastIndexOf(".");
			var entityName = allElementsArray[i].substring(lastIndex + 1);
			var functionCall = "retriveEntityInformation('loadDefineSearchRules.do','categorySearchForm','"+allElementsArray[i]+"')";					
			row = row+'<tr><td bgcolor="#FFFFFF"><a href="javascript:'+functionCall+'">' +entityName+ '</a></td></tr>';
		}			
	}
	else
	{<commit_msg>Added css class for the Category link.<commit_after>/*This is the wrapper function over show_calendar() that allows to select the date only if the operator is Not 'ANY'
opratorListId : Id of the date-operators list box
formNameAndDateFieldId : A string that contains the form name & date field's id
isSecondDateField : A boolean variable that tells whether the date field is first or second
*/
function onDate(operatorListId,formNameAndDateFieldId,isSecondDateField)
{
var dateCombo = document.getElementById(operatorListId);

if(dateCombo.options[dateCombo.selectedIndex].value != "Any")
{
	if(!isSecondDateField)
	{
		show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY')
	}
	else
	{
		if(dateCombo.options[dateCombo.selectedIndex].value == "Between" || dateCombo.options[dateCombo.selectedIndex].value == "Not Between")
		{
			show_calendar(formNameAndDateFieldId,null,null,'MM-DD-YYYY');
		}
	}
}
}
function operatorChanged(rowId,dataType)
{

var textBoxId = rowId+"_textBox1";
var calendarId1 = rowId+"_calendar1";
var textBoxId0 = rowId+"_textBox";
var calendarId0 = "calendarImg";
var opId =  rowId+"_combobox";
if(document.all) {
		// IE.
		var op = document.getElementById(opId).value;
	} else if(document.layers) {
		// Netspace 4
	var op = document.getElementById(opId).value;
	} else {
		// Mozilla
		op = document.forms['categorySearchForm'].elements[opId].value;
	}	
	if(op == "Is Null" || op== "Is Not Null")
	{
		document.getElementById(textBoxId0).value = "";
			document.getElementById(textBoxId0).disabled = true;
			if(dataType == "true")
			{
				document.getElementById(calendarId0).disabled = true;
			}	
	} else
	{
			document.getElementById(textBoxId0).disabled = false;
			if(dataType == "true")
			{
				document.getElementById(calendarId0).disabled = false;
			}	
	}
if(op == "Between")
{
	if(document.all) {
		// IE.
		document.getElementById(textBoxId).style.display="block";		
		if(dataType == "true")
		{
			document.getElementById(calendarId1).style.display="block";		
		}
	} else if(document.layers) {
		// Netspace 4
		document.elements[textBoxId].visibility="visible";
	} else {
		// Mozilla
		var textBoxId1 = document.getElementById(textBoxId);
		textBoxId1.style.display="block";
		if(dataType == "true")
		{
			var calId = document.getElementById(calendarId1);
			calId.style.display="block";
		}
	}	
}
else 
{
	if(document.all) {
		// IE.
		document.getElementById(textBoxId).style.display="none";		
			if(dataType == "true")
		{
		document.getElementById(calendarId1).style.display="none";		
		}
	} else if(document.layers) {
		// Netspace 4
		document.elements[textBoxId].visibility="none";
	} else {
		// Mozilla
		var textBoxId1 = document.getElementById(textBoxId);
		textBoxId1.style.display="none";
		if(dataType == "true")
		{
			var calId = document.getElementById(calendarId1);
			calId.style.display="none";
		}
	}	
}
}
function expand()
{			
	switchObj = document.getElementById('image');
	dataObj = document.getElementById('collapsableTable');
	resultSetDivObj = document.getElementById('resultSetDiv');

	if(dataObj.style.display != 'none') //Clicked on - image
	{
		dataObj.style.display = 'none';				
		switchObj.innerHTML = '<img src="images/nolines_plus.gif" border="0"/>';
		resultSetDivObj.height = 400;
	}
	else  							   //Clicked on + image
	{
		if(navigator.appName == "Microsoft Internet Explorer")
		{					
			dataObj.style.display = 'block';
		}
		else
		{
			dataObj.style.display = 'table-row';
			dataObj.style.display = 'block';
		}
		switchObj.innerHTML = '<img src="images/nolines_minus.gif" border="0"/>';
		resultSetDivObj.height = 320;
	}
}

function retriveSearchedEntities(url,nameOfFormToPost) 
{
	var request = newXMLHTTPReq();				
	var actionURL;
	var handlerFunction = getReadyStateHandler(request,onResponseUpdate,true);
	
	var textFieldValue = document.forms[0].textField.value;

	var classCheckStatus = document.forms[0].classChecked.checked;
	var attributeCheckStatus = document.forms[0].attributeChecked.checked;
	var permissibleValuesCheckStatus = document.forms[0].permissibleValuesChecked.checked;
	var radioCheckStatus;

	request.onreadystatechange = handlerFunction;
			
	if(document.forms[0].selected[0].checked)
		radioCheckStatus = "rb1";
	if(document.forms[0].selected[1].checked)
		radioCheckStatus = "rb2";

	actionURL = "textField=" + textFieldValue + "&attributeChecked=" + attributeCheckStatus + "&classChecked=" + classCheckStatus + "&permissibleValuesChecked=" + permissibleValuesCheckStatus + "&selected=" + radioCheckStatus;

	if(!(classCheckStatus || attributeCheckStatus || permissibleValuesCheckStatus) ) 
	{
		alert("Please select any of the checkbox ");
		onResponseUpdate(" ");
	}
	else if(textFieldValue == "")
	{
		alert("Please Enter the String to search.");
		onResponseUpdate(" ");
	}
	else if(radioCheckStatus == null)
	{
		alert("Please select any of the radio button : 'based on' criteria");
		onResponseUpdate(" ");
	}
		
	else
	{
		//<!-- Open connection to servlet -->
		request.open("POST",url,true);	
		request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");	
		request.send(actionURL);
	}
//	showEntityInformation("");
	//onProduceQueryUpdate("");
}

function onResponseUpdate(text)
{
	if(text == "")
	{
		alert("No results found.");
	}
	var element = document.getElementById('resultSet');
	var allElementsArray = text.split(";");
	var row ='<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="0" cellpadding="0">';
	var isBuildNewTree=allElementsArray[0];			
	if(isBuildNewTree=="false")
	{
		for(i=1; i<allElementsArray.length; i++)
		{
			var lastIndex = allElementsArray[i].lastIndexOf(".");
			var entityName = allElementsArray[i].substring(lastIndex + 1);
			var functionCall = "retriveEntityInformation('loadDefineSearchRules.do','categorySearchForm','"+allElementsArray[i]+"')";					
			row = row+'<tr><td bgcolor="#FFFFFF"><a class="dataPagingLink" href="javascript:'+functionCall+'">' +entityName+ '</a></td></tr>';
		}			
	}
	else
	{
{'fraction_non_alphanumeric': 0.14841402337228715, 'fraction_numerical': 0.008013355592654424, 'mean_word_length': 4.7684159845931635, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7176401', 'n_tokens_mistral': 4250, 'n_tokens_neox': 3881, 'n_words': 691}