<commit_before><%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im" %>
<%@ taglib uri="/WEB-INF/functions.tld" prefix="imf" %>

<!-- queryBuilderConstraint.jsp -->

<script type="text/javascript">
  var addedConstraint = 0;
</script>
<div id="constraint" style="display:none">
    <html:form action="/queryBuilderConstraintAction">
    <c:choose>
      <c:when test="${!empty dec.path.pathString}">
        <html:hidden property="path" value="${dec.path.pathString}"/>
      </c:when>
      <c:otherwise>
        <html:hidden property="path" value="${dec.path}"/>
      </c:otherwise>
    </c:choose>
    <html:hidden property="editingConstraintCode" value="${dec.code}"/>

<c:if test="${(EDITING_TEMPLATE != null || NEW_TEMPLATE != null) && editingTemplateConstraint}">
  <c:set var="constraint" value="${dec}" scope="request"/>
  <tiles:insert page="constraintSettings.jsp"/>
</c:if>

<%--to prevent submit twice --%>
<html:hidden
property="<%=org.apache.struts.taglib.html.Constants.TOKEN_KEY%>"
value="<bean:write name='<%=org.apache.struts.Globals.TRANSACTION_TOKEN_KEY%>'/>"/>

<c:if test="${!editingTemplateConstraint}">
  <div class="heading constraintTitle">
    <fmt:message key="query.constrain"/><%--Constraint--%>
  </div>
</c:if>

<c:if test="${!editingTemplateConstraint}">
<div class="body">
 <c:choose>
 <c:when  test="${empty joinStyleOnly}" >
  <h4><fmt:message key="query.constraintHeading"/></h4> <%--1. Choose a filter--%>
<br/>
<!--
   ATTRIBUTE OR LOOKUP CONSTRAINT
-->
  <c:if test="${dec.path.attribute || dec.lookup}">
  <FIELDSET class="constraintFieldset">
    <LEGEND>
    <a href="javascript:swapInputs('attribute');">
    <fmt:message key="query.filterValue" /><%--Filter query results on this field having a specific value.--%>
    </a>
    </LEGEND>
    <!--
       ATTRIBUTE CONSTRAINT
    -->
    <c:if test="${dec.path.attribute}">
      <!-- field name -->
      <c:choose>
        <c:when test="${empty dec.path.fieldName}">
          <span class="type"> <c:out value="${imf:formatPath(dec.path.path, WEBCONFIG)}" /> </span>
        </c:when>
        <c:otherwise>
          <span class="attributeField">&nbsp;<c:out value="${imf:formatPath(dec.path.path, WEBCONFIG)}" />&nbsp;</span>
        </c:otherwise>
      </c:choose>
      <c:choose>
        <c:when test="${dec.path.collection}">
          <fmt:message key="query.collection">
            <%--collection--%>
            <fmt:param value="${dec.path.type}" />
          </fmt:message>
        </c:when>
      </c:choose>
    </c:if>

    <!-- input or radio buttons -->
     <c:set var="selectedValue" value="" />
       <c:if test="${dec.valueSelected}"> <%--the constraint is not a bag or a nullconstraint --%>
         <c:set var="selectedValue" value="${dec.selectedValue}" />
       </c:if>

        <table cellspacing="2" cellpadding="1" class="noborder">
          <tr>
            <td>
            <!--  constraint op -->
            <c:choose>
              <c:when test="${dec.boolean}">
                <!--  boolean does not have a separate op dropdown -->
                <html:hidden property="attributeOp" styleId="attribute1"
                  value="0" disabled="false" />
                  <input type="radio" name="attributeValue" id="attribute2" value="true"
                  <c:if test="${selectedValue == 'true'}">checked</c:if>/>
                  <label for="attribute2">
                    <fmt:message key="query.constraint.true" />
                  </label>
                  <input type="radio" name="attributeValue" id="attribute3" value="false"
                  <c:if test="${selectedValue == 'false'}">checked</c:if>/>
                  <label for="attribute2">
                    <fmt:message key="query.constraint.false" />
                  </label>
                  <c:choose>
                      <c:when test="${dec.path.type == 'Boolean'}">
                      <input type="radio" name="attributeValue" id="attribute4" value="NULL"
                      <c:if test="${selectedValue == 'NULL'}">checked</c:if>/>
                      <label for="attribute4">
                        <fmt:message key="query.constraint.null" />
                      </label>
                      </c:when>
                  </c:choose>
                <br/>
              </c:when>
              <c:otherwise>
                <!-- dropdown to select constraint op or label for lookup-->

                <c:choose>
                  <c:when test="${dec.path.attribute}">
                    <html:select property="attributeOp" styleId="attribute5"
                        onchange="onChangeAttributeOp();" style="float:left;">
                      <c:forEach items="${dec.validOps}" var="op">
                        <option value="${op.property}"
                          <c:if test="${!empty dec.selectedOp && dec.selectedOp.property == op.property}">selected</c:if>>
                          <im:displayableOpName opName="${op.label}" valueType="${op.property}" />
                        </option>
                      </c:forEach>
                    </html:select>&nbsp;</c:when>
                  <c:otherwise>
                   <html:hidden property="attributeOp" styleId="attribute5" value="${dec.lookupOp.property}" disabled="false" />
                   <fmt:message key="query.lookupConstraintLabel" /><%-- LOOKUP: --%>
                  </c:otherwise>
                 </c:choose>



              <!-- constraint value -->
              <c:if test="${!empty dec.possibleValues}">
                <c:set var="possibleValuesDisplay" value="display:none;"/>
                <c:if test="${dec.possibleValuesDisplayed}">
                  <c:set var="possibleValuesDisplay" value="display:inline;"/><commit_msg>When you add a constraint having as type a Boolean object you can set TRUE/FALSE (not 'has no value' anymore) or add a null constraint ('Has no value'/'Has a value')<commit_after><%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im" %>
