<commit_before><%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>

<style type="text/css">
    div#queryResultsDiv{height:400px; overflow:scroll;}
</style>

<!--Search Results-->
<s:div theme="xhtml">
    <h2>Query Results for: 
        <s:if test="query != null && query.name != null && query.name.length() > 0">
            <s:property value="query.name" />
        </s:if>
        <s:else>
            Unsaved Query
        </s:else>        
    </h2>

    <div class="tableheader" style="white-space: nowrap; position: relative; width: 25em;">
        <div style="float: left; position: relative; width: 100px; margin-top: 0.3em;">
            <s:if test='%{query.resultType.value.equals("genomic")}'></s:if>
            <s:else>
    	        <label>Results per Page:</label>
    	        <s:select name="pageSize" list="{'10', '20', '50', '100'}" />
    	        <s:a href="#" onclick="submitForm('updateResultsPerPage')">
    	            <span class="btn_img">Apply</span>
    	        </s:a>
            </s:else>
        </div>
        <div class="tabhelp" style="white-space:nowrap; position: relative; margin-top: 0.4em; margin-right: 0.5em;"><a href="javascript:openHelpWindowWithNavigation('query_results_help')" class="help">
   &nbsp;</a>
        </div>
    </div>

    <div id="queryResultsDiv" >
        <s:if test='%{query.resultType.value.equals("genomic")}'>
        <table class="data">
            <s:if test='%{query.orientation.value.equals("subjectsAsColumns")}'>
                <tr>
                    <td />
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td />
                    </s:if>
                    <th>Subject ID</th>
                    <s:iterator value="genomicDataQueryResult.columnCollection">
                        <td><b><s:property value="sampleAcquisition.assignment.identifier" /></b></td>
                    </s:iterator>
                </tr>
                <tr>
                    <td />
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td />
                    </s:if>
                    <th>Sample ID</th>
                    <s:iterator value="genomicDataQueryResult.columnCollection">
                        <td><b><s:property value="sampleAcquisition.sample.name" /></b></td>
                    </s:iterator>
                </tr>
                <tr />
                <tr>
                    <th>Gene Name</th>
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <th>Reporter ID</th>
                    </s:if>
                </tr>
                <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                    <s:if test="#status.odd == true">
                        <tr class="odd">
                    </s:if>
                    <s:else>
                        <tr class="even">
                    </s:else>
                    <td><a href="${reporter.geneSymbolsCgapUrl}" target="cai2_CGAP" title="Click to find this Gene Symbol in the Cancer Genome Anatomy Project (CGAP)">
                        <b><s:property value="reporter.geneSymbols" /></b>
                    </a></td>
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td><b><s:property value="reporter.name" /></b></td>
                    </s:if>
                    <td /><s:iterator value="values">
                        <td><s:property value="value" /></td>
                    </s:iterator>
                </s:iterator>
            </s:if>
            <s:else>
                <tr>
                    <td/><td/>
                    <th>Gene Name</th>
                    <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                        <td><a href="${reporter.geneSymbolsCgapUrl}" target="cai2_CGAP" title="Click to find this Gene Symbol in the Cancer Genome Anatomy Project (CGAP)">
                            <b><s:property value="reporter.geneSymbols" /></b>
                        </a></td>
                    </s:iterator>
                </tr>
                <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                    <tr>
                        <td/><td/>
                        <th>Reporter ID</th>
                        <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                            <td><b><s:property value="reporter.name" /></b></td>
                        </s:iterator>
                    </tr>
                </s:if>
                <tr>
                    <th>Subject ID</th>
                    <th>Sample ID</th>
                </tr>
                <s:iterator value="genomicDataQueryResult.columnCollection" status="status">
                    <s:if test="#status.odd == true">
                        <tr class="odd">
                    </s:if>
                    <s:else>
                        <tr class="even">
                    </s:else>
                    <td><b><s:property value="sampleAcquisition.assignment.identifier" /></b></td>
                    <td><b><s:property value="sampleAcquisition.sample.name" /></b></td>
                    <td/>
                    <s:iterator value="values">
                        <td><s:property value="value" /></td>
                    </s:iterator>
                    </tr>
                </s:iterator>
            </s:else>
        </table>    
        <br>
            <div class="exportlinks">
				Export options:
				<s:a href="#" onclick="submitForm('exportGenomicResults')">
				<span class="export csv">CSV</span>
				</s:a>
			</div>
        </s:if>
        <s:else>
            <s:set name="pageSizeVar" id="pageSizeVar" value="%{queryResult.pageSize}" />
            <display:table name="queryResult.rows" uid="queryResultRows" id="queryResultRows" pagesize="${pageSizeVar}"
                sort="list" class="data" requestURI="manageQuery.action#" export="true">
                <display:setProperty name="paging.banner.placement" value="both" />
                <display:setProperty name="export.excel" value="false" />
                <display:setProperty name="export.xml" value="false" />
                <display:setProperty name="export.csv.filename" value="StudySearchResults.csv" />
                <display:setProperty name="export.csv.include_header" value="true" />
                <display:column 
                    title="Select <br> <font style='font-size:9px;text-decoration:underline;cursor:pointer;'>
                    <s:a href='#' cssStyle='text-decoration: underline;' onclick='selectAll()'> All
                    </s:a> | <s:a href='#' onclick='selectNone()'>None</s:a> </font>" 
                    media="html"
                    sortable="false">
                    <s:if test="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imagingRow}">
                        <s:checkbox theme="simple" name="queryResult.rows[%{#attr.queryResultRows_rowNum - 1}].checkedRow"/>
                    </s:if>
                </display:column>
                <s:if test="queryResult.hasSubjects">
                    <display:column title="Subject Identifier" sortable="true">
                        <s:property
                            value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).subjectAssignment.identifier}" />
                    </display:column>
                </s:if>
                <s:if test="queryResult.hasImageSeries">
                    <display:column title="Image Series Identifier" sortable="true">
                        <s:if test="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imageSeries != null}">
                            <s:property
                                value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imageSeries.identifier}" />
                            <a
                                href='<s:property value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).nciaLink}" escape="false"/>'
                                target="_">View in NBIA</a>
                        </s:if>
                    </display:column>
                </s:if>

                <s:iterator value="queryResult.headers" status="status" id="column">
                    <s:set id="curValue" name="curValue" value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).values.get(#status.count - 1)}" />
                        <s:if test="#curValue.dateType">
                            <s:set id="dateValue" name="dateValue" value="#curValue.dateValue" />
                            <display:column title="${column}" sortable="true" decorator="gov.nih.nci.caintegrator2.application.query.DateFormatColumnDecorator" >
                                ${dateValue}
                            </display:column>
                        </s:if>
                        <s:else>
                            <display:column title="${column}" sortable="true" >
                                ${curValue}
                            </display:column>
                        </s:else>
                </s:iterator>
            </display:table>

        </s:else>
    </div>
    <!--Buttons-->
    <s:if test="queryResult.numberOfRows > 0">
    <div class="actionsrow">
    <del class="btnwrapper">
    <ul class="btnrow">
        <s:if test='%{query.resultType.value.equals("genomic")}'>
            <li><s:a href="#" cssClass="btn" onclick="submitForm('exportGenomicResults')">
                <span class="btn_img"><span class="add">Export To CSV</span></span>
            </s:a></li>
        </s:if>
        <s:else>
            <li><s:a href="#" cssClass="btn" onclick="submitForm('exportGenomicResults')"
                onclick="openExportLink(); return false;">
                <span class="btn_img">Export To CSV</span>
            </s:a></li>
        </s:else>
        <s:if test="queryForm.hasImageDataSources()">
            <li><s:a href="#" cssClass="btn" 
                onclick="document.manageQueryForm.target='_blank';document.manageQueryForm.selectedAction.value='forwardToNcia';document.manageQueryForm.submit();document.manageQueryForm.target='_self'">
                <span class="btn_img">Forward To NBIA</span>
            </s:a></li>
            <li><s:a href="#" cssClass="btn" 
                onclick="document.manageQueryForm.target='_blank';document.manageQueryForm.selectedAction.value='retrieveDicomImages';document.manageQueryForm.submit();document.manageQueryForm.target='_self'">
                <span class="btn_img">Retrieve Dicom Images</span>
            </s:a></li>
        </s:if>
    </ul>
    </del>
    </div>
    </s:if>

    <!--/Buttons-->
</s:div>
<!--/Search Results-->


<div class="clear"><br />
</div>
<commit_msg>Item # 22943 - Fix a bug in hiding the "Export" button for genomics result type (Merge from release 1.0), reviewed by TJ.<commit_after><%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>

<style type="text/css">
    div#queryResultsDiv{height:400px; overflow:scroll;}
</style>

<!--Search Results-->
<s:div theme="xhtml">
    <h2>Query Results for: 
        <s:if test="query != null && query.name != null && query.name.length() > 0">
            <s:property value="query.name" />
        </s:if>
        <s:else>
            Unsaved Query
        </s:else>        
    </h2>

    <div class="tableheader" style="white-space: nowrap; position: relative; width: 25em;">
        <div style="float: left; position: relative; width: 100px; margin-top: 0.3em;">
            <s:if test='%{query.resultType.value.equals("genomic")}'></s:if>
            <s:else>
                <label>Results per Page:</label>
                <s:select name="pageSize" list="{'10', '20', '50', '100'}" />
                <s:a href="#" onclick="submitForm('updateResultsPerPage')">
                    <span class="btn_img">Apply</span>
                </s:a>
            </s:else>
        </div>
        <div class="tabhelp" style="white-space:nowrap; position: relative; margin-top: 0.4em; margin-right: 0.5em;"><a href="javascript:openHelpWindowWithNavigation('query_results_help')" class="help">
   &nbsp;</a>
        </div>
    </div>

    <div id="queryResultsDiv" >
        <s:if test='%{query.resultType.value.equals("genomic")}'>
        <table class="data">
            <s:if test='%{query.orientation.value.equals("subjectsAsColumns")}'>
                <tr>
                    <td />
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td />
                    </s:if>
                    <th>Subject ID</th>
                    <s:iterator value="genomicDataQueryResult.columnCollection">
                        <td><b><s:property value="sampleAcquisition.assignment.identifier" /></b></td>
                    </s:iterator>
                </tr>
                <tr>
                    <td />
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td />
                    </s:if>
                    <th>Sample ID</th>
                    <s:iterator value="genomicDataQueryResult.columnCollection">
                        <td><b><s:property value="sampleAcquisition.sample.name" /></b></td>
                    </s:iterator>
                </tr>
                <tr />
                <tr>
                    <th>Gene Name</th>
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <th>Reporter ID</th>
                    </s:if>
                </tr>
                <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                    <s:if test="#status.odd == true">
                        <tr class="odd">
                    </s:if>
                    <s:else>
                        <tr class="even">
                    </s:else>
                    <td><a href="${reporter.geneSymbolsCgapUrl}" target="cai2_CGAP" title="Click to find this Gene Symbol in the Cancer Genome Anatomy Project (CGAP)">
                        <b><s:property value="reporter.geneSymbols" /></b>
                    </a></td>
                    <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                        <td><b><s:property value="reporter.name" /></b></td>
                    </s:if>
                    <td /><s:iterator value="values">
                        <td><s:property value="value" /></td>
                    </s:iterator>
                </s:iterator>
            </s:if>
            <s:else>
                <tr>
                    <td/><td/>
                    <th>Gene Name</th>
                    <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                        <td><a href="${reporter.geneSymbolsCgapUrl}" target="cai2_CGAP" title="Click to find this Gene Symbol in the Cancer Genome Anatomy Project (CGAP)">
                            <b><s:property value="reporter.geneSymbols" /></b>
                        </a></td>
                    </s:iterator>
                </tr>
                <s:if test='%{queryForm.resultConfiguration.reporterType.equals("geneExpressionProbeSet")}'>
                    <tr>
                        <td/><td/>
                        <th>Reporter ID</th>
                        <s:iterator value="genomicDataQueryResult.rowCollection" status="status">
                            <td><b><s:property value="reporter.name" /></b></td>
                        </s:iterator>
                    </tr>
                </s:if>
                <tr>
                    <th>Subject ID</th>
                    <th>Sample ID</th>
                </tr>
                <s:iterator value="genomicDataQueryResult.columnCollection" status="status">
                    <s:if test="#status.odd == true">
                        <tr class="odd">
                    </s:if>
                    <s:else>
                        <tr class="even">
                    </s:else>
                    <td><b><s:property value="sampleAcquisition.assignment.identifier" /></b></td>
                    <td><b><s:property value="sampleAcquisition.sample.name" /></b></td>
                    <td/>
                    <s:iterator value="values">
                        <td><s:property value="value" /></td>
                    </s:iterator>
                    </tr>
                </s:iterator>
            </s:else>
        </table>    
        <br>
            <s:if test="!genomicDataQueryResult.columnCollection.isEmpty() &&
                    !genomicDataQueryResult.rowCollection.isEmpty()">
                <div class="exportlinks">
                    Export options:
                    <s:a href="#" onclick="submitForm('exportGenomicResults')">
                        <span class="export csv">CSV</span>
                    </s:a>
                </div>
            </s:if>
        </s:if>
        <s:else>
            <s:set name="pageSizeVar" id="pageSizeVar" value="%{queryResult.pageSize}" />
            <display:table name="queryResult.rows" uid="queryResultRows" id="queryResultRows" pagesize="${pageSizeVar}"
                sort="list" class="data" requestURI="manageQuery.action#" export="true">
                <display:setProperty name="paging.banner.placement" value="both" />
                <display:setProperty name="export.excel" value="false" />
                <display:setProperty name="export.xml" value="false" />
                <display:setProperty name="export.csv.filename" value="StudySearchResults.csv" />
                <display:setProperty name="export.csv.include_header" value="true" />
                <display:column 
                    title="Select <br> <font style='font-size:9px;text-decoration:underline;cursor:pointer;'>
                    <s:a href='#' cssStyle='text-decoration: underline;' onclick='selectAll()'> All
                    </s:a> | <s:a href='#' onclick='selectNone()'>None</s:a> </font>" 
                    media="html"
                    sortable="false">
                    <s:if test="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imagingRow}">
                        <s:checkbox theme="simple" name="queryResult.rows[%{#attr.queryResultRows_rowNum - 1}].checkedRow"/>
                    </s:if>
                </display:column>
                <s:if test="queryResult.hasSubjects">
                    <display:column title="Subject Identifier" sortable="true">
                        <s:property
                            value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).subjectAssignment.identifier}" />
                    </display:column>
                </s:if>
                <s:if test="queryResult.hasImageSeries">
                    <display:column title="Image Series Identifier" sortable="true">
                        <s:if test="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imageSeries != null}">
                            <s:property
                                value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).imageSeries.identifier}" />
                            <a
                                href='<s:property value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).nciaLink}" escape="false"/>'
                                target="_">View in NBIA</a>
                        </s:if>
                    </display:column>
                </s:if>

                <s:iterator value="queryResult.headers" status="status" id="column">
                    <s:set id="curValue" name="curValue" value="%{queryResult.rows.get(#attr.queryResultRows_rowNum - 1).values.get(#status.count - 1)}" />
                        <s:if test="#curValue.dateType">
                            <s:set id="dateValue" name="dateValue" value="#curValue.dateValue" />
                            <display:column title="${column}" sortable="true" decorator="gov.nih.nci.caintegrator2.application.query.DateFormatColumnDecorator" >
                                ${dateValue}
                            </display:column>
                        </s:if>
                        <s:else>
                            <display:column title="${column}" sortable="true" >
                                ${curValue}
                            </display:column>
                        </s:else>
                </s:iterator>
            </display:table>

        </s:else>
    </div>
    <!--Buttons-->
    <s:if test="!queryResult.rows.isEmpty() ||
         (!genomicDataQueryResult.columnCollection.isEmpty() &&
          !genomicDataQueryResult.rowCollection.isEmpty())">
    <div class="actionsrow">
    <del class="btnwrapper">
    <ul class="btnrow">
        <s:if test='%{query.resultType.value.equals("genomic")}'>
            <li><s:a href="#" cssClass="btn" onclick="submitForm('exportGenomicResults')">
                <span class="btn_img"><span class="add">Export To CSV</span></span>
            </s:a></li>
        </s:if>
        <s:else>
            <li><s:a href="#" cssClass="btn" onclick="submitForm('exportGenomicResults')"
                onclick="openExportLink(); return false;">
                <span class="btn_img">Export To CSV</span>
            </s:a></li>
        </s:else>
        <s:if test="queryForm.hasImageDataSources()">
            <li><s:a href="#" cssClass="btn" 
                onclick="document.manageQueryForm.target='_blank';document.manageQueryForm.selectedAction.value='forwardToNcia';document.manageQueryForm.submit();document.manageQueryForm.target='_self'">
                <span class="btn_img">Forward To NBIA</span>
            </s:a></li>
            <li><s:a href="#" cssClass="btn" 
                onclick="document.manageQueryForm.target='_blank';document.manageQueryForm.selectedAction.value='retrieveDicomImages';document.manageQueryForm.submit();document.manageQueryForm.target='_self'">
                <span class="btn_img">Retrieve Dicom Images</span>
            </s:a></li>
        </s:if>
    </ul>
    </del>
    </div>
    </s:if>

    <!--/Buttons-->
</s:div>
<!--/Search Results-->


<div class="clear"><br />
</div>

{'fraction_non_alphanumeric': 0.15369961466857168, 'fraction_numerical': 0.0036368359527211326, 'mean_word_length': 1.5432724069588197, 'pattern_counts': {'":': 0, '<': 551, '<?xml version=': 0, '>': 554, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3019723', 'n_tokens_mistral': 6668, 'n_tokens_neox': 6116, 'n_words': 967}