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

<tiles:importAttribute name="expr" ignore="false"/>
<tiles:importAttribute name="objectClass" ignore="false"/>
<im:eval evalExpression="interMineObject.${expr}" evalVariable="outVal"/>
<c:choose>
  <c:when test="${empty outVal}">
    &nbsp;
  </c:when>
  <c:otherwise>
    <c:choose>
      <c:when test="${!empty interMineObject.sequence}">
          <im:value>${outVal}</im:value>&nbsp;<html:link action="sequenceExporter?object=${interMineObject.id}" target="_new"><html:img styleClass="fasta" src="model/images/fasta.gif" title="FASTA" />
        </html:link>
        <span style="margin-left: 5px;"><a href='javascript: sendSequenceToGalaxy();'><html:img styleClass="galaxy" src="images/formats/galaxy.gif" title="Galaxy" /></a></span>
      </c:when>
      <c:otherwise>
        <im:value>${outVal}</im:value>
      </c:otherwise>
    </c:choose>
  </c:otherwise>
</c:choose>

<script type="text/javascript">
    var s = $SERVICE; // globally available in the webapp.
    var openWindowWithPost = function(uri, name, params) {
        var name = name + new Date().getTime();
        // var form = jQuery('<form method="POST" action="' + uri + '" target="' + name + '"></form>');

        var form = jQuery('<form>', {
            'method': 'POST',
            'action': uri,
            'target': name
        })

        jQuery.each(params, function(v, k) {
            var input = jQuery('<input name="' + v + '" + type="hidden">');
            form.append(input);
            input.val(k)
            // console.log(k)
        });
        form.appendTo('body');
        var w = window.open("someNonExistantPathToSomeWhere", name);
        form.submit();
        form.remove();
    };

    function sendSequenceToGalaxy() {
        jQuery.when(s.query({select: ["id"], from: "${objectClass}", where: {id: ${interMineObject.id}}}), s.findById("${objectClass}", ${interMineObject.id}))
        .done(function(q, feature) {
           var dataForGalaxy = {
             tool_id: 'flymine',
             organism: feature.organism.name,
             URL: q.getFASTAURI(),
             URL_method: 'post',
             name: "Sequence for " + feature.symbol,
             data_type: 'fasta',
             info: "FASTA sequence for the " + feature.organism.shortName + " feature " + feature.symbol,
           };
           openWindowWithPost("http://main.g2.bx.psu.edu/tool_runner", "Galaxy", dataForGalaxy);
          });
    }
</script><commit_msg>missed commit for #136<commit_after><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>

<tiles:importAttribute name="expr" ignore="false"/>
<im:eval evalExpression="interMineObject.${expr}" evalVariable="outVal"/>
<c:choose>
  <c:when test="${empty outVal}">
    &nbsp;
  </c:when>
  <c:otherwise>
    <c:choose>
      <c:when test="${!empty interMineObject.sequence}">
          <im:value>${outVal}</im:value>&nbsp;<html:link action="sequenceExporter?object=${interMineObject.id}" target="_new"><html:img styleClass="fasta" src="model/images/fasta.gif" title="FASTA" />
        </html:link>
      </c:when>
      <c:otherwise>
        <im:value>${outVal}</im:value>
      </c:otherwise>
    </c:choose>
  </c:otherwise>
</c:choose>
{'fraction_non_alphanumeric': 0.20110650069156294, 'fraction_numerical': 0.0013831258644536654, 'mean_word_length': 3.1755196304849886, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, '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': '2770315', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1202, 'n_words': 200}