<commit_before><%--
 - Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center.
 -
 - This library is distributed in the hope that it will be useful, but WITHOUT
 - ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
 - FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
 - is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
 - obligations to provide maintenance, support, updates, enhancements or
 - modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
 - liable to any party for direct, indirect, special, incidental or
 - consequential damages, including lost profits, arising out of the use of this
 - software and its documentation, even if Memorial Sloan-Kettering Cancer
 - Center has been advised of the possibility of such damage.
 --%>

<%--
 - This file is part of cBioPortal.
 -
 - cBioPortal is free software: you can redistribute it and/or modify
 - it under the terms of the GNU Affero General Public License as
 - published by the Free Software Foundation, either version 3 of the
 - License.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - GNU Affero General Public License for more details.
 -
 - You should have received a copy of the GNU Affero General Public License
 - along with this program.  If not, see <http://www.gnu.org/licenses/>.
--%>


<%@ include file="global/global_variables.jsp" %>
<jsp:include page="global/header.jsp" flush="true" />

<script type="text/javascript" src="js/src/modifyQuery.js?<%=GlobalProperties.getAppVersion()%>"></script>

<script>
window.appVersion = '<%=GlobalProperties.getAppVersion()%>';
    
window.historyType = 'memory';

window.maxTreeDepth = '<%=GlobalProperties.getMaxTreeDepth()%>';
window.skinExampleStudyQueries = '<%=GlobalProperties.getExampleStudyQueries().replace("\n","\\n")%>'.split("\n");

window.priorityStudies = {};

// global variables required for MutationMapper annotation column
window.showCivic = <%=GlobalProperties.showCivic()%>;
window.showHotspot = <%=GlobalProperties.showHotspot()%>;
window.showMyCancerGenome = <%=GlobalProperties.showMyCancerGenomeUrl()%>;
window.oncoKBApiUrl = '<%=GlobalProperties.getOncoKBPublicApiUrl()%>';
window.showOncoKB = window.oncoKBApiUrl ? true : false;

<%
List<String[]> priorityStudies = GlobalProperties.getPriorityStudies();
for (String[] group : priorityStudies) {
    if (group.length > 1) {
        out.println("window.priorityStudies['"+group[0]+"'] = ");
        out.println("[");
        int i = 1;
        while (i < group.length) {
            if (i >= 2) {
                out.println(",");
            }
            out.println("'"+group[i]+"'");
            i++;
        }
        out.println("];");
    }
}
%>


    // Set API root variable for cbioportal-frontend repo
    <%
String url = request.getRequestURL().toString();
String baseURL = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath();
baseURL = baseURL.replace("https://", "").replace("http://", "");
%>
__API_ROOT__ = '<%=baseURL%>';

window.loadReactApp({ defaultRoute: 'blank' });

window.onReactAppReady(function() {
    window.initModifyQueryComponent("modifyQueryButton", "querySelector");
});


</script>

<div id="reactRoot" class="hidden"></div>
    
<%@ page import="java.util.Map" %>
<%@ page import="org.codehaus.jackson.map.ObjectMapper" %>

<%
    // we have session service running AND this was a post, 
    // then modify URL to include session service id so bookmarking will work
    if (useSessionServiceBookmark && "POST".equals(request.getMethod())) {
%>
    <script>
        changeURLToSessionServiceURL(window.location.href, 
            window.location.pageTitle, 
            <%= new ObjectMapper().writeValueAsString(request.getParameterMap()) %>);
   </script>
<% } // end if isPost and we have session service running %><commit_msg>Default to frontend route results for results page<commit_after><%--
 - Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center.
 -
 - This library is distributed in the hope that it will be useful, but WITHOUT
 - ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
 - FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
 - is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
 - obligations to provide maintenance, support, updates, enhancements or
 - modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
 - liable to any party for direct, indirect, special, incidental or
 - consequential damages, including lost profits, arising out of the use of this
 - software and its documentation, even if Memorial Sloan-Kettering Cancer
 - Center has been advised of the possibility of such damage.
 --%>

<%--
 - This file is part of cBioPortal.
 -
 - cBioPortal is free software: you can redistribute it and/or modify
 - it under the terms of the GNU Affero General Public License as
 - published by the Free Software Foundation, either version 3 of the
 - License.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - GNU Affero General Public License for more details.
 -
 - You should have received a copy of the GNU Affero General Public License
 - along with this program.  If not, see <http://www.gnu.org/licenses/>.
--%>


<%@ include file="global/global_variables.jsp" %>
<jsp:include page="global/header.jsp" flush="true" />

<script type="text/javascript" src="js/src/modifyQuery.js?<%=GlobalProperties.getAppVersion()%>"></script>

<script>
window.appVersion = '<%=GlobalProperties.getAppVersion()%>';
    
window.historyType = 'memory';

window.maxTreeDepth = '<%=GlobalProperties.getMaxTreeDepth()%>';
window.skinExampleStudyQueries = '<%=GlobalProperties.getExampleStudyQueries().replace("\n","\\n")%>'.split("\n");

window.priorityStudies = {};

// global variables required for MutationMapper annotation column
window.showCivic = <%=GlobalProperties.showCivic()%>;
window.showHotspot = <%=GlobalProperties.showHotspot()%>;
window.showMyCancerGenome = <%=GlobalProperties.showMyCancerGenomeUrl()%>;
window.oncoKBApiUrl = '<%=GlobalProperties.getOncoKBPublicApiUrl()%>';
window.showOncoKB = window.oncoKBApiUrl ? true : false;

<%
List<String[]> priorityStudies = GlobalProperties.getPriorityStudies();
for (String[] group : priorityStudies) {
    if (group.length > 1) {
        out.println("window.priorityStudies['"+group[0]+"'] = ");
        out.println("[");
        int i = 1;
        while (i < group.length) {
            if (i >= 2) {
                out.println(",");
            }
            out.println("'"+group[i]+"'");
            i++;
        }
        out.println("];");
    }
}
%>


    // Set API root variable for cbioportal-frontend repo
    <%
String url = request.getRequestURL().toString();
String baseURL = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath();
baseURL = baseURL.replace("https://", "").replace("http://", "");
%>
__API_ROOT__ = '<%=baseURL%>';
    
window.loadReactApp({ defaultRoute: 'results' });

window.onReactAppReady(function() {
    window.initModifyQueryComponent("modifyQueryButton", "querySelector");
});
    
</script>

<div id="reactRoot" class="hidden"></div>
    
<%@ page import="java.util.Map" %>
<%@ page import="org.codehaus.jackson.map.ObjectMapper" %>

<%
    // we have session service running AND this was a post, 
    // then modify URL to include session service id so bookmarking will work
    if (useSessionServiceBookmark && "POST".equals(request.getMethod())) {
%>
    <script>
        changeURLToSessionServiceURL(window.location.href, 
            window.location.pageTitle, 
            <%= new ObjectMapper().writeValueAsString(request.getParameterMap()) %>);
   </script>
<% } // end if isPost and we have session service running %>
{'fraction_non_alphanumeric': 0.13259803921568628, 'fraction_numerical': 0.0024509803921568627, 'mean_word_length': 3.872238805970149, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 67, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4901148', 'n_tokens_mistral': 2377, 'n_tokens_neox': 2248, 'n_words': 711}