<commit_before>
var TEMPLATE_EXECUTE_COMPLEX_INPUTS_MARKUP = '\
	<div class="wps-execute-complex-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_COMPLEX_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}</li>';

var TEMPLATE_EXECUTE_LITERAL_INPUTS_MARKUP = '\
	<div class="wps-execute-literal-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';
	
var TEMPLATE_EXECUTE_LITERAL_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}</li>';


var TEMPLATE_EXECUTE_BBOX_INPUTS_MARKUP = '\
	<div class="wps-execute-bbox-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}<label>${description}</label>{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_BBOX_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}<label>${description}</label></li>';

var TEMPLATE_EXECUTE_OUTPUTS_MARKUP = '\
	<div class="wps-execute-complex-inputs"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list" id="outputs"> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_COMPLEX_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}</li>';


var TEMPLATE_EXECUTE_LITERAL_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li>';

var TEMPLATE_EXECUTE_BBOX_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li>';

//array for storing literalvalues, used to obtain the defaultvalues that are defined by the server for this input
var literalInputsWithServerSideDefaultValues = [];

//array for storing literalvalues, used to obtain the defaultvalues that are defined by the client for this input
var clientSideDefaultValues = {"org.n52.wps.server.algorithm.SimpleBufferAlgorithm" : ["data", "http://geoprocessing.demo.52north.org:8080/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=topp:tasmania_roads&amp;SRS=EPSG:4326&amp;OUTPUTFORMAT=GML3"]};

