<commit_before><%@ page import="org.dbnp.gdt.GdtService" %>
<%
	/**
	 * Properties template which shows entities and allows to assign properties to columns
	 *
	 * @author <NAME>
	 * @since 20100210
	 * @package importer
	 *
	 * Revision information: 
	 * $Rev$
	 * $Author$
	 * $Date$
	 */
%>
<script type="text/javascript">

// for each select field on the page
$(document).ready(function() {

$('select[name^=columnproperty.index.]').each ( function() {

  $(this).bind('change', function(e) {
      //console.log($(this).val())      
      var selection = $(this)

      $('select[name^=columnproperty.index.] option:selected').each ( function() {
        var selector = $(this)
        
        if (selection.attr('id') != selector.parent().attr('id') && (selection.val()!="dontimport"))
          if ($(this).val() == selection.val()) {
            selection.val($('option:first', selection).val());

            alert("Property is already set for an other column, please choose a different property.")
            return false
          }
      });      
   
  });
 
});

$('#clearselect').click(function() {

  // for each select field on the page
  $("select").each( function(){
    // set its value to its first option
    $(this).val($('option:first', this).val());
  });

});


});
</script>
<!-- saveproperties action was defined in the form --> 
    <table>
	  <g:each var="stdentity" in ="${GdtService.cachedEntities}">
	      <% if (importer_selectedentities.any { it.name.toLowerCase() == stdentity.entity.toLowerCase() } && stdentity.entity!="") { %>
            
	      <tr><td colspan="3"><h4>${stdentity.name}</h4></td></tr>
		<tr>
            <td class="header" width="25px"><input id="clearselect" type="button" value="clear" name="clearselect"></td>
            <g:each var="selentity" in="${importer_selectedentities}">
              <g:if test="${selentity.name.toLowerCase()==stdentity.entity.toLowerCase()}">
			    <td class="header" width="200px">
				<b>${importer_header[selentity.columnindex.toInteger()].name}</b>
                  <importer:propertyChooser name="columnproperty" mappingcolumn="${importer_header[selentity.columnindex.toInteger()]}" matchvalue="${importer_header[selentity.columnindex.toInteger()].name}" template_id="${importer_template_id}" allfieldtypes="${importer_allfieldtypes}"/>
			    </td>			    		
              </g:if>
            </g:each>
		</tr>

        <g:each var="row" in="${session.importer_datamatrix}">
		<tr>
                  <td class="datamatrix">                    
                  </td>
		    <g:each var="cell" in="${row}">
			<td class="datamatrix">
			    <g:if test="${cell.toString()==''}">.</g:if>
			    <g:else><importer:displayCell cell="${cell}"/></g:else>
			</td>
		    </g:each>
		</tr>
		</g:each>

	  <% }  %> <!-- end of JSP if-->
	  </g:each>
    </table><commit_msg>- all possible properties are shown in the select boxes (allfieldtypes=true)<commit_after><%@ page import="org.dbnp.gdt.GdtService" %>
<%
	/**
	 * Properties template which shows entities and allows to assign properties to columns
	 *
	 * @author <NAME>
	 * @since 20100210
	 * @package importer
	 *
	 * Revision information: 
	 * $Rev$
	 * $Author$
	 * $Date$
	 */
%>
<script type="text/javascript">

// for each select field on the page
$(document).ready(function() {

$('select[name^=columnproperty.index.]').each ( function() {

  $(this).bind('change', function(e) {
      //console.log($(this).val())      
      var selection = $(this)

      $('select[name^=columnproperty.index.] option:selected').each ( function() {
        var selector = $(this)
        
        if (selection.attr('id') != selector.parent().attr('id') && (selection.val()!="dontimport"))
          if ($(this).val() == selection.val()) {
            selection.val($('option:first', selection).val());

            alert("Property is already set for an other column, please choose a different property.")
            return false
          }
      });      
   
  });
 
});

$('#clearselect').click(function() {

  // for each select field on the page
  $("select").each( function(){
    // set its value to its first option
    $(this).val($('option:first', this).val());
  });

});


});
</script>
<!-- saveproperties action was defined in the form --> 
    <table>
	  <g:each var="stdentity" in ="${GdtService.cachedEntities}">
	      <% if (importer_selectedentities.any { it.name.toLowerCase() == stdentity.entity.toLowerCase() } && stdentity.entity!="") { %>
            
	      <tr><td colspan="3"><h4>${stdentity.name}</h4></td></tr>
		<tr>
            <td class="header" width="25px"><input id="clearselect" type="button" value="clear" name="clearselect"></td>
            <g:each var="selentity" in="${importer_selectedentities}">
              <g:if test="${selentity.name.toLowerCase()==stdentity.entity.toLowerCase()}">
			    <td class="header" width="200px">
				<b>${importer_header[selentity.columnindex.toInteger()].name}</b>
                  <importer:propertyChooser name="columnproperty" mappingcolumn="${importer_header[selentity.columnindex.toInteger()]}" matchvalue="${importer_header[selentity.columnindex.toInteger()].name}" template_id="${importer_template_id}" allfieldtypes="true"/>
			    </td>			    		
              </g:if>
            </g:each>
		</tr>

        <g:each var="row" in="${session.importer_datamatrix}">
		<tr>
                  <td class="datamatrix">                    
                  </td>
		    <g:each var="cell" in="${row}">
			<td class="datamatrix">
			    <g:if test="${cell.toString()==''}">.</g:if>
			    <g:else><importer:displayCell cell="${cell}"/></g:else>
			</td>
		    </g:each>
		</tr>
		</g:each>

	  <% }  %> <!-- end of JSP if-->
	  </g:each>
    </table>
{'fraction_non_alphanumeric': 0.19795635607897472, 'fraction_numerical': 0.005542085209560097, 'mean_word_length': 2.8551401869158877, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 99, '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': '529579', 'n_tokens_mistral': 1908, 'n_tokens_neox': 1771, 'n_words': 341}