<commit_before><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>

<!-- objectDetails.jsp -->
<html:xhtml/>

<link rel="stylesheet" href="css/resultstables.css" type="text/css" />

<script type="text/javascript">
<!--//<![CDATA[
  var modifyDetailsURL = '<html:rewrite action="/modifyDetails"/>';
  var detailsType = 'object';
//]]>-->
</script>
<script type="text/javascript" src="js/inlinetemplate.js">
  var modifyDetailsURL = '<html:rewrite action="/modifyDetails"/>';
</script>

<%-- figure out whether we should show templates or not --%>
<c:set var="showTemplatesFlag" value="false"/>


<tiles:get name="objectTrail.tile"/>
<c:if test="${!empty lookupResults}">
   <tiles:insert name="bagRunnerMsg.tile">
      <tiles:put name="lookupResults" beanName="lookupResults" />
    </tiles:insert>
 <%-- lookupReport --%>
</c:if>

<c:if test="${!empty object}">

  <table width="100%">
    <tr>
      <td valign="top" width="30%">


          <div class="heading">Summary for selected
          <c:forEach items="${object.clds}" var="cld">
            ${cld.unqualifiedName}
          </c:forEach>
          </div>


        <im:body id="summary">
          <table cellpadding="5" border="0" cellspacing="0" class="objSummary">

            <%-- Show the summary fields as configured in webconfig.xml --%>
            <c:forEach items="${object.fieldExprs}" var="expr">
              <c:choose>
              <c:when test="${object.fieldConfigMap[expr].showInSummary && ! empty object.fieldConfigMap[expr].displayer}">
              <tr>
                <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                </td>
                <td nowrap>
                  <c:set var="interMineObject" value="${object.object}" scope="request"/>
                  <b> <span class="value">
                      <tiles:insert page="${object.fieldConfigMap[expr].displayer}">
                        <tiles:put name="expr" value="${expr}" />
                      </tiles:insert>
                  </span> </b>
              	</td>
              </tr>
              </c:when>
              <c:when test="${object.fieldConfigMap[expr].showInSummary}">
                <im:eval evalExpression="object.object.${expr}" evalVariable="outVal"/>
                <tr>
                  <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${expr}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:choose>
                      <c:when test="${empty outVal}">
                        &nbsp;
                      </c:when>
                      <c:otherwise>
                        <b><im:value>${outVal}</im:value></b>
                      </c:otherwise>
                    </c:choose>
                  </td>
                </tr>
              </c:when>
              </c:choose>
            </c:forEach>

            <%-- Show all other fields --%>
            <c:forEach items="${object.attributes}" var="entry">
              <c:if test="${! object.fieldConfigMap[entry.key].showInSummary && !object.fieldConfigMap[entry.key].sectionOnRight}">
                <tr>
                  <td>
                    <span class="attributeField">${entry.key}</span>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${entry.key}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:set var="maxLength" value="60"/>
                    <c:choose>
                      <c:when test="${entry.value.class.name ==
                                    'java.lang.String' && fn:length(entry.value) > maxLength
                                    && ! object.fieldConfigMap[entry.key].doNotTruncate}
                                    && ! fn:startsWith(fn:trim(object), 'http://')">
                        <im:value>
                          ${fn:substring(entry.value, 0, maxLength/2)}
                        </im:value>
                        <span class="value" style="white-space:nowrap">
                          ${fn:substring(entry.value, maxLength/2, maxLength)}
                          <html:link action="/getAttributeAsFile?object=${object.id}&amp;field=${entry.key}">
                            <fmt:message key="objectDetails.viewall"/>
                          </html:link>
                        </span>
                      </c:when>
                      <c:otherwise>
                        <im:value>${entry.value}</im:value>
                      </c:otherwise>
                    </c:choose>
                  </td><commit_msg>Fixed bug when truncating fields<commit_after><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>

<!-- objectDetails.jsp -->
<html:xhtml/>

<link rel="stylesheet" href="css/resultstables.css" type="text/css" />