var FormBuilder = Class.extend({
	
	init : function(settings) {
		this.settings = settings;
	},
	
	clearForm : function(targetDiv) {
		targetDiv.html('');
	},
	
	buildExecuteForm : function(targetDiv, processDescription, executeCallback) {
	 	var formElement = jQuery('<form id="wps-execute-form"></form>');
	 	formElement.submit(function() {
	 			executeCallback("wps-execute-form");
	        	return false;
	        });
	 	if(processDescription["abstract"] != null && processDescription["abstract"] != "null") {
	 		formElement.append(jQuery('<span id="abstract">' + processDescription["abstract"] + "</span>"));
	 	}
	 	formElement.append(this.createFormInputs(processDescription.dataInputs));
        
        if(literalInputsWithServerSideDefaultValues.length > 0){
        
            var button = jQuery('<button type="button" id="fillServerSideDefaultValues-button">Fill in default values for LiteralData inputs defined by the WPS process</button>');
            formElement.append(button);
	        	
	        $('#wps-execute-container').on('click', '#fillServerSideDefaultValues-button', function () {
	        	       
	           for (var i=0; i < literalInputsWithServerSideDefaultValues.length; i++) {
	               var inputIDArray = literalInputsWithServerSideDefaultValues[i];	           
	               
	               var input = $('input[name='+ inputIDArray[0] + ']');
	               
	               if(input){
	                   input.val(inputIDArray[1]);
	               }
	               
	               var select = $('select[name='+ inputIDArray[0] + ']');
	               
	               if(select){
	                   select.val(inputIDArray[1]);
	               }	           
	           } 
	            
		    });
		}
		
        var clientSideDefaultValuesForProcess = clientSideDefaultValues[processDescription.identifier];
        
        if(clientSideDefaultValuesForProcess && clientSideDefaultValuesForProcess.length > 0){
        
            formElement.append(jQuery("<br>"));
        
            var button = jQuery('<button type="button" id="fillClientSideDefaultValues-button">Fill in default values defined by this client</button>');
            formElement.append(button);
	        	
	        $('#wps-execute-container').on('click', '#fillClientSideDefaultValues-button', function () {
	        	       
	           for (var i=0; i < clientSideDefaultValuesForProcess.length; i++) {
	               var inputIDArray = clientSideDefaultValuesForProcess[i];	           
	               
	               var textarea = $('textarea[name=input_'+ inputIDArray[0] + ']');
	               
	               if(input){
	                   textarea.val(inputIDArray[1]);
	               }	     
	           } 
	            
		    });
		}
        
		formElement.append(this.createFormOutputs(processDescription));
	 	formElement.append(jQuery('<input type="hidden" name="processIdentifier" value="'+processDescription.identifier+'" />'));
	        
        var executeButton = jQuery("<button id=\"btn_execute\">Execute</button>");
        formElement.append(executeButton);
        
        targetDiv.append(jQuery("<div>").append(formElement));
	},
	
	createFormInputs : function(inputs){
	    
	    var container = jQuery('<div id="input"></div>');
	    var complexContainer = jQuery('<div id="complex-inputs"/>');
	    var literalContainer = jQuery('<div id="literal-inputs"/>');
	    var bboxContainer = jQuery('<div id="bbox-inputs"/>');
	    container.append(complexContainer);
	    container.append(literalContainer);
	    container.append(bboxContainer);
	    
	    var input;
	    for (var i=0; i < inputs.length; i++) {
	        input = inputs[i];    
	                <commit_msg>Safetypoint<commit_after>
var TEMPLATE_EXECUTE_COMPLEX_INPUTS_MARKUP = '\
	<div class="wps-execute-complex-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_COMPLEX_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}</li>';

var TEMPLATE_EXECUTE_LITERAL_INPUTS_MARKUP = '\
	<div class="wps-execute-literal-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';
	
var TEMPLATE_EXECUTE_LITERAL_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}</li>';


var TEMPLATE_EXECUTE_BBOX_INPUTS_MARKUP = '\
	<div class="wps-execute-bbox-inputs" id="input_${identifier}"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list"> \
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}<label>${description}</label>{{html copyButton}}</li> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_BBOX_INPUTS_COPY_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}${required}</label>{{html inputField}}<label>${description}</label></li>';

var TEMPLATE_EXECUTE_OUTPUTS_MARKUP = '\
	<div class="wps-execute-complex-inputs"> \
		<div class="wps-execute-response-process"> \
			<ul class="wps-execute-response-list" id="outputs"> \
			</ul> \
		</div> \
	</div>';

var TEMPLATE_EXECUTE_COMPLEX_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li> \
				<li class="wps-execute-response-list-entry"> \
					{{html formats}}</li>';


var TEMPLATE_EXECUTE_LITERAL_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li>';

var TEMPLATE_EXECUTE_BBOX_OUTPUTS_MARKUP = '\
				<li class="wps-execute-response-list-entry"> \
					<label class="wps-input-item-label">${identifier}</label>{{html settings}}{{html asReference}}</li>';

//array for storing literalvalues, used to obtain the defaultvalues that are defined by the server for this input
var literalInputsWithServerSideDefaultValues = [];

//array for storing literalvalues, used to obtain the defaultvalues that are defined by the client for this input
var clientSideDefaultValues = {"org.n52.wps.server.algorithm.SimpleBufferAlgorithm" : [["data", "http://geoprocessing.demo.52north.org:8080/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=topp:tasmania_roads&amp;SRS=EPSG:4326&amp;OUTPUTFORMAT=GML3"]]};
var FormBuilder = Class.extend({
	
	init : function(settings) {
		this.settings = settings;
	},
	
	clearForm : function(targetDiv) {
		targetDiv.html('');
	},
	
	buildExecuteForm : function(targetDiv, processDescription, executeCallback) {
	 	var formElement = jQuery('<form id="wps-execute-form"></form>');
	 	formElement.submit(function() {
	 			executeCallback("wps-execute-form");
	        	return false;
	        });
	 	if(processDescription["abstract"] != null && processDescription["abstract"] != "null") {
	 		formElement.append(jQuery('<span id="abstract">' + processDescription["abstract"] + "</span>"));
	 	}
	 	formElement.append(this.createFormInputs(processDescription.dataInputs));
        
        if(literalInputsWithServerSideDefaultValues.length > 0){
        
            var button = jQuery('<button type="button" id="fillServerSideDefaultValues-button">Fill in default values for LiteralData inputs defined by the WPS process</button>');
            formElement.append(button);
	        	
	        $('#wps-execute-container').on('click', '#fillServerSideDefaultValues-button', function () {
	        	       
	           for (var i=0; i < literalInputsWithServerSideDefaultValues.length; i++) {
	               var inputIDArray = literalInputsWithServerSideDefaultValues[i];	           
	               
	               var input = $('input[name='+ inputIDArray[0] + ']');
	               
	               if(input){
	                   input.val(inputIDArray[1]);
	               }
	               
	               var select = $('select[name='+ inputIDArray[0] + ']');
	               
	               if(select){
	                   select.val(inputIDArray[1]);
	               }	           
	           } 
	            
		    });
		}
        
		formElement.append(this.createFormOutputs(processDescription));
	 	formElement.append(jQuery('<input type="hidden" name="processIdentifier" value="'+processDescription.identifier+'" />'));
	        
        var executeButton = jQuery("<button id=\"btn_execute\">Execute</button>");
        formElement.append(executeButton);
        
        targetDiv.append(jQuery("<div>").append(formElement));
		
        var clientSideDefaultValuesForProcess = clientSideDefaultValues[processDescription.identifier];
        
        if(clientSideDefaultValuesForProcess && clientSideDefaultValuesForProcess.length > 0){
            
            if(literalInputsWithServerSideDefaultValues.length > 0){            
                formElement.append(jQuery("<br>"));            
            }
        
            var button = jQuery('<button type="button" id="fillClientSideDefaultValues-button">Fill in default values defined by this client</button>');
            formElement.append(button);
	        	
	        $('#wps-execute-container').on('click', '#fillClientSideDefaultValues-button', function () {
	           FormBuilder.prototype.fillInClientSideDefaultValues(clientSideDefaultValuesForProcess);
		    });
        
            FormBuilder.prototype.fillInClientSideDefaultValues(clientSideDefaultValuesForProcess);
		}
	},
	
	fillInClientSideDefaultValues : function(clientSideDefaultValuesForProcess){
	
		for (var i=0; i < clientSideDefaultValuesForProcess.length; i++) {
	        var inputIDArray = clientSideDefaultValuesForProcess[i];	 
	
	        var name = inputIDArray[0];          
	        
	        var values = inputIDArray;
	        
	        var textarea = $('textarea[name=input_'+ name + ']');
	        
	        //check for multiple inputs
	        if(values.length > 1){
	        
	            var button = null;
	        
	        	var copyButtonDiv = jQuery("<div></div>"); 
	        
	        	button = this.addInputCopyButton(name);    	
	        
	            copyButtonDiv.append(button);
	            //templateProperties.copyButton = copyButtonDiv.html();	            
	        }
	        
	        //if(textarea){
	        //    textarea.val();
	        //}	     
	    } 
	
	},
	
	createFormInputs : function(inputs){
	    
	    var container = jQuery('<div id="input"></div>');
	    var complexContainer = jQuery('<div id="complex-inputs"/>');
	    var literalContainer = jQuery('<div id="literal-inputs"/>');
	    var bboxContainer = jQuery('<div id="bbox-inputs"/>');
	    container.append(complexContainer);
	    container.append(literalContainer);
	    container.append(bboxContainer);
	    
	    var input;
	    for (var i=0; i < inputs.length; i++) {
	        input = inputs[i];    
	                
{'fraction_non_alphanumeric': 0.1574487353645126, 'fraction_numerical': 0.0035577980464454365, 'mean_word_length': 3.0620073568050445, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4814724', 'n_tokens_mistral': 5051, 'n_tokens_neox': 4525, 'n_words': 675}