<%@ taglib uri="/WEB-INF/functions.tld" prefix="imf" %>

<!-- queryBuilderConstraint.jsp -->

<script type="text/javascript">
  var addedConstraint = 0;
</script>
<div id="constraint" style="display:none">
    <html:form action="/queryBuilderConstraintAction">
    <c:choose>
      <c:when test="${!empty dec.path.pathString}">
        <html:hidden property="path" value="${dec.path.pathString}"/>
      </c:when>
      <c:otherwise>
        <html:hidden property="path" value="${dec.path}"/>
      </c:otherwise>
    </c:choose>
    <html:hidden property="editingConstraintCode" value="${dec.code}"/>

<c:if test="${(EDITING_TEMPLATE != null || NEW_TEMPLATE != null) && editingTemplateConstraint}">
  <c:set var="constraint" value="${dec}" scope="request"/>
  <tiles:insert page="constraintSettings.jsp"/>
</c:if>

<%--to prevent submit twice --%>
<html:hidden
property="<%=org.apache.struts.taglib.html.Constants.TOKEN_KEY%>"
value="<bean:write name='<%=org.apache.struts.Globals.TRANSACTION_TOKEN_KEY%>'/>"/>

<c:if test="${!editingTemplateConstraint}">
  <div class="heading constraintTitle">
    <fmt:message key="query.constrain"/><%--Constraint--%>
  </div>
</c:if>

<c:if test="${!editingTemplateConstraint}">
<div class="body">
 <c:choose>
 <c:when  test="${empty joinStyleOnly}" >
  <h4><fmt:message key="query.constraintHeading"/></h4> <%--1. Choose a filter--%>
<br/>
<!--
   ATTRIBUTE OR LOOKUP CONSTRAINT
-->
  <c:if test="${dec.path.attribute || dec.lookup}">
  <FIELDSET class="constraintFieldset">
    <LEGEND>
    <a href="javascript:swapInputs('attribute');">
    <fmt:message key="query.filterValue" /><%--Filter query results on this field having a specific value.--%>
    </a>
    </LEGEND>
    <!--
       ATTRIBUTE CONSTRAINT
    -->
    <c:if test="${dec.path.attribute}">
      <!-- field name -->
      <c:choose>
        <c:when test="${empty dec.path.fieldName}">
          <span class="type"> <c:out value="${imf:formatPath(dec.path.path, WEBCONFIG)}" /> </span>
        </c:when>
        <c:otherwise>
          <span class="attributeField">&nbsp;<c:out value="${imf:formatPath(dec.path.path, WEBCONFIG)}" />&nbsp;</span>
        </c:otherwise>
      </c:choose>
      <c:choose>
        <c:when test="${dec.path.collection}">
          <fmt:message key="query.collection">
            <%--collection--%>
            <fmt:param value="${dec.path.type}" />
          </fmt:message>
        </c:when>
      </c:choose>
    </c:if>

    <!-- input or radio buttons -->
     <c:set var="selectedValue" value="" />
       <c:if test="${dec.valueSelected}"> <%--the constraint is not a bag or a nullconstraint --%>
         <c:set var="selectedValue" value="${dec.selectedValue}" />
       </c:if>

        <table cellspacing="2" cellpadding="1" class="noborder">
          <tr>
            <td>
            <!--  constraint op -->
            <c:choose>
              <c:when test="${dec.boolean}">
                <!--  boolean does not have a separate op dropdown -->
                <html:hidden property="attributeOp" styleId="attribute1"
                  value="0" disabled="false" />
                  <input type="radio" name="attributeValue" id="attribute2" value="true"
                  <c:if test="${selectedValue == 'true'}">checked</c:if>/>
                  <label for="attribute2">
                    <fmt:message key="query.constraint.true" />
                  </label>
                  <input type="radio" name="attributeValue" id="attribute3" value="false"
                  <c:if test="${selectedValue == 'false'}">checked</c:if>/>
                  <label for="attribute2">
                    <fmt:message key="query.constraint.false" />
                  </label>
                <br/>
              </c:when>
              <c:otherwise>
                <!-- dropdown to select constraint op or label for lookup-->

                <c:choose>
                  <c:when test="${dec.path.attribute}">
                    <html:select property="attributeOp" styleId="attribute5"
                        onchange="onChangeAttributeOp();" style="float:left;">
                      <c:forEach items="${dec.validOps}" var="op">
                        <option value="${op.property}"
                          <c:if test="${!empty dec.selectedOp && dec.selectedOp.property == op.property}">selected</c:if>>
                          <im:displayableOpName opName="${op.label}" valueType="${op.property}" />
                        </option>
                      </c:forEach>
                    </html:select>&nbsp;</c:when>
                  <c:otherwise>
                   <html:hidden property="attributeOp" styleId="attribute5" value="${dec.lookupOp.property}" disabled="false" />
                   <fmt:message key="query.lookupConstraintLabel" /><%-- LOOKUP: --%>
                  </c:otherwise>
                 </c:choose>



              <!-- constraint value -->
              <c:if test="${!empty dec.possibleValues}">
                <c:set var="possibleValuesDisplay" value="display:none;"/>
                <c:if test="${dec.possibleValuesDisplayed}">
                  <c:set var="possibleValuesDisplay" value="display:inline;"/>
{'fraction_non_alphanumeric': 0.1907715207144629, 'fraction_numerical': 0.002811543868353593, 'mean_word_length': 2.355715871254162, 'pattern_counts': {'":': 0, '<': 279, '<?xml version=': 0, '>': 279, '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': '828585', 'n_tokens_mistral': 3764, 'n_tokens_neox': 3568, 'n_words': 643}