<commit_before><!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Simplity Hello World</title>
</head>
<body>
<div id="response"></div>
</br>
</br>
<button onclick="callRest()">Invoke Rest Call</button>
</br>
</br>
<button onclick="callFile()">Invoke File Processor</button>
</br>
</br>
<button onclick="callAgents()">Invoke DB Lookup - Agents</button>
</br>
</br>
<button onclick="callCustomer()">Invoke DB Lookup - Customers</button>
</br>
</br>
<button onclick="callSQL()">Call SQL</button>
</br>
</br>
<button onclick="invokeCustomServlet()">Invoke Custom Servlet</button>
</body>
<script src="js/simplity-min.js"></script>
<script type="text/javascript">
Simplity.getResponse("helloworld",null,onSuccess,onError);
function onSuccess(response){
	document.getElementById("response").innerHTML = JSON.stringify(response);
}
function onError(response){
	document.getElementById("response").innerHTML = JSON.stringify(response);
}

function callRest(){
	Simplity.getResponse("restService.callAnotherService",null,onSuccess,onError);
}
function callFile(){
	Simplity.getResponse("fileactions.fileProcessing",null,onSuccess,onError);
}
function callAgents(){
	var data = "{'fieldName':'commission','commission':0.15,'commissionOperator':'<'}";
	Simplity.getResponse("filter_tables.agents",data,onSuccess,onError);
}
function callCustomer(){
	Simplity.getResponse("filter_tables.customer",null,onSuccess,onError);
}

function callSQL(){
	var data = "{'custCode':'C00013'}"
	Simplity.getResponse("dbactions.callSqlqueryCust",data,onSuccess,onError);
}
function invokeCustomServlet(){
	var xhttp = new XMLHttpRequest();
	xhttp.onreadystatechange = function() {
	    if (this.readyState == 4 && this.status == 200) {
	    	document.getElementById("response").innerHTML = JSON.stringify(this.response);
	    }
	};
	xhttp.open("GET", "\processFile", true);
	xhttp.send();
}

function onError(response){
	console.log(response);
	
}
</script>
</html><commit_msg>File upload/download example added<commit_after><!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Simplity Hello World</title>
</head>
<body>
<div id="response"></div>
</br>
</br>
<button onclick="callRest()">Invoke Rest Call</button>
</br>
</br>
<button onclick="callFile()">Invoke File Processor</button>
</br>
</br>
<button onclick="callAgents()">Invoke DB Lookup - Agents</button>
</br>
</br>
<button onclick="callCustomer()">Invoke DB Lookup - Customers</button>
</br>
</br>
<button onclick="callSQL()">Call SQL</button>
<br>
<br>
<button onclick="invokeCustomServlet()">Invoke Custom Servlet</button>
<br>
<br>
Upload file: <input type="file" id="myFile"  onchange="uploadfile()"/>
<br>
<br>
<a href="javascript:void(0);" onClick="downloadfile()">Click here to download</a>
<br>
</body>
<script src="js/simplity-min.js"></script>
<script type="text/javascript">
Simplity.getResponse("helloworld",null,onSuccess,onError);
function onSuccess(response){
	document.getElementById("response").innerHTML = JSON.stringify(response);
}
function onError(response){
	document.getElementById("response").innerHTML = JSON.stringify(response);
}

function callRest(){
	Simplity.getResponse("restService.callAnotherService",null,onSuccess,onError);
}
function callFile(){
	Simplity.getResponse("fileactions.fileProcessing",null,onSuccess,onError);
}
function callAgents(){
	var data = "{'fieldName':'commission','commission':0.15,'commissionOperator':'<'}";
	Simplity.getResponse("filter_tables.agents",data,onSuccess,onError);
}
function callCustomer(){
	Simplity.getResponse("filter_tables.customer",null,onSuccess,onError);
}

function callSQL(){
	var data = "{'custCode':'C00013'}"
	Simplity.getResponse("dbactions.callSqlqueryCust",data,onSuccess,onError);
}
function invokeCustomServlet(){
	var xhttp = new XMLHttpRequest();
	xhttp.onreadystatechange = function() {
	    if (this.readyState == 4 && this.status == 200) {
	    	document.getElementById("response").innerHTML = JSON.stringify(this.response);
	    }
	};
	xhttp.open("GET", "\processFile", true);
	xhttp.send();
}

function onError(response){
	console.log(response);
	
}

var fileKey ;
var fileName;
function uploadfile(){
	var file = document.getElementById("myFile").files[0];
	fileName = file.name;
	Simplity.uploadFile(file, function(key) {
		fileKey = key;
		console.log("filekey: "+key)
	});	
 }
 
function downloadfile(){
	Simplity.downloadFile(fileKey,fileName,null);
}
</script>
</html>
{'fraction_non_alphanumeric': 0.18349864743011723, 'fraction_numerical': 0.008115419296663661, 'mean_word_length': 7.324577861163227, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4221118', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1426, 'n_words': 257}