<script type="text/javascript">
<!--//<![CDATA[
  var modifyDetailsURL = '<html:rewrite action="/modifyDetails"/>';
  var detailsType = 'object';
//]]>-->
</script>
<script type="text/javascript" src="js/inlinetemplate.js">
  var modifyDetailsURL = '<html:rewrite action="/modifyDetails"/>';
</script>

<%-- figure out whether we should show templates or not --%>
<c:set var="showTemplatesFlag" value="false"/>


<tiles:get name="objectTrail.tile"/>
<c:if test="${!empty lookupResults}">
   <tiles:insert name="bagRunnerMsg.tile">
      <tiles:put name="lookupResults" beanName="lookupResults" />
    </tiles:insert>
 <%-- lookupReport --%>
</c:if>

<c:if test="${!empty object}">

  <table width="100%">
    <tr>
      <td valign="top" width="30%">


          <div class="heading">Summary for selected
          <c:forEach items="${object.clds}" var="cld">
            ${cld.unqualifiedName}
          </c:forEach>
          </div>


        <im:body id="summary">
          <table cellpadding="5" border="0" cellspacing="0" class="objSummary">

            <%-- Show the summary fields as configured in webconfig.xml --%>
            <c:forEach items="${object.fieldExprs}" var="expr">
              <c:choose>
              <c:when test="${object.fieldConfigMap[expr].showInSummary && ! empty object.fieldConfigMap[expr].displayer}">
              <tr>
                <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                </td>
                <td nowrap>
                  <c:set var="interMineObject" value="${object.object}" scope="request"/>
                  <b> <span class="value">
                      <tiles:insert page="${object.fieldConfigMap[expr].displayer}">
                        <tiles:put name="expr" value="${expr}" />
                      </tiles:insert>
                  </span> </b>
              	</td>
              </tr>
              </c:when>
              <c:when test="${object.fieldConfigMap[expr].showInSummary}">
                <im:eval evalExpression="object.object.${expr}" evalVariable="outVal"/>
                <tr>
                  <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${expr}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:choose>
                      <c:when test="${empty outVal}">
                        &nbsp;
                      </c:when>
                      <c:otherwise>
                        <b><im:value>${outVal}</im:value></b>
                      </c:otherwise>
                    </c:choose>
                  </td>
                </tr>
              </c:when>
              </c:choose>
            </c:forEach>

            <%-- Show all other fields --%>
            <c:forEach items="${object.attributes}" var="entry">
              <c:if test="${! object.fieldConfigMap[entry.key].showInSummary && !object.fieldConfigMap[entry.key].sectionOnRight}">
                <tr>
                  <td>
                    <span class="attributeField">${entry.key}</span>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${entry.key}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:set var="maxLength" value="60"/>
                    <c:choose>
                      <c:when test="${entry.value.class.name ==
                                    'java.lang.String' && fn:length(entry.value) > maxLength
                                    && ! object.fieldConfigMap[entry.key].doNotTruncate
                                    && ! fn:startsWith(fn:trim(object), 'http://')}">
                        <im:value>
                          ${fn:substring(entry.value, 0, maxLength/2)}
                        </im:value>
                        <span class="value" style="white-space:nowrap">
                          ${fn:substring(entry.value, maxLength/2, maxLength)}
                          <html:link action="/getAttributeAsFile?object=${object.id}&amp;field=${entry.key}">
                            <fmt:message key="objectDetails.viewall"/>
                          </html:link>
                        </span>
                      </c:when>
                      <c:otherwise>
                        <im:value>${entry.value}</im:value>
                      </c:otherwise>
                    </c:choose>
                  </td>
{'fraction_non_alphanumeric': 0.17360908826099622, 'fraction_numerical': 0.0025245169433925625, 'mean_word_length': 1.564102564102564, 'pattern_counts': {'":': 0, '<': 235, '<?xml version=': 0, '>': 237, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3311645', 'n_tokens_mistral': 3051, 'n_tokens_neox': 2856, 'n_words': 459}